UNPKG

primevue

Version:

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![npm version](https://badge.fury.io/js/primevue.svg)](https://badge.fury.io/js/primevue) [![Discord Chat](https://img.shields.io/discord/55794023

2 lines (1 loc) 21.5 kB
import e from"primevue/button";import t from"primevue/icons/angledoubledown";import i from"primevue/icons/angledoubleleft";import o from"primevue/icons/angledoubleright";import l from"primevue/icons/angledoubleup";import s from"primevue/icons/angledown";import n from"primevue/icons/angleleft";import a from"primevue/icons/angleright";import r from"primevue/icons/angleup";import d from"primevue/ripple";import{UniqueComponentId as c,ObjectUtils as u,DomHandler as h}from"primevue/utils";import{resolveComponent as p,resolveDirective as m,openBlock as v,createElementBlock as g,normalizeClass as f,renderSlot as b,createVNode as $,mergeProps as y,withCtx as k,createCommentVNode as I,createElementVNode as L,TransitionGroup as w,Fragment as T,renderList as D,withDirectives as x,createBlock as A,resolveDynamicComponent as _}from"vue";var C={name:"PickList",emits:["update:modelValue","reorder","update:selection","selection-change","move-to-target","move-to-source","move-all-to-target","move-all-to-source","focus","blur"],props:{modelValue:{type:Array,default:()=>[[],[]]},selection:{type:Array,default:()=>[[],[]]},dataKey:{type:String,default:null},listStyle:{type:null,default:null},metaKeySelection:{type:Boolean,default:!0},responsive:{type:Boolean,default:!0},breakpoint:{type:String,default:"960px"},stripedRows:{type:Boolean,default:!1},showSourceControls:{type:Boolean,default:!0},showTargetControls:{type:Boolean,default:!0},targetListProps:{type:null,default:null},sourceListProps:{type:null,default:null},moveUpButtonProps:{type:null,default:null},moveTopButtonProps:{type:null,default:null},moveDownButtonProps:{type:null,default:null},moveBottomButtonProps:{type:null,default:null},moveToTargetProps:{type:null,default:null},moveAllToTargetProps:{type:null,default:null},moveToSourceProps:{type:null,default:null},moveAllToSourceProps:{type:null,default:null},tabindex:{type:Number,default:0}},itemTouched:!1,reorderDirection:null,styleElement:null,media:null,mediaChangeListener:null,data(){return{id:this.$attrs.id,d_selection:this.selection,focused:{sourceList:!1,targetList:!1},focusedOptionIndex:-1,viewChanged:!1}},watch:{"$attrs.id":function(e){this.id=e||c()},selection(e){this.d_selection=e},breakpoint(e){this.destroyMedia(),this.initMedia()}},updated(){this.reorderDirection&&(this.updateListScroll(this.$refs.sourceList.$el),this.updateListScroll(this.$refs.targetList.$el),this.reorderDirection=null)},beforeUnmount(){this.destroyStyle(),this.destroyMedia()},mounted(){this.id=this.id||c(),this.responsive&&(this.createStyle(),this.initMedia())},methods:{getItemKey(e,t){return this.dataKey?u.resolveFieldData(e,this.dataKey):t},isSelected(e,t){return-1!=u.findIndexInList(e,this.d_selection[t])},onListFocus(e,t){const i=h.findSingle(this.$refs[t].$el,"li.p-picklist-item.p-highlight"),o=u.findIndexInList(i,this.$refs[t].$el.children);this.focused[t]=!0;const l=-1!==this.focusedOptionIndex?this.focusedOptionIndex:i?o:-1;this.changeFocusedOptionIndex(l,t),this.$emit("focus",e)},onListBlur(e,t){this.focused[t]=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onOptionMouseDown(e,t){this.focused[t]=!0,this.focusedOptionIndex=e},moveUp(e,t){if(this.d_selection&&this.d_selection[t]){let i=[...this.modelValue[t]],o=this.d_selection[t];for(let e=0;e<o.length;e++){let t=o[e],l=u.findIndexInList(t,i);if(0===l)break;{let e=i[l],t=i[l-1];i[l-1]=e,i[l]=t}}let l=[...this.modelValue];l[t]=i,this.reorderDirection="up",this.$emit("update:modelValue",l),this.$emit("reorder",{originalEvent:e,value:l,direction:this.reorderDirection,listIndex:t})}},moveTop(e,t){if(this.d_selection){let i=[...this.modelValue[t]],o=this.d_selection[t];for(let e=0;e<o.length;e++){let t=o[e],l=u.findIndexInList(t,i);if(0===l)break;{let e=i.splice(l,1)[0];i.unshift(e)}}let l=[...this.modelValue];l[t]=i,this.reorderDirection="top",this.$emit("update:modelValue",l),this.$emit("reorder",{originalEvent:e,value:l,direction:this.reorderDirection,listIndex:t})}},moveDown(e,t){if(this.d_selection){let i=[...this.modelValue[t]],o=this.d_selection[t];for(let e=o.length-1;e>=0;e--){let t=o[e],l=u.findIndexInList(t,i);if(l===i.length-1)break;{let e=i[l],t=i[l+1];i[l+1]=e,i[l]=t}}let l=[...this.modelValue];l[t]=i,this.reorderDirection="down",this.$emit("update:modelValue",l),this.$emit("reorder",{originalEvent:e,value:l,direction:this.reorderDirection,listIndex:t})}},moveBottom(e,t){if(this.d_selection){let i=[...this.modelValue[t]],o=this.d_selection[t];for(let e=o.length-1;e>=0;e--){let t=o[e],l=u.findIndexInList(t,i);if(l===i.length-1)break;{let e=i.splice(l,1)[0];i.push(e)}}let l=[...this.modelValue];l[t]=i,this.reorderDirection="bottom",this.$emit("update:modelValue",l),this.$emit("reorder",{originalEvent:e,value:l,direction:this.reorderDirection,listIndex:t})}},moveToTarget(e){let t=this.d_selection&&this.d_selection[0]?this.d_selection[0]:null,i=[...this.modelValue[0]],o=[...this.modelValue[1]];if(t){for(let e=0;e<t.length;e++){let l=t[e];-1==u.findIndexInList(l,o)&&o.push(i.splice(u.findIndexInList(l,i),1)[0])}let l=[...this.modelValue];l[0]=i,l[1]=o,this.$emit("update:modelValue",l),this.$emit("move-to-target",{originalEvent:e,items:t}),this.d_selection[0]=[],this.$emit("update:selection",this.d_selection),this.$emit("selection-change",{originalEvent:e,value:this.d_selection})}},moveAllToTarget(e){if(this.modelValue[0]){let t=[...this.modelValue[0]],i=[...this.modelValue[1]];this.$emit("move-all-to-target",{originalEvent:e,items:t}),i=[...i,...t],t=[];let o=[...this.modelValue];o[0]=t,o[1]=i,this.$emit("update:modelValue",o),this.d_selection[0]=[],this.$emit("update:selection",this.d_selection),this.$emit("selection-change",{originalEvent:e,value:this.d_selection})}},moveToSource(e){let t=this.d_selection&&this.d_selection[1]?this.d_selection[1]:null,i=[...this.modelValue[0]],o=[...this.modelValue[1]];if(t){for(let e=0;e<t.length;e++){let l=t[e];-1==u.findIndexInList(l,i)&&i.push(o.splice(u.findIndexInList(l,o),1)[0])}let l=[...this.modelValue];l[0]=i,l[1]=o,this.$emit("update:modelValue",l),this.$emit("move-to-source",{originalEvent:e,items:t}),this.d_selection[1]=[],this.$emit("update:selection",this.d_selection),this.$emit("selection-change",{originalEvent:e,value:this.d_selection})}},moveAllToSource(e){if(this.modelValue[1]){let t=[...this.modelValue[0]],i=[...this.modelValue[1]];this.$emit("move-all-to-source",{originalEvent:e,items:i}),t=[...t,...i],i=[];let o=[...this.modelValue];o[0]=t,o[1]=i,this.$emit("update:modelValue",o),this.d_selection[1]=[],this.$emit("update:selection",this.d_selection),this.$emit("selection-change",{originalEvent:e,value:this.d_selection})}},onItemClick(e,t,i,o){const l=0===o?"sourceList":"targetList";this.itemTouched=!1;const s=this.d_selection[o],n=u.findIndexInList(t,this.d_selection),a=-1!=n,r=!this.itemTouched&&this.metaKeySelection,d=h.find(this.$refs[l].$el,".p-picklist-item")[i].getAttribute("id");let c;if(this.focusedOptionIndex=d,r){let i=e.metaKey||e.ctrlKey;a&&i?c=s.filter(((e,t)=>t!==n)):(c=i&&s?[...s]:[],c.push(t))}else a?c=s.filter(((e,t)=>t!==n)):(c=s?[...s]:[],c.push(t));let p=[...this.d_selection];p[o]=c,this.d_selection=p,this.$emit("update:selection",this.d_selection),this.$emit("selection-change",{originalEvent:e,value:this.d_selection})},onItemDblClick(e,t,i){0===i?this.moveToTarget(e):1===i&&this.moveToSource(e)},onItemTouchEnd(){this.itemTouched=!0},onItemKeyDown(e,t){switch(e.code){case"ArrowDown":this.onArrowDownKey(e,t);break;case"ArrowUp":this.onArrowUpKey(e,t);break;case"Home":this.onHomeKey(e,t);break;case"End":this.onEndKey(e,t);break;case"Enter":this.onEnterKey(e,t);break;case"Space":this.onSpaceKey(e,t);break;case"KeyA":e.ctrlKey&&(this.d_selection=[...this.modelValue],this.$emit("update:selection",this.d_selection))}},onArrowDownKey(e,t){const i=this.findNextOptionIndex(this.focusedOptionIndex,t);this.changeFocusedOptionIndex(i,t),e.shiftKey&&this.onEnterKey(e,t),e.preventDefault()},onArrowUpKey(e,t){const i=this.findPrevOptionIndex(this.focusedOptionIndex,t);this.changeFocusedOptionIndex(i,t),e.shiftKey&&this.onEnterKey(e,t),e.preventDefault()},onEnterKey(e,t){const i=h.find(this.$refs[t].$el,"li.p-picklist-item"),o=h.findSingle(this.$refs[t].$el,`li.p-picklist-item[id=${this.focusedOptionIndex}]`),l=[...i].findIndex((e=>e===o)),s="sourceList"===t?0:1;this.onItemClick(e,this.modelValue[s][l],l,s),e.preventDefault()},onSpaceKey(e,t){if(e.preventDefault(),e.shiftKey){const e="sourceList"===t?0:1,i=h.find(this.$refs[t].$el,"li.p-picklist-item"),o=u.findIndexInList(this.d_selection[e][0],[...this.modelValue[e]]),l=h.findSingle(this.$refs[t].$el,`li.p-picklist-item[id=${this.focusedOptionIndex}]`),s=[...i].findIndex((e=>e===l));this.d_selection[e]=[...this.modelValue[e]].slice(Math.min(o,s),Math.max(o,s)+1),this.$emit("update:selection",this.d_selection)}else this.onEnterKey(e,t)},onHomeKey(e,t){if(e.ctrlKey&&e.shiftKey){const e="sourceList"===t?0:1,i=h.find(this.$refs[t].$el,"li.p-picklist-item"),o=h.findSingle(this.$refs[t].$el,`li.p-picklist-item[id=${this.focusedOptionIndex}]`),l=[...i].findIndex((e=>e===o));this.d_selection[e]=[...this.modelValue[e]].slice(0,l+1),this.$emit("update:selection",this.d_selection)}else this.changeFocusedOptionIndex(0,t);e.preventDefault()},onEndKey(e,t){const i=h.find(this.$refs[t].$el,"li.p-picklist-item");if(e.ctrlKey&&e.shiftKey){const e="sourceList"===t?0:1,o=h.findSingle(this.$refs[t].$el,`li.p-picklist-item[id=${this.focusedOptionIndex}]`),l=[...i].findIndex((e=>e===o));this.d_selection[e]=[...this.modelValue[e]].slice(l,i.length),this.$emit("update:selection",this.d_selection)}else this.changeFocusedOptionIndex(i.length-1,t);e.preventDefault()},findNextOptionIndex(e,t){const i=[...h.find(this.$refs[t].$el,"li.p-picklist-item")].findIndex((t=>t.id===e));return i>-1?i+1:0},findPrevOptionIndex(e,t){const i=[...h.find(this.$refs[t].$el,"li.p-picklist-item")].findIndex((t=>t.id===e));return i>-1?i-1:0},changeFocusedOptionIndex(e,t){const i=h.find(this.$refs[t].$el,"li.p-picklist-item");let o=e>=i.length?i.length-1:e<0?0:e;this.focusedOptionIndex=i[o].getAttribute("id"),this.scrollInView(i[o].getAttribute("id"),t)},scrollInView(e,t){const i=h.findSingle(this.$refs[t].$el,`li[id="${e}"]`);i&&i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"start"})},updateListScroll(e){const t=h.find(e,".p-picklist-item.p-highlight");if(t&&t.length)switch(this.reorderDirection){case"up":h.scrollInView(e,t[0]);break;case"top":e.scrollTop=0;break;case"down":h.scrollInView(e,t[t.length-1]);break;case"bottom":e.scrollTop=e.scrollHeight}},initMedia(){this.media=window.matchMedia(`(max-width: ${this.breakpoint})`),this.viewChanged=this.media.matches,this.bindMediaChangeListener()},destroyMedia(){this.unbindMediaChangeListener()},bindMediaChangeListener(){this.media&&!this.mediaChangeListener&&(this.mediaChangeListener=e=>{this.viewChanged=e.matches},this.media.addEventListener("change",this.mediaChangeListener))},unbindMediaChangeListener(){this.media&&this.mediaChangeListener&&(this.media.removeEventListener("change",this.mediaChangeListener),this.mediaChangeListener=null)},createStyle(){if(!this.styleElement){this.$el.setAttribute(this.attributeSelector,""),this.styleElement=document.createElement("style"),this.styleElement.type="text/css",document.head.appendChild(this.styleElement);let e=`\n@media screen and (max-width: ${this.breakpoint}) {\n .p-picklist[${this.attributeSelector}] {\n flex-direction: column;\n }\n\n .p-picklist[${this.attributeSelector}] .p-picklist-buttons {\n padding: var(--content-padding);\n flex-direction: row;\n }\n\n .p-picklist[${this.attributeSelector}] .p-picklist-buttons .p-button {\n margin-right: var(--inline-spacing);\n margin-bottom: 0;\n }\n\n .p-picklist[${this.attributeSelector}] .p-picklist-buttons .p-button:last-child {\n margin-right: 0;\n }\n}\n`;this.styleElement.innerHTML=e}},destroyStyle(){this.styleElement&&(document.head.removeChild(this.styleElement),this.styleElement=null)},moveDisabled(e){if(!this.d_selection[e]||!this.d_selection[e].length)return!0},moveAllDisabled(e){return u.isEmpty(this[e])},moveSourceDisabled(){return u.isEmpty(this.targetList)},itemClass(e,t,i){return["p-picklist-item",{"p-highlight":this.isSelected(e,i),"p-focus":t===this.focusedOptionId}]}},computed:{idSource(){return`${this.id}_source`},idTarget(){return`${this.id}_target`},focusedOptionId(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null},containerClass(){return["p-picklist p-component",{"p-picklist-striped":this.stripedRows}]},sourceList(){return this.modelValue&&this.modelValue[0]?this.modelValue[0]:null},targetList(){return this.modelValue&&this.modelValue[1]?this.modelValue[1]:null},attributeSelector:()=>c(),moveUpAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.moveUp:void 0},moveTopAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.moveTop:void 0},moveDownAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.moveDown:void 0},moveBottomAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.moveBottom:void 0},moveToTargetAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.moveToTarget:void 0},moveAllToTargetAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.moveAllToTarget:void 0},moveToSourceAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.moveToSource:void 0},moveAllToSourceAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.moveAllToSource:void 0}},components:{PLButton:e,AngleRightIcon:a,AngleLeftIcon:n,AngleDownIcon:s,AngleUpIcon:r,AngleDoubleRightIcon:o,AngleDoubleLeftIcon:i,AngleDoubleDownIcon:t,AngleDoubleUpIcon:l},directives:{ripple:d}};const S={key:0,class:"p-picklist-buttons p-picklist-source-controls"},V={class:"p-picklist-list-wrapper p-picklist-source-wrapper"},E={key:0,class:"p-picklist-header"},K=["id","onClick","onDblclick","onMousedown","aria-selected"],B={class:"p-picklist-buttons p-picklist-transfer-buttons"},O={class:"p-picklist-list-wrapper p-picklist-target-wrapper"},P={key:0,class:"p-picklist-header"},M=["id","onClick","onDblclick","onMousedown","aria-selected"],U={key:1,class:"p-picklist-buttons p-picklist-target-controls"};!function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css","top"===i&&o.firstChild?o.insertBefore(l,o.firstChild):o.appendChild(l),l.styleSheet?l.styleSheet.cssText=e:l.appendChild(document.createTextNode(e))}}("\n.p-picklist {\n display: flex;\n}\n.p-picklist-buttons {\n display: flex;\n flex-direction: column;\n justify-content: center;\n}\n.p-picklist-list-wrapper {\n flex: 1 1 50%;\n}\n.p-picklist-list {\n list-style-type: none;\n margin: 0;\n padding: 0;\n overflow: auto;\n min-height: 12rem;\n max-height: 24rem;\n}\n.p-picklist-item {\n cursor: pointer;\n overflow: hidden;\n position: relative;\n}\n.p-picklist-item.p-picklist-flip-enter-active.p-picklist-flip-enter-to,\n.p-picklist-item.p-picklist-flip-leave-active.p-picklist-flip-leave-to {\n transition: none !important;\n}\n"),C.render=function(e,t,i,o,l,s){const n=p("AngleUpIcon"),a=p("PLButton"),r=p("AngleDoubleUpIcon"),d=p("AngleDownIcon"),c=p("AngleDoubleDownIcon"),u=m("ripple");return v(),g("div",{class:f(s.containerClass)},[i.showSourceControls?(v(),g("div",S,[b(e.$slots,"sourcecontrolsstart"),$(a,y({"aria-label":s.moveUpAriaLabel,disabled:s.moveDisabled(0),type:"button",onClick:t[0]||(t[0]=e=>s.moveUp(e,0))},i.moveUpButtonProps),{icon:k((()=>[b(e.$slots,"moveupicon",{},(()=>[$(n)]))])),_:3},16,["aria-label","disabled"]),$(a,y({"aria-label":s.moveTopAriaLabel,disabled:s.moveDisabled(0),type:"button",onClick:t[1]||(t[1]=e=>s.moveTop(e,0))},i.moveTopButtonProps),{icon:k((()=>[b(e.$slots,"movetopicon",{},(()=>[$(r)]))])),_:3},16,["aria-label","disabled"]),$(a,y({"aria-label":s.moveDownAriaLabel,disabled:s.moveDisabled(0),type:"button",onClick:t[2]||(t[2]=e=>s.moveDown(e,0))},i.moveDownButtonProps),{icon:k((()=>[b(e.$slots,"movedownicon",{},(()=>[$(d)]))])),_:3},16,["aria-label","disabled"]),$(a,y({"aria-label":s.moveBottomAriaLabel,disabled:s.moveDisabled(0),type:"button",onClick:t[3]||(t[3]=e=>s.moveBottom(e,0))},i.moveBottomButtonProps),{icon:k((()=>[b(e.$slots,"movebottomicon",{},(()=>[$(c)]))])),_:3},16,["aria-label","disabled"]),b(e.$slots,"sourcecontrolsend")])):I("",!0),L("div",V,[e.$slots.sourceheader?(v(),g("div",E,[b(e.$slots,"sourceheader")])):I("",!0),$(w,y({ref:"sourceList",id:s.idSource+"_list",name:"p-picklist-flip",tag:"ul",class:"p-picklist-list p-picklist-source",style:i.listStyle,role:"listbox","aria-multiselectable":"true","aria-activedescendant":l.focused.sourceList?s.focusedOptionId:void 0,tabindex:s.sourceList&&s.sourceList.length>0?i.tabindex:-1,onFocus:t[5]||(t[5]=e=>s.onListFocus(e,"sourceList")),onBlur:t[6]||(t[6]=e=>s.onListBlur(e,"sourceList")),onKeydown:t[7]||(t[7]=e=>s.onItemKeyDown(e,"sourceList"))},i.sourceListProps),{default:k((()=>[(v(!0),g(T,null,D(s.sourceList,((i,o)=>x((v(),g("li",{key:s.getItemKey(i,o),id:s.idSource+"_"+o,class:f(s.itemClass(i,`${s.idSource}_${o}`,0)),onClick:e=>s.onItemClick(e,i,o,0),onDblclick:e=>s.onItemDblClick(e,i,0),onTouchend:t[4]||(t[4]=(...e)=>s.onItemTouchEnd&&s.onItemTouchEnd(...e)),onMousedown:e=>s.onOptionMouseDown(o,"sourceList"),role:"option","aria-selected":s.isSelected(i,0)},[b(e.$slots,"item",{item:i,index:o})],42,K)),[[u]]))),128))])),_:3},16,["id","style","aria-activedescendant","tabindex"])]),L("div",B,[b(e.$slots,"movecontrolsstart"),$(a,y({"aria-label":s.moveToTargetAriaLabel,type:"button",onClick:s.moveToTarget,disabled:s.moveDisabled(0)},i.moveToTargetProps),{icon:k((()=>[b(e.$slots,"movetotargeticon",{viewChanged:l.viewChanged},(()=>[(v(),A(_(l.viewChanged?"AngleDownIcon":"AngleRightIcon")))]))])),_:3},16,["aria-label","onClick","disabled"]),$(a,y({"aria-label":s.moveAllToTargetAriaLabel,type:"button",onClick:s.moveAllToTarget,disabled:s.moveAllDisabled("sourceList")},i.moveAllToTargetProps),{icon:k((()=>[b(e.$slots,"movealltotargeticon",{viewChanged:l.viewChanged},(()=>[(v(),A(_(l.viewChanged?"AngleDoubleDownIcon":"AngleDoubleRightIcon")))]))])),_:3},16,["aria-label","onClick","disabled"]),$(a,y({"aria-label":s.moveToSourceAriaLabel,type:"button",onClick:s.moveToSource,disabled:s.moveDisabled(1)},i.moveToSourceProps),{icon:k((()=>[b(e.$slots,"movetosourceicon",{viewChanged:l.viewChanged},(()=>[(v(),A(_(l.viewChanged?"AngleUpIcon":"AngleLeftIcon")))]))])),_:3},16,["aria-label","onClick","disabled"]),$(a,y({"aria-label":s.moveAllToSourceAriaLabel,type:"button",onClick:s.moveAllToSource,disabled:s.moveSourceDisabled("targetList")},i.moveAllToSourceProps),{icon:k((()=>[b(e.$slots,"movealltosourceicon",{viewChanged:l.viewChanged},(()=>[(v(),A(_(l.viewChanged?"AngleDoubleUpIcon":"AngleDoubleLeftIcon")))]))])),_:3},16,["aria-label","onClick","disabled"]),b(e.$slots,"movecontrolsend")]),L("div",O,[e.$slots.targetheader?(v(),g("div",P,[b(e.$slots,"targetheader")])):I("",!0),$(w,y({ref:"targetList",id:s.idTarget+"_list",name:"p-picklist-flip",tag:"ul",class:"p-picklist-list p-picklist-target",style:i.listStyle,role:"listbox","aria-multiselectable":"true","aria-activedescendant":l.focused.targetList?s.focusedOptionId:void 0,tabindex:s.targetList&&s.targetList.length>0?i.tabindex:-1,onFocus:t[10]||(t[10]=e=>s.onListFocus(e,"targetList")),onBlur:t[11]||(t[11]=e=>s.onListBlur(e,"targetList")),onKeydown:t[12]||(t[12]=e=>s.onItemKeyDown(e,"targetList"))},i.targetListProps),{default:k((()=>[(v(!0),g(T,null,D(s.targetList,((i,o)=>x((v(),g("li",{key:s.getItemKey(i,o),id:s.idTarget+"_"+o,class:f(s.itemClass(i,`${s.idTarget}_${o}`,1)),onClick:e=>s.onItemClick(e,i,o,1),onDblclick:e=>s.onItemDblClick(e,i,1),onKeydown:t[8]||(t[8]=e=>s.onItemKeyDown(e,"targetList")),onMousedown:e=>s.onOptionMouseDown(o,"targetList"),onTouchend:t[9]||(t[9]=(...e)=>s.onItemTouchEnd&&s.onItemTouchEnd(...e)),role:"option","aria-selected":s.isSelected(i,1)},[b(e.$slots,"item",{item:i,index:o})],42,M)),[[u]]))),128))])),_:3},16,["id","style","aria-activedescendant","tabindex"])]),i.showTargetControls?(v(),g("div",U,[b(e.$slots,"targetcontrolsstart"),$(a,y({"aria-label":s.moveUpAriaLabel,disabled:s.moveDisabled(1),type:"button",onClick:t[13]||(t[13]=e=>s.moveUp(e,1))},i.moveUpButtonProps),{icon:k((()=>[b(e.$slots,"moveupicon",{},(()=>[$(n)]))])),_:3},16,["aria-label","disabled"]),$(a,y({"aria-label":s.moveTopAriaLabel,disabled:s.moveDisabled(1),type:"button",onClick:t[14]||(t[14]=e=>s.moveTop(e,1))},i.moveTopButtonProps),{icon:k((()=>[b(e.$slots,"movetopicon",{},(()=>[$(r)]))])),_:3},16,["aria-label","disabled"]),$(a,y({"aria-label":s.moveDownAriaLabel,disabled:s.moveDisabled(1),type:"button",onClick:t[15]||(t[15]=e=>s.moveDown(e,1))},i.moveDownButtonProps),{icon:k((()=>[b(e.$slots,"movedownicon",{},(()=>[$(d)]))])),_:3},16,["aria-label","disabled"]),$(a,y({"aria-label":s.moveBottomAriaLabel,disabled:s.moveDisabled(1),type:"button",onClick:t[16]||(t[16]=e=>s.moveBottom(e,1))},i.moveBottomButtonProps),{icon:k((()=>[b(e.$slots,"movebottomicon",{},(()=>[$(c)]))])),_:3},16,["aria-label","disabled"]),b(e.$slots,"targetcontrolsend")])):I("",!0)],2)};export{C as default};