PageSourceSearch

https://changellenge.com/local/js/vue/multiselect/dist/script.bundle.js?179085222720193

js changellenge.com collected 2026-10-02 06:45:20 UTC 20,193 bytes, 1 lines download raw bytes

1!function(t){"use strict";function e(t){return 0!==t&&(!(!Array.isArray(t)||0!==t.length)||!t)}function i(t,e,i,n){return e?t.filter((function(t){return s=n(t,i),l=e,void 0===s&&(s="undefined"),null===s&&(s="null"),!1===s&&(s="false"),-1!==s.toString().toLowerCase().indexOf(l.trim());var s,l})).sort((function(t,e){return n(t,i).length-n(e,i).length})):t}function n(t){return t.filter((function(t){return!t.$isLabel}))}function s(t,e){return function(i){return i.reduce((function(i,n){return n[t]&&n[t].length?(i.push({$groupLabel:n[e],$isLabel:!0}),i.concat(n[t])):i}),[])}}var l=function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return function(t){return e.reduce((function(t,e){return e(t)}),t)}},o={data:function(){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:function(t,i){return e(t)?"":i?t[i]:t}},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:function(){return[]}},preserveSearch:{type:Boolean,default:!1},preselectFirst:{type:Boolean,default:!1},preventAutofocus:{type:Boolean,default:!1}},mounted:function(){!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:function(){return this.modelValue||0===this.modelValue?Array.isArray(this.modelValue)?this.modelValue:[this.modelValue]:[]},filteredOptions:function(){var t,e=this.search||"",n=e.toLowerCase().trim(),l=this.options.concat();return l=this.internalSearch?this.groupValues?this.filterAndFlat(l,n,this.label):i(l,n,this.label,this.customLabel):this.groupValues?s(this.groupValues,this.groupLabel)(l):l,l=this.hideSelected?l.filter((t=this.isSelected,function(){return!t.apply(void 0,arguments)})):l,this.taggable&&n.length&&!this.isExistingOption(n)&&("bottom"===this.tagPosition?l.push({isTag:!0,label:e}):l.unshift({isTag:!0,label:e})),l.slice(0,this.optionsLimit)},valueKeys:function(){var t=this;return this.trackBy?this.internalValue.map((function(e){return e[t.trackBy]})):this.internalValue},optionKeys:function(){var t=this;return(this.groupValues?this.flatAndStrip(this.options):this.options).map((function(e){return t.customLabel(e,t.label).toString().toLowerCase()}))},currentOptionLabel:function(){return this.multiple?this.searchable?"":this.placeholder:this.internalValue.length?this.getOptionLabel(this.internalValue[0]):this.searchable?"":this.placeholder}},watch:{internalValue:{handler:function(){this.resetAfter&&this.internalValue.length&&(this.search="",this.$emit("update:modelValue",this.multiple?[]:null))},deep:!0},search:function(){this.$emit("search-change",this.search)}},emits:["open","search-change","close","select","update:modelValue","remove","tag"],methods:{getValue:function(){return this.multiple?this.internalValue:0===this.internalValue.length?null:this.internalValue[0]},filterAndFlat:function(t,e,n){return l(function(t,e,n,s,l){return function(o){return o.map((function(o){var a;if(!o[n])return console.warn("Options passed to vue-multiselect do not contain groups, despite the config."),[];var r=i(o[n],t,e,l);return r.length?(a={},babelHelpers.defineProperty(a,s,o[s]),babelHelpers.defineProperty(a,n,r),a):[]}))}}(e,n,this.groupValues,this.groupLabel,this.customLabel),s(this.groupValues,this.groupLabel))(t)},flatAndStrip:function(t){return l(s(this.groupValues,this.groupLabel),n)(t)},updateSearch:function(t){this.search=t},isExistingOption:function(t){return!!this.options&&this.optionKeys.indexOf(t)>-1},isSelected:function(t){var e=this.trackBy?t[this.trackBy]:t;return this.valueKeys.indexOf(e)>-1},isOptionDisabled:function(t){return!!t.$isDisabled},getOptionLabel:function(t){if(e(t))return"";if(t.isTag)return t.label;if(t.$isLabel)return t.$groupLabel;var i=this.customLabel(t,this.label);return e(i)?"":i},select:function(t,e){if(t.$isLabel&&this.groupSelect)this.selectGroup(t);else if(!(-1!==this.blockKeys.indexOf(e)||this.disabled||t.$isDisabled||t.$isLabel)&&(!this.max||!this.multiple||this.internalValue.length!==this.max)&&("Tab"!==e||this.pointerDirty)){if(t.isTag)this.$emit("tag",t.label,this.id),this.search="",this.closeOnSelect&&!this.multiple&&this.deactivate();else{if(this.isSelected(t))return void("Tab"!==e&&this.removeElement(t));this.multiple?this.$emit("update:modelValue",this.internalValue.concat([t])):this.$emit("update:modelValue",t),this.$emit("select",t,this.id),this.clearOnSelect&&(this.search="")}this.closeOnSelect&&this.deactivate()}},selectGroup:function(t){var e=this,i=this.options.find((function(i){return i[e.groupLabel]===t.$groupLabel}));if(i){if(this.wholeGroupSelected(i)){this.$emit("remove",i[this.groupValues],this.id);var n=this.trackBy?i[this.groupValues].map((function(t){return t[e.trackBy]})):i[this.groupValues],s=this.internalValue.filter((function(t){return-1===n.indexOf(e.trackBy?t[e.trackBy]:t)}));this.$emit("update:modelValue",s)}else{var l=i[this.groupValues].filter((function(t){return!(e.isOptionDisabled(t)||e.isSelected(t))}));this.max&&l.splice(this.max-this.internalValue.length),this.$emit("select",l,this.id),this.$emit("update:modelValue",this.internalValue.concat(l))}this.closeOnSelect&&this.deactivate()}},wholeGroupSelected:function(t){var e=this;return t[this.groupValues].every((function(t){return e.isSelected(t)||e.isOptionDisabled(t)}))},wholeGroupDisabled:function(t){return t[this.groupValues].every(this.isOptionDisabled)},removeElement:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!this.disabled&&!t.$isDisabled)if(!this.allowEmpty&&this.internalValue.length<=1)this.deactivate();else{var i="object"===babelHelpers.typeof(t)?this.valueKeys.indexOf(t[this.trackBy]):this.valueKeys.indexOf(t);if(this.multiple){var n=this.internalValue.slice(0,i).concat(this.internalValue.slice(i+1));this.$emit("update:modelValue",n)}else this.$emit("update:modelValue",null);this.$emit("remove",t,this.id),this.closeOnSelect&&e&&this.deactivate()}},removeLastElement:function(){-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:function(){var t=this;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((function(){return t.$refs.search&&t.$refs.search.focus()}))):this.preventAutofocus||void 0!==this.$el&&this.$el.focus(),this.$emit("open",this.id))},deactivate:function(){this.isOpen&&(this.isOpen=!1,this.searchable?null!==this.$refs.search&&void 0!==this.$refs.search&&this.$refs.search.blur():void 0!==this.$el&&this.$el.blur(),this.preserveSearch||(this.search=""),this.$emit("close",this.getValue(),this.id))},toggle:function(){this.isOpen?this.deactivate():this.activate()},adjustPosition:function(){if("undefined"!=typeof window){var t=this.$el.getBoundingClientRect().top,e=window.innerHeight-this.$el.getBoundingClientRect().bottom;e>this.maxHeight||e>t||"below"===this.openDirection||"bottom"===this.openDirection?(this.preferredOpenDirection="below",this.optimizedHeight=Math.min(e-40,this.maxHeight)):(this.preferredOpenDirection="above",this.optimizedHeight=Math.min(t-40,this.maxHeight))}}}},a={data:function(){return{pointer:0,pointerDirty:!1}},props:{showPointer:{type:Boolean,default:!0},optionHeight:{type:Number,default:40}},computed:{pointerPosition:function(){return this.pointer*this.optionHeight},visibleElements:function(){return this.optimizedHeight/this.optionHeight}},watch:{filteredOptions:function(){this.pointerAdjust()},isOpen:function(){this.pointerDirty=!1},pointer:function(){this.$refs.search&&this.$refs.search.setAttribute("aria-activedescendant",this.id+"-"+this.pointer.toString())}},methods:{optionHighlight:function(t,e){return{"multiselect__option--highlight":t===this.pointer&&this.showPointer,"multiselect__option--selected":this.isSelected(e)}},groupHighlight:function(t,e){var i=this;if(!this.groupSelect)return["multiselect__option--disabled",{"multiselect__option--group":e.$isLabel}];var n=this.options.find((function(t){return t[i.groupLabel]===e.$groupLabel}));return n&&!this.wholeGroupDisabled(n)?["multiselect__option--group",{"multiselect__option--highlight":t===this.pointer&&this.showPointer},{"multiselect__option--group-selected":this.wholeGroupSelected(n)}]:"multiselect__option--disabled"},addPointerElement:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Enter",e=t.key;this.filteredOptions.length>0&&this.select(this.filteredOptions[this.pointer],e),this.pointerRe
1set()},pointerForward:function(){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:function(){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:function(){this.closeOnSelect&&(this.pointer=0,this.$refs.list&&(this.$refs.list.scrollTop=0))},pointerAdjust:function(){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:function(t){this.pointer=t,this.pointerDirty=!0}}},r={name:"vue-multiselect",mixins:[o,a],compatConfig:{MODE:3,ATTR_ENUMERATED_COERCION:!1},props:{name:{type:String,default:""},modelValue:{type:null,default:function(){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:function(t){return"and ".concat(t," 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},readonly:{type:Boolean,default:!1}},computed:{hasOptionGroup:function(){return this.groupValues&&this.groupLabel&&this.groupSelect},isSingleLabelVisible:function(){return(this.singleValue||0===this.singleValue)&&(!this.isOpen||!this.searchable)&&!this.visibleValues.length},isPlaceholderVisible:function(){return!(this.internalValue.length||this.searchable&&this.isOpen)},visibleValues:function(){return this.multiple?this.internalValue.slice(0,this.limit):[]},singleValue:function(){return this.internalValue[0]},deselectLabelText:function(){return this.showLabels?this.deselectLabel:""},deselectGroupLabelText:function(){return this.showLabels?this.deselectGroupLabel:""},selectLabelText:function(){return this.showLabels?this.selectLabel:""},selectGroupLabelText:function(){return this.showLabels?this.selectGroupLabel:""},selectedLabelText:function(){return this.showLabels?this.selectedLabel:""},inputStyle:function(){return this.searchable||this.multiple&&this.modelValue&&this.modelValue.length?this.isOpen?{width:"100%"}:{width:"0",position:"absolute",padding:"0"}:""},contentStyle:function(){return this.options.length?{display:"inline-block"}:{display:"block"}},isAbove:function(){return"above"===this.openDirection||"top"===this.openDirection||"below"!==this.openDirection&&"bottom"!==this.openDirection&&"above"===this.preferredOpenDirection},showSearchInput:function(){return this.searchable&&(!this.hasSingleSelectedSlot||!this.visibleSingleValue&&0!==this.visibleSingleValue||this.isOpen)}},mounted:function(){var t=this;document.addEventListener("click",(function(e){t.$el.contains(e.target)||t.deactivate()}))},template:'\n\t\t<div\n\t\t\t:tabindex="searchable ? -1 : tabindex"\n\t\t\t:class="{ \'multiselect--active\': isOpen, \'multiselect--disabled\': disabled, \'multiselect--above\': isAbove, \'multiselect--has-options-group\': hasOptionGroup }"\n\t\t\t@blur="searchable ? false : deactivate()"\n\t\t\[email protected]="pointerForward()"\n\t\t\[email protected]="pointerBackward()"\n\t\t\[email protected]="addPointerElement($event)"\n\t\t\[email protected]="deactivate()"\n\t\t\tclass="multiselect"\n\t\t\trole="combobox"\n\t\t\t:aria-owns="\'listbox-\'+id"\n\t\t\t@click="toggle">\n\t\t\t<div ref="tags" class="multiselect__tags">\n\t\t\t\t<slot name="caret" :toggle="toggle">\n\t\t\t\t\t<div class="multiselect__select"></div>\n\t\t\t\t</slot>\n\t\t\t\t<slot name="clear" :search="search"></slot>\n\t\t\t\t<slot\n\t\t\t\t\tname="selection"\n\t\t\t\t\t:search="search"\n\t\t\t\t\t:remove="removeElement"\n\t\t\t\t\t:values="visibleValues"\n\t\t\t\t\t:is-open="isOpen"\n\t\t\t\t\t:toggle="toggle"\n\t\t\t\t>\n\t\t\t\t\t<div class="multiselect__tags-wrap" v-show="visibleValues.length > 0">\n\t\t\t\t\t\t<template v-for="(option, index) of visibleValues" @mousedown.prevent>\n\t\t\t\t\t\t\t<slot name="tag" :option="option" :search="search" :remove="removeElement">\n\t\t\t\t\t\t\t  <span class="multiselect__tag" :key="index">\n\t\t\t\t\t\t\t\t<span v-text="getOptionLabel(option)"></span>\n\t\t\t\t\t\t\t\t<i tabindex="1" @keypress.enter.prevent="removeElement(option)"\n\t\t\t\t\t\t\t\t   @mousedown.prevent="removeElement(option)" class="multiselect__tag-icon"></i>\n\t\t\t\t\t\t\t  </span>\n\t\t\t\t\t\t\t</slot>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</div>\n\t\t\t\t\t<template v-if="internalValue && internalValue.length > limit">\n\t\t\t\t\t\t<slot name="limit">\n\t\t\t\t\t\t\t<strong class="multiselect__strong" v-text="limitText(internalValue.length - limit)"/>\n\t\t\t\t\t\t</slot>\n\t\t\t\t\t</template>\n\t\t\t\t</slot>\n\t\t\t\t<transition name="multiselect__loading">\n\t\t\t\t\t<slot name="loading">\n\t\t\t\t\t\t<div v-show="loading" class="multiselect__spinner"/>\n\t\t\t\t\t</slot>\n\t\t\t\t</transition>\n\t\t\t\t<input\n\t\t\t\t\tref="search"\n\t\t\t\t\tv-if="searchable"\n\t\t\t\t\t:readonly="readonly"\n\t\t\t\t\t:id="id"\n\t\t\t\t\t:name="name"\n\t\t\t\t\ttype="text"\n\t\t\t\t\tautocomplete="off"\n\t\t\t\t\t:spellcheck="false"\n\t\t\t\t\t:placeholder="placeholder"\n\t\t\t\t\t:style="inputStyle"\n\t\t\t\t\t:value="search"\n\t\t\t\t\t:disabled="disabled"\
1n\t\t\t\t\t:tabindex="tabindex"\n\t\t\t\t\t@input="updateSearch($event.target.value)"\n\t\t\t\t\[email protected]="deactivate()"\n\t\t\t\t\[email protected]="pointerForward()"\n\t\t\t\t\[email protected]="pointerBackward()"\n\t\t\t\t\[email protected]="addPointerElement($event)"\n\t\t\t\t\[email protected]="removeLastElement()"\n\t\t\t\t\tclass="multiselect__input"\n\t\t\t\t\t:aria-controls="\'listbox-\'+id"\n\t\t\t\t/>\n\t\t\t\t<span\n\t\t\t\t\tv-if="isSingleLabelVisible"\n\t\t\t\t\tclass="multiselect__single"\n\t\t\t\t\[email protected]="toggle"\n\t\t\t\t>\n\t\t\t\t\t<slot name="singleLabel" :option="singleValue">\n\t\t\t\t\t  {{ currentOptionLabel }}\n\t\t\t\t\t</slot>\n\t\t\t\t  </span>\n\t\t\t\t<span\n\t\t\t\t\tv-if="isPlaceholderVisible"\n\t\t\t\t\tclass="multiselect__placeholder"\n\t\t\t\t\[email protected]="toggle"\n\t\t\t\t>\n        <slot name="placeholder">\n          {{ placeholder }}\n        </slot>\n      </span>\n\t\t\t</div>\n\t\t\t<transition name="multiselect">\n\t\t\t\t<div\n\t\t\t\t\tclass="multiselect__content-wrapper"\n\t\t\t\t\tv-show="isOpen"\n\t\t\t\t\t@focus="activate"\n\t\t\t\t\ttabindex="-1"\n\t\t\t\t\[email protected]\n\t\t\t\t\t:style="{ maxHeight: optimizedHeight + \'px\' }"\n\t\t\t\t\tref="list"\n\t\t\t\t>\n\t\t\t\t\t<ul class="multiselect__content" :style="contentStyle" role="listbox" :id="\'listbox-\'+id">\n\t\t\t\t\t\t<slot name="beforeList"></slot>\n\t\t\t\t\t\t<li v-if="multiple && max === internalValue.length">\n            <span class="multiselect__option">\n              <slot name="maxElements">Maximum of {{ max }} options selected. First remove a selected option to select another.</slot>\n            </span>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<template v-if="!max || internalValue.length < max">\n\t\t\t\t\t\t\t<li class="multiselect__element"\n\t\t\t\t\t\t\t\tv-for="(option, index) of filteredOptions"\n\t\t\t\t\t\t\t\t:key="index"\n\t\t\t\t\t\t\t\tv-bind:id="id + \'-\' + index"\n\t\t\t\t\t\t\t\tv-bind:role="!(option && (option.$isLabel || option.$isDisabled)) ? \'option\' : null">\n              <span\n\t\t\t\t  v-if="!(option && (option.$isLabel || option.$isDisabled))"\n\t\t\t\t  :class="optionHighlight(index, option)"\n\t\t\t\t  @click.stop="select(option)"\n\t\t\t\t  @mouseenter.self="pointerSet(index)"\n\t\t\t\t  :data-select="option && option.isTag ? tagPlaceholder : selectLabelText"\n\t\t\t\t  :data-selected="selectedLabelText"\n\t\t\t\t  :data-deselect="deselectLabelText"\n\t\t\t\t  class="multiselect__option">\n                <slot name="option" :option="option" :search="search" :index="index">\n                  <span>{{ getOptionLabel(option) }}</span>\n                </slot>\n              </span>\n\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\tv-if="option && (option.$isLabel || option.$isDisabled)"\n\t\t\t\t\t\t\t\t\t:data-select="groupSelect && selectGroupLabelText"\n\t\t\t\t\t\t\t\t\t:data-deselect="groupSelect && deselectGroupLabelText"\n\t\t\t\t\t\t\t\t\t:class="groupHighlight(index, option)"\n\t\t\t\t\t\t\t\t\[email protected]="groupSelect && pointerSet(index)"\n\t\t\t\t\t\t\t\t\[email protected]="selectGroup(option)"\n\t\t\t\t\t\t\t\t\tclass="multiselect__option">\n                <slot name="option" :option="option" :search="search" :index="index">\n                  <span>{{ getOptionLabel(option) }}</span>\n                </slot>\n              </span>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t<li v-show="showNoResults && (filteredOptions.length === 0 && search && !loading)">\n            <span class="multiselect__option">\n              <slot name="noResult" :search="search">No elements found. Consider changing the search query.</slot>\n            </span>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li v-show="showNoOptions && ((options.length === 0 || (hasOptionGroup === true && filteredOptions.length === 0)) && !search && !loading)">\n            <span class="multiselect__option">\n              <slot name="noOptions">List is empty.</slot>\n            </span>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<slot name="afterList"></slot>\n\t\t\t\t\t</ul>\n\t\t\t\t\t<slot name="afterContentList"></slot>\n\t\t\t\t</div>\n\t\t\t</transition>\n\t\t</div>\n\t'};t.default=r,t.Multiselect=r,t.multiselectMixin=o,t.pointerMixin=a}(this.window=this.window||{});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.