primevue
Version:
[](https://opensource.org/licenses/MIT) [](https://badge.fury.io/js/primevue) [ • 23.1 kB
JavaScript
import e from"primevue/basecomponent";import t from"primevue/button";import i from"primevue/icons/angledoubledown";import o from"primevue/icons/angledoubleleft";import l from"primevue/icons/angledoubleright";import n from"primevue/icons/angledoubleup";import s from"primevue/icons/angledown";import r from"primevue/icons/angleleft";import a from"primevue/icons/angleright";import d from"primevue/icons/angleup";import c from"primevue/ripple";import{UniqueComponentId as u,ObjectUtils as p,DomHandler as m}from"primevue/utils";import{resolveComponent as h,resolveDirective as v,openBlock as g,createElementBlock as f,mergeProps as b,renderSlot as $,createVNode as y,withCtx as k,normalizeProps as I,guardReactiveProps as L,createCommentVNode as T,createElementVNode as w,TransitionGroup as D,Fragment as x,renderList as A,withDirectives as C,createBlock as _,resolveDynamicComponent as B}from"vue";var S={name:"PickList",extends:e,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||u()},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||u(),this.responsive&&(this.createStyle(),this.initMedia())},methods:{getItemKey(e,t){return this.dataKey?p.resolveFieldData(e,this.dataKey):t},getPTOptions(e,t){return this.ptm(t,{context:{active:this.isSelected(e),focused:this.id===this.focusedOptionId}})},isSelected(e,t){return-1!=p.findIndexInList(e,this.d_selection[t])},onListFocus(e,t){const i=m.findSingle(this.$refs[t].$el,"li.p-picklist-item.p-highlight"),o=p.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=p.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=p.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=p.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=p.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==p.findIndexInList(l,o)&&o.push(i.splice(p.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==p.findIndexInList(l,i)&&i.push(o.splice(p.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 n=this.d_selection[o],s=p.findIndexInList(t,this.d_selection),r=-1!=s,a=!this.itemTouched&&this.metaKeySelection,d=m.find(this.$refs[l].$el,".p-picklist-item")[i].getAttribute("id");let c;if(this.focusedOptionIndex=d,a){let i=e.metaKey||e.ctrlKey;r&&i?c=n.filter(((e,t)=>t!==s)):(c=i&&n?[...n]:[],c.push(t))}else r?c=n.filter(((e,t)=>t!==s)):(c=n?[...n]:[],c.push(t));let u=[...this.d_selection];u[o]=c,this.d_selection=u,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=m.find(this.$refs[t].$el,"li.p-picklist-item"),o=m.findSingle(this.$refs[t].$el,`li.p-picklist-item[id=${this.focusedOptionIndex}]`),l=[...i].findIndex((e=>e===o)),n="sourceList"===t?0:1;this.onItemClick(e,this.modelValue[n][l],l,n),e.preventDefault()},onSpaceKey(e,t){if(e.preventDefault(),e.shiftKey){const e="sourceList"===t?0:1,i=m.find(this.$refs[t].$el,"li.p-picklist-item"),o=p.findIndexInList(this.d_selection[e][0],[...this.modelValue[e]]),l=m.findSingle(this.$refs[t].$el,`li.p-picklist-item[id=${this.focusedOptionIndex}]`),n=[...i].findIndex((e=>e===l));this.d_selection[e]=[...this.modelValue[e]].slice(Math.min(o,n),Math.max(o,n)+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=m.find(this.$refs[t].$el,"li.p-picklist-item"),o=m.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=m.find(this.$refs[t].$el,"li.p-picklist-item");if(e.ctrlKey&&e.shiftKey){const e="sourceList"===t?0:1,o=m.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=[...m.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=[...m.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=m.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=m.findSingle(this.$refs[t].$el,`li[id="${e}"]`);i&&i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"start"})},updateListScroll(e){const t=m.find(e,".p-picklist-item.p-highlight");if(t&&t.length)switch(this.reorderDirection){case"up":m.scrollInView(e,t[0]);break;case"top":e.scrollTop=0;break;case"down":m.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 p.isEmpty(this[e])},moveSourceDisabled(){return p.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:()=>u(),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:t,AngleRightIcon:a,AngleLeftIcon:r,AngleDownIcon:s,AngleUpIcon:d,AngleDoubleRightIcon:l,AngleDoubleLeftIcon:o,AngleDoubleDownIcon:i,AngleDoubleUpIcon:n},directives:{ripple:c}};const V=["id","onClick","onDblclick","onMousedown","aria-selected"],E=["id","onClick","onDblclick","onMousedown","aria-selected"];!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"),S.render=function(e,t,i,o,l,n){const s=h("AngleUpIcon"),r=h("PLButton"),a=h("AngleDoubleUpIcon"),d=h("AngleDownIcon"),c=h("AngleDoubleDownIcon"),u=v("ripple");return g(),f("div",b({class:n.containerClass},e.ptm("root")),[i.showSourceControls?(g(),f("div",b({key:0,class:"p-picklist-buttons p-picklist-source-controls"},e.ptm("sourceControls")),[$(e.$slots,"sourcecontrolsstart"),y(r,b({"aria-label":n.moveUpAriaLabel,disabled:n.moveDisabled(0),type:"button",onClick:t[0]||(t[0]=e=>n.moveUp(e,0))},i.moveUpButtonProps,{pt:e.ptm("sourceMoveUpButton")}),{icon:k((()=>[$(e.$slots,"moveupicon",{},(()=>[y(s,I(L(e.ptm("sourceMoveUpButton").icon)),null,16)]))])),_:3},16,["aria-label","disabled","pt"]),y(r,b({"aria-label":n.moveTopAriaLabel,disabled:n.moveDisabled(0),type:"button",onClick:t[1]||(t[1]=e=>n.moveTop(e,0))},i.moveTopButtonProps,{pt:e.ptm("sourceMoveTopButton")}),{icon:k((()=>[$(e.$slots,"movetopicon",{},(()=>[y(a,I(L(e.ptm("sourceMoveTopButton").icon)),null,16)]))])),_:3},16,["aria-label","disabled","pt"]),y(r,b({"aria-label":n.moveDownAriaLabel,disabled:n.moveDisabled(0),type:"button",onClick:t[2]||(t[2]=e=>n.moveDown(e,0))},i.moveDownButtonProps,{pt:e.ptm("sourceMoveDownButton")}),{icon:k((()=>[$(e.$slots,"movedownicon",{},(()=>[y(d,I(L(e.ptm("sourceMoveDownButton").icon)),null,16)]))])),_:3},16,["aria-label","disabled","pt"]),y(r,b({"aria-label":n.moveBottomAriaLabel,disabled:n.moveDisabled(0),type:"button",onClick:t[3]||(t[3]=e=>n.moveBottom(e,0))},i.moveBottomButtonProps,{pt:e.ptm("sourceMoveBottomButton")}),{icon:k((()=>[$(e.$slots,"movebottomicon",{},(()=>[y(c,I(L(e.ptm("sourceMoveBottomButton").icon)),null,16)]))])),_:3},16,["aria-label","disabled","pt"]),$(e.$slots,"sourcecontrolsend")],16)):T("",!0),w("div",b({class:"p-picklist-list-wrapper p-picklist-source-wrapper"},e.ptm("sourceWrapper")),[e.$slots.sourceheader?(g(),f("div",b({key:0,class:"p-picklist-header"},e.ptm("sourceHeader")),[$(e.$slots,"sourceheader")],16)):T("",!0),y(D,b({ref:"sourceList",id:n.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?n.focusedOptionId:void 0,tabindex:n.sourceList&&n.sourceList.length>0?i.tabindex:-1,onFocus:t[5]||(t[5]=e=>n.onListFocus(e,"sourceList")),onBlur:t[6]||(t[6]=e=>n.onListBlur(e,"sourceList")),onKeydown:t[7]||(t[7]=e=>n.onItemKeyDown(e,"sourceList"))},{...i.sourceListProps,...e.ptm("sourceList")}),{default:k((()=>[(g(!0),f(x,null,A(n.sourceList,((i,o)=>C((g(),f("li",b({key:n.getItemKey(i,o),id:n.idSource+"_"+o,class:n.itemClass(i,`${n.idSource}_${o}`,0),onClick:e=>n.onItemClick(e,i,o,0),onDblclick:e=>n.onItemDblClick(e,i,0),onTouchend:t[4]||(t[4]=(...e)=>n.onItemTouchEnd&&n.onItemTouchEnd(...e)),onMousedown:e=>n.onOptionMouseDown(o,"sourceList"),role:"option","aria-selected":n.isSelected(i,0)},n.getPTOptions(i,"item")),[$(e.$slots,"item",{item:i,index:o})],16,V)),[[u]]))),128))])),_:3},16,["id","style","aria-activedescendant","tabindex"])],16),w("div",b({class:"p-picklist-buttons p-picklist-transfer-buttons"},e.ptm("buttons")),[$(e.$slots,"movecontrolsstart"),y(r,b({"aria-label":n.moveToTargetAriaLabel,type:"button",onClick:n.moveToTarget,disabled:n.moveDisabled(0)},i.moveToTargetProps,{pt:e.ptm("moveToTargetButton")}),{icon:k((()=>[$(e.$slots,"movetotargeticon",{viewChanged:l.viewChanged},(()=>[(g(),_(B(l.viewChanged?"AngleDownIcon":"AngleRightIcon"),I(L(e.ptm("moveToTargetButton").icon)),null,16))]))])),_:3},16,["aria-label","onClick","disabled","pt"]),y(r,b({"aria-label":n.moveAllToTargetAriaLabel,type:"button",onClick:n.moveAllToTarget,disabled:n.moveAllDisabled("sourceList")},i.moveAllToTargetProps,{pt:e.ptm("moveAllToTargetButton")}),{icon:k((()=>[$(e.$slots,"movealltotargeticon",{viewChanged:l.viewChanged},(()=>[(g(),_(B(l.viewChanged?"AngleDoubleDownIcon":"AngleDoubleRightIcon"),I(L(e.ptm("moveAllToTargetButton").icon)),null,16))]))])),_:3},16,["aria-label","onClick","disabled","pt"]),y(r,b({"aria-label":n.moveToSourceAriaLabel,type:"button",onClick:n.moveToSource,disabled:n.moveDisabled(1)},i.moveToSourceProps,{pt:e.ptm("moveToSourceButton")}),{icon:k((()=>[$(e.$slots,"movetosourceicon",{viewChanged:l.viewChanged},(()=>[(g(),_(B(l.viewChanged?"AngleUpIcon":"AngleLeftIcon"),I(L(e.ptm("moveToSourceButton").icon)),null,16))]))])),_:3},16,["aria-label","onClick","disabled","pt"]),y(r,b({"aria-label":n.moveAllToSourceAriaLabel,type:"button",onClick:n.moveAllToSource,disabled:n.moveSourceDisabled("targetList")},i.moveAllToSourceProps,{pt:e.ptm("moveAllToSourceButton")}),{icon:k((()=>[$(e.$slots,"movealltosourceicon",{viewChanged:l.viewChanged},(()=>[(g(),_(B(l.viewChanged?"AngleDoubleUpIcon":"AngleDoubleLeftIcon"),I(L(e.ptm("moveAllToSourceButton").icon)),null,16))]))])),_:3},16,["aria-label","onClick","disabled","pt"]),$(e.$slots,"movecontrolsend")],16),w("div",b({class:"p-picklist-list-wrapper p-picklist-target-wrapper"},e.ptm("targetWrapper")),[e.$slots.targetheader?(g(),f("div",b({key:0,class:"p-picklist-header"},e.ptm("targetHeader")),[$(e.$slots,"targetheader")],16)):T("",!0),y(D,b({ref:"targetList",id:n.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?n.focusedOptionId:void 0,tabindex:n.targetList&&n.targetList.length>0?i.tabindex:-1,onFocus:t[10]||(t[10]=e=>n.onListFocus(e,"targetList")),onBlur:t[11]||(t[11]=e=>n.onListBlur(e,"targetList")),onKeydown:t[12]||(t[12]=e=>n.onItemKeyDown(e,"targetList"))},{...i.targetListProps,...e.ptm("targetList")}),{default:k((()=>[(g(!0),f(x,null,A(n.targetList,((i,o)=>C((g(),f("li",b({key:n.getItemKey(i,o),id:n.idTarget+"_"+o,class:n.itemClass(i,`${n.idTarget}_${o}`,1),onClick:e=>n.onItemClick(e,i,o,1),onDblclick:e=>n.onItemDblClick(e,i,1),onKeydown:t[8]||(t[8]=e=>n.onItemKeyDown(e,"targetList")),onMousedown:e=>n.onOptionMouseDown(o,"targetList"),onTouchend:t[9]||(t[9]=(...e)=>n.onItemTouchEnd&&n.onItemTouchEnd(...e)),role:"option","aria-selected":n.isSelected(i,1)},n.getPTOptions(i,"item")),[$(e.$slots,"item",{item:i,index:o})],16,E)),[[u]]))),128))])),_:3},16,["id","style","aria-activedescendant","tabindex"])],16),i.showTargetControls?(g(),f("div",b({key:1,class:"p-picklist-buttons p-picklist-target-controls"},e.ptm("targetControls")),[$(e.$slots,"targetcontrolsstart"),y(r,b({"aria-label":n.moveUpAriaLabel,disabled:n.moveDisabled(1),type:"button",onClick:t[13]||(t[13]=e=>n.moveUp(e,1))},i.moveUpButtonProps,{pt:e.ptm("targetMoveUpButton")}),{icon:k((()=>[$(e.$slots,"moveupicon",{},(()=>[y(s,I(L(e.ptm("targetMoveUpButton").icon)),null,16)]))])),_:3},16,["aria-label","disabled","pt"]),y(r,b({"aria-label":n.moveTopAriaLabel,disabled:n.moveDisabled(1),type:"button",onClick:t[14]||(t[14]=e=>n.moveTop(e,1))},i.moveTopButtonProps,{pt:e.ptm("targetMoveTopButton")}),{icon:k((()=>[$(e.$slots,"movetopicon",{},(()=>[y(a,I(L(e.ptm("targetMoveTopButton").icon)),null,16)]))])),_:3},16,["aria-label","disabled","pt"]),y(r,b({"aria-label":n.moveDownAriaLabel,disabled:n.moveDisabled(1),type:"button",onClick:t[15]||(t[15]=e=>n.moveDown(e,1))},i.moveDownButtonProps,{pt:e.ptm("targetMoveDownButton")}),{icon:k((()=>[$(e.$slots,"movedownicon",{},(()=>[y(d,I(L(e.ptm("targetMoveDownButton").icon)),null,16)]))])),_:3},16,["aria-label","disabled","pt"]),y(r,b({"aria-label":n.moveBottomAriaLabel,disabled:n.moveDisabled(1),type:"button",onClick:t[16]||(t[16]=e=>n.moveBottom(e,1))},i.moveBottomButtonProps,{pt:e.ptm("targetMoveBottomButton")}),{icon:k((()=>[$(e.$slots,"movebottomicon",{},(()=>[y(c,I(L(e.ptm("targetMoveBottomButton").icon)),null,16)]))])),_:3},16,["aria-label","disabled","pt"]),$(e.$slots,"targetcontrolsend")],16)):T("",!0)],16)};export{S as default};