primevue 3.22.3 → 3.22.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.
- package/accordion/Accordion.vue +7 -3
- package/accordion/accordion.cjs.js +7 -3
- package/accordion/accordion.cjs.min.js +1 -1
- package/accordion/accordion.esm.js +8 -4
- package/accordion/accordion.esm.min.js +1 -1
- package/accordion/accordion.js +7 -3
- package/accordion/accordion.min.js +1 -1
- package/autocomplete/AutoComplete.vue +6 -3
- package/autocomplete/autocomplete.cjs.js +12 -9
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.esm.js +13 -10
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +12 -9
- package/autocomplete/autocomplete.min.js +1 -1
- package/breadcrumb/Breadcrumb.vue +2 -2
- package/breadcrumb/breadcrumb.cjs.js +17 -10
- package/breadcrumb/breadcrumb.cjs.min.js +1 -1
- package/breadcrumb/breadcrumb.esm.js +17 -10
- package/breadcrumb/breadcrumb.esm.min.js +1 -1
- package/breadcrumb/breadcrumb.js +17 -10
- package/breadcrumb/breadcrumb.min.js +1 -1
- package/cascadeselect/CascadeSelect.vue +6 -3
- package/cascadeselect/cascadeselect.cjs.js +9 -6
- package/cascadeselect/cascadeselect.cjs.min.js +1 -1
- package/cascadeselect/cascadeselect.esm.js +10 -7
- package/cascadeselect/cascadeselect.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.js +9 -6
- package/cascadeselect/cascadeselect.min.js +1 -1
- package/contextmenu/ContextMenu.vue +6 -3
- package/contextmenu/contextmenu.cjs.js +8 -5
- package/contextmenu/contextmenu.cjs.min.js +1 -1
- package/contextmenu/contextmenu.esm.js +9 -6
- package/contextmenu/contextmenu.esm.min.js +1 -1
- package/contextmenu/contextmenu.js +8 -5
- package/contextmenu/contextmenu.min.js +1 -1
- package/core/core.js +45 -33
- package/core/core.min.js +4 -4
- package/datatable/BodyCell.vue +4 -2
- package/datatable/datatable.cjs.js +4 -2
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.esm.js +4 -2
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +4 -2
- package/datatable/datatable.min.js +1 -1
- package/dock/DockSub.vue +9 -3
- package/dock/dock.cjs.js +10 -4
- package/dock/dock.cjs.min.js +1 -1
- package/dock/dock.esm.js +11 -5
- package/dock/dock.esm.min.js +1 -1
- package/dock/dock.js +10 -4
- package/dock/dock.min.js +1 -1
- package/dropdown/Dropdown.vue +6 -3
- package/dropdown/dropdown.cjs.js +13 -10
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.esm.js +14 -11
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +13 -10
- package/dropdown/dropdown.min.js +1 -1
- package/listbox/Listbox.vue +6 -3
- package/listbox/listbox.cjs.js +11 -8
- package/listbox/listbox.cjs.min.js +1 -1
- package/listbox/listbox.esm.js +12 -9
- package/listbox/listbox.esm.min.js +1 -1
- package/listbox/listbox.js +11 -8
- package/listbox/listbox.min.js +1 -1
- package/megamenu/MegaMenu.vue +7 -3
- package/megamenu/megamenu.cjs.js +10 -6
- package/megamenu/megamenu.cjs.min.js +1 -1
- package/megamenu/megamenu.esm.js +11 -7
- package/megamenu/megamenu.esm.min.js +1 -1
- package/megamenu/megamenu.js +10 -6
- package/megamenu/megamenu.min.js +1 -1
- package/menu/Menu.vue +8 -3
- package/menu/menu.cjs.js +13 -8
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.esm.js +14 -9
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +13 -8
- package/menu/menu.min.js +1 -1
- package/menubar/Menubar.vue +7 -3
- package/menubar/menubar.cjs.js +10 -6
- package/menubar/menubar.cjs.min.js +1 -1
- package/menubar/menubar.esm.js +11 -7
- package/menubar/menubar.esm.min.js +1 -1
- package/menubar/menubar.js +10 -6
- package/menubar/menubar.min.js +1 -1
- package/multiselect/MultiSelect.vue +6 -3
- package/multiselect/multiselect.cjs.js +11 -8
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.esm.js +12 -9
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +11 -8
- package/multiselect/multiselect.min.js +1 -1
- package/orderlist/OrderList.vue +8 -3
- package/orderlist/orderlist.cjs.js +11 -6
- package/orderlist/orderlist.cjs.min.js +1 -1
- package/orderlist/orderlist.esm.js +12 -7
- package/orderlist/orderlist.esm.min.js +1 -1
- package/orderlist/orderlist.js +11 -6
- package/orderlist/orderlist.min.js +1 -1
- package/package.json +1 -1
- package/panelmenu/PanelMenu.vue +9 -6
- package/panelmenu/PanelMenuList.vue +1 -1
- package/panelmenu/panelmenu.cjs.js +11 -8
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.esm.js +11 -8
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +11 -8
- package/panelmenu/panelmenu.min.js +1 -1
- package/picklist/PickList.vue +8 -2
- package/picklist/picklist.cjs.js +8 -2
- package/picklist/picklist.cjs.min.js +1 -1
- package/picklist/picklist.esm.js +9 -3
- package/picklist/picklist.esm.min.js +1 -1
- package/picklist/picklist.js +8 -2
- package/picklist/picklist.min.js +1 -1
- package/rating/Rating.vue +9 -3
- package/rating/rating.cjs.js +11 -5
- package/rating/rating.cjs.min.js +1 -1
- package/rating/rating.esm.js +12 -6
- package/rating/rating.esm.min.js +1 -1
- package/rating/rating.js +11 -5
- package/rating/rating.min.js +1 -1
- package/resources/themes/arya-blue/theme.css +7 -0
- package/resources/themes/arya-green/theme.css +7 -0
- package/resources/themes/arya-orange/theme.css +7 -0
- package/resources/themes/arya-purple/theme.css +7 -0
- package/resources/themes/bootstrap4-dark-blue/theme.css +7 -0
- package/resources/themes/bootstrap4-dark-purple/theme.css +7 -0
- package/resources/themes/bootstrap4-light-blue/theme.css +7 -0
- package/resources/themes/bootstrap4-light-purple/theme.css +7 -0
- package/resources/themes/fluent-light/theme.css +7 -0
- package/resources/themes/lara-dark-blue/theme.css +7 -0
- package/resources/themes/lara-dark-indigo/theme.css +7 -0
- package/resources/themes/lara-dark-purple/theme.css +7 -0
- package/resources/themes/lara-dark-teal/theme.css +7 -0
- package/resources/themes/lara-light-blue/theme.css +7 -0
- package/resources/themes/lara-light-indigo/theme.css +7 -0
- package/resources/themes/lara-light-purple/theme.css +7 -0
- package/resources/themes/lara-light-teal/theme.css +7 -0
- package/resources/themes/luna-amber/theme.css +7 -0
- package/resources/themes/luna-blue/theme.css +7 -0
- package/resources/themes/luna-green/theme.css +7 -0
- package/resources/themes/luna-pink/theme.css +7 -0
- package/resources/themes/md-dark-deeppurple/theme.css +10 -2
- package/resources/themes/md-dark-indigo/theme.css +10 -2
- package/resources/themes/md-light-deeppurple/theme.css +10 -2
- package/resources/themes/md-light-indigo/theme.css +10 -2
- package/resources/themes/mdc-dark-deeppurple/theme.css +10 -2
- package/resources/themes/mdc-dark-indigo/theme.css +10 -2
- package/resources/themes/mdc-light-deeppurple/theme.css +10 -2
- package/resources/themes/mdc-light-indigo/theme.css +10 -2
- package/resources/themes/nova/theme.css +7 -0
- package/resources/themes/nova-accent/theme.css +7 -0
- package/resources/themes/nova-alt/theme.css +7 -0
- package/resources/themes/nova-vue/theme.css +7 -0
- package/resources/themes/rhea/theme.css +7 -0
- package/resources/themes/saga-blue/theme.css +7 -0
- package/resources/themes/saga-green/theme.css +7 -0
- package/resources/themes/saga-orange/theme.css +7 -0
- package/resources/themes/saga-purple/theme.css +7 -0
- package/resources/themes/tailwind-light/theme.css +7 -0
- package/resources/themes/vela-blue/theme.css +7 -0
- package/resources/themes/vela-green/theme.css +7 -0
- package/resources/themes/vela-orange/theme.css +7 -0
- package/resources/themes/vela-purple/theme.css +7 -0
- package/speeddial/SpeedDial.vue +6 -3
- package/speeddial/speeddial.cjs.js +11 -8
- package/speeddial/speeddial.cjs.min.js +1 -1
- package/speeddial/speeddial.esm.js +12 -9
- package/speeddial/speeddial.esm.min.js +1 -1
- package/speeddial/speeddial.js +11 -8
- package/speeddial/speeddial.min.js +1 -1
- package/tabview/TabView.vue +6 -3
- package/tabview/tabview.cjs.js +6 -3
- package/tabview/tabview.cjs.min.js +1 -1
- package/tabview/tabview.esm.js +7 -4
- package/tabview/tabview.esm.min.js +1 -1
- package/tabview/tabview.js +6 -3
- package/tabview/tabview.min.js +1 -1
- package/tieredmenu/TieredMenu.vue +7 -3
- package/tieredmenu/tieredmenu.cjs.js +10 -6
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.esm.js +11 -7
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +10 -6
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/utils/utils.cjs.js +9 -9
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.esm.js +9 -9
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +9 -9
- package/utils/utils.min.js +1 -1
- package/web-types.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primevue=this.primevue||{},this.primevue.multiselect=function(e,t,i,l,s,n,o){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=a(t),c=a(i),d=a(l),p=a(n),h={name:"MultiSelect",emits:["update:modelValue","change","focus","blur","before-show","before-hide","show","hide","filter","selectall-change"],props:{modelValue:null,options:Array,optionLabel:null,optionValue:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,scrollHeight:{type:String,default:"200px"},placeholder:String,disabled:Boolean,inputId:{type:String,default:null},inputProps:{type:null,default:null},panelClass:{type:String,default:null},panelStyle:{type:null,default:null},panelProps:{type:null,default:null},filterInputProps:{type:null,default:null},closeButtonProps:{type:null,default:null},dataKey:null,filter:Boolean,filterPlaceholder:String,filterLocale:String,filterMatchMode:{type:String,default:"contains"},filterFields:{type:Array,default:null},appendTo:{type:String,default:"body"},display:{type:String,default:"comma"},selectedItemsLabel:{type:String,default:"{0} items selected"},maxSelectedLabels:{type:Number,default:null},selectionLimit:{type:Number,default:null},showToggleAll:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},checkboxIcon:{type:String,default:"pi pi-check"},closeIcon:{type:String,default:"pi pi-times"},dropdownIcon:{type:String,default:"pi pi-chevron-down"},filterIcon:{type:String,default:"pi pi-search"},loadingIcon:{type:String,default:"pi pi-spinner pi-spin"},removeTokenIcon:{type:String,default:"pi pi-times-circle"},selectAll:{type:Boolean,default:null},resetFilterOnHide:{type:Boolean,default:!1},virtualScrollerOptions:{type:Object,default:null},autoOptionFocus:{type:Boolean,default:!0},autoFilterFocus:{type:Boolean,default:!1},filterMessage:{type:String,default:null},selectionMessage:{type:String,default:null},emptySelectionMessage:{type:String,default:null},emptyFilterMessage:{type:String,default:null},emptyMessage:{type:String,default:null},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},outsideClickListener:null,scrollHandler:null,resizeListener:null,overlay:null,list:null,virtualScroller:null,startRangeIndex:-1,searchTimeout:null,searchValue:"",selectOnFocus:!1,focusOnHover:!1,data:()=>({focused:!1,focusedOptionIndex:-1,headerCheckboxFocused:!1,filterValue:null,overlayVisible:!1}),watch:{options(){this.autoUpdateModel()}},mounted(){this.autoUpdateModel()},beforeUnmount(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(s.ZIndexUtils.clear(this.overlay),this.overlay=null)},methods:{getOptionIndex(e,t){return this.virtualScrollerDisabled?e:t&&t(e).index},getOptionLabel(e){return this.optionLabel?s.ObjectUtils.resolveFieldData(e,this.optionLabel):e},getOptionValue(e){return this.optionValue?s.ObjectUtils.resolveFieldData(e,this.optionValue):e},getOptionRenderKey(e){return this.dataKey?s.ObjectUtils.resolveFieldData(e,this.dataKey):this.getOptionLabel(e)},isOptionDisabled(e){return!(!this.maxSelectionLimitReached||this.isSelected(e))||!!this.optionDisabled&&s.ObjectUtils.resolveFieldData(e,this.optionDisabled)},isOptionGroup(e){return this.optionGroupLabel&&e.optionGroup&&e.group},getOptionGroupLabel(e){return s.ObjectUtils.resolveFieldData(e,this.optionGroupLabel)},getOptionGroupChildren(e){return s.ObjectUtils.resolveFieldData(e,this.optionGroupChildren)},getAriaPosInset(e){return(this.optionGroupLabel?e-this.visibleOptions.slice(0,e).filter((e=>this.isOptionGroup(e))).length:e)+1},show(e){this.$emit("before-show"),this.overlayVisible=!0,this.focusedOptionIndex=-1!==this.focusedOptionIndex?this.focusedOptionIndex:this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,e&&s.DomHandler.focus(this.$refs.focusInput)},hide(e){const t=()=>{this.$emit("before-hide"),this.overlayVisible=!1,this.focusedOptionIndex=-1,this.searchValue="",this.resetFilterOnHide&&(this.filterValue=null),e&&s.DomHandler.focus(this.$refs.focusInput)};setTimeout((()=>{t()}),0)},onFocus(e){this.disabled||(this.focused=!0,this.focusedOptionIndex=-1!==this.focusedOptionIndex?this.focusedOptionIndex:this.overlayVisible&&this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,this.overlayVisible&&this.scrollInView(this.focusedOptionIndex),this.$emit("focus",e))},onBlur(e){this.focused=!1,this.focusedOptionIndex=-1,this.searchValue="",this.$emit("blur",e)},onKeyDown(e){if(this.disabled)return void e.preventDefault();const t=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"PageDown":this.onPageDownKey(e);break;case"PageUp":this.onPageUpKey(e);break;case"Enter":case"Space":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"ShiftLeft":case"ShiftRight":this.onShiftKey(e);break;default:if("KeyA"===e.code&&t){const t=this.visibleOptions.filter((e=>this.isValidOption(e))).map((e=>this.getOptionValue(e)));this.updateModel(e,t),e.preventDefault();break}!t&&s.ObjectUtils.isPrintableCharacter(e.key)&&(!this.overlayVisible&&this.show(),this.searchOptions(e),e.preventDefault())}},onContainerClick(e){this.disabled||this.loading||this.overlay&&this.overlay.contains(e.target)||(this.overlayVisible?this.hide(!0):this.show(!0))},onFirstHiddenFocus(e){const t=e.relatedTarget===this.$refs.focusInput?s.DomHandler.getFirstFocusableElement(this.overlay,":not(.p-hidden-focusable)"):this.$refs.focusInput;s.DomHandler.focus(t)},onLastHiddenFocus(e){const t=e.relatedTarget===this.$refs.focusInput?s.DomHandler.getLastFocusableElement(this.overlay,":not(.p-hidden-focusable)"):this.$refs.focusInput;s.DomHandler.focus(t)},onCloseClick(){this.hide(!0)},onHeaderCheckboxFocus(){this.headerCheckboxFocused=!0},onHeaderCheckboxBlur(){this.headerCheckboxFocused=!1},onOptionSelect(e,t,i=-1,l=!1){if(this.disabled||this.isOptionDisabled(t))return;let n=null;n=this.isSelected(t)?this.modelValue.filter((e=>!s.ObjectUtils.equals(e,this.getOptionValue(t),this.equalityKey))):[...this.modelValue||[],this.getOptionValue(t)],this.updateModel(e,n),-1!==i&&(this.focusedOptionIndex=i),l&&s.DomHandler.focus(this.$refs.focusInput)},onOptionMouseMove(e,t){this.focusOnHover&&this.changeFocusedOptionIndex(e,t)},onOptionSelectRange(e,t=-1,i=-1){if(-1===t&&(t=this.findNearestSelectedOptionIndex(i,!0)),-1===i&&(i=this.findNearestSelectedOptionIndex(t)),-1!==t&&-1!==i){const l=Math.min(t,i),s=Math.max(t,i),n=this.visibleOptions.slice(l,s+1).filter((e=>this.isValidOption(e))).map((e=>this.getOptionValue(e)));this.updateModel(e,n)}},onFilterChange(e){const t=e.target.value;this.filterValue=t,this.focusedOptionIndex=-1,this.$emit("filter",{originalEvent:e,value:t}),!this.virtualScrollerDisabled&&this.virtualScroller.scrollToIndex(0)},onFilterKeyDown(e){switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e,!0);break;case"ArrowLeft":case"ArrowRight":this.onArrowLeftKey(e,!0);break;case"Home":this.onHomeKey(e,!0);break;case"End":this.onEndKey(e,!0);break;case"Enter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e,!0)}},onFilterBlur(){this.focusedOptionIndex=-1},onFilterUpdated(){this.overlayVisible&&this.alignOverlay()},onOverlayClick(e){r.default.emit("overlay-click",{originalEvent:e,target:this.$el})},onOverlayKeyDown(e){if("Escape"===e.code)this.onEscapeKey(e)},onArrowDownKey(e){const t=-1!==this.focusedOptionIndex?this.findNextOptionIndex(this.focusedOptionIndex):this.findFirstFocusedOptionIndex();e.shiftKey&&this.onOptionSelectRange(e,this.startRangeIndex,t),this.changeFocusedOptionIndex(e,t),!this.overlayVisible&&this.show(),e.preventDefault()},onArrowUpKey(e,t=!1){if(e.altKey&&!t)-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide(),e.preventDefault();else{const t=-1!==this.focusedOptionIndex?this.findPrevOptionIndex(this.focusedOptionIndex):this.findLastFocusedOptionIndex();e.shiftKey&&this.onOptionSelectRange(e,t,this.startRangeIndex),this.changeFocusedOptionIndex(e,t),!this.overlayVisible&&this.show(),e.preventDefault()}},onArrowLeftKey(e,t=!1){t&&(this.focusedOptionIndex=-1)},onHomeKey(e,t=!1){const{currentTarget:i}=e;if(t){const t=i.value.length;i.setSelectionRange(0,e.shiftKey?t:0),this.focusedOptionIndex=-1}else{let t=e.metaKey||e.ctrlKey,i=this.findFirstOptionIndex();e.shiftKey&&t&&this.onOptionSelectRange(e,i,this.startRangeIndex),this.changeFocusedOptionIndex(e,i),!this.overlayVisible&&this.show()}e.preventDefault()},onEndKey(e,t=!1){const{currentTarget:i}=e;if(t){const t=i.value.length;i.setSelectionRange(e.shiftKey?0:t,t),this.focusedOptionIndex=-1}else{let t=e.metaKey||e.ctrlKey,i=this.findLastOptionIndex();e.shiftKey&&t&&this.onOptionSelectRange(e,this.startRangeIndex,i),this.changeFocusedOptionIndex(e,i),!this.overlayVisible&&this.show()}e.preventDefault()},onPageUpKey(e){this.scrollInView(0),e.preventDefault()},onPageDownKey(e){this.scrollInView(this.visibleOptions.length-1),e.preventDefault()},onEnterKey(e){this.overlayVisible?-1!==this.focusedOptionIndex&&(e.shiftKey?this.onOptionSelectRange(e,this.focusedOptionIndex):this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex])):this.onArrowDownKey(e),e.preventDefault()},onEscapeKey(e){this.overlayVisible&&this.hide(!0),e.preventDefault()},onTabKey(e,t=!1){t||(this.overlayVisible&&this.hasFocusableElements()?(s.DomHandler.focus(e.shiftKey?this.$refs.lastHiddenFocusableElementOnOverlay:this.$refs.firstHiddenFocusableElementOnOverlay),e.preventDefault()):(-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide(this.filter)))},onShiftKey(){this.startRangeIndex=this.focusedOptionIndex},onOverlayEnter(e){s.ZIndexUtils.set("overlay",e,this.$primevue.config.zIndex.overlay),this.alignOverlay(),this.scrollInView(),this.autoFilterFocus&&s.DomHandler.focus(this.$refs.filterInput)},onOverlayAfterEnter(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.$emit("show")},onOverlayLeave(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null},onOverlayAfterLeave(e){s.ZIndexUtils.clear(e)},alignOverlay(){"self"===this.appendTo?s.DomHandler.relativePosition(this.overlay,this.$el):(this.overlay.style.minWidth=s.DomHandler.getOuterWidth(this.$el)+"px",s.DomHandler.absolutePosition(this.overlay,this.$el))},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{this.overlayVisible&&this.isOutsideClicked(e)&&this.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new s.ConnectedOverlayScrollHandler(this.$refs.container,(()=>{this.overlayVisible&&this.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!s.DomHandler.isTouchDevice()&&this.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isOutsideClicked(e){return!(this.$el.isSameNode(e.target)||this.$el.contains(e.target)||this.overlay&&this.overlay.contains(e.target))},getLabelByValue(e){const t=(this.optionGroupLabel?this.flatOptions(this.options):this.options||[]).find((t=>!this.isOptionGroup(t)&&s.ObjectUtils.equals(this.getOptionValue(t),e,this.equalityKey)));return t?this.getOptionLabel(t):null},getSelectedItemsLabel(){let e=/{(.*?)}/;return e.test(this.selectedItemsLabel)?this.selectedItemsLabel.replace(this.selectedItemsLabel.match(e)[0],this.modelValue.length+""):this.selectedItemsLabel},onToggleAll(e){if(null!==this.selectAll)this.$emit("selectall-change",{originalEvent:e,checked:!this.allSelected});else{const t=this.allSelected?[]:this.visibleOptions.filter((e=>this.isValidOption(e))).map((e=>this.getOptionValue(e)));this.updateModel(e,t)}this.headerCheckboxFocused=!0},removeOption(e,t){let i=this.modelValue.filter((e=>!s.ObjectUtils.equals(e,t,this.equalityKey)));this.updateModel(e,i)},clearFilter(){this.filterValue=null},hasFocusableElements(){return s.DomHandler.getFocusableElements(this.overlay,":not(.p-hidden-focusable)").length>0},isOptionMatched(e){return this.isValidOption(e)&&this.getOptionLabel(e).toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale))},isValidOption(e){return e&&!(this.isOptionDisabled(e)||this.isOptionGroup(e))},isValidSelectedOption(e){return this.isValidOption(e)&&this.isSelected(e)},isSelected(e){const t=this.getOptionValue(e);return(this.modelValue||[]).some((e=>s.ObjectUtils.equals(e,t,this.equalityKey)))},findFirstOptionIndex(){return this.visibleOptions.findIndex((e=>this.isValidOption(e)))},findLastOptionIndex(){return s.ObjectUtils.findLastIndex(this.visibleOptions,(e=>this.isValidOption(e)))},findNextOptionIndex(e){const t=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((e=>this.isValidOption(e))):-1;return t>-1?t+e+1:e},findPrevOptionIndex(e){const t=e>0?s.ObjectUtils.findLastIndex(this.visibleOptions.slice(0,e),(e=>this.isValidOption(e))):-1;return t>-1?t:e},findFirstSelectedOptionIndex(){return this.hasSelectedOption?this.visibleOptions.findIndex((e=>this.isValidSelectedOption(e))):-1},findLastSelectedOptionIndex(){return this.hasSelectedOption?s.ObjectUtils.findLastIndex(this.visibleOptions,(e=>this.isValidSelectedOption(e))):-1},findNextSelectedOptionIndex(e){const t=this.hasSelectedOption&&e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((e=>this.isValidSelectedOption(e))):-1;return t>-1?t+e+1:-1},findPrevSelectedOptionIndex(e){const t=this.hasSelectedOption&&e>0?s.ObjectUtils.findLastIndex(this.visibleOptions.slice(0,e),(e=>this.isValidSelectedOption(e))):-1;return t>-1?t:-1},findNearestSelectedOptionIndex(e,t=!1){let i=-1;return this.hasSelectedOption&&(t?(i=this.findPrevSelectedOptionIndex(e),i=-1===i?this.findNextSelectedOptionIndex(e):i):(i=this.findNextSelectedOptionIndex(e),i=-1===i?this.findPrevSelectedOptionIndex(e):i)),i>-1?i:e},findFirstFocusedOptionIndex(){const e=this.findFirstSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex(){const e=this.findLastSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},searchOptions(e){this.searchValue=(this.searchValue||"")+e.key;let t=-1;-1!==this.focusedOptionIndex?(t=this.visibleOptions.slice(this.focusedOptionIndex).findIndex((e=>this.isOptionMatched(e))),t=-1===t?this.visibleOptions.slice(0,this.focusedOptionIndex).findIndex((e=>this.isOptionMatched(e))):t+this.focusedOptionIndex):t=this.visibleOptions.findIndex((e=>this.isOptionMatched(e))),-1===t&&-1===this.focusedOptionIndex&&(t=this.findFirstFocusedOptionIndex()),-1!==t&&this.changeFocusedOptionIndex(e,t),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((()=>{this.searchValue="",this.searchTimeout=null}),500)},changeFocusedOptionIndex(e,t){this.focusedOptionIndex!==t&&(this.focusedOptionIndex=t,this.scrollInView())},scrollInView(e=-1){const t=-1!==e?`${this.id}_${e}`:this.focusedOptionId,i=s.DomHandler.findSingle(this.list,`li[id="${t}"]`);i?i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"nearest"}):this.virtualScrollerDisabled||this.virtualScroller&&this.virtualScroller.scrollToIndex(-1!==e?e:this.focusedOptionIndex)},autoUpdateModel(){if(this.selectOnFocus&&this.autoOptionFocus&&!this.hasSelectedOption){this.focusedOptionIndex=this.findFirstFocusedOptionIndex();const e=this.getOptionValue(this.visibleOptions[this.focusedOptionIndex]);this.updateModel(null,[e])}},updateModel(e,t){this.$emit("update:modelValue",t),this.$emit("change",{originalEvent:e,value:t})},flatOptions(e){return(e||[]).reduce(((e,t,i)=>{e.push({optionGroup:t,group:!0,index:i});const l=this.getOptionGroupChildren(t);return l&&l.forEach((t=>e.push(t))),e}),[])},overlayRef(e){this.overlay=e},listRef(e,t){this.list=e,t&&t(e)},virtualScrollerRef(e){this.virtualScroller=e}},computed:{containerClass(){return["p-multiselect p-component p-inputwrapper",{"p-multiselect-chip":"chip"===this.display,"p-disabled":this.disabled,"p-focus":this.focused,"p-inputwrapper-filled":this.modelValue&&this.modelValue.length,"p-inputwrapper-focus":this.focused||this.overlayVisible,"p-overlay-open":this.overlayVisible}]},labelClass(){return["p-multiselect-label",{"p-placeholder":this.label===this.placeholder,"p-multiselect-label-empty":!(this.placeholder||this.modelValue&&0!==this.modelValue.length)}]},dropdownIconClass(){return["p-multiselect-trigger-icon",this.loading?this.loadingIcon:this.dropdownIcon]},panelStyleClass(){return["p-multiselect-panel p-component",this.panelClass,{"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},headerCheckboxClass(){return["p-checkbox p-component",{"p-checkbox-checked":this.allSelected,"p-checkbox-focused":this.headerCheckboxFocused}]},visibleOptions(){const t=this.optionGroupLabel?this.flatOptions(this.options):this.options||[];if(this.filterValue){const i=e.FilterService.filter(t,this.searchFields,this.filterValue,this.filterMatchMode,this.filterLocale);if(this.optionGroupLabel){const e=this.options||[],t=[];return e.forEach((e=>{const l=e.items.filter((e=>i.includes(e)));l.length>0&&t.push({...e,items:[...l]})})),this.flatOptions(t)}return i}return t},label(){let e;if(this.modelValue&&this.modelValue.length){if(s.ObjectUtils.isNotEmpty(this.maxSelectedLabels)&&this.modelValue.length>this.maxSelectedLabels)return this.getSelectedItemsLabel();e="";for(let t=0;t<this.modelValue.length;t++)0!==t&&(e+=", "),e+=this.getLabelByValue(this.modelValue[t])}else e=this.placeholder;return e},chipSelectedItems(){return s.ObjectUtils.isNotEmpty(this.maxSelectedLabels)&&this.modelValue&&this.modelValue.length>this.maxSelectedLabels?this.modelValue.slice(0,this.maxSelectedLabels):this.modelValue},allSelected(){return null!==this.selectAll?this.selectAll:s.ObjectUtils.isNotEmpty(this.visibleOptions)&&this.visibleOptions.every((e=>this.isOptionGroup(e)||this.isOptionDisabled(e)||this.isSelected(e)))},hasSelectedOption(){return s.ObjectUtils.isNotEmpty(this.modelValue)},equalityKey(){return this.optionValue?null:this.dataKey},searchFields(){return this.filterFields||[this.optionLabel]},maxSelectionLimitReached(){return this.selectionLimit&&this.modelValue&&this.modelValue.length===this.selectionLimit},filterResultMessageText(){return s.ObjectUtils.isNotEmpty(this.visibleOptions)?this.filterMessageText.replaceAll("{0}",this.visibleOptions.length):this.emptyFilterMessageText},filterMessageText(){return this.filterMessage||this.$primevue.config.locale.searchMessage||""},emptyFilterMessageText(){return this.emptyFilterMessage||this.$primevue.config.locale.emptySearchMessage||this.$primevue.config.locale.emptyFilterMessage||""},emptyMessageText(){return this.emptyMessage||this.$primevue.config.locale.emptyMessage||""},selectionMessageText(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}",this.modelValue.length):this.emptySelectionMessageText},id(){return this.$attrs.id||s.UniqueComponentId()},focusedOptionId(){return-1!==this.focusedOptionIndex?`${this.id}_${this.focusedOptionIndex}`:null},ariaSetSize(){return this.visibleOptions.filter((e=>!this.isOptionGroup(e))).length},toggleAllAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria[this.allSelected?"selectAll":"unselectAll"]:void 0},closeAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.close:void 0},virtualScrollerDisabled(){return!this.virtualScrollerOptions}},directives:{ripple:d.default},components:{VirtualScroller:p.default,Portal:c.default}};const u={class:"p-hidden-accessible"},m=["id","disabled","placeholder","tabindex","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"],f={class:"p-multiselect-label-container"},y={class:"p-multiselect-token-label"},b=["onClick"],O={class:"p-multiselect-trigger"},g={key:0,class:"p-multiselect-header"},v={class:"p-hidden-accessible"},x=["checked","aria-label"],S={key:1,class:"p-multiselect-filter-container"},I=["value","placeholder","aria-owns","aria-activedescendant"],k={key:2,role:"status","aria-live":"polite",class:"p-hidden-accessible"},V=["aria-label"],L=["id"],C=["id"],F=["id","aria-label","aria-selected","aria-disabled","aria-setsize","aria-posinset","onClick","onMousemove"],w={class:"p-checkbox p-component"},E={key:0,class:"p-multiselect-empty-message",role:"option"},D={key:1,class:"p-multiselect-empty-message",role:"option"},K={key:1,role:"status","aria-live":"polite",class:"p-hidden-accessible"},B={role:"status","aria-live":"polite",class:"p-hidden-accessible"};return function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var l=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css","top"===i&&l.firstChild?l.insertBefore(s,l.firstChild):l.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}}("\n.p-multiselect {\n display: inline-flex;\n cursor: pointer;\n position: relative;\n user-select: none;\n}\n.p-multiselect-trigger {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n}\n.p-multiselect-label-container {\n overflow: hidden;\n flex: 1 1 auto;\n cursor: pointer;\n}\n.p-multiselect-label {\n display: block;\n white-space: nowrap;\n cursor: pointer;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.p-multiselect-label-empty {\n overflow: hidden;\n visibility: hidden;\n}\n.p-multiselect-token {\n cursor: default;\n display: inline-flex;\n align-items: center;\n flex: 0 0 auto;\n}\n.p-multiselect-token-icon {\n cursor: pointer;\n}\n.p-multiselect .p-multiselect-panel {\n min-width: 100%;\n}\n.p-multiselect-panel {\n position: absolute;\n top: 0;\n left: 0;\n}\n.p-multiselect-items-wrapper {\n overflow: auto;\n}\n.p-multiselect-items {\n margin: 0;\n padding: 0;\n list-style-type: none;\n}\n.p-multiselect-item {\n cursor: pointer;\n display: flex;\n align-items: center;\n font-weight: normal;\n white-space: nowrap;\n position: relative;\n overflow: hidden;\n}\n.p-multiselect-item-group {\n cursor: auto;\n}\n.p-multiselect-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n.p-multiselect-filter-container {\n position: relative;\n flex: 1 1 auto;\n}\n.p-multiselect-filter-icon {\n position: absolute;\n top: 50%;\n margin-top: -0.5rem;\n}\n.p-multiselect-filter-container .p-inputtext {\n width: 100%;\n}\n.p-multiselect-close {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n overflow: hidden;\n position: relative;\n margin-left: auto;\n}\n.p-fluid .p-multiselect {\n display: flex;\n}\n"),h.render=function(e,t,i,l,s,n){const a=o.resolveComponent("VirtualScroller"),r=o.resolveComponent("Portal"),c=o.resolveDirective("ripple");return o.openBlock(),o.createElementBlock("div",{ref:"container",class:o.normalizeClass(n.containerClass),onClick:t[15]||(t[15]=(...e)=>n.onContainerClick&&n.onContainerClick(...e))},[o.createElementVNode("div",u,[o.createElementVNode("input",o.mergeProps({ref:"focusInput",id:i.inputId,type:"text",readonly:"",disabled:i.disabled,placeholder:i.placeholder,tabindex:i.disabled?-1:i.tabindex,role:"combobox","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"listbox","aria-expanded":s.overlayVisible,"aria-controls":n.id+"_list","aria-activedescendant":s.focused?n.focusedOptionId:void 0,onFocus:t[0]||(t[0]=(...e)=>n.onFocus&&n.onFocus(...e)),onBlur:t[1]||(t[1]=(...e)=>n.onBlur&&n.onBlur(...e)),onKeydown:t[2]||(t[2]=(...e)=>n.onKeyDown&&n.onKeyDown(...e))},i.inputProps),null,16,m)]),o.createElementVNode("div",f,[o.createElementVNode("div",{class:o.normalizeClass(n.labelClass)},[o.renderSlot(e.$slots,"value",{value:i.modelValue,placeholder:i.placeholder},(()=>["comma"===i.display?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createTextVNode(o.toDisplayString(n.label||"empty"),1)],64)):"chip"===i.display?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.chipSelectedItems,(t=>(o.openBlock(),o.createElementBlock("div",{key:n.getLabelByValue(t),class:"p-multiselect-token"},[o.renderSlot(e.$slots,"chip",{value:t},(()=>[o.createElementVNode("span",y,o.toDisplayString(n.getLabelByValue(t)),1)])),i.disabled?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(["p-multiselect-token-icon",i.removeTokenIcon]),onClick:o.withModifiers((e=>n.removeOption(e,t)),["stop"])},null,10,b))])))),128)),i.modelValue&&0!==i.modelValue.length?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createTextVNode(o.toDisplayString(i.placeholder||"empty"),1)],64))],64)):o.createCommentVNode("",!0)]))],2)]),o.createElementVNode("div",O,[o.renderSlot(e.$slots,"indicator",{},(()=>[o.createElementVNode("span",{class:o.normalizeClass(n.dropdownIconClass),"aria-hidden":"true"},null,2)]))]),o.createVNode(r,{appendTo:i.appendTo},{default:o.withCtx((()=>[o.createVNode(o.Transition,{name:"p-connected-overlay",onEnter:n.onOverlayEnter,onAfterEnter:n.onOverlayAfterEnter,onLeave:n.onOverlayLeave,onAfterLeave:n.onOverlayAfterLeave},{default:o.withCtx((()=>[s.overlayVisible?(o.openBlock(),o.createElementBlock("div",o.mergeProps({key:0,ref:n.overlayRef,style:i.panelStyle,class:n.panelStyleClass,onClick:t[13]||(t[13]=(...e)=>n.onOverlayClick&&n.onOverlayClick(...e)),onKeydown:t[14]||(t[14]=(...e)=>n.onOverlayKeyDown&&n.onOverlayKeyDown(...e))},i.panelProps),[o.createElementVNode("span",{ref:"firstHiddenFocusableElementOnOverlay",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:0,onFocus:t[3]||(t[3]=(...e)=>n.onFirstHiddenFocus&&n.onFirstHiddenFocus(...e))},null,544),o.renderSlot(e.$slots,"header",{value:i.modelValue,options:n.visibleOptions}),i.showToggleAll&&null==i.selectionLimit||i.filter?(o.openBlock(),o.createElementBlock("div",g,[i.showToggleAll&&null==i.selectionLimit?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(n.headerCheckboxClass),onClick:t[6]||(t[6]=(...e)=>n.onToggleAll&&n.onToggleAll(...e))},[o.createElementVNode("div",v,[o.createElementVNode("input",{type:"checkbox",readonly:"",checked:n.allSelected,"aria-label":n.toggleAllAriaLabel,onFocus:t[4]||(t[4]=(...e)=>n.onHeaderCheckboxFocus&&n.onHeaderCheckboxFocus(...e)),onBlur:t[5]||(t[5]=(...e)=>n.onHeaderCheckboxBlur&&n.onHeaderCheckboxBlur(...e))},null,40,x)]),o.createElementVNode("div",{class:o.normalizeClass(["p-checkbox-box",{"p-highlight":n.allSelected,"p-focus":s.headerCheckboxFocused}])},[o.createElementVNode("span",{class:o.normalizeClass(["p-checkbox-icon",{[i.checkboxIcon]:n.allSelected}])},null,2)],2)],2)):o.createCommentVNode("",!0),i.filter?(o.openBlock(),o.createElementBlock("div",S,[o.createElementVNode("input",o.mergeProps({ref:"filterInput",type:"text",value:s.filterValue,onVnodeUpdated:t[7]||(t[7]=(...e)=>n.onFilterUpdated&&n.onFilterUpdated(...e)),class:"p-multiselect-filter p-inputtext p-component",placeholder:i.filterPlaceholder,role:"searchbox",autocomplete:"off","aria-owns":n.id+"_list","aria-activedescendant":n.focusedOptionId,onKeydown:t[8]||(t[8]=(...e)=>n.onFilterKeyDown&&n.onFilterKeyDown(...e)),onBlur:t[9]||(t[9]=(...e)=>n.onFilterBlur&&n.onFilterBlur(...e)),onInput:t[10]||(t[10]=(...e)=>n.onFilterChange&&n.onFilterChange(...e))},i.filterInputProps),null,16,I),o.createElementVNode("span",{class:o.normalizeClass(["p-multiselect-filter-icon",i.filterIcon])},null,2)])):o.createCommentVNode("",!0),i.filter?(o.openBlock(),o.createElementBlock("span",k,o.toDisplayString(n.filterResultMessageText),1)):o.createCommentVNode("",!0),o.withDirectives((o.openBlock(),o.createElementBlock("button",o.mergeProps({class:"p-multiselect-close p-link","aria-label":n.closeAriaLabel,onClick:t[11]||(t[11]=(...e)=>n.onCloseClick&&n.onCloseClick(...e)),type:"button"},i.closeButtonProps),[o.createElementVNode("span",{class:o.normalizeClass(["p-multiselect-close-icon",i.closeIcon])},null,2)],16,V)),[[c]])])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:"p-multiselect-items-wrapper",style:o.normalizeStyle({"max-height":n.virtualScrollerDisabled?i.scrollHeight:""})},[o.createVNode(a,o.mergeProps({ref:n.virtualScrollerRef},i.virtualScrollerOptions,{items:n.visibleOptions,style:{height:i.scrollHeight},tabindex:-1,disabled:n.virtualScrollerDisabled}),o.createSlots({content:o.withCtx((({styleClass:t,contentRef:l,items:a,getItemOptions:r,contentStyle:d,itemSize:p})=>[o.createElementVNode("ul",{ref:e=>n.listRef(e,l),id:n.id+"_list",class:o.normalizeClass(["p-multiselect-items p-component",t]),style:o.normalizeStyle(d),role:"listbox","aria-multiselectable":"true"},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a,((t,l)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:n.getOptionRenderKey(t,n.getOptionIndex(l,r))},[n.isOptionGroup(t)?(o.openBlock(),o.createElementBlock("li",{key:0,id:n.id+"_"+n.getOptionIndex(l,r),style:o.normalizeStyle({height:p?p+"px":void 0}),class:"p-multiselect-item-group",role:"option"},[o.renderSlot(e.$slots,"optiongroup",{option:t.optionGroup,index:n.getOptionIndex(l,r)},(()=>[o.createTextVNode(o.toDisplayString(n.getOptionGroupLabel(t.optionGroup)),1)]))],12,C)):o.withDirectives((o.openBlock(),o.createElementBlock("li",{key:1,id:n.id+"_"+n.getOptionIndex(l,r),style:o.normalizeStyle({height:p?p+"px":void 0}),class:o.normalizeClass(["p-multiselect-item",{"p-highlight":n.isSelected(t),"p-focus":s.focusedOptionIndex===n.getOptionIndex(l,r),"p-disabled":n.isOptionDisabled(t)}]),role:"option","aria-label":n.getOptionLabel(t),"aria-selected":n.isSelected(t),"aria-disabled":n.isOptionDisabled(t),"aria-setsize":n.ariaSetSize,"aria-posinset":n.getAriaPosInset(n.getOptionIndex(l,r)),onClick:e=>n.onOptionSelect(e,t,n.getOptionIndex(l,r),!0),onMousemove:e=>n.onOptionMouseMove(e,n.getOptionIndex(l,r))},[o.createElementVNode("div",w,[o.createElementVNode("div",{class:o.normalizeClass(["p-checkbox-box",{"p-highlight":n.isSelected(t)}])},[o.createElementVNode("span",{class:o.normalizeClass(["p-checkbox-icon",{[i.checkboxIcon]:n.isSelected(t)}])},null,2)],2)]),o.renderSlot(e.$slots,"option",{option:t,index:n.getOptionIndex(l,r)},(()=>[o.createElementVNode("span",null,o.toDisplayString(n.getOptionLabel(t)),1)]))],46,F)),[[c]])],64)))),128)),s.filterValue&&(!a||a&&0===a.length)?(o.openBlock(),o.createElementBlock("li",E,[o.renderSlot(e.$slots,"emptyfilter",{},(()=>[o.createTextVNode(o.toDisplayString(n.emptyFilterMessageText),1)]))])):!i.options||i.options&&0===i.options.length?(o.openBlock(),o.createElementBlock("li",D,[o.renderSlot(e.$slots,"empty",{},(()=>[o.createTextVNode(o.toDisplayString(n.emptyMessageText),1)]))])):o.createCommentVNode("",!0)],14,L)])),_:2},[e.$slots.loader?{name:"loader",fn:o.withCtx((({options:t})=>[o.renderSlot(e.$slots,"loader",{options:t})])),key:"0"}:void 0]),1040,["items","style","disabled"])],4),o.renderSlot(e.$slots,"footer",{value:i.modelValue,options:n.visibleOptions}),!i.options||i.options&&0===i.options.length?(o.openBlock(),o.createElementBlock("span",K,o.toDisplayString(n.emptyMessageText),1)):o.createCommentVNode("",!0),o.createElementVNode("span",B,o.toDisplayString(n.selectedMessageText),1),o.createElementVNode("span",{ref:"lastHiddenFocusableElementOnOverlay",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:0,onFocus:t[12]||(t[12]=(...e)=>n.onLastHiddenFocus&&n.onLastHiddenFocus(...e))},null,544)],16)):o.createCommentVNode("",!0)])),_:3},8,["onEnter","onAfterEnter","onLeave","onAfterLeave"])])),_:3},8,["appendTo"])],2)},h}(primevue.api,primevue.overlayeventbus,primevue.portal,primevue.ripple,primevue.utils,primevue.virtualscroller,Vue);
|
|
1
|
+
this.primevue=this.primevue||{},this.primevue.multiselect=function(e,t,i,l,s,n,o){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=a(t),c=a(i),d=a(l),p=a(n),h={name:"MultiSelect",emits:["update:modelValue","change","focus","blur","before-show","before-hide","show","hide","filter","selectall-change"],props:{modelValue:null,options:Array,optionLabel:null,optionValue:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,scrollHeight:{type:String,default:"200px"},placeholder:String,disabled:Boolean,inputId:{type:String,default:null},inputProps:{type:null,default:null},panelClass:{type:String,default:null},panelStyle:{type:null,default:null},panelProps:{type:null,default:null},filterInputProps:{type:null,default:null},closeButtonProps:{type:null,default:null},dataKey:null,filter:Boolean,filterPlaceholder:String,filterLocale:String,filterMatchMode:{type:String,default:"contains"},filterFields:{type:Array,default:null},appendTo:{type:String,default:"body"},display:{type:String,default:"comma"},selectedItemsLabel:{type:String,default:"{0} items selected"},maxSelectedLabels:{type:Number,default:null},selectionLimit:{type:Number,default:null},showToggleAll:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},checkboxIcon:{type:String,default:"pi pi-check"},closeIcon:{type:String,default:"pi pi-times"},dropdownIcon:{type:String,default:"pi pi-chevron-down"},filterIcon:{type:String,default:"pi pi-search"},loadingIcon:{type:String,default:"pi pi-spinner pi-spin"},removeTokenIcon:{type:String,default:"pi pi-times-circle"},selectAll:{type:Boolean,default:null},resetFilterOnHide:{type:Boolean,default:!1},virtualScrollerOptions:{type:Object,default:null},autoOptionFocus:{type:Boolean,default:!0},autoFilterFocus:{type:Boolean,default:!1},filterMessage:{type:String,default:null},selectionMessage:{type:String,default:null},emptySelectionMessage:{type:String,default:null},emptyFilterMessage:{type:String,default:null},emptyMessage:{type:String,default:null},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},outsideClickListener:null,scrollHandler:null,resizeListener:null,overlay:null,list:null,virtualScroller:null,startRangeIndex:-1,searchTimeout:null,searchValue:"",selectOnFocus:!1,focusOnHover:!1,data(){return{id:this.$attrs.id,focused:!1,focusedOptionIndex:-1,headerCheckboxFocused:!1,filterValue:null,overlayVisible:!1}},watch:{"$attrs.id":function(e){this.id=e||s.UniqueComponentId()},options(){this.autoUpdateModel()}},mounted(){this.id=this.id||s.UniqueComponentId(),this.autoUpdateModel()},beforeUnmount(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(s.ZIndexUtils.clear(this.overlay),this.overlay=null)},methods:{getOptionIndex(e,t){return this.virtualScrollerDisabled?e:t&&t(e).index},getOptionLabel(e){return this.optionLabel?s.ObjectUtils.resolveFieldData(e,this.optionLabel):e},getOptionValue(e){return this.optionValue?s.ObjectUtils.resolveFieldData(e,this.optionValue):e},getOptionRenderKey(e){return this.dataKey?s.ObjectUtils.resolveFieldData(e,this.dataKey):this.getOptionLabel(e)},isOptionDisabled(e){return!(!this.maxSelectionLimitReached||this.isSelected(e))||!!this.optionDisabled&&s.ObjectUtils.resolveFieldData(e,this.optionDisabled)},isOptionGroup(e){return this.optionGroupLabel&&e.optionGroup&&e.group},getOptionGroupLabel(e){return s.ObjectUtils.resolveFieldData(e,this.optionGroupLabel)},getOptionGroupChildren(e){return s.ObjectUtils.resolveFieldData(e,this.optionGroupChildren)},getAriaPosInset(e){return(this.optionGroupLabel?e-this.visibleOptions.slice(0,e).filter((e=>this.isOptionGroup(e))).length:e)+1},show(e){this.$emit("before-show"),this.overlayVisible=!0,this.focusedOptionIndex=-1!==this.focusedOptionIndex?this.focusedOptionIndex:this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,e&&s.DomHandler.focus(this.$refs.focusInput)},hide(e){const t=()=>{this.$emit("before-hide"),this.overlayVisible=!1,this.focusedOptionIndex=-1,this.searchValue="",this.resetFilterOnHide&&(this.filterValue=null),e&&s.DomHandler.focus(this.$refs.focusInput)};setTimeout((()=>{t()}),0)},onFocus(e){this.disabled||(this.focused=!0,this.focusedOptionIndex=-1!==this.focusedOptionIndex?this.focusedOptionIndex:this.overlayVisible&&this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,this.overlayVisible&&this.scrollInView(this.focusedOptionIndex),this.$emit("focus",e))},onBlur(e){this.focused=!1,this.focusedOptionIndex=-1,this.searchValue="",this.$emit("blur",e)},onKeyDown(e){if(this.disabled)return void e.preventDefault();const t=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"PageDown":this.onPageDownKey(e);break;case"PageUp":this.onPageUpKey(e);break;case"Enter":case"Space":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"ShiftLeft":case"ShiftRight":this.onShiftKey(e);break;default:if("KeyA"===e.code&&t){const t=this.visibleOptions.filter((e=>this.isValidOption(e))).map((e=>this.getOptionValue(e)));this.updateModel(e,t),e.preventDefault();break}!t&&s.ObjectUtils.isPrintableCharacter(e.key)&&(!this.overlayVisible&&this.show(),this.searchOptions(e),e.preventDefault())}},onContainerClick(e){this.disabled||this.loading||this.overlay&&this.overlay.contains(e.target)||(this.overlayVisible?this.hide(!0):this.show(!0))},onFirstHiddenFocus(e){const t=e.relatedTarget===this.$refs.focusInput?s.DomHandler.getFirstFocusableElement(this.overlay,":not(.p-hidden-focusable)"):this.$refs.focusInput;s.DomHandler.focus(t)},onLastHiddenFocus(e){const t=e.relatedTarget===this.$refs.focusInput?s.DomHandler.getLastFocusableElement(this.overlay,":not(.p-hidden-focusable)"):this.$refs.focusInput;s.DomHandler.focus(t)},onCloseClick(){this.hide(!0)},onHeaderCheckboxFocus(){this.headerCheckboxFocused=!0},onHeaderCheckboxBlur(){this.headerCheckboxFocused=!1},onOptionSelect(e,t,i=-1,l=!1){if(this.disabled||this.isOptionDisabled(t))return;let n=null;n=this.isSelected(t)?this.modelValue.filter((e=>!s.ObjectUtils.equals(e,this.getOptionValue(t),this.equalityKey))):[...this.modelValue||[],this.getOptionValue(t)],this.updateModel(e,n),-1!==i&&(this.focusedOptionIndex=i),l&&s.DomHandler.focus(this.$refs.focusInput)},onOptionMouseMove(e,t){this.focusOnHover&&this.changeFocusedOptionIndex(e,t)},onOptionSelectRange(e,t=-1,i=-1){if(-1===t&&(t=this.findNearestSelectedOptionIndex(i,!0)),-1===i&&(i=this.findNearestSelectedOptionIndex(t)),-1!==t&&-1!==i){const l=Math.min(t,i),s=Math.max(t,i),n=this.visibleOptions.slice(l,s+1).filter((e=>this.isValidOption(e))).map((e=>this.getOptionValue(e)));this.updateModel(e,n)}},onFilterChange(e){const t=e.target.value;this.filterValue=t,this.focusedOptionIndex=-1,this.$emit("filter",{originalEvent:e,value:t}),!this.virtualScrollerDisabled&&this.virtualScroller.scrollToIndex(0)},onFilterKeyDown(e){switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e,!0);break;case"ArrowLeft":case"ArrowRight":this.onArrowLeftKey(e,!0);break;case"Home":this.onHomeKey(e,!0);break;case"End":this.onEndKey(e,!0);break;case"Enter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e,!0)}},onFilterBlur(){this.focusedOptionIndex=-1},onFilterUpdated(){this.overlayVisible&&this.alignOverlay()},onOverlayClick(e){r.default.emit("overlay-click",{originalEvent:e,target:this.$el})},onOverlayKeyDown(e){if("Escape"===e.code)this.onEscapeKey(e)},onArrowDownKey(e){const t=-1!==this.focusedOptionIndex?this.findNextOptionIndex(this.focusedOptionIndex):this.findFirstFocusedOptionIndex();e.shiftKey&&this.onOptionSelectRange(e,this.startRangeIndex,t),this.changeFocusedOptionIndex(e,t),!this.overlayVisible&&this.show(),e.preventDefault()},onArrowUpKey(e,t=!1){if(e.altKey&&!t)-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide(),e.preventDefault();else{const t=-1!==this.focusedOptionIndex?this.findPrevOptionIndex(this.focusedOptionIndex):this.findLastFocusedOptionIndex();e.shiftKey&&this.onOptionSelectRange(e,t,this.startRangeIndex),this.changeFocusedOptionIndex(e,t),!this.overlayVisible&&this.show(),e.preventDefault()}},onArrowLeftKey(e,t=!1){t&&(this.focusedOptionIndex=-1)},onHomeKey(e,t=!1){const{currentTarget:i}=e;if(t){const t=i.value.length;i.setSelectionRange(0,e.shiftKey?t:0),this.focusedOptionIndex=-1}else{let t=e.metaKey||e.ctrlKey,i=this.findFirstOptionIndex();e.shiftKey&&t&&this.onOptionSelectRange(e,i,this.startRangeIndex),this.changeFocusedOptionIndex(e,i),!this.overlayVisible&&this.show()}e.preventDefault()},onEndKey(e,t=!1){const{currentTarget:i}=e;if(t){const t=i.value.length;i.setSelectionRange(e.shiftKey?0:t,t),this.focusedOptionIndex=-1}else{let t=e.metaKey||e.ctrlKey,i=this.findLastOptionIndex();e.shiftKey&&t&&this.onOptionSelectRange(e,this.startRangeIndex,i),this.changeFocusedOptionIndex(e,i),!this.overlayVisible&&this.show()}e.preventDefault()},onPageUpKey(e){this.scrollInView(0),e.preventDefault()},onPageDownKey(e){this.scrollInView(this.visibleOptions.length-1),e.preventDefault()},onEnterKey(e){this.overlayVisible?-1!==this.focusedOptionIndex&&(e.shiftKey?this.onOptionSelectRange(e,this.focusedOptionIndex):this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex])):this.onArrowDownKey(e),e.preventDefault()},onEscapeKey(e){this.overlayVisible&&this.hide(!0),e.preventDefault()},onTabKey(e,t=!1){t||(this.overlayVisible&&this.hasFocusableElements()?(s.DomHandler.focus(e.shiftKey?this.$refs.lastHiddenFocusableElementOnOverlay:this.$refs.firstHiddenFocusableElementOnOverlay),e.preventDefault()):(-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide(this.filter)))},onShiftKey(){this.startRangeIndex=this.focusedOptionIndex},onOverlayEnter(e){s.ZIndexUtils.set("overlay",e,this.$primevue.config.zIndex.overlay),this.alignOverlay(),this.scrollInView(),this.autoFilterFocus&&s.DomHandler.focus(this.$refs.filterInput)},onOverlayAfterEnter(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.$emit("show")},onOverlayLeave(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null},onOverlayAfterLeave(e){s.ZIndexUtils.clear(e)},alignOverlay(){"self"===this.appendTo?s.DomHandler.relativePosition(this.overlay,this.$el):(this.overlay.style.minWidth=s.DomHandler.getOuterWidth(this.$el)+"px",s.DomHandler.absolutePosition(this.overlay,this.$el))},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{this.overlayVisible&&this.isOutsideClicked(e)&&this.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new s.ConnectedOverlayScrollHandler(this.$refs.container,(()=>{this.overlayVisible&&this.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!s.DomHandler.isTouchDevice()&&this.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isOutsideClicked(e){return!(this.$el.isSameNode(e.target)||this.$el.contains(e.target)||this.overlay&&this.overlay.contains(e.target))},getLabelByValue(e){const t=(this.optionGroupLabel?this.flatOptions(this.options):this.options||[]).find((t=>!this.isOptionGroup(t)&&s.ObjectUtils.equals(this.getOptionValue(t),e,this.equalityKey)));return t?this.getOptionLabel(t):null},getSelectedItemsLabel(){let e=/{(.*?)}/;return e.test(this.selectedItemsLabel)?this.selectedItemsLabel.replace(this.selectedItemsLabel.match(e)[0],this.modelValue.length+""):this.selectedItemsLabel},onToggleAll(e){if(null!==this.selectAll)this.$emit("selectall-change",{originalEvent:e,checked:!this.allSelected});else{const t=this.allSelected?[]:this.visibleOptions.filter((e=>this.isValidOption(e))).map((e=>this.getOptionValue(e)));this.updateModel(e,t)}this.headerCheckboxFocused=!0},removeOption(e,t){let i=this.modelValue.filter((e=>!s.ObjectUtils.equals(e,t,this.equalityKey)));this.updateModel(e,i)},clearFilter(){this.filterValue=null},hasFocusableElements(){return s.DomHandler.getFocusableElements(this.overlay,":not(.p-hidden-focusable)").length>0},isOptionMatched(e){return this.isValidOption(e)&&this.getOptionLabel(e).toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale))},isValidOption(e){return e&&!(this.isOptionDisabled(e)||this.isOptionGroup(e))},isValidSelectedOption(e){return this.isValidOption(e)&&this.isSelected(e)},isSelected(e){const t=this.getOptionValue(e);return(this.modelValue||[]).some((e=>s.ObjectUtils.equals(e,t,this.equalityKey)))},findFirstOptionIndex(){return this.visibleOptions.findIndex((e=>this.isValidOption(e)))},findLastOptionIndex(){return s.ObjectUtils.findLastIndex(this.visibleOptions,(e=>this.isValidOption(e)))},findNextOptionIndex(e){const t=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((e=>this.isValidOption(e))):-1;return t>-1?t+e+1:e},findPrevOptionIndex(e){const t=e>0?s.ObjectUtils.findLastIndex(this.visibleOptions.slice(0,e),(e=>this.isValidOption(e))):-1;return t>-1?t:e},findFirstSelectedOptionIndex(){return this.hasSelectedOption?this.visibleOptions.findIndex((e=>this.isValidSelectedOption(e))):-1},findLastSelectedOptionIndex(){return this.hasSelectedOption?s.ObjectUtils.findLastIndex(this.visibleOptions,(e=>this.isValidSelectedOption(e))):-1},findNextSelectedOptionIndex(e){const t=this.hasSelectedOption&&e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((e=>this.isValidSelectedOption(e))):-1;return t>-1?t+e+1:-1},findPrevSelectedOptionIndex(e){const t=this.hasSelectedOption&&e>0?s.ObjectUtils.findLastIndex(this.visibleOptions.slice(0,e),(e=>this.isValidSelectedOption(e))):-1;return t>-1?t:-1},findNearestSelectedOptionIndex(e,t=!1){let i=-1;return this.hasSelectedOption&&(t?(i=this.findPrevSelectedOptionIndex(e),i=-1===i?this.findNextSelectedOptionIndex(e):i):(i=this.findNextSelectedOptionIndex(e),i=-1===i?this.findPrevSelectedOptionIndex(e):i)),i>-1?i:e},findFirstFocusedOptionIndex(){const e=this.findFirstSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex(){const e=this.findLastSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},searchOptions(e){this.searchValue=(this.searchValue||"")+e.key;let t=-1;-1!==this.focusedOptionIndex?(t=this.visibleOptions.slice(this.focusedOptionIndex).findIndex((e=>this.isOptionMatched(e))),t=-1===t?this.visibleOptions.slice(0,this.focusedOptionIndex).findIndex((e=>this.isOptionMatched(e))):t+this.focusedOptionIndex):t=this.visibleOptions.findIndex((e=>this.isOptionMatched(e))),-1===t&&-1===this.focusedOptionIndex&&(t=this.findFirstFocusedOptionIndex()),-1!==t&&this.changeFocusedOptionIndex(e,t),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((()=>{this.searchValue="",this.searchTimeout=null}),500)},changeFocusedOptionIndex(e,t){this.focusedOptionIndex!==t&&(this.focusedOptionIndex=t,this.scrollInView())},scrollInView(e=-1){const t=-1!==e?`${this.id}_${e}`:this.focusedOptionId,i=s.DomHandler.findSingle(this.list,`li[id="${t}"]`);i?i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"nearest"}):this.virtualScrollerDisabled||this.virtualScroller&&this.virtualScroller.scrollToIndex(-1!==e?e:this.focusedOptionIndex)},autoUpdateModel(){if(this.selectOnFocus&&this.autoOptionFocus&&!this.hasSelectedOption){this.focusedOptionIndex=this.findFirstFocusedOptionIndex();const e=this.getOptionValue(this.visibleOptions[this.focusedOptionIndex]);this.updateModel(null,[e])}},updateModel(e,t){this.$emit("update:modelValue",t),this.$emit("change",{originalEvent:e,value:t})},flatOptions(e){return(e||[]).reduce(((e,t,i)=>{e.push({optionGroup:t,group:!0,index:i});const l=this.getOptionGroupChildren(t);return l&&l.forEach((t=>e.push(t))),e}),[])},overlayRef(e){this.overlay=e},listRef(e,t){this.list=e,t&&t(e)},virtualScrollerRef(e){this.virtualScroller=e}},computed:{containerClass(){return["p-multiselect p-component p-inputwrapper",{"p-multiselect-chip":"chip"===this.display,"p-disabled":this.disabled,"p-focus":this.focused,"p-inputwrapper-filled":this.modelValue&&this.modelValue.length,"p-inputwrapper-focus":this.focused||this.overlayVisible,"p-overlay-open":this.overlayVisible}]},labelClass(){return["p-multiselect-label",{"p-placeholder":this.label===this.placeholder,"p-multiselect-label-empty":!(this.placeholder||this.modelValue&&0!==this.modelValue.length)}]},dropdownIconClass(){return["p-multiselect-trigger-icon",this.loading?this.loadingIcon:this.dropdownIcon]},panelStyleClass(){return["p-multiselect-panel p-component",this.panelClass,{"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},headerCheckboxClass(){return["p-checkbox p-component",{"p-checkbox-checked":this.allSelected,"p-checkbox-focused":this.headerCheckboxFocused}]},visibleOptions(){const t=this.optionGroupLabel?this.flatOptions(this.options):this.options||[];if(this.filterValue){const i=e.FilterService.filter(t,this.searchFields,this.filterValue,this.filterMatchMode,this.filterLocale);if(this.optionGroupLabel){const e=this.options||[],t=[];return e.forEach((e=>{const l=e.items.filter((e=>i.includes(e)));l.length>0&&t.push({...e,items:[...l]})})),this.flatOptions(t)}return i}return t},label(){let e;if(this.modelValue&&this.modelValue.length){if(s.ObjectUtils.isNotEmpty(this.maxSelectedLabels)&&this.modelValue.length>this.maxSelectedLabels)return this.getSelectedItemsLabel();e="";for(let t=0;t<this.modelValue.length;t++)0!==t&&(e+=", "),e+=this.getLabelByValue(this.modelValue[t])}else e=this.placeholder;return e},chipSelectedItems(){return s.ObjectUtils.isNotEmpty(this.maxSelectedLabels)&&this.modelValue&&this.modelValue.length>this.maxSelectedLabels?this.modelValue.slice(0,this.maxSelectedLabels):this.modelValue},allSelected(){return null!==this.selectAll?this.selectAll:s.ObjectUtils.isNotEmpty(this.visibleOptions)&&this.visibleOptions.every((e=>this.isOptionGroup(e)||this.isOptionDisabled(e)||this.isSelected(e)))},hasSelectedOption(){return s.ObjectUtils.isNotEmpty(this.modelValue)},equalityKey(){return this.optionValue?null:this.dataKey},searchFields(){return this.filterFields||[this.optionLabel]},maxSelectionLimitReached(){return this.selectionLimit&&this.modelValue&&this.modelValue.length===this.selectionLimit},filterResultMessageText(){return s.ObjectUtils.isNotEmpty(this.visibleOptions)?this.filterMessageText.replaceAll("{0}",this.visibleOptions.length):this.emptyFilterMessageText},filterMessageText(){return this.filterMessage||this.$primevue.config.locale.searchMessage||""},emptyFilterMessageText(){return this.emptyFilterMessage||this.$primevue.config.locale.emptySearchMessage||this.$primevue.config.locale.emptyFilterMessage||""},emptyMessageText(){return this.emptyMessage||this.$primevue.config.locale.emptyMessage||""},selectionMessageText(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}",this.modelValue.length):this.emptySelectionMessageText},focusedOptionId(){return-1!==this.focusedOptionIndex?`${this.id}_${this.focusedOptionIndex}`:null},ariaSetSize(){return this.visibleOptions.filter((e=>!this.isOptionGroup(e))).length},toggleAllAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria[this.allSelected?"selectAll":"unselectAll"]:void 0},closeAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.close:void 0},virtualScrollerDisabled(){return!this.virtualScrollerOptions}},directives:{ripple:d.default},components:{VirtualScroller:p.default,Portal:c.default}};const u={class:"p-hidden-accessible"},m=["id","disabled","placeholder","tabindex","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"],f={class:"p-multiselect-label-container"},y={class:"p-multiselect-token-label"},b=["onClick"],O={class:"p-multiselect-trigger"},g={key:0,class:"p-multiselect-header"},v={class:"p-hidden-accessible"},x=["checked","aria-label"],S={key:1,class:"p-multiselect-filter-container"},I=["value","placeholder","aria-owns","aria-activedescendant"],k={key:2,role:"status","aria-live":"polite",class:"p-hidden-accessible"},V=["aria-label"],L=["id"],C=["id"],F=["id","aria-label","aria-selected","aria-disabled","aria-setsize","aria-posinset","onClick","onMousemove"],w={class:"p-checkbox p-component"},E={key:0,class:"p-multiselect-empty-message",role:"option"},D={key:1,class:"p-multiselect-empty-message",role:"option"},K={key:1,role:"status","aria-live":"polite",class:"p-hidden-accessible"},B={role:"status","aria-live":"polite",class:"p-hidden-accessible"};return function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var l=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css","top"===i&&l.firstChild?l.insertBefore(s,l.firstChild):l.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}}("\n.p-multiselect {\n display: inline-flex;\n cursor: pointer;\n position: relative;\n user-select: none;\n}\n.p-multiselect-trigger {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n}\n.p-multiselect-label-container {\n overflow: hidden;\n flex: 1 1 auto;\n cursor: pointer;\n}\n.p-multiselect-label {\n display: block;\n white-space: nowrap;\n cursor: pointer;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.p-multiselect-label-empty {\n overflow: hidden;\n visibility: hidden;\n}\n.p-multiselect-token {\n cursor: default;\n display: inline-flex;\n align-items: center;\n flex: 0 0 auto;\n}\n.p-multiselect-token-icon {\n cursor: pointer;\n}\n.p-multiselect .p-multiselect-panel {\n min-width: 100%;\n}\n.p-multiselect-panel {\n position: absolute;\n top: 0;\n left: 0;\n}\n.p-multiselect-items-wrapper {\n overflow: auto;\n}\n.p-multiselect-items {\n margin: 0;\n padding: 0;\n list-style-type: none;\n}\n.p-multiselect-item {\n cursor: pointer;\n display: flex;\n align-items: center;\n font-weight: normal;\n white-space: nowrap;\n position: relative;\n overflow: hidden;\n}\n.p-multiselect-item-group {\n cursor: auto;\n}\n.p-multiselect-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n.p-multiselect-filter-container {\n position: relative;\n flex: 1 1 auto;\n}\n.p-multiselect-filter-icon {\n position: absolute;\n top: 50%;\n margin-top: -0.5rem;\n}\n.p-multiselect-filter-container .p-inputtext {\n width: 100%;\n}\n.p-multiselect-close {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n overflow: hidden;\n position: relative;\n margin-left: auto;\n}\n.p-fluid .p-multiselect {\n display: flex;\n}\n"),h.render=function(e,t,i,l,s,n){const a=o.resolveComponent("VirtualScroller"),r=o.resolveComponent("Portal"),c=o.resolveDirective("ripple");return o.openBlock(),o.createElementBlock("div",{ref:"container",class:o.normalizeClass(n.containerClass),onClick:t[15]||(t[15]=(...e)=>n.onContainerClick&&n.onContainerClick(...e))},[o.createElementVNode("div",u,[o.createElementVNode("input",o.mergeProps({ref:"focusInput",id:i.inputId,type:"text",readonly:"",disabled:i.disabled,placeholder:i.placeholder,tabindex:i.disabled?-1:i.tabindex,role:"combobox","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"listbox","aria-expanded":s.overlayVisible,"aria-controls":s.id+"_list","aria-activedescendant":s.focused?n.focusedOptionId:void 0,onFocus:t[0]||(t[0]=(...e)=>n.onFocus&&n.onFocus(...e)),onBlur:t[1]||(t[1]=(...e)=>n.onBlur&&n.onBlur(...e)),onKeydown:t[2]||(t[2]=(...e)=>n.onKeyDown&&n.onKeyDown(...e))},i.inputProps),null,16,m)]),o.createElementVNode("div",f,[o.createElementVNode("div",{class:o.normalizeClass(n.labelClass)},[o.renderSlot(e.$slots,"value",{value:i.modelValue,placeholder:i.placeholder},(()=>["comma"===i.display?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createTextVNode(o.toDisplayString(n.label||"empty"),1)],64)):"chip"===i.display?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.chipSelectedItems,(t=>(o.openBlock(),o.createElementBlock("div",{key:n.getLabelByValue(t),class:"p-multiselect-token"},[o.renderSlot(e.$slots,"chip",{value:t},(()=>[o.createElementVNode("span",y,o.toDisplayString(n.getLabelByValue(t)),1)])),i.disabled?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(["p-multiselect-token-icon",i.removeTokenIcon]),onClick:o.withModifiers((e=>n.removeOption(e,t)),["stop"])},null,10,b))])))),128)),i.modelValue&&0!==i.modelValue.length?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createTextVNode(o.toDisplayString(i.placeholder||"empty"),1)],64))],64)):o.createCommentVNode("",!0)]))],2)]),o.createElementVNode("div",O,[o.renderSlot(e.$slots,"indicator",{},(()=>[o.createElementVNode("span",{class:o.normalizeClass(n.dropdownIconClass),"aria-hidden":"true"},null,2)]))]),o.createVNode(r,{appendTo:i.appendTo},{default:o.withCtx((()=>[o.createVNode(o.Transition,{name:"p-connected-overlay",onEnter:n.onOverlayEnter,onAfterEnter:n.onOverlayAfterEnter,onLeave:n.onOverlayLeave,onAfterLeave:n.onOverlayAfterLeave},{default:o.withCtx((()=>[s.overlayVisible?(o.openBlock(),o.createElementBlock("div",o.mergeProps({key:0,ref:n.overlayRef,style:i.panelStyle,class:n.panelStyleClass,onClick:t[13]||(t[13]=(...e)=>n.onOverlayClick&&n.onOverlayClick(...e)),onKeydown:t[14]||(t[14]=(...e)=>n.onOverlayKeyDown&&n.onOverlayKeyDown(...e))},i.panelProps),[o.createElementVNode("span",{ref:"firstHiddenFocusableElementOnOverlay",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:0,onFocus:t[3]||(t[3]=(...e)=>n.onFirstHiddenFocus&&n.onFirstHiddenFocus(...e))},null,544),o.renderSlot(e.$slots,"header",{value:i.modelValue,options:n.visibleOptions}),i.showToggleAll&&null==i.selectionLimit||i.filter?(o.openBlock(),o.createElementBlock("div",g,[i.showToggleAll&&null==i.selectionLimit?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(n.headerCheckboxClass),onClick:t[6]||(t[6]=(...e)=>n.onToggleAll&&n.onToggleAll(...e))},[o.createElementVNode("div",v,[o.createElementVNode("input",{type:"checkbox",readonly:"",checked:n.allSelected,"aria-label":n.toggleAllAriaLabel,onFocus:t[4]||(t[4]=(...e)=>n.onHeaderCheckboxFocus&&n.onHeaderCheckboxFocus(...e)),onBlur:t[5]||(t[5]=(...e)=>n.onHeaderCheckboxBlur&&n.onHeaderCheckboxBlur(...e))},null,40,x)]),o.createElementVNode("div",{class:o.normalizeClass(["p-checkbox-box",{"p-highlight":n.allSelected,"p-focus":s.headerCheckboxFocused}])},[o.createElementVNode("span",{class:o.normalizeClass(["p-checkbox-icon",{[i.checkboxIcon]:n.allSelected}])},null,2)],2)],2)):o.createCommentVNode("",!0),i.filter?(o.openBlock(),o.createElementBlock("div",S,[o.createElementVNode("input",o.mergeProps({ref:"filterInput",type:"text",value:s.filterValue,onVnodeUpdated:t[7]||(t[7]=(...e)=>n.onFilterUpdated&&n.onFilterUpdated(...e)),class:"p-multiselect-filter p-inputtext p-component",placeholder:i.filterPlaceholder,role:"searchbox",autocomplete:"off","aria-owns":s.id+"_list","aria-activedescendant":n.focusedOptionId,onKeydown:t[8]||(t[8]=(...e)=>n.onFilterKeyDown&&n.onFilterKeyDown(...e)),onBlur:t[9]||(t[9]=(...e)=>n.onFilterBlur&&n.onFilterBlur(...e)),onInput:t[10]||(t[10]=(...e)=>n.onFilterChange&&n.onFilterChange(...e))},i.filterInputProps),null,16,I),o.createElementVNode("span",{class:o.normalizeClass(["p-multiselect-filter-icon",i.filterIcon])},null,2)])):o.createCommentVNode("",!0),i.filter?(o.openBlock(),o.createElementBlock("span",k,o.toDisplayString(n.filterResultMessageText),1)):o.createCommentVNode("",!0),o.withDirectives((o.openBlock(),o.createElementBlock("button",o.mergeProps({class:"p-multiselect-close p-link","aria-label":n.closeAriaLabel,onClick:t[11]||(t[11]=(...e)=>n.onCloseClick&&n.onCloseClick(...e)),type:"button"},i.closeButtonProps),[o.createElementVNode("span",{class:o.normalizeClass(["p-multiselect-close-icon",i.closeIcon])},null,2)],16,V)),[[c]])])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:"p-multiselect-items-wrapper",style:o.normalizeStyle({"max-height":n.virtualScrollerDisabled?i.scrollHeight:""})},[o.createVNode(a,o.mergeProps({ref:n.virtualScrollerRef},i.virtualScrollerOptions,{items:n.visibleOptions,style:{height:i.scrollHeight},tabindex:-1,disabled:n.virtualScrollerDisabled}),o.createSlots({content:o.withCtx((({styleClass:t,contentRef:l,items:a,getItemOptions:r,contentStyle:d,itemSize:p})=>[o.createElementVNode("ul",{ref:e=>n.listRef(e,l),id:s.id+"_list",class:o.normalizeClass(["p-multiselect-items p-component",t]),style:o.normalizeStyle(d),role:"listbox","aria-multiselectable":"true"},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a,((t,l)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:n.getOptionRenderKey(t,n.getOptionIndex(l,r))},[n.isOptionGroup(t)?(o.openBlock(),o.createElementBlock("li",{key:0,id:s.id+"_"+n.getOptionIndex(l,r),style:o.normalizeStyle({height:p?p+"px":void 0}),class:"p-multiselect-item-group",role:"option"},[o.renderSlot(e.$slots,"optiongroup",{option:t.optionGroup,index:n.getOptionIndex(l,r)},(()=>[o.createTextVNode(o.toDisplayString(n.getOptionGroupLabel(t.optionGroup)),1)]))],12,C)):o.withDirectives((o.openBlock(),o.createElementBlock("li",{key:1,id:s.id+"_"+n.getOptionIndex(l,r),style:o.normalizeStyle({height:p?p+"px":void 0}),class:o.normalizeClass(["p-multiselect-item",{"p-highlight":n.isSelected(t),"p-focus":s.focusedOptionIndex===n.getOptionIndex(l,r),"p-disabled":n.isOptionDisabled(t)}]),role:"option","aria-label":n.getOptionLabel(t),"aria-selected":n.isSelected(t),"aria-disabled":n.isOptionDisabled(t),"aria-setsize":n.ariaSetSize,"aria-posinset":n.getAriaPosInset(n.getOptionIndex(l,r)),onClick:e=>n.onOptionSelect(e,t,n.getOptionIndex(l,r),!0),onMousemove:e=>n.onOptionMouseMove(e,n.getOptionIndex(l,r))},[o.createElementVNode("div",w,[o.createElementVNode("div",{class:o.normalizeClass(["p-checkbox-box",{"p-highlight":n.isSelected(t)}])},[o.createElementVNode("span",{class:o.normalizeClass(["p-checkbox-icon",{[i.checkboxIcon]:n.isSelected(t)}])},null,2)],2)]),o.renderSlot(e.$slots,"option",{option:t,index:n.getOptionIndex(l,r)},(()=>[o.createElementVNode("span",null,o.toDisplayString(n.getOptionLabel(t)),1)]))],46,F)),[[c]])],64)))),128)),s.filterValue&&(!a||a&&0===a.length)?(o.openBlock(),o.createElementBlock("li",E,[o.renderSlot(e.$slots,"emptyfilter",{},(()=>[o.createTextVNode(o.toDisplayString(n.emptyFilterMessageText),1)]))])):!i.options||i.options&&0===i.options.length?(o.openBlock(),o.createElementBlock("li",D,[o.renderSlot(e.$slots,"empty",{},(()=>[o.createTextVNode(o.toDisplayString(n.emptyMessageText),1)]))])):o.createCommentVNode("",!0)],14,L)])),_:2},[e.$slots.loader?{name:"loader",fn:o.withCtx((({options:t})=>[o.renderSlot(e.$slots,"loader",{options:t})])),key:"0"}:void 0]),1040,["items","style","disabled"])],4),o.renderSlot(e.$slots,"footer",{value:i.modelValue,options:n.visibleOptions}),!i.options||i.options&&0===i.options.length?(o.openBlock(),o.createElementBlock("span",K,o.toDisplayString(n.emptyMessageText),1)):o.createCommentVNode("",!0),o.createElementVNode("span",B,o.toDisplayString(n.selectedMessageText),1),o.createElementVNode("span",{ref:"lastHiddenFocusableElementOnOverlay",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:0,onFocus:t[12]||(t[12]=(...e)=>n.onLastHiddenFocus&&n.onLastHiddenFocus(...e))},null,544)],16)):o.createCommentVNode("",!0)])),_:3},8,["onEnter","onAfterEnter","onLeave","onAfterLeave"])])),_:3},8,["appendTo"])],2)},h}(primevue.api,primevue.overlayeventbus,primevue.portal,primevue.ripple,primevue.utils,primevue.virtualscroller,Vue);
|
package/orderlist/OrderList.vue
CHANGED
|
@@ -120,11 +120,17 @@ export default {
|
|
|
120
120
|
list: null,
|
|
121
121
|
data() {
|
|
122
122
|
return {
|
|
123
|
+
id: this.$attrs.id,
|
|
123
124
|
d_selection: this.selection,
|
|
124
125
|
focused: false,
|
|
125
126
|
focusedOptionIndex: -1
|
|
126
127
|
};
|
|
127
128
|
},
|
|
129
|
+
watch: {
|
|
130
|
+
'$attrs.id': function (newValue) {
|
|
131
|
+
this.id = newValue || UniqueComponentId();
|
|
132
|
+
}
|
|
133
|
+
},
|
|
128
134
|
beforeUnmount() {
|
|
129
135
|
this.destroyStyle();
|
|
130
136
|
},
|
|
@@ -135,6 +141,8 @@ export default {
|
|
|
135
141
|
}
|
|
136
142
|
},
|
|
137
143
|
mounted() {
|
|
144
|
+
this.id = this.id || UniqueComponentId();
|
|
145
|
+
|
|
138
146
|
if (this.responsive) {
|
|
139
147
|
this.createStyle();
|
|
140
148
|
}
|
|
@@ -550,9 +558,6 @@ export default {
|
|
|
550
558
|
}
|
|
551
559
|
];
|
|
552
560
|
},
|
|
553
|
-
id() {
|
|
554
|
-
return this.$attrs.id || UniqueComponentId();
|
|
555
|
-
},
|
|
556
561
|
attributeSelector() {
|
|
557
562
|
return UniqueComponentId();
|
|
558
563
|
},
|
|
@@ -85,11 +85,17 @@ var script = {
|
|
|
85
85
|
list: null,
|
|
86
86
|
data() {
|
|
87
87
|
return {
|
|
88
|
+
id: this.$attrs.id,
|
|
88
89
|
d_selection: this.selection,
|
|
89
90
|
focused: false,
|
|
90
91
|
focusedOptionIndex: -1
|
|
91
92
|
};
|
|
92
93
|
},
|
|
94
|
+
watch: {
|
|
95
|
+
'$attrs.id': function (newValue) {
|
|
96
|
+
this.id = newValue || utils.UniqueComponentId();
|
|
97
|
+
}
|
|
98
|
+
},
|
|
93
99
|
beforeUnmount() {
|
|
94
100
|
this.destroyStyle();
|
|
95
101
|
},
|
|
@@ -100,6 +106,8 @@ var script = {
|
|
|
100
106
|
}
|
|
101
107
|
},
|
|
102
108
|
mounted() {
|
|
109
|
+
this.id = this.id || utils.UniqueComponentId();
|
|
110
|
+
|
|
103
111
|
if (this.responsive) {
|
|
104
112
|
this.createStyle();
|
|
105
113
|
}
|
|
@@ -509,9 +517,6 @@ var script = {
|
|
|
509
517
|
}
|
|
510
518
|
];
|
|
511
519
|
},
|
|
512
|
-
id() {
|
|
513
|
-
return this.$attrs.id || utils.UniqueComponentId();
|
|
514
|
-
},
|
|
515
520
|
attributeSelector() {
|
|
516
521
|
return utils.UniqueComponentId();
|
|
517
522
|
},
|
|
@@ -594,7 +599,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
594
599
|
: vue.createCommentVNode("", true),
|
|
595
600
|
vue.createVNode(vue.TransitionGroup, vue.mergeProps({
|
|
596
601
|
ref: $options.listRef,
|
|
597
|
-
id: $
|
|
602
|
+
id: $data.id + '_list',
|
|
598
603
|
name: "p-orderlist-flip",
|
|
599
604
|
tag: "ul",
|
|
600
605
|
class: "p-orderlist-list",
|
|
@@ -613,9 +618,9 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
613
618
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.modelValue, (item, i) => {
|
|
614
619
|
return vue.withDirectives((vue.openBlock(), vue.createElementBlock("li", {
|
|
615
620
|
key: $options.getItemKey(item, i),
|
|
616
|
-
id: $
|
|
621
|
+
id: $data.id + '_' + i,
|
|
617
622
|
role: "option",
|
|
618
|
-
class: vue.normalizeClass($options.itemClass(item, `${$
|
|
623
|
+
class: vue.normalizeClass($options.itemClass(item, `${$data.id}_${i}`)),
|
|
619
624
|
onClick: $event => ($options.onItemClick($event, item, i)),
|
|
620
625
|
onTouchend: _cache[0] || (_cache[0] = (...args) => ($options.onItemTouchEnd && $options.onItemTouchEnd(...args))),
|
|
621
626
|
"aria-selected": $options.isSelected(item),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("primevue/button"),t=require("primevue/ripple"),i=require("primevue/utils"),n=require("vue");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=l(e),s=l(t),r={name:"OrderList",emits:["update:modelValue","reorder","update:selection","selection-change","focus","blur"],props:{modelValue:{type:Array,default:null},selection:{type:Array,default:null},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},tabindex:{type:Number,default:0},listProps:{type:null,default:null},moveUpButtonProps:{type:null,default:null},moveTopButtonProps:{type:null,default:null},moveDownButtonProps:{type:null,default:null},moveBottomButtonProps:{type:null,default:null},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},itemTouched:!1,reorderDirection:null,styleElement:null,list:null,data(){return{d_selection:this.selection,focused:!1,focusedOptionIndex:-1}},beforeUnmount(){this.destroyStyle()},updated(){this.reorderDirection&&(this.updateListScroll(),this.reorderDirection=null)},mounted(){this.responsive&&this.createStyle()},methods:{getItemKey(e,t){return this.dataKey?i.ObjectUtils.resolveFieldData(e,this.dataKey):t},isSelected(e){return-1!=i.ObjectUtils.findIndexInList(e,this.d_selection)},onListFocus(e){const t=i.DomHandler.findSingle(this.list,"li.p-orderlist-item.p-highlight"),n=i.ObjectUtils.findIndexInList(t,this.list.children);this.focused=!0;const l=-1!==this.focusedOptionIndex?this.focusedOptionIndex:t?n:-1;this.changeFocusedOptionIndex(l),this.$emit("focus",e)},onListBlur(e){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onListKeyDown(e){switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"Enter":this.onEnterKey(e);break;case"Space":this.onSpaceKey(e);break;case"KeyA":e.ctrlKey&&(this.d_selection=[...this.modelValue],this.$emit("update:selection",this.d_selection))}},onOptionMouseDown(e){this.focused=!0,this.focusedOptionIndex=e},onArrowDownKey(e){const t=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.shiftKey&&this.onEnterKey(e),e.preventDefault()},onArrowUpKey(e){const t=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.shiftKey&&this.onEnterKey(e),e.preventDefault()},onHomeKey(e){if(e.ctrlKey&&e.shiftKey){const e=i.DomHandler.find(this.list,"li.p-orderlist-item"),t=i.DomHandler.findSingle(this.list,`li.p-orderlist-item[id=${this.focusedOptionIndex}]`),n=[...e].findIndex((e=>e===t));this.d_selection=[...this.modelValue].slice(0,n+1),this.$emit("update:selection",this.d_selection)}else this.changeFocusedOptionIndex(0);e.preventDefault()},onEndKey(e){if(e.ctrlKey&&e.shiftKey){const e=i.DomHandler.find(this.list,"li.p-orderlist-item"),t=i.DomHandler.findSingle(this.list,`li.p-orderlist-item[id=${this.focusedOptionIndex}]`),n=[...e].findIndex((e=>e===t));this.d_selection=[...this.modelValue].slice(n,e.length),this.$emit("update:selection",this.d_selection)}else this.changeFocusedOptionIndex(i.DomHandler.find(this.list,"li.p-orderlist-item").length-1);e.preventDefault()},onEnterKey(e){const t=i.DomHandler.find(this.list,"li.p-orderlist-item"),n=i.DomHandler.findSingle(this.list,`li.p-orderlist-item[id=${this.focusedOptionIndex}]`),l=[...t].findIndex((e=>e===n));this.onItemClick(e,this.modelValue[l],l),e.preventDefault()},onSpaceKey(e){if(e.shiftKey){const e=i.DomHandler.find(this.list,"li.p-orderlist-item"),t=i.ObjectUtils.findIndexInList(this.d_selection[0],[...this.modelValue]),n=i.DomHandler.findSingle(this.list,`li.p-orderlist-item[id=${this.focusedOptionIndex}]`),l=[...e].findIndex((e=>e===n));this.d_selection=[...this.modelValue].slice(Math.min(t,l),Math.max(t,l)+1),this.$emit("update:selection",this.d_selection)}else this.onEnterKey(e)},findNextOptionIndex(e){const t=[...i.DomHandler.find(this.list,"li.p-orderlist-item")].findIndex((t=>t.id===e));return t>-1?t+1:0},findPrevOptionIndex(e){const t=[...i.DomHandler.find(this.list,"li.p-orderlist-item")].findIndex((t=>t.id===e));return t>-1?t-1:0},changeFocusedOptionIndex(e){const t=i.DomHandler.find(this.list,"li.p-orderlist-item");let n=e>=t.length?t.length-1:e<0?0:e;this.focusedOptionIndex=t[n].getAttribute("id"),this.scrollInView(t[n].getAttribute("id"))},scrollInView(e){const t=i.DomHandler.findSingle(this.list,`li[id="${e}"]`);t&&t.scrollIntoView&&t.scrollIntoView({block:"nearest",inline:"start"})},moveUp(e){if(this.d_selection){let t=[...this.modelValue];for(let e=0;e<this.d_selection.length;e++){let n=this.d_selection[e],l=i.ObjectUtils.findIndexInList(n,t);if(0===l)break;{let e=t[l],i=t[l-1];t[l-1]=e,t[l]=i}}this.reorderDirection="up",this.$emit("update:modelValue",t),this.$emit("reorder",{originalEvent:e,value:t,direction:this.reorderDirection})}},moveTop(e){if(this.d_selection){let t=[...this.modelValue];for(let e=0;e<this.d_selection.length;e++){let n=this.d_selection[e],l=i.ObjectUtils.findIndexInList(n,t);if(0===l)break;{let e=t.splice(l,1)[0];t.unshift(e)}}this.reorderDirection="top",this.$emit("update:modelValue",t),this.$emit("reorder",{originalEvent:e,value:t,direction:this.reorderDirection})}},moveDown(e){if(this.d_selection){let t=[...this.modelValue];for(let e=this.d_selection.length-1;e>=0;e--){let n=this.d_selection[e],l=i.ObjectUtils.findIndexInList(n,t);if(l===t.length-1)break;{let e=t[l],i=t[l+1];t[l+1]=e,t[l]=i}}this.reorderDirection="down",this.$emit("update:modelValue",t),this.$emit("reorder",{originalEvent:e,value:t,direction:this.reorderDirection})}},moveBottom(e){if(this.d_selection){let t=[...this.modelValue];for(let e=this.d_selection.length-1;e>=0;e--){let n=this.d_selection[e],l=i.ObjectUtils.findIndexInList(n,t);if(l===t.length-1)break;{let e=t.splice(l,1)[0];t.push(e)}}this.reorderDirection="bottom",this.$emit("update:modelValue",t),this.$emit("reorder",{originalEvent:e,value:t,direction:this.reorderDirection})}},onItemClick(e,t,n){this.itemTouched=!1;const l=i.ObjectUtils.findIndexInList(t,this.d_selection),o=-1!=l,s=!this.itemTouched&&this.metaKeySelection,r=i.DomHandler.find(this.list,".p-orderlist-item")[n].getAttribute("id");if(this.focusedOptionIndex=r,s){const s=e.metaKey||e.ctrlKey;o&&s?this.d_selection=this.d_selection.filter(((e,t)=>t!==l)):(this.d_selection=s&&this.d_selection?[...this.d_selection]:[],i.ObjectUtils.insertIntoOrderedArray(t,n,this.d_selection,this.modelValue))}else o?this.d_selection=this.d_selection.filter(((e,t)=>t!==l)):(this.d_selection=this.d_selection?[...this.d_selection]:[],i.ObjectUtils.insertIntoOrderedArray(t,n,this.d_selection,this.modelValue));this.$emit("update:selection",this.d_selection),this.$emit("selection-change",{originalEvent:e,value:this.d_selection})},onItemTouchEnd(){this.itemTouched=!0},findNextItem(e){let t=e.nextElementSibling;return t?i.DomHandler.hasClass(t,"p-orderlist-item")?t:this.findNextItem(t):null},findPrevItem(e){let t=e.previousElementSibling;return t?i.DomHandler.hasClass(t,"p-orderlist-item")?t:this.findPrevItem(t):null},findFirstItem(){return i.DomHandler.findSingle(this.list,".p-orderlist-item")},findLastItem(){const e=i.DomHandler.find(this.list,".p-orderlist-item");return e[e.length-1]},itemClass(e,t){return["p-orderlist-item",{"p-highlight":this.isSelected(e),"p-focus":t===this.focusedOptionId}]},updateListScroll(){const e=i.DomHandler.find(this.list,".p-orderlist-item.p-highlight");if(e&&e.length)switch(this.reorderDirection){case"up":i.DomHandler.scrollInView(this.list,e[0]);break;case"top":this.list.scrollTop=0;break;case"down":i.DomHandler.scrollInView(this.list,e[e.length-1]);break;case"bottom":this.list.scrollTop=this.list.scrollHeight}},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-orderlist[${this.attributeSelector}] {\n flex-direction: column;\n }\n\n .p-orderlist[${this.attributeSelector}] .p-orderlist-controls {\n padding: var(--content-padding);\n flex-direction: row;\n }\n\n .p-orderlist[${this.attributeSelector}] .p-orderlist-controls .p-button {\n margin-right: var(--inline-spacing);\n margin-bottom: 0;\n }\n\n .p-orderlist[${this.attributeSelector}] .p-orderlist-controls .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(){if(!this.d_selection||!this.d_selection.length)return!0},listRef(e){this.list=e?e.$el:void 0}},computed:{containerClass(){return["p-orderlist p-component",{"p-orderlist-striped":this.stripedRows}]},id(){return this.$attrs.id||i.UniqueComponentId()},attributeSelector:()=>i.UniqueComponentId(),focusedOptionId(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null},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}},components:{OLButton:o.default},directives:{ripple:s.default}};const d={class:"p-orderlist-controls"},a={class:"p-orderlist-list-container"},c={key:0,class:"p-orderlist-header"},h=["id","onClick","aria-selected","onMousedown"];!function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css","top"===i&&n.firstChild?n.insertBefore(l,n.firstChild):n.appendChild(l),l.styleSheet?l.styleSheet.cssText=e:l.appendChild(document.createTextNode(e))}}("\n.p-orderlist {\n display: flex;\n}\n.p-orderlist-controls {\n display: flex;\n flex-direction: column;\n justify-content: center;\n}\n.p-orderlist-list-container {\n flex: 1 1 auto;\n}\n.p-orderlist-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-orderlist-item {\n cursor: pointer;\n overflow: hidden;\n position: relative;\n}\n.p-orderlist.p-state-disabled .p-orderlist-item,\n.p-orderlist.p-state-disabled .p-button {\n cursor: default;\n}\n.p-orderlist.p-state-disabled .p-orderlist-list {\n overflow: hidden;\n}\n"),r.render=function(e,t,i,l,o,s){const r=n.resolveComponent("OLButton"),u=n.resolveDirective("ripple");return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(s.containerClass)},[n.createElementVNode("div",d,[n.renderSlot(e.$slots,"controlsstart"),n.createVNode(r,n.mergeProps({type:"button",icon:"pi pi-angle-up",onClick:s.moveUp,"aria-label":s.moveUpAriaLabel,disabled:s.moveDisabled()},i.moveUpButtonProps),null,16,["onClick","aria-label","disabled"]),n.createVNode(r,n.mergeProps({type:"button",icon:"pi pi-angle-double-up",onClick:s.moveTop,"aria-label":s.moveTopAriaLabel,disabled:s.moveDisabled()},i.moveTopButtonProps),null,16,["onClick","aria-label","disabled"]),n.createVNode(r,n.mergeProps({type:"button",icon:"pi pi-angle-down",onClick:s.moveDown,"aria-label":s.moveDownAriaLabel,disabled:s.moveDisabled()},i.moveDownButtonProps),null,16,["onClick","aria-label","disabled"]),n.createVNode(r,n.mergeProps({type:"button",icon:"pi pi-angle-double-down",onClick:s.moveBottom,"aria-label":s.moveBottomAriaLabel,disabled:s.moveDisabled()},i.moveBottomButtonProps),null,16,["onClick","aria-label","disabled"]),n.renderSlot(e.$slots,"controlsend")]),n.createElementVNode("div",a,[e.$slots.header?(n.openBlock(),n.createElementBlock("div",c,[n.renderSlot(e.$slots,"header")])):n.createCommentVNode("",!0),n.createVNode(n.TransitionGroup,n.mergeProps({ref:s.listRef,id:s.id+"_list",name:"p-orderlist-flip",tag:"ul",class:"p-orderlist-list",style:i.listStyle,role:"listbox","aria-multiselectable":"true",tabindex:i.tabindex,"aria-activedescendant":o.focused?s.focusedOptionId:void 0,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,onFocus:s.onListFocus,onBlur:s.onListBlur,onKeydown:s.onListKeyDown},i.listProps),{default:n.withCtx((()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.modelValue,((i,l)=>n.withDirectives((n.openBlock(),n.createElementBlock("li",{key:s.getItemKey(i,l),id:s.id+"_"+l,role:"option",class:n.normalizeClass(s.itemClass(i,`${s.id}_${l}`)),onClick:e=>s.onItemClick(e,i,l),onTouchend:t[0]||(t[0]=(...e)=>s.onItemTouchEnd&&s.onItemTouchEnd(...e)),"aria-selected":s.isSelected(i),onMousedown:e=>s.onOptionMouseDown(l)},[n.renderSlot(e.$slots,"item",{item:i,index:l})],42,h)),[[u]]))),128))])),_:3},16,["id","style","tabindex","aria-activedescendant","aria-label","aria-labelledby","onFocus","onBlur","onKeydown"])])],2)},module.exports=r;
|
|
1
|
+
"use strict";var e=require("primevue/button"),t=require("primevue/ripple"),i=require("primevue/utils"),n=require("vue");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=l(e),s=l(t),r={name:"OrderList",emits:["update:modelValue","reorder","update:selection","selection-change","focus","blur"],props:{modelValue:{type:Array,default:null},selection:{type:Array,default:null},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},tabindex:{type:Number,default:0},listProps:{type:null,default:null},moveUpButtonProps:{type:null,default:null},moveTopButtonProps:{type:null,default:null},moveDownButtonProps:{type:null,default:null},moveBottomButtonProps:{type:null,default:null},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},itemTouched:!1,reorderDirection:null,styleElement:null,list:null,data(){return{id:this.$attrs.id,d_selection:this.selection,focused:!1,focusedOptionIndex:-1}},watch:{"$attrs.id":function(e){this.id=e||i.UniqueComponentId()}},beforeUnmount(){this.destroyStyle()},updated(){this.reorderDirection&&(this.updateListScroll(),this.reorderDirection=null)},mounted(){this.id=this.id||i.UniqueComponentId(),this.responsive&&this.createStyle()},methods:{getItemKey(e,t){return this.dataKey?i.ObjectUtils.resolveFieldData(e,this.dataKey):t},isSelected(e){return-1!=i.ObjectUtils.findIndexInList(e,this.d_selection)},onListFocus(e){const t=i.DomHandler.findSingle(this.list,"li.p-orderlist-item.p-highlight"),n=i.ObjectUtils.findIndexInList(t,this.list.children);this.focused=!0;const l=-1!==this.focusedOptionIndex?this.focusedOptionIndex:t?n:-1;this.changeFocusedOptionIndex(l),this.$emit("focus",e)},onListBlur(e){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onListKeyDown(e){switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"Enter":this.onEnterKey(e);break;case"Space":this.onSpaceKey(e);break;case"KeyA":e.ctrlKey&&(this.d_selection=[...this.modelValue],this.$emit("update:selection",this.d_selection))}},onOptionMouseDown(e){this.focused=!0,this.focusedOptionIndex=e},onArrowDownKey(e){const t=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.shiftKey&&this.onEnterKey(e),e.preventDefault()},onArrowUpKey(e){const t=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.shiftKey&&this.onEnterKey(e),e.preventDefault()},onHomeKey(e){if(e.ctrlKey&&e.shiftKey){const e=i.DomHandler.find(this.list,"li.p-orderlist-item"),t=i.DomHandler.findSingle(this.list,`li.p-orderlist-item[id=${this.focusedOptionIndex}]`),n=[...e].findIndex((e=>e===t));this.d_selection=[...this.modelValue].slice(0,n+1),this.$emit("update:selection",this.d_selection)}else this.changeFocusedOptionIndex(0);e.preventDefault()},onEndKey(e){if(e.ctrlKey&&e.shiftKey){const e=i.DomHandler.find(this.list,"li.p-orderlist-item"),t=i.DomHandler.findSingle(this.list,`li.p-orderlist-item[id=${this.focusedOptionIndex}]`),n=[...e].findIndex((e=>e===t));this.d_selection=[...this.modelValue].slice(n,e.length),this.$emit("update:selection",this.d_selection)}else this.changeFocusedOptionIndex(i.DomHandler.find(this.list,"li.p-orderlist-item").length-1);e.preventDefault()},onEnterKey(e){const t=i.DomHandler.find(this.list,"li.p-orderlist-item"),n=i.DomHandler.findSingle(this.list,`li.p-orderlist-item[id=${this.focusedOptionIndex}]`),l=[...t].findIndex((e=>e===n));this.onItemClick(e,this.modelValue[l],l),e.preventDefault()},onSpaceKey(e){if(e.shiftKey){const e=i.DomHandler.find(this.list,"li.p-orderlist-item"),t=i.ObjectUtils.findIndexInList(this.d_selection[0],[...this.modelValue]),n=i.DomHandler.findSingle(this.list,`li.p-orderlist-item[id=${this.focusedOptionIndex}]`),l=[...e].findIndex((e=>e===n));this.d_selection=[...this.modelValue].slice(Math.min(t,l),Math.max(t,l)+1),this.$emit("update:selection",this.d_selection)}else this.onEnterKey(e)},findNextOptionIndex(e){const t=[...i.DomHandler.find(this.list,"li.p-orderlist-item")].findIndex((t=>t.id===e));return t>-1?t+1:0},findPrevOptionIndex(e){const t=[...i.DomHandler.find(this.list,"li.p-orderlist-item")].findIndex((t=>t.id===e));return t>-1?t-1:0},changeFocusedOptionIndex(e){const t=i.DomHandler.find(this.list,"li.p-orderlist-item");let n=e>=t.length?t.length-1:e<0?0:e;this.focusedOptionIndex=t[n].getAttribute("id"),this.scrollInView(t[n].getAttribute("id"))},scrollInView(e){const t=i.DomHandler.findSingle(this.list,`li[id="${e}"]`);t&&t.scrollIntoView&&t.scrollIntoView({block:"nearest",inline:"start"})},moveUp(e){if(this.d_selection){let t=[...this.modelValue];for(let e=0;e<this.d_selection.length;e++){let n=this.d_selection[e],l=i.ObjectUtils.findIndexInList(n,t);if(0===l)break;{let e=t[l],i=t[l-1];t[l-1]=e,t[l]=i}}this.reorderDirection="up",this.$emit("update:modelValue",t),this.$emit("reorder",{originalEvent:e,value:t,direction:this.reorderDirection})}},moveTop(e){if(this.d_selection){let t=[...this.modelValue];for(let e=0;e<this.d_selection.length;e++){let n=this.d_selection[e],l=i.ObjectUtils.findIndexInList(n,t);if(0===l)break;{let e=t.splice(l,1)[0];t.unshift(e)}}this.reorderDirection="top",this.$emit("update:modelValue",t),this.$emit("reorder",{originalEvent:e,value:t,direction:this.reorderDirection})}},moveDown(e){if(this.d_selection){let t=[...this.modelValue];for(let e=this.d_selection.length-1;e>=0;e--){let n=this.d_selection[e],l=i.ObjectUtils.findIndexInList(n,t);if(l===t.length-1)break;{let e=t[l],i=t[l+1];t[l+1]=e,t[l]=i}}this.reorderDirection="down",this.$emit("update:modelValue",t),this.$emit("reorder",{originalEvent:e,value:t,direction:this.reorderDirection})}},moveBottom(e){if(this.d_selection){let t=[...this.modelValue];for(let e=this.d_selection.length-1;e>=0;e--){let n=this.d_selection[e],l=i.ObjectUtils.findIndexInList(n,t);if(l===t.length-1)break;{let e=t.splice(l,1)[0];t.push(e)}}this.reorderDirection="bottom",this.$emit("update:modelValue",t),this.$emit("reorder",{originalEvent:e,value:t,direction:this.reorderDirection})}},onItemClick(e,t,n){this.itemTouched=!1;const l=i.ObjectUtils.findIndexInList(t,this.d_selection),o=-1!=l,s=!this.itemTouched&&this.metaKeySelection,r=i.DomHandler.find(this.list,".p-orderlist-item")[n].getAttribute("id");if(this.focusedOptionIndex=r,s){const s=e.metaKey||e.ctrlKey;o&&s?this.d_selection=this.d_selection.filter(((e,t)=>t!==l)):(this.d_selection=s&&this.d_selection?[...this.d_selection]:[],i.ObjectUtils.insertIntoOrderedArray(t,n,this.d_selection,this.modelValue))}else o?this.d_selection=this.d_selection.filter(((e,t)=>t!==l)):(this.d_selection=this.d_selection?[...this.d_selection]:[],i.ObjectUtils.insertIntoOrderedArray(t,n,this.d_selection,this.modelValue));this.$emit("update:selection",this.d_selection),this.$emit("selection-change",{originalEvent:e,value:this.d_selection})},onItemTouchEnd(){this.itemTouched=!0},findNextItem(e){let t=e.nextElementSibling;return t?i.DomHandler.hasClass(t,"p-orderlist-item")?t:this.findNextItem(t):null},findPrevItem(e){let t=e.previousElementSibling;return t?i.DomHandler.hasClass(t,"p-orderlist-item")?t:this.findPrevItem(t):null},findFirstItem(){return i.DomHandler.findSingle(this.list,".p-orderlist-item")},findLastItem(){const e=i.DomHandler.find(this.list,".p-orderlist-item");return e[e.length-1]},itemClass(e,t){return["p-orderlist-item",{"p-highlight":this.isSelected(e),"p-focus":t===this.focusedOptionId}]},updateListScroll(){const e=i.DomHandler.find(this.list,".p-orderlist-item.p-highlight");if(e&&e.length)switch(this.reorderDirection){case"up":i.DomHandler.scrollInView(this.list,e[0]);break;case"top":this.list.scrollTop=0;break;case"down":i.DomHandler.scrollInView(this.list,e[e.length-1]);break;case"bottom":this.list.scrollTop=this.list.scrollHeight}},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-orderlist[${this.attributeSelector}] {\n flex-direction: column;\n }\n\n .p-orderlist[${this.attributeSelector}] .p-orderlist-controls {\n padding: var(--content-padding);\n flex-direction: row;\n }\n\n .p-orderlist[${this.attributeSelector}] .p-orderlist-controls .p-button {\n margin-right: var(--inline-spacing);\n margin-bottom: 0;\n }\n\n .p-orderlist[${this.attributeSelector}] .p-orderlist-controls .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(){if(!this.d_selection||!this.d_selection.length)return!0},listRef(e){this.list=e?e.$el:void 0}},computed:{containerClass(){return["p-orderlist p-component",{"p-orderlist-striped":this.stripedRows}]},attributeSelector:()=>i.UniqueComponentId(),focusedOptionId(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null},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}},components:{OLButton:o.default},directives:{ripple:s.default}};const d={class:"p-orderlist-controls"},a={class:"p-orderlist-list-container"},c={key:0,class:"p-orderlist-header"},h=["id","onClick","aria-selected","onMousedown"];!function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css","top"===i&&n.firstChild?n.insertBefore(l,n.firstChild):n.appendChild(l),l.styleSheet?l.styleSheet.cssText=e:l.appendChild(document.createTextNode(e))}}("\n.p-orderlist {\n display: flex;\n}\n.p-orderlist-controls {\n display: flex;\n flex-direction: column;\n justify-content: center;\n}\n.p-orderlist-list-container {\n flex: 1 1 auto;\n}\n.p-orderlist-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-orderlist-item {\n cursor: pointer;\n overflow: hidden;\n position: relative;\n}\n.p-orderlist.p-state-disabled .p-orderlist-item,\n.p-orderlist.p-state-disabled .p-button {\n cursor: default;\n}\n.p-orderlist.p-state-disabled .p-orderlist-list {\n overflow: hidden;\n}\n"),r.render=function(e,t,i,l,o,s){const r=n.resolveComponent("OLButton"),u=n.resolveDirective("ripple");return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(s.containerClass)},[n.createElementVNode("div",d,[n.renderSlot(e.$slots,"controlsstart"),n.createVNode(r,n.mergeProps({type:"button",icon:"pi pi-angle-up",onClick:s.moveUp,"aria-label":s.moveUpAriaLabel,disabled:s.moveDisabled()},i.moveUpButtonProps),null,16,["onClick","aria-label","disabled"]),n.createVNode(r,n.mergeProps({type:"button",icon:"pi pi-angle-double-up",onClick:s.moveTop,"aria-label":s.moveTopAriaLabel,disabled:s.moveDisabled()},i.moveTopButtonProps),null,16,["onClick","aria-label","disabled"]),n.createVNode(r,n.mergeProps({type:"button",icon:"pi pi-angle-down",onClick:s.moveDown,"aria-label":s.moveDownAriaLabel,disabled:s.moveDisabled()},i.moveDownButtonProps),null,16,["onClick","aria-label","disabled"]),n.createVNode(r,n.mergeProps({type:"button",icon:"pi pi-angle-double-down",onClick:s.moveBottom,"aria-label":s.moveBottomAriaLabel,disabled:s.moveDisabled()},i.moveBottomButtonProps),null,16,["onClick","aria-label","disabled"]),n.renderSlot(e.$slots,"controlsend")]),n.createElementVNode("div",a,[e.$slots.header?(n.openBlock(),n.createElementBlock("div",c,[n.renderSlot(e.$slots,"header")])):n.createCommentVNode("",!0),n.createVNode(n.TransitionGroup,n.mergeProps({ref:s.listRef,id:o.id+"_list",name:"p-orderlist-flip",tag:"ul",class:"p-orderlist-list",style:i.listStyle,role:"listbox","aria-multiselectable":"true",tabindex:i.tabindex,"aria-activedescendant":o.focused?s.focusedOptionId:void 0,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,onFocus:s.onListFocus,onBlur:s.onListBlur,onKeydown:s.onListKeyDown},i.listProps),{default:n.withCtx((()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.modelValue,((i,l)=>n.withDirectives((n.openBlock(),n.createElementBlock("li",{key:s.getItemKey(i,l),id:o.id+"_"+l,role:"option",class:n.normalizeClass(s.itemClass(i,`${o.id}_${l}`)),onClick:e=>s.onItemClick(e,i,l),onTouchend:t[0]||(t[0]=(...e)=>s.onItemTouchEnd&&s.onItemTouchEnd(...e)),"aria-selected":s.isSelected(i),onMousedown:e=>s.onOptionMouseDown(l)},[n.renderSlot(e.$slots,"item",{item:i,index:l})],42,h)),[[u]]))),128))])),_:3},16,["id","style","tabindex","aria-activedescendant","aria-label","aria-labelledby","onFocus","onBlur","onKeydown"])])],2)},module.exports=r;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Button from 'primevue/button';
|
|
2
2
|
import Ripple from 'primevue/ripple';
|
|
3
|
-
import { ObjectUtils, DomHandler
|
|
3
|
+
import { UniqueComponentId, ObjectUtils, DomHandler } from 'primevue/utils';
|
|
4
4
|
import { resolveComponent, resolveDirective, openBlock, createElementBlock, normalizeClass, createElementVNode, renderSlot, createVNode, mergeProps, createCommentVNode, TransitionGroup, withCtx, Fragment, renderList, withDirectives } from 'vue';
|
|
5
5
|
|
|
6
6
|
var script = {
|
|
@@ -78,11 +78,17 @@ var script = {
|
|
|
78
78
|
list: null,
|
|
79
79
|
data() {
|
|
80
80
|
return {
|
|
81
|
+
id: this.$attrs.id,
|
|
81
82
|
d_selection: this.selection,
|
|
82
83
|
focused: false,
|
|
83
84
|
focusedOptionIndex: -1
|
|
84
85
|
};
|
|
85
86
|
},
|
|
87
|
+
watch: {
|
|
88
|
+
'$attrs.id': function (newValue) {
|
|
89
|
+
this.id = newValue || UniqueComponentId();
|
|
90
|
+
}
|
|
91
|
+
},
|
|
86
92
|
beforeUnmount() {
|
|
87
93
|
this.destroyStyle();
|
|
88
94
|
},
|
|
@@ -93,6 +99,8 @@ var script = {
|
|
|
93
99
|
}
|
|
94
100
|
},
|
|
95
101
|
mounted() {
|
|
102
|
+
this.id = this.id || UniqueComponentId();
|
|
103
|
+
|
|
96
104
|
if (this.responsive) {
|
|
97
105
|
this.createStyle();
|
|
98
106
|
}
|
|
@@ -502,9 +510,6 @@ var script = {
|
|
|
502
510
|
}
|
|
503
511
|
];
|
|
504
512
|
},
|
|
505
|
-
id() {
|
|
506
|
-
return this.$attrs.id || UniqueComponentId();
|
|
507
|
-
},
|
|
508
513
|
attributeSelector() {
|
|
509
514
|
return UniqueComponentId();
|
|
510
515
|
},
|
|
@@ -587,7 +592,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
587
592
|
: createCommentVNode("", true),
|
|
588
593
|
createVNode(TransitionGroup, mergeProps({
|
|
589
594
|
ref: $options.listRef,
|
|
590
|
-
id: $
|
|
595
|
+
id: $data.id + '_list',
|
|
591
596
|
name: "p-orderlist-flip",
|
|
592
597
|
tag: "ul",
|
|
593
598
|
class: "p-orderlist-list",
|
|
@@ -606,9 +611,9 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
606
611
|
(openBlock(true), createElementBlock(Fragment, null, renderList($props.modelValue, (item, i) => {
|
|
607
612
|
return withDirectives((openBlock(), createElementBlock("li", {
|
|
608
613
|
key: $options.getItemKey(item, i),
|
|
609
|
-
id: $
|
|
614
|
+
id: $data.id + '_' + i,
|
|
610
615
|
role: "option",
|
|
611
|
-
class: normalizeClass($options.itemClass(item, `${$
|
|
616
|
+
class: normalizeClass($options.itemClass(item, `${$data.id}_${i}`)),
|
|
612
617
|
onClick: $event => ($options.onItemClick($event, item, i)),
|
|
613
618
|
onTouchend: _cache[0] || (_cache[0] = (...args) => ($options.onItemTouchEnd && $options.onItemTouchEnd(...args))),
|
|
614
619
|
"aria-selected": $options.isSelected(item),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"primevue/button";import t from"primevue/ripple";import{ObjectUtils as i,DomHandler as n,UniqueComponentId as l}from"primevue/utils";import{resolveComponent as o,resolveDirective as s,openBlock as r,createElementBlock as d,normalizeClass as a,createElementVNode as c,renderSlot as h,createVNode as u,mergeProps as p,createCommentVNode as m,TransitionGroup as f,withCtx as y,Fragment as b,renderList as v,withDirectives as g}from"vue";var I={name:"OrderList",emits:["update:modelValue","reorder","update:selection","selection-change","focus","blur"],props:{modelValue:{type:Array,default:null},selection:{type:Array,default:null},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},tabindex:{type:Number,default:0},listProps:{type:null,default:null},moveUpButtonProps:{type:null,default:null},moveTopButtonProps:{type:null,default:null},moveDownButtonProps:{type:null,default:null},moveBottomButtonProps:{type:null,default:null},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},itemTouched:!1,reorderDirection:null,styleElement:null,list:null,data(){return{d_selection:this.selection,focused:!1,focusedOptionIndex:-1}},beforeUnmount(){this.destroyStyle()},updated(){this.reorderDirection&&(this.updateListScroll(),this.reorderDirection=null)},mounted(){this.responsive&&this.createStyle()},methods:{getItemKey(e,t){return this.dataKey?i.resolveFieldData(e,this.dataKey):t},isSelected(e){return-1!=i.findIndexInList(e,this.d_selection)},onListFocus(e){const t=n.findSingle(this.list,"li.p-orderlist-item.p-highlight"),l=i.findIndexInList(t,this.list.children);this.focused=!0;const o=-1!==this.focusedOptionIndex?this.focusedOptionIndex:t?l:-1;this.changeFocusedOptionIndex(o),this.$emit("focus",e)},onListBlur(e){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onListKeyDown(e){switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"Enter":this.onEnterKey(e);break;case"Space":this.onSpaceKey(e);break;case"KeyA":e.ctrlKey&&(this.d_selection=[...this.modelValue],this.$emit("update:selection",this.d_selection))}},onOptionMouseDown(e){this.focused=!0,this.focusedOptionIndex=e},onArrowDownKey(e){const t=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.shiftKey&&this.onEnterKey(e),e.preventDefault()},onArrowUpKey(e){const t=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.shiftKey&&this.onEnterKey(e),e.preventDefault()},onHomeKey(e){if(e.ctrlKey&&e.shiftKey){const e=n.find(this.list,"li.p-orderlist-item"),t=n.findSingle(this.list,`li.p-orderlist-item[id=${this.focusedOptionIndex}]`),i=[...e].findIndex((e=>e===t));this.d_selection=[...this.modelValue].slice(0,i+1),this.$emit("update:selection",this.d_selection)}else this.changeFocusedOptionIndex(0);e.preventDefault()},onEndKey(e){if(e.ctrlKey&&e.shiftKey){const e=n.find(this.list,"li.p-orderlist-item"),t=n.findSingle(this.list,`li.p-orderlist-item[id=${this.focusedOptionIndex}]`),i=[...e].findIndex((e=>e===t));this.d_selection=[...this.modelValue].slice(i,e.length),this.$emit("update:selection",this.d_selection)}else this.changeFocusedOptionIndex(n.find(this.list,"li.p-orderlist-item").length-1);e.preventDefault()},onEnterKey(e){const t=n.find(this.list,"li.p-orderlist-item"),i=n.findSingle(this.list,`li.p-orderlist-item[id=${this.focusedOptionIndex}]`),l=[...t].findIndex((e=>e===i));this.onItemClick(e,this.modelValue[l],l),e.preventDefault()},onSpaceKey(e){if(e.shiftKey){const e=n.find(this.list,"li.p-orderlist-item"),t=i.findIndexInList(this.d_selection[0],[...this.modelValue]),l=n.findSingle(this.list,`li.p-orderlist-item[id=${this.focusedOptionIndex}]`),o=[...e].findIndex((e=>e===l));this.d_selection=[...this.modelValue].slice(Math.min(t,o),Math.max(t,o)+1),this.$emit("update:selection",this.d_selection)}else this.onEnterKey(e)},findNextOptionIndex(e){const t=[...n.find(this.list,"li.p-orderlist-item")].findIndex((t=>t.id===e));return t>-1?t+1:0},findPrevOptionIndex(e){const t=[...n.find(this.list,"li.p-orderlist-item")].findIndex((t=>t.id===e));return t>-1?t-1:0},changeFocusedOptionIndex(e){const t=n.find(this.list,"li.p-orderlist-item");let i=e>=t.length?t.length-1:e<0?0:e;this.focusedOptionIndex=t[i].getAttribute("id"),this.scrollInView(t[i].getAttribute("id"))},scrollInView(e){const t=n.findSingle(this.list,`li[id="${e}"]`);t&&t.scrollIntoView&&t.scrollIntoView({block:"nearest",inline:"start"})},moveUp(e){if(this.d_selection){let t=[...this.modelValue];for(let e=0;e<this.d_selection.length;e++){let n=this.d_selection[e],l=i.findIndexInList(n,t);if(0===l)break;{let e=t[l],i=t[l-1];t[l-1]=e,t[l]=i}}this.reorderDirection="up",this.$emit("update:modelValue",t),this.$emit("reorder",{originalEvent:e,value:t,direction:this.reorderDirection})}},moveTop(e){if(this.d_selection){let t=[...this.modelValue];for(let e=0;e<this.d_selection.length;e++){let n=this.d_selection[e],l=i.findIndexInList(n,t);if(0===l)break;{let e=t.splice(l,1)[0];t.unshift(e)}}this.reorderDirection="top",this.$emit("update:modelValue",t),this.$emit("reorder",{originalEvent:e,value:t,direction:this.reorderDirection})}},moveDown(e){if(this.d_selection){let t=[...this.modelValue];for(let e=this.d_selection.length-1;e>=0;e--){let n=this.d_selection[e],l=i.findIndexInList(n,t);if(l===t.length-1)break;{let e=t[l],i=t[l+1];t[l+1]=e,t[l]=i}}this.reorderDirection="down",this.$emit("update:modelValue",t),this.$emit("reorder",{originalEvent:e,value:t,direction:this.reorderDirection})}},moveBottom(e){if(this.d_selection){let t=[...this.modelValue];for(let e=this.d_selection.length-1;e>=0;e--){let n=this.d_selection[e],l=i.findIndexInList(n,t);if(l===t.length-1)break;{let e=t.splice(l,1)[0];t.push(e)}}this.reorderDirection="bottom",this.$emit("update:modelValue",t),this.$emit("reorder",{originalEvent:e,value:t,direction:this.reorderDirection})}},onItemClick(e,t,l){this.itemTouched=!1;const o=i.findIndexInList(t,this.d_selection),s=-1!=o,r=!this.itemTouched&&this.metaKeySelection,d=n.find(this.list,".p-orderlist-item")[l].getAttribute("id");if(this.focusedOptionIndex=d,r){const n=e.metaKey||e.ctrlKey;s&&n?this.d_selection=this.d_selection.filter(((e,t)=>t!==o)):(this.d_selection=n&&this.d_selection?[...this.d_selection]:[],i.insertIntoOrderedArray(t,l,this.d_selection,this.modelValue))}else s?this.d_selection=this.d_selection.filter(((e,t)=>t!==o)):(this.d_selection=this.d_selection?[...this.d_selection]:[],i.insertIntoOrderedArray(t,l,this.d_selection,this.modelValue));this.$emit("update:selection",this.d_selection),this.$emit("selection-change",{originalEvent:e,value:this.d_selection})},onItemTouchEnd(){this.itemTouched=!0},findNextItem(e){let t=e.nextElementSibling;return t?n.hasClass(t,"p-orderlist-item")?t:this.findNextItem(t):null},findPrevItem(e){let t=e.previousElementSibling;return t?n.hasClass(t,"p-orderlist-item")?t:this.findPrevItem(t):null},findFirstItem(){return n.findSingle(this.list,".p-orderlist-item")},findLastItem(){const e=n.find(this.list,".p-orderlist-item");return e[e.length-1]},itemClass(e,t){return["p-orderlist-item",{"p-highlight":this.isSelected(e),"p-focus":t===this.focusedOptionId}]},updateListScroll(){const e=n.find(this.list,".p-orderlist-item.p-highlight");if(e&&e.length)switch(this.reorderDirection){case"up":n.scrollInView(this.list,e[0]);break;case"top":this.list.scrollTop=0;break;case"down":n.scrollInView(this.list,e[e.length-1]);break;case"bottom":this.list.scrollTop=this.list.scrollHeight}},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-orderlist[${this.attributeSelector}] {\n flex-direction: column;\n }\n\n .p-orderlist[${this.attributeSelector}] .p-orderlist-controls {\n padding: var(--content-padding);\n flex-direction: row;\n }\n\n .p-orderlist[${this.attributeSelector}] .p-orderlist-controls .p-button {\n margin-right: var(--inline-spacing);\n margin-bottom: 0;\n }\n\n .p-orderlist[${this.attributeSelector}] .p-orderlist-controls .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(){if(!this.d_selection||!this.d_selection.length)return!0},listRef(e){this.list=e?e.$el:void 0}},computed:{containerClass(){return["p-orderlist p-component",{"p-orderlist-striped":this.stripedRows}]},id(){return this.$attrs.id||l()},attributeSelector:()=>l(),focusedOptionId(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null},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}},components:{OLButton:e},directives:{ripple:t}};const x={class:"p-orderlist-controls"},$={class:"p-orderlist-list-container"},_={key:0,class:"p-orderlist-header"},w=["id","onClick","aria-selected","onMousedown"];!function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css","top"===i&&n.firstChild?n.insertBefore(l,n.firstChild):n.appendChild(l),l.styleSheet?l.styleSheet.cssText=e:l.appendChild(document.createTextNode(e))}}("\n.p-orderlist {\n display: flex;\n}\n.p-orderlist-controls {\n display: flex;\n flex-direction: column;\n justify-content: center;\n}\n.p-orderlist-list-container {\n flex: 1 1 auto;\n}\n.p-orderlist-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-orderlist-item {\n cursor: pointer;\n overflow: hidden;\n position: relative;\n}\n.p-orderlist.p-state-disabled .p-orderlist-item,\n.p-orderlist.p-state-disabled .p-button {\n cursor: default;\n}\n.p-orderlist.p-state-disabled .p-orderlist-list {\n overflow: hidden;\n}\n"),I.render=function(e,t,i,n,l,I){const D=o("OLButton"),K=s("ripple");return r(),d("div",{class:a(I.containerClass)},[c("div",x,[h(e.$slots,"controlsstart"),u(D,p({type:"button",icon:"pi pi-angle-up",onClick:I.moveUp,"aria-label":I.moveUpAriaLabel,disabled:I.moveDisabled()},i.moveUpButtonProps),null,16,["onClick","aria-label","disabled"]),u(D,p({type:"button",icon:"pi pi-angle-double-up",onClick:I.moveTop,"aria-label":I.moveTopAriaLabel,disabled:I.moveDisabled()},i.moveTopButtonProps),null,16,["onClick","aria-label","disabled"]),u(D,p({type:"button",icon:"pi pi-angle-down",onClick:I.moveDown,"aria-label":I.moveDownAriaLabel,disabled:I.moveDisabled()},i.moveDownButtonProps),null,16,["onClick","aria-label","disabled"]),u(D,p({type:"button",icon:"pi pi-angle-double-down",onClick:I.moveBottom,"aria-label":I.moveBottomAriaLabel,disabled:I.moveDisabled()},i.moveBottomButtonProps),null,16,["onClick","aria-label","disabled"]),h(e.$slots,"controlsend")]),c("div",$,[e.$slots.header?(r(),d("div",_,[h(e.$slots,"header")])):m("",!0),u(f,p({ref:I.listRef,id:I.id+"_list",name:"p-orderlist-flip",tag:"ul",class:"p-orderlist-list",style:i.listStyle,role:"listbox","aria-multiselectable":"true",tabindex:i.tabindex,"aria-activedescendant":l.focused?I.focusedOptionId:void 0,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,onFocus:I.onListFocus,onBlur:I.onListBlur,onKeydown:I.onListKeyDown},i.listProps),{default:y((()=>[(r(!0),d(b,null,v(i.modelValue,((i,n)=>g((r(),d("li",{key:I.getItemKey(i,n),id:I.id+"_"+n,role:"option",class:a(I.itemClass(i,`${I.id}_${n}`)),onClick:e=>I.onItemClick(e,i,n),onTouchend:t[0]||(t[0]=(...e)=>I.onItemTouchEnd&&I.onItemTouchEnd(...e)),"aria-selected":I.isSelected(i),onMousedown:e=>I.onOptionMouseDown(n)},[h(e.$slots,"item",{item:i,index:n})],42,w)),[[K]]))),128))])),_:3},16,["id","style","tabindex","aria-activedescendant","aria-label","aria-labelledby","onFocus","onBlur","onKeydown"])])],2)};export{I as default};
|
|
1
|
+
import e from"primevue/button";import t from"primevue/ripple";import{UniqueComponentId as i,ObjectUtils as n,DomHandler as l}from"primevue/utils";import{resolveComponent as o,resolveDirective as s,openBlock as r,createElementBlock as d,normalizeClass as a,createElementVNode as c,renderSlot as h,createVNode as u,mergeProps as p,createCommentVNode as m,TransitionGroup as f,withCtx as y,Fragment as b,renderList as v,withDirectives as g}from"vue";var I={name:"OrderList",emits:["update:modelValue","reorder","update:selection","selection-change","focus","blur"],props:{modelValue:{type:Array,default:null},selection:{type:Array,default:null},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},tabindex:{type:Number,default:0},listProps:{type:null,default:null},moveUpButtonProps:{type:null,default:null},moveTopButtonProps:{type:null,default:null},moveDownButtonProps:{type:null,default:null},moveBottomButtonProps:{type:null,default:null},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},itemTouched:!1,reorderDirection:null,styleElement:null,list:null,data(){return{id:this.$attrs.id,d_selection:this.selection,focused:!1,focusedOptionIndex:-1}},watch:{"$attrs.id":function(e){this.id=e||i()}},beforeUnmount(){this.destroyStyle()},updated(){this.reorderDirection&&(this.updateListScroll(),this.reorderDirection=null)},mounted(){this.id=this.id||i(),this.responsive&&this.createStyle()},methods:{getItemKey(e,t){return this.dataKey?n.resolveFieldData(e,this.dataKey):t},isSelected(e){return-1!=n.findIndexInList(e,this.d_selection)},onListFocus(e){const t=l.findSingle(this.list,"li.p-orderlist-item.p-highlight"),i=n.findIndexInList(t,this.list.children);this.focused=!0;const o=-1!==this.focusedOptionIndex?this.focusedOptionIndex:t?i:-1;this.changeFocusedOptionIndex(o),this.$emit("focus",e)},onListBlur(e){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onListKeyDown(e){switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"Enter":this.onEnterKey(e);break;case"Space":this.onSpaceKey(e);break;case"KeyA":e.ctrlKey&&(this.d_selection=[...this.modelValue],this.$emit("update:selection",this.d_selection))}},onOptionMouseDown(e){this.focused=!0,this.focusedOptionIndex=e},onArrowDownKey(e){const t=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.shiftKey&&this.onEnterKey(e),e.preventDefault()},onArrowUpKey(e){const t=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.shiftKey&&this.onEnterKey(e),e.preventDefault()},onHomeKey(e){if(e.ctrlKey&&e.shiftKey){const e=l.find(this.list,"li.p-orderlist-item"),t=l.findSingle(this.list,`li.p-orderlist-item[id=${this.focusedOptionIndex}]`),i=[...e].findIndex((e=>e===t));this.d_selection=[...this.modelValue].slice(0,i+1),this.$emit("update:selection",this.d_selection)}else this.changeFocusedOptionIndex(0);e.preventDefault()},onEndKey(e){if(e.ctrlKey&&e.shiftKey){const e=l.find(this.list,"li.p-orderlist-item"),t=l.findSingle(this.list,`li.p-orderlist-item[id=${this.focusedOptionIndex}]`),i=[...e].findIndex((e=>e===t));this.d_selection=[...this.modelValue].slice(i,e.length),this.$emit("update:selection",this.d_selection)}else this.changeFocusedOptionIndex(l.find(this.list,"li.p-orderlist-item").length-1);e.preventDefault()},onEnterKey(e){const t=l.find(this.list,"li.p-orderlist-item"),i=l.findSingle(this.list,`li.p-orderlist-item[id=${this.focusedOptionIndex}]`),n=[...t].findIndex((e=>e===i));this.onItemClick(e,this.modelValue[n],n),e.preventDefault()},onSpaceKey(e){if(e.shiftKey){const e=l.find(this.list,"li.p-orderlist-item"),t=n.findIndexInList(this.d_selection[0],[...this.modelValue]),i=l.findSingle(this.list,`li.p-orderlist-item[id=${this.focusedOptionIndex}]`),o=[...e].findIndex((e=>e===i));this.d_selection=[...this.modelValue].slice(Math.min(t,o),Math.max(t,o)+1),this.$emit("update:selection",this.d_selection)}else this.onEnterKey(e)},findNextOptionIndex(e){const t=[...l.find(this.list,"li.p-orderlist-item")].findIndex((t=>t.id===e));return t>-1?t+1:0},findPrevOptionIndex(e){const t=[...l.find(this.list,"li.p-orderlist-item")].findIndex((t=>t.id===e));return t>-1?t-1:0},changeFocusedOptionIndex(e){const t=l.find(this.list,"li.p-orderlist-item");let i=e>=t.length?t.length-1:e<0?0:e;this.focusedOptionIndex=t[i].getAttribute("id"),this.scrollInView(t[i].getAttribute("id"))},scrollInView(e){const t=l.findSingle(this.list,`li[id="${e}"]`);t&&t.scrollIntoView&&t.scrollIntoView({block:"nearest",inline:"start"})},moveUp(e){if(this.d_selection){let t=[...this.modelValue];for(let e=0;e<this.d_selection.length;e++){let i=this.d_selection[e],l=n.findIndexInList(i,t);if(0===l)break;{let e=t[l],i=t[l-1];t[l-1]=e,t[l]=i}}this.reorderDirection="up",this.$emit("update:modelValue",t),this.$emit("reorder",{originalEvent:e,value:t,direction:this.reorderDirection})}},moveTop(e){if(this.d_selection){let t=[...this.modelValue];for(let e=0;e<this.d_selection.length;e++){let i=this.d_selection[e],l=n.findIndexInList(i,t);if(0===l)break;{let e=t.splice(l,1)[0];t.unshift(e)}}this.reorderDirection="top",this.$emit("update:modelValue",t),this.$emit("reorder",{originalEvent:e,value:t,direction:this.reorderDirection})}},moveDown(e){if(this.d_selection){let t=[...this.modelValue];for(let e=this.d_selection.length-1;e>=0;e--){let i=this.d_selection[e],l=n.findIndexInList(i,t);if(l===t.length-1)break;{let e=t[l],i=t[l+1];t[l+1]=e,t[l]=i}}this.reorderDirection="down",this.$emit("update:modelValue",t),this.$emit("reorder",{originalEvent:e,value:t,direction:this.reorderDirection})}},moveBottom(e){if(this.d_selection){let t=[...this.modelValue];for(let e=this.d_selection.length-1;e>=0;e--){let i=this.d_selection[e],l=n.findIndexInList(i,t);if(l===t.length-1)break;{let e=t.splice(l,1)[0];t.push(e)}}this.reorderDirection="bottom",this.$emit("update:modelValue",t),this.$emit("reorder",{originalEvent:e,value:t,direction:this.reorderDirection})}},onItemClick(e,t,i){this.itemTouched=!1;const o=n.findIndexInList(t,this.d_selection),s=-1!=o,r=!this.itemTouched&&this.metaKeySelection,d=l.find(this.list,".p-orderlist-item")[i].getAttribute("id");if(this.focusedOptionIndex=d,r){const l=e.metaKey||e.ctrlKey;s&&l?this.d_selection=this.d_selection.filter(((e,t)=>t!==o)):(this.d_selection=l&&this.d_selection?[...this.d_selection]:[],n.insertIntoOrderedArray(t,i,this.d_selection,this.modelValue))}else s?this.d_selection=this.d_selection.filter(((e,t)=>t!==o)):(this.d_selection=this.d_selection?[...this.d_selection]:[],n.insertIntoOrderedArray(t,i,this.d_selection,this.modelValue));this.$emit("update:selection",this.d_selection),this.$emit("selection-change",{originalEvent:e,value:this.d_selection})},onItemTouchEnd(){this.itemTouched=!0},findNextItem(e){let t=e.nextElementSibling;return t?l.hasClass(t,"p-orderlist-item")?t:this.findNextItem(t):null},findPrevItem(e){let t=e.previousElementSibling;return t?l.hasClass(t,"p-orderlist-item")?t:this.findPrevItem(t):null},findFirstItem(){return l.findSingle(this.list,".p-orderlist-item")},findLastItem(){const e=l.find(this.list,".p-orderlist-item");return e[e.length-1]},itemClass(e,t){return["p-orderlist-item",{"p-highlight":this.isSelected(e),"p-focus":t===this.focusedOptionId}]},updateListScroll(){const e=l.find(this.list,".p-orderlist-item.p-highlight");if(e&&e.length)switch(this.reorderDirection){case"up":l.scrollInView(this.list,e[0]);break;case"top":this.list.scrollTop=0;break;case"down":l.scrollInView(this.list,e[e.length-1]);break;case"bottom":this.list.scrollTop=this.list.scrollHeight}},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-orderlist[${this.attributeSelector}] {\n flex-direction: column;\n }\n\n .p-orderlist[${this.attributeSelector}] .p-orderlist-controls {\n padding: var(--content-padding);\n flex-direction: row;\n }\n\n .p-orderlist[${this.attributeSelector}] .p-orderlist-controls .p-button {\n margin-right: var(--inline-spacing);\n margin-bottom: 0;\n }\n\n .p-orderlist[${this.attributeSelector}] .p-orderlist-controls .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(){if(!this.d_selection||!this.d_selection.length)return!0},listRef(e){this.list=e?e.$el:void 0}},computed:{containerClass(){return["p-orderlist p-component",{"p-orderlist-striped":this.stripedRows}]},attributeSelector:()=>i(),focusedOptionId(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null},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}},components:{OLButton:e},directives:{ripple:t}};const x={class:"p-orderlist-controls"},$={class:"p-orderlist-list-container"},w={key:0,class:"p-orderlist-header"},_=["id","onClick","aria-selected","onMousedown"];!function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css","top"===i&&n.firstChild?n.insertBefore(l,n.firstChild):n.appendChild(l),l.styleSheet?l.styleSheet.cssText=e:l.appendChild(document.createTextNode(e))}}("\n.p-orderlist {\n display: flex;\n}\n.p-orderlist-controls {\n display: flex;\n flex-direction: column;\n justify-content: center;\n}\n.p-orderlist-list-container {\n flex: 1 1 auto;\n}\n.p-orderlist-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-orderlist-item {\n cursor: pointer;\n overflow: hidden;\n position: relative;\n}\n.p-orderlist.p-state-disabled .p-orderlist-item,\n.p-orderlist.p-state-disabled .p-button {\n cursor: default;\n}\n.p-orderlist.p-state-disabled .p-orderlist-list {\n overflow: hidden;\n}\n"),I.render=function(e,t,i,n,l,I){const D=o("OLButton"),K=s("ripple");return r(),d("div",{class:a(I.containerClass)},[c("div",x,[h(e.$slots,"controlsstart"),u(D,p({type:"button",icon:"pi pi-angle-up",onClick:I.moveUp,"aria-label":I.moveUpAriaLabel,disabled:I.moveDisabled()},i.moveUpButtonProps),null,16,["onClick","aria-label","disabled"]),u(D,p({type:"button",icon:"pi pi-angle-double-up",onClick:I.moveTop,"aria-label":I.moveTopAriaLabel,disabled:I.moveDisabled()},i.moveTopButtonProps),null,16,["onClick","aria-label","disabled"]),u(D,p({type:"button",icon:"pi pi-angle-down",onClick:I.moveDown,"aria-label":I.moveDownAriaLabel,disabled:I.moveDisabled()},i.moveDownButtonProps),null,16,["onClick","aria-label","disabled"]),u(D,p({type:"button",icon:"pi pi-angle-double-down",onClick:I.moveBottom,"aria-label":I.moveBottomAriaLabel,disabled:I.moveDisabled()},i.moveBottomButtonProps),null,16,["onClick","aria-label","disabled"]),h(e.$slots,"controlsend")]),c("div",$,[e.$slots.header?(r(),d("div",w,[h(e.$slots,"header")])):m("",!0),u(f,p({ref:I.listRef,id:l.id+"_list",name:"p-orderlist-flip",tag:"ul",class:"p-orderlist-list",style:i.listStyle,role:"listbox","aria-multiselectable":"true",tabindex:i.tabindex,"aria-activedescendant":l.focused?I.focusedOptionId:void 0,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,onFocus:I.onListFocus,onBlur:I.onListBlur,onKeydown:I.onListKeyDown},i.listProps),{default:y((()=>[(r(!0),d(b,null,v(i.modelValue,((i,n)=>g((r(),d("li",{key:I.getItemKey(i,n),id:l.id+"_"+n,role:"option",class:a(I.itemClass(i,`${l.id}_${n}`)),onClick:e=>I.onItemClick(e,i,n),onTouchend:t[0]||(t[0]=(...e)=>I.onItemTouchEnd&&I.onItemTouchEnd(...e)),"aria-selected":I.isSelected(i),onMousedown:e=>I.onOptionMouseDown(n)},[h(e.$slots,"item",{item:i,index:n})],42,_)),[[K]]))),128))])),_:3},16,["id","style","tabindex","aria-activedescendant","aria-label","aria-labelledby","onFocus","onBlur","onKeydown"])])],2)};export{I as default};
|
package/orderlist/orderlist.js
CHANGED
|
@@ -82,11 +82,17 @@ this.primevue.orderlist = (function (Button, Ripple, utils, vue) {
|
|
|
82
82
|
list: null,
|
|
83
83
|
data() {
|
|
84
84
|
return {
|
|
85
|
+
id: this.$attrs.id,
|
|
85
86
|
d_selection: this.selection,
|
|
86
87
|
focused: false,
|
|
87
88
|
focusedOptionIndex: -1
|
|
88
89
|
};
|
|
89
90
|
},
|
|
91
|
+
watch: {
|
|
92
|
+
'$attrs.id': function (newValue) {
|
|
93
|
+
this.id = newValue || utils.UniqueComponentId();
|
|
94
|
+
}
|
|
95
|
+
},
|
|
90
96
|
beforeUnmount() {
|
|
91
97
|
this.destroyStyle();
|
|
92
98
|
},
|
|
@@ -97,6 +103,8 @@ this.primevue.orderlist = (function (Button, Ripple, utils, vue) {
|
|
|
97
103
|
}
|
|
98
104
|
},
|
|
99
105
|
mounted() {
|
|
106
|
+
this.id = this.id || utils.UniqueComponentId();
|
|
107
|
+
|
|
100
108
|
if (this.responsive) {
|
|
101
109
|
this.createStyle();
|
|
102
110
|
}
|
|
@@ -506,9 +514,6 @@ this.primevue.orderlist = (function (Button, Ripple, utils, vue) {
|
|
|
506
514
|
}
|
|
507
515
|
];
|
|
508
516
|
},
|
|
509
|
-
id() {
|
|
510
|
-
return this.$attrs.id || utils.UniqueComponentId();
|
|
511
|
-
},
|
|
512
517
|
attributeSelector() {
|
|
513
518
|
return utils.UniqueComponentId();
|
|
514
519
|
},
|
|
@@ -591,7 +596,7 @@ this.primevue.orderlist = (function (Button, Ripple, utils, vue) {
|
|
|
591
596
|
: vue.createCommentVNode("", true),
|
|
592
597
|
vue.createVNode(vue.TransitionGroup, vue.mergeProps({
|
|
593
598
|
ref: $options.listRef,
|
|
594
|
-
id: $
|
|
599
|
+
id: $data.id + '_list',
|
|
595
600
|
name: "p-orderlist-flip",
|
|
596
601
|
tag: "ul",
|
|
597
602
|
class: "p-orderlist-list",
|
|
@@ -610,9 +615,9 @@ this.primevue.orderlist = (function (Button, Ripple, utils, vue) {
|
|
|
610
615
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.modelValue, (item, i) => {
|
|
611
616
|
return vue.withDirectives((vue.openBlock(), vue.createElementBlock("li", {
|
|
612
617
|
key: $options.getItemKey(item, i),
|
|
613
|
-
id: $
|
|
618
|
+
id: $data.id + '_' + i,
|
|
614
619
|
role: "option",
|
|
615
|
-
class: vue.normalizeClass($options.itemClass(item, `${$
|
|
620
|
+
class: vue.normalizeClass($options.itemClass(item, `${$data.id}_${i}`)),
|
|
616
621
|
onClick: $event => ($options.onItemClick($event, item, i)),
|
|
617
622
|
onTouchend: _cache[0] || (_cache[0] = (...args) => ($options.onItemTouchEnd && $options.onItemTouchEnd(...args))),
|
|
618
623
|
"aria-selected": $options.isSelected(item),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primevue=this.primevue||{},this.primevue.orderlist=function(e,t,i,n){"use strict";function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=l(e),s=l(t),r={name:"OrderList",emits:["update:modelValue","reorder","update:selection","selection-change","focus","blur"],props:{modelValue:{type:Array,default:null},selection:{type:Array,default:null},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},tabindex:{type:Number,default:0},listProps:{type:null,default:null},moveUpButtonProps:{type:null,default:null},moveTopButtonProps:{type:null,default:null},moveDownButtonProps:{type:null,default:null},moveBottomButtonProps:{type:null,default:null},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},itemTouched:!1,reorderDirection:null,styleElement:null,list:null,data(){return{d_selection:this.selection,focused:!1,focusedOptionIndex:-1}},beforeUnmount(){this.destroyStyle()},updated(){this.reorderDirection&&(this.updateListScroll(),this.reorderDirection=null)},mounted(){this.responsive&&this.createStyle()},methods:{getItemKey(e,t){return this.dataKey?i.ObjectUtils.resolveFieldData(e,this.dataKey):t},isSelected(e){return-1!=i.ObjectUtils.findIndexInList(e,this.d_selection)},onListFocus(e){const t=i.DomHandler.findSingle(this.list,"li.p-orderlist-item.p-highlight"),n=i.ObjectUtils.findIndexInList(t,this.list.children);this.focused=!0;const l=-1!==this.focusedOptionIndex?this.focusedOptionIndex:t?n:-1;this.changeFocusedOptionIndex(l),this.$emit("focus",e)},onListBlur(e){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onListKeyDown(e){switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"Enter":this.onEnterKey(e);break;case"Space":this.onSpaceKey(e);break;case"KeyA":e.ctrlKey&&(this.d_selection=[...this.modelValue],this.$emit("update:selection",this.d_selection))}},onOptionMouseDown(e){this.focused=!0,this.focusedOptionIndex=e},onArrowDownKey(e){const t=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.shiftKey&&this.onEnterKey(e),e.preventDefault()},onArrowUpKey(e){const t=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.shiftKey&&this.onEnterKey(e),e.preventDefault()},onHomeKey(e){if(e.ctrlKey&&e.shiftKey){const e=i.DomHandler.find(this.list,"li.p-orderlist-item"),t=i.DomHandler.findSingle(this.list,`li.p-orderlist-item[id=${this.focusedOptionIndex}]`),n=[...e].findIndex((e=>e===t));this.d_selection=[...this.modelValue].slice(0,n+1),this.$emit("update:selection",this.d_selection)}else this.changeFocusedOptionIndex(0);e.preventDefault()},onEndKey(e){if(e.ctrlKey&&e.shiftKey){const e=i.DomHandler.find(this.list,"li.p-orderlist-item"),t=i.DomHandler.findSingle(this.list,`li.p-orderlist-item[id=${this.focusedOptionIndex}]`),n=[...e].findIndex((e=>e===t));this.d_selection=[...this.modelValue].slice(n,e.length),this.$emit("update:selection",this.d_selection)}else this.changeFocusedOptionIndex(i.DomHandler.find(this.list,"li.p-orderlist-item").length-1);e.preventDefault()},onEnterKey(e){const t=i.DomHandler.find(this.list,"li.p-orderlist-item"),n=i.DomHandler.findSingle(this.list,`li.p-orderlist-item[id=${this.focusedOptionIndex}]`),l=[...t].findIndex((e=>e===n));this.onItemClick(e,this.modelValue[l],l),e.preventDefault()},onSpaceKey(e){if(e.shiftKey){const e=i.DomHandler.find(this.list,"li.p-orderlist-item"),t=i.ObjectUtils.findIndexInList(this.d_selection[0],[...this.modelValue]),n=i.DomHandler.findSingle(this.list,`li.p-orderlist-item[id=${this.focusedOptionIndex}]`),l=[...e].findIndex((e=>e===n));this.d_selection=[...this.modelValue].slice(Math.min(t,l),Math.max(t,l)+1),this.$emit("update:selection",this.d_selection)}else this.onEnterKey(e)},findNextOptionIndex(e){const t=[...i.DomHandler.find(this.list,"li.p-orderlist-item")].findIndex((t=>t.id===e));return t>-1?t+1:0},findPrevOptionIndex(e){const t=[...i.DomHandler.find(this.list,"li.p-orderlist-item")].findIndex((t=>t.id===e));return t>-1?t-1:0},changeFocusedOptionIndex(e){const t=i.DomHandler.find(this.list,"li.p-orderlist-item");let n=e>=t.length?t.length-1:e<0?0:e;this.focusedOptionIndex=t[n].getAttribute("id"),this.scrollInView(t[n].getAttribute("id"))},scrollInView(e){const t=i.DomHandler.findSingle(this.list,`li[id="${e}"]`);t&&t.scrollIntoView&&t.scrollIntoView({block:"nearest",inline:"start"})},moveUp(e){if(this.d_selection){let t=[...this.modelValue];for(let e=0;e<this.d_selection.length;e++){let n=this.d_selection[e],l=i.ObjectUtils.findIndexInList(n,t);if(0===l)break;{let e=t[l],i=t[l-1];t[l-1]=e,t[l]=i}}this.reorderDirection="up",this.$emit("update:modelValue",t),this.$emit("reorder",{originalEvent:e,value:t,direction:this.reorderDirection})}},moveTop(e){if(this.d_selection){let t=[...this.modelValue];for(let e=0;e<this.d_selection.length;e++){let n=this.d_selection[e],l=i.ObjectUtils.findIndexInList(n,t);if(0===l)break;{let e=t.splice(l,1)[0];t.unshift(e)}}this.reorderDirection="top",this.$emit("update:modelValue",t),this.$emit("reorder",{originalEvent:e,value:t,direction:this.reorderDirection})}},moveDown(e){if(this.d_selection){let t=[...this.modelValue];for(let e=this.d_selection.length-1;e>=0;e--){let n=this.d_selection[e],l=i.ObjectUtils.findIndexInList(n,t);if(l===t.length-1)break;{let e=t[l],i=t[l+1];t[l+1]=e,t[l]=i}}this.reorderDirection="down",this.$emit("update:modelValue",t),this.$emit("reorder",{originalEvent:e,value:t,direction:this.reorderDirection})}},moveBottom(e){if(this.d_selection){let t=[...this.modelValue];for(let e=this.d_selection.length-1;e>=0;e--){let n=this.d_selection[e],l=i.ObjectUtils.findIndexInList(n,t);if(l===t.length-1)break;{let e=t.splice(l,1)[0];t.push(e)}}this.reorderDirection="bottom",this.$emit("update:modelValue",t),this.$emit("reorder",{originalEvent:e,value:t,direction:this.reorderDirection})}},onItemClick(e,t,n){this.itemTouched=!1;const l=i.ObjectUtils.findIndexInList(t,this.d_selection),o=-1!=l,s=!this.itemTouched&&this.metaKeySelection,r=i.DomHandler.find(this.list,".p-orderlist-item")[n].getAttribute("id");if(this.focusedOptionIndex=r,s){const s=e.metaKey||e.ctrlKey;o&&s?this.d_selection=this.d_selection.filter(((e,t)=>t!==l)):(this.d_selection=s&&this.d_selection?[...this.d_selection]:[],i.ObjectUtils.insertIntoOrderedArray(t,n,this.d_selection,this.modelValue))}else o?this.d_selection=this.d_selection.filter(((e,t)=>t!==l)):(this.d_selection=this.d_selection?[...this.d_selection]:[],i.ObjectUtils.insertIntoOrderedArray(t,n,this.d_selection,this.modelValue));this.$emit("update:selection",this.d_selection),this.$emit("selection-change",{originalEvent:e,value:this.d_selection})},onItemTouchEnd(){this.itemTouched=!0},findNextItem(e){let t=e.nextElementSibling;return t?i.DomHandler.hasClass(t,"p-orderlist-item")?t:this.findNextItem(t):null},findPrevItem(e){let t=e.previousElementSibling;return t?i.DomHandler.hasClass(t,"p-orderlist-item")?t:this.findPrevItem(t):null},findFirstItem(){return i.DomHandler.findSingle(this.list,".p-orderlist-item")},findLastItem(){const e=i.DomHandler.find(this.list,".p-orderlist-item");return e[e.length-1]},itemClass(e,t){return["p-orderlist-item",{"p-highlight":this.isSelected(e),"p-focus":t===this.focusedOptionId}]},updateListScroll(){const e=i.DomHandler.find(this.list,".p-orderlist-item.p-highlight");if(e&&e.length)switch(this.reorderDirection){case"up":i.DomHandler.scrollInView(this.list,e[0]);break;case"top":this.list.scrollTop=0;break;case"down":i.DomHandler.scrollInView(this.list,e[e.length-1]);break;case"bottom":this.list.scrollTop=this.list.scrollHeight}},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-orderlist[${this.attributeSelector}] {\n flex-direction: column;\n }\n\n .p-orderlist[${this.attributeSelector}] .p-orderlist-controls {\n padding: var(--content-padding);\n flex-direction: row;\n }\n\n .p-orderlist[${this.attributeSelector}] .p-orderlist-controls .p-button {\n margin-right: var(--inline-spacing);\n margin-bottom: 0;\n }\n\n .p-orderlist[${this.attributeSelector}] .p-orderlist-controls .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(){if(!this.d_selection||!this.d_selection.length)return!0},listRef(e){this.list=e?e.$el:void 0}},computed:{containerClass(){return["p-orderlist p-component",{"p-orderlist-striped":this.stripedRows}]},id(){return this.$attrs.id||i.UniqueComponentId()},attributeSelector:()=>i.UniqueComponentId(),focusedOptionId(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null},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}},components:{OLButton:o.default},directives:{ripple:s.default}};const d={class:"p-orderlist-controls"},a={class:"p-orderlist-list-container"},c={key:0,class:"p-orderlist-header"},h=["id","onClick","aria-selected","onMousedown"];return function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css","top"===i&&n.firstChild?n.insertBefore(l,n.firstChild):n.appendChild(l),l.styleSheet?l.styleSheet.cssText=e:l.appendChild(document.createTextNode(e))}}("\n.p-orderlist {\n display: flex;\n}\n.p-orderlist-controls {\n display: flex;\n flex-direction: column;\n justify-content: center;\n}\n.p-orderlist-list-container {\n flex: 1 1 auto;\n}\n.p-orderlist-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-orderlist-item {\n cursor: pointer;\n overflow: hidden;\n position: relative;\n}\n.p-orderlist.p-state-disabled .p-orderlist-item,\n.p-orderlist.p-state-disabled .p-button {\n cursor: default;\n}\n.p-orderlist.p-state-disabled .p-orderlist-list {\n overflow: hidden;\n}\n"),r.render=function(e,t,i,l,o,s){const r=n.resolveComponent("OLButton"),u=n.resolveDirective("ripple");return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(s.containerClass)},[n.createElementVNode("div",d,[n.renderSlot(e.$slots,"controlsstart"),n.createVNode(r,n.mergeProps({type:"button",icon:"pi pi-angle-up",onClick:s.moveUp,"aria-label":s.moveUpAriaLabel,disabled:s.moveDisabled()},i.moveUpButtonProps),null,16,["onClick","aria-label","disabled"]),n.createVNode(r,n.mergeProps({type:"button",icon:"pi pi-angle-double-up",onClick:s.moveTop,"aria-label":s.moveTopAriaLabel,disabled:s.moveDisabled()},i.moveTopButtonProps),null,16,["onClick","aria-label","disabled"]),n.createVNode(r,n.mergeProps({type:"button",icon:"pi pi-angle-down",onClick:s.moveDown,"aria-label":s.moveDownAriaLabel,disabled:s.moveDisabled()},i.moveDownButtonProps),null,16,["onClick","aria-label","disabled"]),n.createVNode(r,n.mergeProps({type:"button",icon:"pi pi-angle-double-down",onClick:s.moveBottom,"aria-label":s.moveBottomAriaLabel,disabled:s.moveDisabled()},i.moveBottomButtonProps),null,16,["onClick","aria-label","disabled"]),n.renderSlot(e.$slots,"controlsend")]),n.createElementVNode("div",a,[e.$slots.header?(n.openBlock(),n.createElementBlock("div",c,[n.renderSlot(e.$slots,"header")])):n.createCommentVNode("",!0),n.createVNode(n.TransitionGroup,n.mergeProps({ref:s.listRef,id:s.id+"_list",name:"p-orderlist-flip",tag:"ul",class:"p-orderlist-list",style:i.listStyle,role:"listbox","aria-multiselectable":"true",tabindex:i.tabindex,"aria-activedescendant":o.focused?s.focusedOptionId:void 0,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,onFocus:s.onListFocus,onBlur:s.onListBlur,onKeydown:s.onListKeyDown},i.listProps),{default:n.withCtx((()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.modelValue,((i,l)=>n.withDirectives((n.openBlock(),n.createElementBlock("li",{key:s.getItemKey(i,l),id:s.id+"_"+l,role:"option",class:n.normalizeClass(s.itemClass(i,`${s.id}_${l}`)),onClick:e=>s.onItemClick(e,i,l),onTouchend:t[0]||(t[0]=(...e)=>s.onItemTouchEnd&&s.onItemTouchEnd(...e)),"aria-selected":s.isSelected(i),onMousedown:e=>s.onOptionMouseDown(l)},[n.renderSlot(e.$slots,"item",{item:i,index:l})],42,h)),[[u]]))),128))])),_:3},16,["id","style","tabindex","aria-activedescendant","aria-label","aria-labelledby","onFocus","onBlur","onKeydown"])])],2)},r}(primevue.button,primevue.ripple,primevue.utils,Vue);
|
|
1
|
+
this.primevue=this.primevue||{},this.primevue.orderlist=function(e,t,i,n){"use strict";function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=l(e),s=l(t),r={name:"OrderList",emits:["update:modelValue","reorder","update:selection","selection-change","focus","blur"],props:{modelValue:{type:Array,default:null},selection:{type:Array,default:null},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},tabindex:{type:Number,default:0},listProps:{type:null,default:null},moveUpButtonProps:{type:null,default:null},moveTopButtonProps:{type:null,default:null},moveDownButtonProps:{type:null,default:null},moveBottomButtonProps:{type:null,default:null},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},itemTouched:!1,reorderDirection:null,styleElement:null,list:null,data(){return{id:this.$attrs.id,d_selection:this.selection,focused:!1,focusedOptionIndex:-1}},watch:{"$attrs.id":function(e){this.id=e||i.UniqueComponentId()}},beforeUnmount(){this.destroyStyle()},updated(){this.reorderDirection&&(this.updateListScroll(),this.reorderDirection=null)},mounted(){this.id=this.id||i.UniqueComponentId(),this.responsive&&this.createStyle()},methods:{getItemKey(e,t){return this.dataKey?i.ObjectUtils.resolveFieldData(e,this.dataKey):t},isSelected(e){return-1!=i.ObjectUtils.findIndexInList(e,this.d_selection)},onListFocus(e){const t=i.DomHandler.findSingle(this.list,"li.p-orderlist-item.p-highlight"),n=i.ObjectUtils.findIndexInList(t,this.list.children);this.focused=!0;const l=-1!==this.focusedOptionIndex?this.focusedOptionIndex:t?n:-1;this.changeFocusedOptionIndex(l),this.$emit("focus",e)},onListBlur(e){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onListKeyDown(e){switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"Enter":this.onEnterKey(e);break;case"Space":this.onSpaceKey(e);break;case"KeyA":e.ctrlKey&&(this.d_selection=[...this.modelValue],this.$emit("update:selection",this.d_selection))}},onOptionMouseDown(e){this.focused=!0,this.focusedOptionIndex=e},onArrowDownKey(e){const t=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.shiftKey&&this.onEnterKey(e),e.preventDefault()},onArrowUpKey(e){const t=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.shiftKey&&this.onEnterKey(e),e.preventDefault()},onHomeKey(e){if(e.ctrlKey&&e.shiftKey){const e=i.DomHandler.find(this.list,"li.p-orderlist-item"),t=i.DomHandler.findSingle(this.list,`li.p-orderlist-item[id=${this.focusedOptionIndex}]`),n=[...e].findIndex((e=>e===t));this.d_selection=[...this.modelValue].slice(0,n+1),this.$emit("update:selection",this.d_selection)}else this.changeFocusedOptionIndex(0);e.preventDefault()},onEndKey(e){if(e.ctrlKey&&e.shiftKey){const e=i.DomHandler.find(this.list,"li.p-orderlist-item"),t=i.DomHandler.findSingle(this.list,`li.p-orderlist-item[id=${this.focusedOptionIndex}]`),n=[...e].findIndex((e=>e===t));this.d_selection=[...this.modelValue].slice(n,e.length),this.$emit("update:selection",this.d_selection)}else this.changeFocusedOptionIndex(i.DomHandler.find(this.list,"li.p-orderlist-item").length-1);e.preventDefault()},onEnterKey(e){const t=i.DomHandler.find(this.list,"li.p-orderlist-item"),n=i.DomHandler.findSingle(this.list,`li.p-orderlist-item[id=${this.focusedOptionIndex}]`),l=[...t].findIndex((e=>e===n));this.onItemClick(e,this.modelValue[l],l),e.preventDefault()},onSpaceKey(e){if(e.shiftKey){const e=i.DomHandler.find(this.list,"li.p-orderlist-item"),t=i.ObjectUtils.findIndexInList(this.d_selection[0],[...this.modelValue]),n=i.DomHandler.findSingle(this.list,`li.p-orderlist-item[id=${this.focusedOptionIndex}]`),l=[...e].findIndex((e=>e===n));this.d_selection=[...this.modelValue].slice(Math.min(t,l),Math.max(t,l)+1),this.$emit("update:selection",this.d_selection)}else this.onEnterKey(e)},findNextOptionIndex(e){const t=[...i.DomHandler.find(this.list,"li.p-orderlist-item")].findIndex((t=>t.id===e));return t>-1?t+1:0},findPrevOptionIndex(e){const t=[...i.DomHandler.find(this.list,"li.p-orderlist-item")].findIndex((t=>t.id===e));return t>-1?t-1:0},changeFocusedOptionIndex(e){const t=i.DomHandler.find(this.list,"li.p-orderlist-item");let n=e>=t.length?t.length-1:e<0?0:e;this.focusedOptionIndex=t[n].getAttribute("id"),this.scrollInView(t[n].getAttribute("id"))},scrollInView(e){const t=i.DomHandler.findSingle(this.list,`li[id="${e}"]`);t&&t.scrollIntoView&&t.scrollIntoView({block:"nearest",inline:"start"})},moveUp(e){if(this.d_selection){let t=[...this.modelValue];for(let e=0;e<this.d_selection.length;e++){let n=this.d_selection[e],l=i.ObjectUtils.findIndexInList(n,t);if(0===l)break;{let e=t[l],i=t[l-1];t[l-1]=e,t[l]=i}}this.reorderDirection="up",this.$emit("update:modelValue",t),this.$emit("reorder",{originalEvent:e,value:t,direction:this.reorderDirection})}},moveTop(e){if(this.d_selection){let t=[...this.modelValue];for(let e=0;e<this.d_selection.length;e++){let n=this.d_selection[e],l=i.ObjectUtils.findIndexInList(n,t);if(0===l)break;{let e=t.splice(l,1)[0];t.unshift(e)}}this.reorderDirection="top",this.$emit("update:modelValue",t),this.$emit("reorder",{originalEvent:e,value:t,direction:this.reorderDirection})}},moveDown(e){if(this.d_selection){let t=[...this.modelValue];for(let e=this.d_selection.length-1;e>=0;e--){let n=this.d_selection[e],l=i.ObjectUtils.findIndexInList(n,t);if(l===t.length-1)break;{let e=t[l],i=t[l+1];t[l+1]=e,t[l]=i}}this.reorderDirection="down",this.$emit("update:modelValue",t),this.$emit("reorder",{originalEvent:e,value:t,direction:this.reorderDirection})}},moveBottom(e){if(this.d_selection){let t=[...this.modelValue];for(let e=this.d_selection.length-1;e>=0;e--){let n=this.d_selection[e],l=i.ObjectUtils.findIndexInList(n,t);if(l===t.length-1)break;{let e=t.splice(l,1)[0];t.push(e)}}this.reorderDirection="bottom",this.$emit("update:modelValue",t),this.$emit("reorder",{originalEvent:e,value:t,direction:this.reorderDirection})}},onItemClick(e,t,n){this.itemTouched=!1;const l=i.ObjectUtils.findIndexInList(t,this.d_selection),o=-1!=l,s=!this.itemTouched&&this.metaKeySelection,r=i.DomHandler.find(this.list,".p-orderlist-item")[n].getAttribute("id");if(this.focusedOptionIndex=r,s){const s=e.metaKey||e.ctrlKey;o&&s?this.d_selection=this.d_selection.filter(((e,t)=>t!==l)):(this.d_selection=s&&this.d_selection?[...this.d_selection]:[],i.ObjectUtils.insertIntoOrderedArray(t,n,this.d_selection,this.modelValue))}else o?this.d_selection=this.d_selection.filter(((e,t)=>t!==l)):(this.d_selection=this.d_selection?[...this.d_selection]:[],i.ObjectUtils.insertIntoOrderedArray(t,n,this.d_selection,this.modelValue));this.$emit("update:selection",this.d_selection),this.$emit("selection-change",{originalEvent:e,value:this.d_selection})},onItemTouchEnd(){this.itemTouched=!0},findNextItem(e){let t=e.nextElementSibling;return t?i.DomHandler.hasClass(t,"p-orderlist-item")?t:this.findNextItem(t):null},findPrevItem(e){let t=e.previousElementSibling;return t?i.DomHandler.hasClass(t,"p-orderlist-item")?t:this.findPrevItem(t):null},findFirstItem(){return i.DomHandler.findSingle(this.list,".p-orderlist-item")},findLastItem(){const e=i.DomHandler.find(this.list,".p-orderlist-item");return e[e.length-1]},itemClass(e,t){return["p-orderlist-item",{"p-highlight":this.isSelected(e),"p-focus":t===this.focusedOptionId}]},updateListScroll(){const e=i.DomHandler.find(this.list,".p-orderlist-item.p-highlight");if(e&&e.length)switch(this.reorderDirection){case"up":i.DomHandler.scrollInView(this.list,e[0]);break;case"top":this.list.scrollTop=0;break;case"down":i.DomHandler.scrollInView(this.list,e[e.length-1]);break;case"bottom":this.list.scrollTop=this.list.scrollHeight}},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-orderlist[${this.attributeSelector}] {\n flex-direction: column;\n }\n\n .p-orderlist[${this.attributeSelector}] .p-orderlist-controls {\n padding: var(--content-padding);\n flex-direction: row;\n }\n\n .p-orderlist[${this.attributeSelector}] .p-orderlist-controls .p-button {\n margin-right: var(--inline-spacing);\n margin-bottom: 0;\n }\n\n .p-orderlist[${this.attributeSelector}] .p-orderlist-controls .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(){if(!this.d_selection||!this.d_selection.length)return!0},listRef(e){this.list=e?e.$el:void 0}},computed:{containerClass(){return["p-orderlist p-component",{"p-orderlist-striped":this.stripedRows}]},attributeSelector:()=>i.UniqueComponentId(),focusedOptionId(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null},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}},components:{OLButton:o.default},directives:{ripple:s.default}};const d={class:"p-orderlist-controls"},a={class:"p-orderlist-list-container"},c={key:0,class:"p-orderlist-header"},h=["id","onClick","aria-selected","onMousedown"];return function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css","top"===i&&n.firstChild?n.insertBefore(l,n.firstChild):n.appendChild(l),l.styleSheet?l.styleSheet.cssText=e:l.appendChild(document.createTextNode(e))}}("\n.p-orderlist {\n display: flex;\n}\n.p-orderlist-controls {\n display: flex;\n flex-direction: column;\n justify-content: center;\n}\n.p-orderlist-list-container {\n flex: 1 1 auto;\n}\n.p-orderlist-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-orderlist-item {\n cursor: pointer;\n overflow: hidden;\n position: relative;\n}\n.p-orderlist.p-state-disabled .p-orderlist-item,\n.p-orderlist.p-state-disabled .p-button {\n cursor: default;\n}\n.p-orderlist.p-state-disabled .p-orderlist-list {\n overflow: hidden;\n}\n"),r.render=function(e,t,i,l,o,s){const r=n.resolveComponent("OLButton"),u=n.resolveDirective("ripple");return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(s.containerClass)},[n.createElementVNode("div",d,[n.renderSlot(e.$slots,"controlsstart"),n.createVNode(r,n.mergeProps({type:"button",icon:"pi pi-angle-up",onClick:s.moveUp,"aria-label":s.moveUpAriaLabel,disabled:s.moveDisabled()},i.moveUpButtonProps),null,16,["onClick","aria-label","disabled"]),n.createVNode(r,n.mergeProps({type:"button",icon:"pi pi-angle-double-up",onClick:s.moveTop,"aria-label":s.moveTopAriaLabel,disabled:s.moveDisabled()},i.moveTopButtonProps),null,16,["onClick","aria-label","disabled"]),n.createVNode(r,n.mergeProps({type:"button",icon:"pi pi-angle-down",onClick:s.moveDown,"aria-label":s.moveDownAriaLabel,disabled:s.moveDisabled()},i.moveDownButtonProps),null,16,["onClick","aria-label","disabled"]),n.createVNode(r,n.mergeProps({type:"button",icon:"pi pi-angle-double-down",onClick:s.moveBottom,"aria-label":s.moveBottomAriaLabel,disabled:s.moveDisabled()},i.moveBottomButtonProps),null,16,["onClick","aria-label","disabled"]),n.renderSlot(e.$slots,"controlsend")]),n.createElementVNode("div",a,[e.$slots.header?(n.openBlock(),n.createElementBlock("div",c,[n.renderSlot(e.$slots,"header")])):n.createCommentVNode("",!0),n.createVNode(n.TransitionGroup,n.mergeProps({ref:s.listRef,id:o.id+"_list",name:"p-orderlist-flip",tag:"ul",class:"p-orderlist-list",style:i.listStyle,role:"listbox","aria-multiselectable":"true",tabindex:i.tabindex,"aria-activedescendant":o.focused?s.focusedOptionId:void 0,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,onFocus:s.onListFocus,onBlur:s.onListBlur,onKeydown:s.onListKeyDown},i.listProps),{default:n.withCtx((()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.modelValue,((i,l)=>n.withDirectives((n.openBlock(),n.createElementBlock("li",{key:s.getItemKey(i,l),id:o.id+"_"+l,role:"option",class:n.normalizeClass(s.itemClass(i,`${o.id}_${l}`)),onClick:e=>s.onItemClick(e,i,l),onTouchend:t[0]||(t[0]=(...e)=>s.onItemTouchEnd&&s.onItemTouchEnd(...e)),"aria-selected":s.isSelected(i),onMousedown:e=>s.onOptionMouseDown(l)},[n.renderSlot(e.$slots,"item",{item:i,index:l})],42,h)),[[u]]))),128))])),_:3},16,["id","style","tabindex","aria-activedescendant","aria-label","aria-labelledby","onFocus","onBlur","onKeydown"])])],2)},r}(primevue.button,primevue.ripple,primevue.utils,Vue);
|