primevue 3.40.0 → 3.41.0
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/README.md +2 -20
- package/autocomplete/AutoComplete.vue +1 -1
- package/autocomplete/autocomplete.cjs.js +1 -1
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.esm.js +1 -1
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +1 -1
- package/autocomplete/autocomplete.min.js +1 -1
- package/baseicon/BaseIcon.vue +3 -0
- package/baseicon/baseicon.cjs.js +4 -0
- package/baseicon/baseicon.cjs.min.js +1 -1
- package/baseicon/baseicon.esm.js +3 -0
- package/baseicon/baseicon.esm.min.js +1 -1
- package/baseicon/baseicon.js +5 -2
- package/baseicon/baseicon.min.js +1 -1
- package/breadcrumb/BreadcrumbItem.vue +1 -1
- package/breadcrumb/breadcrumb.cjs.js +1 -1
- package/breadcrumb/breadcrumb.cjs.min.js +1 -1
- package/breadcrumb/breadcrumb.esm.js +1 -1
- package/breadcrumb/breadcrumb.esm.min.js +1 -1
- package/breadcrumb/breadcrumb.js +1 -1
- package/breadcrumb/breadcrumb.min.js +1 -1
- package/calendar/BaseCalendar.vue +4 -0
- package/calendar/Calendar.d.ts +6 -1
- package/calendar/Calendar.vue +9 -1
- package/calendar/calendar.cjs.js +54 -43
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.esm.js +54 -43
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +54 -43
- package/calendar/calendar.min.js +1 -1
- package/calendar/style/calendarstyle.cjs.js +1 -0
- package/calendar/style/calendarstyle.cjs.min.js +1 -1
- package/calendar/style/calendarstyle.esm.js +1 -0
- package/calendar/style/calendarstyle.esm.min.js +1 -1
- package/calendar/style/calendarstyle.js +1 -0
- package/calendar/style/calendarstyle.min.js +1 -1
- package/confirmationoptions/ConfirmationOptions.d.ts +5 -1
- package/confirmdialog/ConfirmDialog.d.ts +2 -2
- package/core/core.js +65 -50
- package/core/core.min.js +17 -17
- package/datatable/DataTable.vue +3 -2
- package/datatable/datatable.cjs.js +3 -2
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.esm.js +3 -2
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +3 -2
- package/datatable/datatable.min.js +1 -1
- package/dataview/DataView.d.ts +9 -19
- package/dataview/DataView.vue +11 -10
- package/dataview/dataview.cjs.js +18 -18
- package/dataview/dataview.cjs.min.js +1 -1
- package/dataview/dataview.esm.js +19 -19
- package/dataview/dataview.esm.min.js +1 -1
- package/dataview/dataview.js +18 -18
- package/dataview/dataview.min.js +1 -1
- package/dataview/style/dataviewstyle.cjs.js +0 -2
- package/dataview/style/dataviewstyle.cjs.min.js +1 -1
- package/dataview/style/dataviewstyle.esm.js +0 -2
- package/dataview/style/dataviewstyle.esm.min.js +1 -1
- package/dataview/style/dataviewstyle.js +0 -2
- package/dataview/style/dataviewstyle.min.js +1 -1
- package/dialog/Dialog.d.ts +2 -2
- package/dialog/Dialog.vue +4 -4
- package/dialog/dialog.cjs.js +6 -6
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.esm.js +6 -6
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +6 -6
- package/dialog/dialog.min.js +1 -1
- package/dialog/style/dialogstyle.cjs.js +2 -2
- package/dialog/style/dialogstyle.cjs.min.js +1 -1
- package/dialog/style/dialogstyle.esm.js +2 -2
- package/dialog/style/dialogstyle.esm.min.js +1 -1
- package/dialog/style/dialogstyle.js +2 -2
- package/dialog/style/dialogstyle.min.js +1 -1
- package/dock/BaseDock.vue +4 -0
- package/dock/Dock.d.ts +5 -0
- package/dock/Dock.vue +14 -0
- package/dock/dock.cjs.js +17 -0
- package/dock/dock.cjs.min.js +1 -1
- package/dock/dock.esm.js +17 -0
- package/dock/dock.esm.min.js +1 -1
- package/dock/dock.js +17 -0
- package/dock/dock.min.js +1 -1
- package/dock/style/dockstyle.cjs.js +5 -2
- package/dock/style/dockstyle.cjs.min.js +1 -1
- package/dock/style/dockstyle.esm.js +5 -2
- package/dock/style/dockstyle.esm.min.js +1 -1
- package/dock/style/dockstyle.js +5 -2
- package/dock/style/dockstyle.min.js +1 -1
- package/fileupload/FileContent.vue +1 -1
- package/fileupload/FileUpload.vue +1 -1
- package/fileupload/fileupload.cjs.js +2 -2
- package/fileupload/fileupload.cjs.min.js +1 -1
- package/fileupload/fileupload.esm.js +2 -2
- package/fileupload/fileupload.esm.min.js +1 -1
- package/fileupload/fileupload.js +2 -2
- package/fileupload/fileupload.min.js +1 -1
- package/focustrap/focustrap.cjs.js +1 -1
- package/focustrap/focustrap.cjs.min.js +1 -1
- package/focustrap/focustrap.esm.js +1 -1
- package/focustrap/focustrap.esm.min.js +1 -1
- package/focustrap/focustrap.js +1 -1
- package/focustrap/focustrap.min.js +1 -1
- package/inputgroupaddon/package.json +1 -1
- package/inputnumber/style/inputnumberstyle.cjs.js +1 -1
- package/inputnumber/style/inputnumberstyle.cjs.min.js +1 -1
- package/inputnumber/style/inputnumberstyle.esm.js +1 -1
- package/inputnumber/style/inputnumberstyle.esm.min.js +1 -1
- package/inputnumber/style/inputnumberstyle.js +1 -1
- package/inputnumber/style/inputnumberstyle.min.js +1 -1
- package/megamenu/BaseMegaMenu.vue +4 -0
- package/megamenu/MegaMenu.d.ts +9 -0
- package/megamenu/MegaMenu.vue +74 -6
- package/megamenu/MegaMenuSub.vue +6 -1
- package/megamenu/megamenu.cjs.js +118 -35
- package/megamenu/megamenu.cjs.min.js +1 -1
- package/megamenu/megamenu.esm.js +119 -37
- package/megamenu/megamenu.esm.min.js +1 -1
- package/megamenu/megamenu.js +119 -37
- package/megamenu/megamenu.min.js +1 -1
- package/megamenu/style/megamenustyle.cjs.js +22 -17
- package/megamenu/style/megamenustyle.cjs.min.js +1 -1
- package/megamenu/style/megamenustyle.esm.js +22 -17
- package/megamenu/style/megamenustyle.esm.min.js +1 -1
- package/megamenu/style/megamenustyle.js +22 -17
- package/megamenu/style/megamenustyle.min.js +1 -1
- package/menu/Menu.d.ts +1 -1
- package/menu/Menuitem.vue +0 -1
- package/menubar/BaseMenubar.vue +4 -0
- package/menubar/Menubar.d.ts +5 -0
- package/menubar/Menubar.vue +10 -1
- package/menubar/menubar.cjs.js +48 -36
- package/menubar/menubar.cjs.min.js +1 -1
- package/menubar/menubar.esm.js +48 -36
- package/menubar/menubar.esm.min.js +1 -1
- package/menubar/menubar.js +48 -36
- package/menubar/menubar.min.js +1 -1
- package/menubar/style/menubarstyle.cjs.js +2 -1
- package/menubar/style/menubarstyle.cjs.min.js +1 -1
- package/menubar/style/menubarstyle.esm.js +2 -1
- package/menubar/style/menubarstyle.esm.min.js +1 -1
- package/menubar/style/menubarstyle.js +2 -1
- package/menubar/style/menubarstyle.min.js +1 -1
- package/orderlist/OrderList.vue +18 -2
- package/orderlist/orderlist.cjs.js +16 -2
- package/orderlist/orderlist.cjs.min.js +1 -1
- package/orderlist/orderlist.esm.js +16 -2
- package/orderlist/orderlist.esm.min.js +1 -1
- package/orderlist/orderlist.js +16 -2
- package/orderlist/orderlist.min.js +1 -1
- package/overlaypanel/OverlayPanel.d.ts +14 -14
- package/package.json +1 -1
- package/paginator/Paginator.vue +21 -13
- package/paginator/paginator.cjs.js +9 -2
- package/paginator/paginator.cjs.min.js +1 -1
- package/paginator/paginator.esm.js +9 -2
- package/paginator/paginator.esm.min.js +1 -1
- package/paginator/paginator.js +9 -2
- package/paginator/paginator.min.js +1 -1
- package/panelmenu/BasePanelMenu.vue +4 -0
- package/panelmenu/PanelMenu.d.ts +5 -0
- package/panelmenu/PanelMenu.vue +13 -2
- package/panelmenu/panelmenu.cjs.js +21 -2
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.esm.js +21 -2
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +21 -2
- package/panelmenu/panelmenu.min.js +1 -1
- package/passthrough/tailwind/index.cjs.js +4 -4
- package/passthrough/tailwind/index.cjs.min.js +1 -1
- package/passthrough/tailwind/index.esm.js +4 -4
- package/passthrough/tailwind/index.esm.min.js +1 -1
- package/passthrough/tailwind/index.js +4 -4
- package/passthrough/tailwind/index.min.js +1 -1
- package/picklist/PickList.vue +16 -2
- package/picklist/picklist.cjs.js +15 -2
- package/picklist/picklist.cjs.min.js +1 -1
- package/picklist/picklist.esm.js +15 -2
- package/picklist/picklist.esm.min.js +1 -1
- package/picklist/picklist.js +15 -2
- package/picklist/picklist.min.js +1 -1
- package/resources/themes/arya-blue/theme.css +133 -117
- package/resources/themes/arya-green/theme.css +133 -117
- package/resources/themes/arya-orange/theme.css +133 -117
- package/resources/themes/arya-purple/theme.css +133 -117
- package/resources/themes/bootstrap4-dark-blue/theme.css +133 -117
- package/resources/themes/bootstrap4-dark-purple/theme.css +133 -117
- package/resources/themes/bootstrap4-light-blue/theme.css +133 -117
- package/resources/themes/bootstrap4-light-purple/theme.css +133 -117
- package/resources/themes/fluent-light/theme.css +133 -117
- package/resources/themes/lara-dark-amber/fonts/Inter-italic.var.woff2 +0 -0
- package/resources/themes/lara-dark-amber/fonts/Inter-roman.var.woff2 +0 -0
- package/resources/themes/lara-dark-amber/theme.css +5757 -0
- package/resources/themes/lara-dark-blue/theme.css +337 -321
- package/resources/themes/lara-dark-cyan/fonts/Inter-italic.var.woff2 +0 -0
- package/resources/themes/lara-dark-cyan/fonts/Inter-roman.var.woff2 +0 -0
- package/resources/themes/lara-dark-cyan/theme.css +5757 -0
- package/resources/themes/lara-dark-green/fonts/Inter-italic.var.woff2 +0 -0
- package/resources/themes/lara-dark-green/fonts/Inter-roman.var.woff2 +0 -0
- package/resources/themes/lara-dark-green/theme.css +5757 -0
- package/resources/themes/lara-dark-indigo/theme.css +337 -321
- package/resources/themes/lara-dark-pink/fonts/Inter-italic.var.woff2 +0 -0
- package/resources/themes/lara-dark-pink/fonts/Inter-roman.var.woff2 +0 -0
- package/resources/themes/lara-dark-pink/theme.css +5757 -0
- package/resources/themes/lara-dark-purple/theme.css +337 -321
- package/resources/themes/lara-dark-teal/theme.css +577 -561
- package/resources/themes/lara-light-amber/fonts/Inter-italic.var.woff2 +0 -0
- package/resources/themes/lara-light-amber/fonts/Inter-roman.var.woff2 +0 -0
- package/resources/themes/lara-light-amber/theme.css +5749 -0
- package/resources/themes/lara-light-blue/theme.css +192 -176
- package/resources/themes/lara-light-cyan/fonts/Inter-italic.var.woff2 +0 -0
- package/resources/themes/lara-light-cyan/fonts/Inter-roman.var.woff2 +0 -0
- package/resources/themes/lara-light-cyan/theme.css +5749 -0
- package/resources/themes/lara-light-green/fonts/Inter-italic.var.woff2 +0 -0
- package/resources/themes/lara-light-green/fonts/Inter-roman.var.woff2 +0 -0
- package/resources/themes/lara-light-green/theme.css +5749 -0
- package/resources/themes/lara-light-indigo/theme.css +192 -176
- package/resources/themes/lara-light-pink/fonts/Inter-italic.var.woff2 +0 -0
- package/resources/themes/lara-light-pink/fonts/Inter-roman.var.woff2 +0 -0
- package/resources/themes/lara-light-pink/theme.css +5749 -0
- package/resources/themes/lara-light-purple/theme.css +192 -176
- package/resources/themes/lara-light-teal/theme.css +483 -467
- package/resources/themes/luna-amber/theme.css +133 -117
- package/resources/themes/luna-blue/theme.css +133 -117
- package/resources/themes/luna-green/theme.css +133 -117
- package/resources/themes/luna-pink/theme.css +133 -117
- package/resources/themes/md-dark-deeppurple/theme.css +133 -117
- package/resources/themes/md-dark-indigo/theme.css +133 -117
- package/resources/themes/md-light-deeppurple/theme.css +133 -117
- package/resources/themes/md-light-indigo/theme.css +133 -117
- package/resources/themes/mdc-dark-deeppurple/theme.css +133 -117
- package/resources/themes/mdc-dark-indigo/theme.css +133 -117
- package/resources/themes/mdc-light-deeppurple/theme.css +133 -117
- package/resources/themes/mdc-light-indigo/theme.css +133 -117
- package/resources/themes/mira/theme.css +133 -117
- package/resources/themes/nano/theme.css +133 -117
- package/resources/themes/nova/theme.css +133 -117
- package/resources/themes/nova-accent/theme.css +133 -117
- package/resources/themes/nova-alt/theme.css +133 -117
- package/resources/themes/nova-vue/theme.css +133 -117
- package/resources/themes/rhea/theme.css +133 -117
- package/resources/themes/saga-blue/theme.css +133 -117
- package/resources/themes/saga-green/theme.css +133 -117
- package/resources/themes/saga-orange/theme.css +133 -117
- package/resources/themes/saga-purple/theme.css +133 -117
- package/resources/themes/soho-dark/theme.css +133 -117
- package/resources/themes/soho-light/theme.css +133 -117
- package/resources/themes/tailwind-light/theme.css +133 -117
- package/resources/themes/vela-blue/theme.css +133 -117
- package/resources/themes/vela-green/theme.css +133 -117
- package/resources/themes/vela-orange/theme.css +133 -117
- package/resources/themes/vela-purple/theme.css +133 -117
- package/resources/themes/viva-dark/theme.css +133 -117
- package/resources/themes/viva-light/theme.css +133 -117
- package/sidebar/BaseSidebar.vue +4 -0
- package/sidebar/Sidebar.d.ts +12 -2
- package/sidebar/Sidebar.vue +3 -3
- package/sidebar/sidebar.cjs.js +12 -4
- package/sidebar/sidebar.cjs.min.js +1 -1
- package/sidebar/sidebar.esm.js +13 -5
- package/sidebar/sidebar.esm.min.js +1 -1
- package/sidebar/sidebar.js +12 -4
- package/sidebar/sidebar.min.js +1 -1
- package/sidebar/style/sidebarstyle.cjs.js +2 -2
- package/sidebar/style/sidebarstyle.cjs.min.js +1 -1
- package/sidebar/style/sidebarstyle.esm.js +2 -2
- package/sidebar/style/sidebarstyle.esm.min.js +1 -1
- package/sidebar/style/sidebarstyle.js +2 -2
- package/sidebar/style/sidebarstyle.min.js +1 -1
- package/speeddial/style/speeddialstyle.cjs.js +2 -2
- package/speeddial/style/speeddialstyle.cjs.min.js +1 -1
- package/speeddial/style/speeddialstyle.esm.js +2 -2
- package/speeddial/style/speeddialstyle.esm.min.js +1 -1
- package/speeddial/style/speeddialstyle.js +2 -2
- package/speeddial/style/speeddialstyle.min.js +1 -1
- package/splitter/Splitter.vue +3 -1
- package/splitter/splitter.cjs.js +3 -1
- package/splitter/splitter.cjs.min.js +1 -1
- package/splitter/splitter.esm.js +3 -1
- package/splitter/splitter.esm.min.js +1 -1
- package/splitter/splitter.js +3 -1
- package/splitter/splitter.min.js +1 -1
- package/splitterpanel/style/splitterpanelstyle.cjs.js +1 -1
- package/splitterpanel/style/splitterpanelstyle.cjs.min.js +1 -1
- package/splitterpanel/style/splitterpanelstyle.esm.js +1 -1
- package/splitterpanel/style/splitterpanelstyle.esm.min.js +1 -1
- package/splitterpanel/style/splitterpanelstyle.js +1 -1
- package/splitterpanel/style/splitterpanelstyle.min.js +1 -1
- package/tree/TreeNode.vue +1 -1
- package/tree/style/treestyle.cjs.js +1 -4
- package/tree/style/treestyle.cjs.min.js +1 -1
- package/tree/style/treestyle.esm.js +1 -4
- package/tree/style/treestyle.esm.min.js +1 -1
- package/tree/style/treestyle.js +1 -4
- package/tree/style/treestyle.min.js +1 -1
- package/tree/tree.cjs.js +1 -1
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.esm.js +1 -1
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +1 -1
- package/tree/tree.min.js +1 -1
- package/treeselect/TreeSelect.vue +67 -2
- package/treeselect/treeselect.cjs.js +73 -9
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.esm.js +73 -9
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +73 -9
- package/treeselect/treeselect.min.js +1 -1
- package/web-types.json +1 -1
- /package/dynamicdialog/style/{AccordionStyle.d.ts → DynamicDialogStyle.d.ts} +0 -0
package/menubar/menubar.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primevue=this.primevue||{},this.primevue.menubar=function(e,t,i,n,s,o,r,c){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=a(e),l=a(i),m=a(n),d=a(s),I={name:"BaseMenubar",extends:l.default,props:{model:{type:Array,default:null},buttonProps:{type:null,default:null},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},style:m.default,provide:function(){return{$parentInstance:this}}},h={name:"MenubarSub",hostName:"Menubar",extends:l.default,emits:["item-mouseenter","item-click"],props:{items:{type:Array,default:null},root:{type:Boolean,default:!1},popup:{type:Boolean,default:!1},mobileActive:{type:Boolean,default:!1},templates:{type:Object,default:null},level:{type:Number,default:0},menuId:{type:String,default:null},focusedItemId:{type:String,default:null},activeItemPath:{type:Object,default:null}},list:null,methods:{getItemId:function(e){return"".concat(this.menuId,"_").concat(e.key)},getItemKey:function(e){return this.getItemId(e)},getItemProp:function(e,i,n){return e&&e.item?t.ObjectUtils.getItemValue(e.item[i],n):void 0},getItemLabel:function(e){return this.getItemProp(e,"label")},getPTOptions:function(e,t,i){return this.ptm(i,{context:{item:e,index:t,active:this.isItemActive(e),focused:this.isItemFocused(e),disabled:this.isItemDisabled(e),level:this.level}})},isItemActive:function(e){return this.activeItemPath.some((function(t){return t.key===e.key}))},isItemVisible:function(e){return!1!==this.getItemProp(e,"visible")},isItemDisabled:function(e){return this.getItemProp(e,"disabled")},isItemFocused:function(e){return this.focusedItemId===this.getItemId(e)},isItemGroup:function(e){return t.ObjectUtils.isNotEmpty(e.items)},onItemClick:function(e,t){this.getItemProp(t,"command",{originalEvent:e,item:t.item}),this.$emit("item-click",{originalEvent:e,processedItem:t,isFocus:!0})},onItemMouseEnter:function(e,t){this.$emit("item-mouseenter",{originalEvent:e,processedItem:t})},getAriaSetSize:function(){var e=this;return this.items.filter((function(t){return e.isItemVisible(t)&&!e.getItemProp(t,"separator")})).length},getAriaPosInset:function(e){var t=this;return e-this.items.slice(0,e).filter((function(e){return t.isItemVisible(e)&&t.getItemProp(e,"separator")})).length+1},getMenuItemProps:function(e,t){return{action:c.mergeProps({class:this.cx("action"),tabindex:-1,"aria-hidden":!0},this.getPTOptions(e,t,"action")),icon:c.mergeProps({class:[this.cx("icon"),this.getItemProp(e,"icon")]},this.getPTOptions(e,t,"icon")),label:c.mergeProps({class:this.cx("label")},this.getPTOptions(e,t,"label")),submenuicon:c.mergeProps({class:this.cx("submenuIcon")},this.getPTOptions(e,t,"submenuIcon"))}}},components:{AngleRightIcon:a(o).default,AngleDownIcon:d.default},directives:{ripple:a(r).default}},f=["id","aria-label","aria-disabled","aria-expanded","aria-haspopup","aria-level","aria-setsize","aria-posinset","data-p-highlight","data-p-focused","data-p-disabled"],p=["onClick","onMouseenter"],b=["href","target"],v=["id"];h.render=function(e,t,i,n,s,o){var r=c.resolveComponent("MenubarSub",!0),a=c.resolveDirective("ripple");return c.openBlock(),c.createElementBlock("ul",c.mergeProps({class:e.cx(0===i.level?"menu":"submenu")},e.ptm(0===i.level?"menu":"submenu")),[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(i.items,(function(n,s){return c.openBlock(),c.createElementBlock(c.Fragment,{key:o.getItemKey(n)},[o.isItemVisible(n)&&!o.getItemProp(n,"separator")?(c.openBlock(),c.createElementBlock("li",c.mergeProps({key:0,id:o.getItemId(n),style:o.getItemProp(n,"style"),class:[e.cx("menuitem",{processedItem:n}),o.getItemProp(n,"class")],role:"menuitem","aria-label":o.getItemLabel(n),"aria-disabled":o.isItemDisabled(n)||void 0,"aria-expanded":o.isItemGroup(n)?o.isItemActive(n):void 0,"aria-haspopup":o.isItemGroup(n)&&!o.getItemProp(n,"to")?"menu":void 0,"aria-level":i.level+1,"aria-setsize":o.getAriaSetSize(),"aria-posinset":o.getAriaPosInset(s)},o.getPTOptions(n,s,"menuitem"),{"data-p-highlight":o.isItemActive(n),"data-p-focused":o.isItemFocused(n),"data-p-disabled":o.isItemDisabled(n)}),[c.createElementVNode("div",c.mergeProps({class:e.cx("content"),onClick:function(e){return o.onItemClick(e,n)},onMouseenter:function(e){return o.onItemMouseEnter(e,n)}},o.getPTOptions(n,s,"content")),[i.templates.item?(c.openBlock(),c.createBlock(c.resolveDynamicComponent(i.templates.item),{key:1,item:n.item,root:i.root,hasSubmenu:o.getItemProp(n,"items"),label:o.getItemLabel(n),props:o.getMenuItemProps(n,s)},null,8,["item","root","hasSubmenu","label","props"])):c.withDirectives((c.openBlock(),c.createElementBlock("a",c.mergeProps({key:0,href:o.getItemProp(n,"url"),class:e.cx("action"),target:o.getItemProp(n,"target"),tabindex:"-1","aria-hidden":"true"},o.getPTOptions(n,s,"action")),[i.templates.itemicon?(c.openBlock(),c.createBlock(c.resolveDynamicComponent(i.templates.itemicon),{key:0,item:n.item,class:c.normalizeClass([e.cx("icon"),o.getItemProp(n,"icon")])},null,8,["item","class"])):o.getItemProp(n,"icon")?(c.openBlock(),c.createElementBlock("span",c.mergeProps({key:1,class:[e.cx("icon"),o.getItemProp(n,"icon")]},o.getPTOptions(n,s,"icon")),null,16)):c.createCommentVNode("",!0),c.createElementVNode("span",c.mergeProps({class:e.cx("label")},o.getPTOptions(n,s,"label")),c.toDisplayString(o.getItemLabel(n)),17),o.getItemProp(n,"items")?(c.openBlock(),c.createElementBlock(c.Fragment,{key:2},[i.templates.submenuicon?(c.openBlock(),c.createBlock(c.resolveDynamicComponent(i.templates.submenuicon),{key:0,root:i.root,active:o.isItemActive(n),class:c.normalizeClass(e.cx("submenuIcon"))},null,8,["root","active","class"])):(c.openBlock(),c.createBlock(c.resolveDynamicComponent(i.root?"AngleDownIcon":"AngleRightIcon"),c.mergeProps({key:1,class:e.cx("submenuIcon")},o.getPTOptions(n,s,"submenuIcon")),null,16,["class"]))],64)):c.createCommentVNode("",!0)],16,b)),[[a]])],16,p),o.isItemVisible(n)&&o.isItemGroup(n)?(c.openBlock(),c.createBlock(r,{key:0,menuId:i.menuId,role:"menu",style:c.normalizeStyle(e.sx("submenu",!0,{processedItem:n})),focusedItemId:i.focusedItemId,items:n.items,mobileActive:i.mobileActive,activeItemPath:i.activeItemPath,templates:i.templates,level:i.level+1,pt:e.pt,unstyled:e.unstyled,onItemClick:t[0]||(t[0]=function(t){return e.$emit("item-click",t)}),onItemMouseenter:t[1]||(t[1]=function(t){return e.$emit("item-mouseenter",t)})},null,8,["menuId","style","focusedItemId","items","mobileActive","activeItemPath","templates","level","pt","unstyled"])):c.createCommentVNode("",!0)],16,f)):c.createCommentVNode("",!0),o.isItemVisible(n)&&o.getItemProp(n,"separator")?(c.openBlock(),c.createElementBlock("li",c.mergeProps({key:1,id:o.getItemId(n),class:[e.cx("separator"),o.getItemProp(n,"class")],style:o.getItemProp(n,"style"),role:"separator"},e.ptm("separator")),null,16,v)):c.createCommentVNode("",!0)],64)})),128))],16)};var y={name:"Menubar",extends:I,emits:["focus","blur"],data:function(){return{id:this.$attrs.id,mobileActive:!1,focused:!1,focusedItemInfo:{index:-1,level:0,parentKey:""},activeItemPath:[],dirty:!1}},watch:{"$attrs.id":function(e){this.id=e||t.UniqueComponentId()},activeItemPath:function(e){t.ObjectUtils.isNotEmpty(e)?(this.bindOutsideClickListener(),this.bindResizeListener()):(this.unbindOutsideClickListener(),this.unbindResizeListener())}},outsideClickListener:null,container:null,menubar:null,mounted:function(){this.id=this.id||t.UniqueComponentId()},beforeUnmount:function(){this.mobileActive=!1,this.unbindOutsideClickListener(),this.unbindResizeListener(),this.container&&t.ZIndexUtils.clear(this.container),this.container=null},methods:{getItemProp:function(e,i){return e?t.ObjectUtils.getItemValue(e[i]):void 0},getItemLabel:function(e){return this.getItemProp(e,"label")},isItemDisabled:function(e){return this.getItemProp(e,"disabled")},isItemGroup:function(e){return t.ObjectUtils.isNotEmpty(this.getItemProp(e,"items"))},isItemSeparator:function(e){return this.getItemProp(e,"separator")},getProccessedItemLabel:function(e){return e?this.getItemLabel(e.item):void 0},isProccessedItemGroup:function(e){return e&&t.ObjectUtils.isNotEmpty(e.items)},toggle:function(e){var i=this;this.mobileActive?(this.mobileActive=!1,t.ZIndexUtils.clear(this.menubar),this.hide()):(this.mobileActive=!0,t.ZIndexUtils.set("menu",this.menubar,this.$primevue.config.zIndex.menu),setTimeout((function(){i.show()}),1)),this.bindOutsideClickListener(),e.preventDefault()},show:function(){this.focusedItemInfo={index:this.findFirstFocusedItemIndex(),level:0,parentKey:""},t.DomHandler.focus(this.menubar)},hide:function(e,i){var n=this;this.mobileActive&&(this.mobileActive=!1,setTimeout((function(){t.DomHandler.focus(n.$refs.menubutton)}),0)),this.activeItemPath=[],this.focusedItemInfo={index:-1,level:0,parentKey:""},i&&t.DomHandler.focus(this.menubar),this.dirty=!1},onFocus:function(e){this.focused=!0,this.focusedItemInfo=-1!==this.focusedItemInfo.index?this.focusedItemInfo:{index:this.findFirstFocusedItemIndex(),level:0,parentKey:""},this.$emit("focus",e)},onBlur:function(e){this.focused=!1,this.focusedItemInfo={index:-1,level:0,parentKey:""},this.searchValue="",this.dirty=!1,this.$emit("blur",e)},onKeyDown:function(e){var i=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"ArrowLeft":this.onArrowLeftKey(e);break;case"ArrowRight":this.onArrowRightKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"Space":this.onSpaceKey(e);break;case"Enter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"PageDown":case"PageUp":case"Backspace":case"ShiftLeft":case"ShiftRight":break;default:!i&&t.ObjectUtils.isPrintableCharacter(e.key)&&this.searchItems(e,e.key)}},onItemChange:function(e){var i=e.processedItem,n=e.isFocus;if(!t.ObjectUtils.isEmpty(i)){var s=i.index,o=i.key,r=i.level,c=i.parentKey,a=t.ObjectUtils.isNotEmpty(i.items),u=this.activeItemPath.filter((function(e){return e.parentKey!==c&&e.parentKey!==o}));a&&u.push(i),this.focusedItemInfo={index:s,level:r,parentKey:c},this.activeItemPath=u,a&&(this.dirty=!0),n&&t.DomHandler.focus(this.menubar)}},onItemClick:function(e){var i=e.originalEvent,n=e.processedItem,s=this.isProccessedItemGroup(n),o=t.ObjectUtils.isEmpty(n.parent);if(this.isSelected(n)){var r=n.index,c=n.key,a=n.level,u=n.parentKey;this.activeItemPath=this.activeItemPath.filter((function(e){return c!==e.key&&c.startsWith(e.key)})),this.focusedItemInfo={index:r,level:a,parentKey:u},this.dirty=!o,t.DomHandler.focus(this.menubar)}else if(s)this.onItemChange(e);else{var l=o?n:this.activeItemPath.find((function(e){return""===e.parentKey}));this.hide(i),this.changeFocusedItemIndex(i,l?l.index:-1),this.mobileActive=!1,t.DomHandler.focus(this.menubar)}},onItemMouseEnter:function(e){!this.mobileActive&&this.dirty&&this.onItemChange(e)},menuButtonClick:function(e){this.toggle(e)},menuButtonKeydown:function(e){("Enter"===e.code||"Space"===e.code)&&this.menuButtonClick(e)},onArrowDownKey:function(e){var i=this.visibleItems[this.focusedItemInfo.index];if(i?t.ObjectUtils.isEmpty(i.parent):null){this.isProccessedItemGroup(i)&&(this.onItemChange({originalEvent:e,processedItem:i}),this.focusedItemInfo={index:-1,parentKey:i.key},this.onArrowRightKey(e))}else{var n=-1!==this.focusedItemInfo.index?this.findNextItemIndex(this.focusedItemInfo.index):this.findFirstFocusedItemIndex();this.changeFocusedItemIndex(e,n),e.preventDefault()}},onArrowUpKey:function(e){var i=this,n=this.visibleItems[this.focusedItemInfo.index];if(t.ObjectUtils.isEmpty(n.parent)){if(this.isProccessedItemGroup(n)){this.onItemChange({originalEvent:e,processedItem:n}),this.focusedItemInfo={index:-1,parentKey:n.key};var s=this.findLastItemIndex();this.changeFocusedItemIndex(e,s)}}else{var o=this.activeItemPath.find((function(e){return e.key===n.parentKey}));if(0===this.focusedItemInfo.index)this.focusedItemInfo={index:-1,parentKey:o?o.parentKey:""},this.searchValue="",this.onArrowLeftKey(e),this.activeItemPath=this.activeItemPath.filter((function(e){return e.parentKey!==i.focusedItemInfo.parentKey}));else{var r=-1!==this.focusedItemInfo.index?this.findPrevItemIndex(this.focusedItemInfo.index):this.findLastFocusedItemIndex();this.changeFocusedItemIndex(e,r)}}e.preventDefault()},onArrowLeftKey:function(e){var t=this,i=this.visibleItems[this.focusedItemInfo.index],n=i?this.activeItemPath.find((function(e){return e.key===i.parentKey})):null;if(n)this.onItemChange({originalEvent:e,processedItem:n}),this.activeItemPath=this.activeItemPath.filter((function(e){return e.parentKey!==t.focusedItemInfo.parentKey})),e.preventDefault();else{var s=-1!==this.focusedItemInfo.index?this.findPrevItemIndex(this.focusedItemInfo.index):this.findLastFocusedItemIndex();this.changeFocusedItemIndex(e,s),e.preventDefault()}},onArrowRightKey:function(e){var t=this.visibleItems[this.focusedItemInfo.index];if(t?this.activeItemPath.find((function(e){return e.key===t.parentKey})):null){this.isProccessedItemGroup(t)&&(this.onItemChange({originalEvent:e,processedItem:t}),this.focusedItemInfo={index:-1,parentKey:t.key},this.onArrowDownKey(e))}else{var i=-1!==this.focusedItemInfo.index?this.findNextItemIndex(this.focusedItemInfo.index):this.findFirstFocusedItemIndex();this.changeFocusedItemIndex(e,i),e.preventDefault()}},onHomeKey:function(e){this.changeFocusedItemIndex(e,this.findFirstItemIndex()),e.preventDefault()},onEndKey:function(e){this.changeFocusedItemIndex(e,this.findLastItemIndex()),e.preventDefault()},onEnterKey:function(e){if(-1!==this.focusedItemInfo.index){var i=t.DomHandler.findSingle(this.menubar,'li[id="'.concat("".concat(this.focusedItemId),'"]')),n=i&&t.DomHandler.findSingle(i,'a[data-pc-section="action"]');n?n.click():i&&i.click(),!this.isProccessedItemGroup(this.visibleItems[this.focusedItemInfo.index])&&(this.focusedItemInfo.index=this.findFirstFocusedItemIndex())}e.preventDefault()},onSpaceKey:function(e){this.onEnterKey(e)},onEscapeKey:function(e){this.hide(e,!0),this.focusedItemInfo.index=this.findFirstFocusedItemIndex(),e.preventDefault()},onTabKey:function(e){if(-1!==this.focusedItemInfo.index){var t=this.visibleItems[this.focusedItemInfo.index];!this.isProccessedItemGroup(t)&&this.onItemChange({originalEvent:e,processedItem:t})}this.hide()},bindOutsideClickListener:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(t){var i=e.menubar&&!e.menubar.contains(t.target);(!e.mobileActive||!e.$refs.menubutton||e.$refs.menubutton!==t.target&&!e.$refs.menubutton.contains(t.target))&&i&&e.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindResizeListener:function(){var e=this;this.resizeListener||(this.resizeListener=function(i){t.DomHandler.isTouchDevice()||e.hide(i,!0),e.mobileActive=!1},window.addEventListener("resize",this.resizeListener))},unbindResizeListener:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isItemMatched:function(e){return this.isValidItem(e)&&this.getProccessedItemLabel(e).toLocaleLowerCase().startsWith(this.searchValue.toLocaleLowerCase())},isValidItem:function(e){return!!e&&!this.isItemDisabled(e.item)&&!this.isItemSeparator(e.item)},isValidSelectedItem:function(e){return this.isValidItem(e)&&this.isSelected(e)},isSelected:function(e){return this.activeItemPath.some((function(t){return t.key===e.key}))},findFirstItemIndex:function(){var e=this;return this.visibleItems.findIndex((function(t){return e.isValidItem(t)}))},findLastItemIndex:function(){var e=this;return t.ObjectUtils.findLastIndex(this.visibleItems,(function(t){return e.isValidItem(t)}))},findNextItemIndex:function(e){var t=this,i=e<this.visibleItems.length-1?this.visibleItems.slice(e+1).findIndex((function(e){return t.isValidItem(e)})):-1;return i>-1?i+e+1:e},findPrevItemIndex:function(e){var i=this,n=e>0?t.ObjectUtils.findLastIndex(this.visibleItems.slice(0,e),(function(e){return i.isValidItem(e)})):-1;return n>-1?n:e},findSelectedItemIndex:function(){var e=this;return this.visibleItems.findIndex((function(t){return e.isValidSelectedItem(t)}))},findFirstFocusedItemIndex:function(){var e=this.findSelectedItemIndex();return e<0?this.findFirstItemIndex():e},findLastFocusedItemIndex:function(){var e=this.findSelectedItemIndex();return e<0?this.findLastItemIndex():e},searchItems:function(e,t){var i=this;this.searchValue=(this.searchValue||"")+t;var n=-1,s=!1;return-1!==(n=-1!==this.focusedItemInfo.index?-1===(n=this.visibleItems.slice(this.focusedItemInfo.index).findIndex((function(e){return i.isItemMatched(e)})))?this.visibleItems.slice(0,this.focusedItemInfo.index).findIndex((function(e){return i.isItemMatched(e)})):n+this.focusedItemInfo.index:this.visibleItems.findIndex((function(e){return i.isItemMatched(e)})))&&(s=!0),-1===n&&-1===this.focusedItemInfo.index&&(n=this.findFirstFocusedItemIndex()),-1!==n&&this.changeFocusedItemIndex(e,n),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((function(){i.searchValue="",i.searchTimeout=null}),500),s},changeFocusedItemIndex:function(e,t){this.focusedItemInfo.index!==t&&(this.focusedItemInfo.index=t,this.scrollInView())},scrollInView:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,i=-1!==e?"".concat(this.id,"_").concat(e):this.focusedItemId,n=t.DomHandler.findSingle(this.menubar,'li[id="'.concat(i,'"]'));n&&n.scrollIntoView&&n.scrollIntoView({block:"nearest",inline:"start"})},createProcessedItems:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",o=[];return e&&e.forEach((function(e,r){var c=(""!==s?s+"_":"")+r,a={item:e,index:r,level:i,key:c,parent:n,parentKey:s};a.items=t.createProcessedItems(e.items,i+1,a,c),o.push(a)})),o},containerRef:function(e){this.container=e},menubarRef:function(e){this.menubar=e?e.$el:void 0}},computed:{processedItems:function(){return this.createProcessedItems(this.model||[])},visibleItems:function(){var e=this,t=this.activeItemPath.find((function(t){return t.key===e.focusedItemInfo.parentKey}));return t?t.items:this.processedItems},focusedItemId:function(){return-1!==this.focusedItemInfo.index?"".concat(this.id).concat(t.ObjectUtils.isNotEmpty(this.focusedItemInfo.parentKey)?"_"+this.focusedItemInfo.parentKey:"","_").concat(this.focusedItemInfo.index):null}},components:{MenubarSub:h,BarsIcon:u.default}};function g(e){return g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},g(e)}function x(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function P(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?x(Object(i),!0).forEach((function(t){k(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):x(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function k(e,t,i){return(t=K(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function K(e){var t=L(e,"string");return"symbol"===g(t)?t:String(t)}function L(e,t){if("object"!==g(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!==g(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var C=["aria-haspopup","aria-expanded","aria-controls","aria-label"];return y.render=function(e,t,i,n,s,o){var r,a=c.resolveComponent("BarsIcon"),u=c.resolveComponent("MenubarSub");return c.openBlock(),c.createElementBlock("div",c.mergeProps({ref:o.containerRef,class:e.cx("root")},e.ptm("root")),[e.$slots.start?(c.openBlock(),c.createElementBlock("div",c.mergeProps({key:0,class:e.cx("start")},e.ptm("start")),[c.renderSlot(e.$slots,"start")],16)):c.createCommentVNode("",!0),e.model&&e.model.length>0?(c.openBlock(),c.createElementBlock("a",c.mergeProps({key:1,ref:"menubutton",role:"button",tabindex:"0",class:e.cx("button"),"aria-haspopup":!!(e.model.length&&e.model.length>0),"aria-expanded":s.mobileActive,"aria-controls":s.id,"aria-label":null===(r=e.$primevue.config.locale.aria)||void 0===r?void 0:r.navigation,onClick:t[0]||(t[0]=function(e){return o.menuButtonClick(e)}),onKeydown:t[1]||(t[1]=function(e){return o.menuButtonKeydown(e)})},P(P({},e.buttonProps),e.ptm("button"))),[c.renderSlot(e.$slots,"popupicon",{},(function(){return[c.createVNode(a,c.normalizeProps(c.guardReactiveProps(e.ptm("popupIcon"))),null,16)]}))],16,C)):c.createCommentVNode("",!0),c.createVNode(u,{ref:o.menubarRef,id:s.id,role:"menubar",items:o.processedItems,templates:e.$slots,root:!0,mobileActive:s.mobileActive,tabindex:"0","aria-activedescendant":s.focused?o.focusedItemId:void 0,menuId:s.id,focusedItemId:s.focused?o.focusedItemId:void 0,activeItemPath:s.activeItemPath,level:0,"aria-labelledby":e.ariaLabelledby,"aria-label":e.ariaLabel,pt:e.pt,unstyled:e.unstyled,onFocus:o.onFocus,onBlur:o.onBlur,onKeydown:o.onKeyDown,onItemClick:o.onItemClick,onItemMouseenter:o.onItemMouseEnter},null,8,["id","items","templates","mobileActive","aria-activedescendant","menuId","focusedItemId","activeItemPath","aria-labelledby","aria-label","pt","unstyled","onFocus","onBlur","onKeydown","onItemClick","onItemMouseenter"]),e.$slots.end?(c.openBlock(),c.createElementBlock("div",c.mergeProps({key:2,class:e.cx("end")},e.ptm("end")),[c.renderSlot(e.$slots,"end")],16)):c.createCommentVNode("",!0)],16)},y}(primevue.icons.bars,primevue.utils,primevue.basecomponent,primevue.menubar.style,primevue.icons.angledown,primevue.icons.angleright,primevue.ripple,Vue);
|
|
1
|
+
this.primevue=this.primevue||{},this.primevue.menubar=function(e,t,i,n,s,o,r,c){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=a(e),l=a(i),m=a(n),d=a(s),I={name:"BaseMenubar",extends:l.default,props:{model:{type:Array,default:null},buttonProps:{type:null,default:null},breakpoint:{type:String,default:"960px"},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},style:m.default,provide:function(){return{$parentInstance:this}}},h={name:"MenubarSub",hostName:"Menubar",extends:l.default,emits:["item-mouseenter","item-click"],props:{items:{type:Array,default:null},root:{type:Boolean,default:!1},popup:{type:Boolean,default:!1},mobileActive:{type:Boolean,default:!1},templates:{type:Object,default:null},level:{type:Number,default:0},menuId:{type:String,default:null},focusedItemId:{type:String,default:null},activeItemPath:{type:Object,default:null}},list:null,methods:{getItemId:function(e){return"".concat(this.menuId,"_").concat(e.key)},getItemKey:function(e){return this.getItemId(e)},getItemProp:function(e,i,n){return e&&e.item?t.ObjectUtils.getItemValue(e.item[i],n):void 0},getItemLabel:function(e){return this.getItemProp(e,"label")},getPTOptions:function(e,t,i){return this.ptm(i,{context:{item:e,index:t,active:this.isItemActive(e),focused:this.isItemFocused(e),disabled:this.isItemDisabled(e),level:this.level}})},isItemActive:function(e){return this.activeItemPath.some((function(t){return t.key===e.key}))},isItemVisible:function(e){return!1!==this.getItemProp(e,"visible")},isItemDisabled:function(e){return this.getItemProp(e,"disabled")},isItemFocused:function(e){return this.focusedItemId===this.getItemId(e)},isItemGroup:function(e){return t.ObjectUtils.isNotEmpty(e.items)},onItemClick:function(e,t){this.getItemProp(t,"command",{originalEvent:e,item:t.item}),this.$emit("item-click",{originalEvent:e,processedItem:t,isFocus:!0})},onItemMouseEnter:function(e,t){this.$emit("item-mouseenter",{originalEvent:e,processedItem:t})},getAriaSetSize:function(){var e=this;return this.items.filter((function(t){return e.isItemVisible(t)&&!e.getItemProp(t,"separator")})).length},getAriaPosInset:function(e){var t=this;return e-this.items.slice(0,e).filter((function(e){return t.isItemVisible(e)&&t.getItemProp(e,"separator")})).length+1},getMenuItemProps:function(e,t){return{action:c.mergeProps({class:this.cx("action"),tabindex:-1,"aria-hidden":!0},this.getPTOptions(e,t,"action")),icon:c.mergeProps({class:[this.cx("icon"),this.getItemProp(e,"icon")]},this.getPTOptions(e,t,"icon")),label:c.mergeProps({class:this.cx("label")},this.getPTOptions(e,t,"label")),submenuicon:c.mergeProps({class:this.cx("submenuIcon")},this.getPTOptions(e,t,"submenuIcon"))}}},components:{AngleRightIcon:a(o).default,AngleDownIcon:d.default},directives:{ripple:a(r).default}},f=["id","aria-label","aria-disabled","aria-expanded","aria-haspopup","aria-level","aria-setsize","aria-posinset","data-p-highlight","data-p-focused","data-p-disabled"],p=["onClick","onMouseenter"],b=["href","target"],v=["id"];h.render=function(e,t,i,n,s,o){var r=c.resolveComponent("MenubarSub",!0),a=c.resolveDirective("ripple");return c.openBlock(),c.createElementBlock("ul",c.mergeProps({class:e.cx(0===i.level?"menu":"submenu")},e.ptm(0===i.level?"menu":"submenu")),[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(i.items,(function(n,s){return c.openBlock(),c.createElementBlock(c.Fragment,{key:o.getItemKey(n)},[o.isItemVisible(n)&&!o.getItemProp(n,"separator")?(c.openBlock(),c.createElementBlock("li",c.mergeProps({key:0,id:o.getItemId(n),style:o.getItemProp(n,"style"),class:[e.cx("menuitem",{processedItem:n}),o.getItemProp(n,"class")],role:"menuitem","aria-label":o.getItemLabel(n),"aria-disabled":o.isItemDisabled(n)||void 0,"aria-expanded":o.isItemGroup(n)?o.isItemActive(n):void 0,"aria-haspopup":o.isItemGroup(n)&&!o.getItemProp(n,"to")?"menu":void 0,"aria-level":i.level+1,"aria-setsize":o.getAriaSetSize(),"aria-posinset":o.getAriaPosInset(s)},o.getPTOptions(n,s,"menuitem"),{"data-p-highlight":o.isItemActive(n),"data-p-focused":o.isItemFocused(n),"data-p-disabled":o.isItemDisabled(n)}),[c.createElementVNode("div",c.mergeProps({class:e.cx("content"),onClick:function(e){return o.onItemClick(e,n)},onMouseenter:function(e){return o.onItemMouseEnter(e,n)}},o.getPTOptions(n,s,"content")),[i.templates.item?(c.openBlock(),c.createBlock(c.resolveDynamicComponent(i.templates.item),{key:1,item:n.item,root:i.root,hasSubmenu:o.getItemProp(n,"items"),label:o.getItemLabel(n),props:o.getMenuItemProps(n,s)},null,8,["item","root","hasSubmenu","label","props"])):c.withDirectives((c.openBlock(),c.createElementBlock("a",c.mergeProps({key:0,href:o.getItemProp(n,"url"),class:e.cx("action"),target:o.getItemProp(n,"target"),tabindex:"-1","aria-hidden":"true"},o.getPTOptions(n,s,"action")),[i.templates.itemicon?(c.openBlock(),c.createBlock(c.resolveDynamicComponent(i.templates.itemicon),{key:0,item:n.item,class:c.normalizeClass([e.cx("icon"),o.getItemProp(n,"icon")])},null,8,["item","class"])):o.getItemProp(n,"icon")?(c.openBlock(),c.createElementBlock("span",c.mergeProps({key:1,class:[e.cx("icon"),o.getItemProp(n,"icon")]},o.getPTOptions(n,s,"icon")),null,16)):c.createCommentVNode("",!0),c.createElementVNode("span",c.mergeProps({class:e.cx("label")},o.getPTOptions(n,s,"label")),c.toDisplayString(o.getItemLabel(n)),17),o.getItemProp(n,"items")?(c.openBlock(),c.createElementBlock(c.Fragment,{key:2},[i.templates.submenuicon?(c.openBlock(),c.createBlock(c.resolveDynamicComponent(i.templates.submenuicon),{key:0,root:i.root,active:o.isItemActive(n),class:c.normalizeClass(e.cx("submenuIcon"))},null,8,["root","active","class"])):(c.openBlock(),c.createBlock(c.resolveDynamicComponent(i.root?"AngleDownIcon":"AngleRightIcon"),c.mergeProps({key:1,class:e.cx("submenuIcon")},o.getPTOptions(n,s,"submenuIcon")),null,16,["class"]))],64)):c.createCommentVNode("",!0)],16,b)),[[a]])],16,p),o.isItemVisible(n)&&o.isItemGroup(n)?(c.openBlock(),c.createBlock(r,{key:0,menuId:i.menuId,role:"menu",style:c.normalizeStyle(e.sx("submenu",!0,{processedItem:n})),focusedItemId:i.focusedItemId,items:n.items,mobileActive:i.mobileActive,activeItemPath:i.activeItemPath,templates:i.templates,level:i.level+1,pt:e.pt,unstyled:e.unstyled,onItemClick:t[0]||(t[0]=function(t){return e.$emit("item-click",t)}),onItemMouseenter:t[1]||(t[1]=function(t){return e.$emit("item-mouseenter",t)})},null,8,["menuId","style","focusedItemId","items","mobileActive","activeItemPath","templates","level","pt","unstyled"])):c.createCommentVNode("",!0)],16,f)):c.createCommentVNode("",!0),o.isItemVisible(n)&&o.getItemProp(n,"separator")?(c.openBlock(),c.createElementBlock("li",c.mergeProps({key:1,id:o.getItemId(n),class:[e.cx("separator"),o.getItemProp(n,"class")],style:o.getItemProp(n,"style"),role:"separator"},e.ptm("separator")),null,16,v)):c.createCommentVNode("",!0)],64)})),128))],16)};var y={name:"Menubar",extends:I,emits:["focus","blur"],data:function(){return{id:this.$attrs.id,mobileActive:!1,focused:!1,focusedItemInfo:{index:-1,level:0,parentKey:""},activeItemPath:[],dirty:!1,queryMatches:!1}},watch:{"$attrs.id":function(e){this.id=e||t.UniqueComponentId()},activeItemPath:function(e){t.ObjectUtils.isNotEmpty(e)?(this.bindOutsideClickListener(),this.bindResizeListener()):(this.unbindOutsideClickListener(),this.unbindResizeListener())}},outsideClickListener:null,container:null,menubar:null,mounted:function(){var e=this;this.id=this.id||t.UniqueComponentId();var i=matchMedia("(max-width: ".concat(this.breakpoint,")"));this.queryMatches=i.matches,i.addEventListener("change",(function(){e.queryMatches=i.matches,e.mobileActive=!1}))},beforeUnmount:function(){this.mobileActive=!1,this.unbindOutsideClickListener(),this.unbindResizeListener(),this.container&&t.ZIndexUtils.clear(this.container),this.container=null},methods:{getItemProp:function(e,i){return e?t.ObjectUtils.getItemValue(e[i]):void 0},getItemLabel:function(e){return this.getItemProp(e,"label")},isItemDisabled:function(e){return this.getItemProp(e,"disabled")},isItemGroup:function(e){return t.ObjectUtils.isNotEmpty(this.getItemProp(e,"items"))},isItemSeparator:function(e){return this.getItemProp(e,"separator")},getProccessedItemLabel:function(e){return e?this.getItemLabel(e.item):void 0},isProccessedItemGroup:function(e){return e&&t.ObjectUtils.isNotEmpty(e.items)},toggle:function(e){var i=this;this.mobileActive?(this.mobileActive=!1,t.ZIndexUtils.clear(this.menubar),this.hide()):(this.mobileActive=!0,t.ZIndexUtils.set("menu",this.menubar,this.$primevue.config.zIndex.menu),setTimeout((function(){i.show()}),1)),this.bindOutsideClickListener(),e.preventDefault()},show:function(){this.focusedItemInfo={index:this.findFirstFocusedItemIndex(),level:0,parentKey:""},t.DomHandler.focus(this.menubar)},hide:function(e,i){var n=this;this.mobileActive&&(this.mobileActive=!1,setTimeout((function(){t.DomHandler.focus(n.$refs.menubutton)}),0)),this.activeItemPath=[],this.focusedItemInfo={index:-1,level:0,parentKey:""},i&&t.DomHandler.focus(this.menubar),this.dirty=!1},onFocus:function(e){this.focused=!0,this.focusedItemInfo=-1!==this.focusedItemInfo.index?this.focusedItemInfo:{index:this.findFirstFocusedItemIndex(),level:0,parentKey:""},this.$emit("focus",e)},onBlur:function(e){this.focused=!1,this.focusedItemInfo={index:-1,level:0,parentKey:""},this.searchValue="",this.dirty=!1,this.$emit("blur",e)},onKeyDown:function(e){var i=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"ArrowLeft":this.onArrowLeftKey(e);break;case"ArrowRight":this.onArrowRightKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"Space":this.onSpaceKey(e);break;case"Enter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"PageDown":case"PageUp":case"Backspace":case"ShiftLeft":case"ShiftRight":break;default:!i&&t.ObjectUtils.isPrintableCharacter(e.key)&&this.searchItems(e,e.key)}},onItemChange:function(e){var i=e.processedItem,n=e.isFocus;if(!t.ObjectUtils.isEmpty(i)){var s=i.index,o=i.key,r=i.level,c=i.parentKey,a=t.ObjectUtils.isNotEmpty(i.items),u=this.activeItemPath.filter((function(e){return e.parentKey!==c&&e.parentKey!==o}));a&&u.push(i),this.focusedItemInfo={index:s,level:r,parentKey:c},this.activeItemPath=u,a&&(this.dirty=!0),n&&t.DomHandler.focus(this.menubar)}},onItemClick:function(e){var i=e.originalEvent,n=e.processedItem,s=this.isProccessedItemGroup(n),o=t.ObjectUtils.isEmpty(n.parent);if(this.isSelected(n)){var r=n.index,c=n.key,a=n.level,u=n.parentKey;this.activeItemPath=this.activeItemPath.filter((function(e){return c!==e.key&&c.startsWith(e.key)})),this.focusedItemInfo={index:r,level:a,parentKey:u},this.dirty=!o,t.DomHandler.focus(this.menubar)}else if(s)this.onItemChange(e);else{var l=o?n:this.activeItemPath.find((function(e){return""===e.parentKey}));this.hide(i),this.changeFocusedItemIndex(i,l?l.index:-1),this.mobileActive=!1,t.DomHandler.focus(this.menubar)}},onItemMouseEnter:function(e){!this.mobileActive&&this.dirty&&this.onItemChange(e)},menuButtonClick:function(e){this.toggle(e)},menuButtonKeydown:function(e){("Enter"===e.code||"Space"===e.code)&&this.menuButtonClick(e)},onArrowDownKey:function(e){var i=this.visibleItems[this.focusedItemInfo.index];if(i?t.ObjectUtils.isEmpty(i.parent):null){this.isProccessedItemGroup(i)&&(this.onItemChange({originalEvent:e,processedItem:i}),this.focusedItemInfo={index:-1,parentKey:i.key},this.onArrowRightKey(e))}else{var n=-1!==this.focusedItemInfo.index?this.findNextItemIndex(this.focusedItemInfo.index):this.findFirstFocusedItemIndex();this.changeFocusedItemIndex(e,n),e.preventDefault()}},onArrowUpKey:function(e){var i=this,n=this.visibleItems[this.focusedItemInfo.index];if(t.ObjectUtils.isEmpty(n.parent)){if(this.isProccessedItemGroup(n)){this.onItemChange({originalEvent:e,processedItem:n}),this.focusedItemInfo={index:-1,parentKey:n.key};var s=this.findLastItemIndex();this.changeFocusedItemIndex(e,s)}}else{var o=this.activeItemPath.find((function(e){return e.key===n.parentKey}));if(0===this.focusedItemInfo.index)this.focusedItemInfo={index:-1,parentKey:o?o.parentKey:""},this.searchValue="",this.onArrowLeftKey(e),this.activeItemPath=this.activeItemPath.filter((function(e){return e.parentKey!==i.focusedItemInfo.parentKey}));else{var r=-1!==this.focusedItemInfo.index?this.findPrevItemIndex(this.focusedItemInfo.index):this.findLastFocusedItemIndex();this.changeFocusedItemIndex(e,r)}}e.preventDefault()},onArrowLeftKey:function(e){var t=this,i=this.visibleItems[this.focusedItemInfo.index],n=i?this.activeItemPath.find((function(e){return e.key===i.parentKey})):null;if(n)this.onItemChange({originalEvent:e,processedItem:n}),this.activeItemPath=this.activeItemPath.filter((function(e){return e.parentKey!==t.focusedItemInfo.parentKey})),e.preventDefault();else{var s=-1!==this.focusedItemInfo.index?this.findPrevItemIndex(this.focusedItemInfo.index):this.findLastFocusedItemIndex();this.changeFocusedItemIndex(e,s),e.preventDefault()}},onArrowRightKey:function(e){var t=this.visibleItems[this.focusedItemInfo.index];if(t?this.activeItemPath.find((function(e){return e.key===t.parentKey})):null){this.isProccessedItemGroup(t)&&(this.onItemChange({originalEvent:e,processedItem:t}),this.focusedItemInfo={index:-1,parentKey:t.key},this.onArrowDownKey(e))}else{var i=-1!==this.focusedItemInfo.index?this.findNextItemIndex(this.focusedItemInfo.index):this.findFirstFocusedItemIndex();this.changeFocusedItemIndex(e,i),e.preventDefault()}},onHomeKey:function(e){this.changeFocusedItemIndex(e,this.findFirstItemIndex()),e.preventDefault()},onEndKey:function(e){this.changeFocusedItemIndex(e,this.findLastItemIndex()),e.preventDefault()},onEnterKey:function(e){if(-1!==this.focusedItemInfo.index){var i=t.DomHandler.findSingle(this.menubar,'li[id="'.concat("".concat(this.focusedItemId),'"]')),n=i&&t.DomHandler.findSingle(i,'a[data-pc-section="action"]');n?n.click():i&&i.click(),!this.isProccessedItemGroup(this.visibleItems[this.focusedItemInfo.index])&&(this.focusedItemInfo.index=this.findFirstFocusedItemIndex())}e.preventDefault()},onSpaceKey:function(e){this.onEnterKey(e)},onEscapeKey:function(e){this.hide(e,!0),this.focusedItemInfo.index=this.findFirstFocusedItemIndex(),e.preventDefault()},onTabKey:function(e){if(-1!==this.focusedItemInfo.index){var t=this.visibleItems[this.focusedItemInfo.index];!this.isProccessedItemGroup(t)&&this.onItemChange({originalEvent:e,processedItem:t})}this.hide()},bindOutsideClickListener:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(t){var i=e.menubar&&!e.menubar.contains(t.target);(!e.mobileActive||!e.$refs.menubutton||e.$refs.menubutton!==t.target&&!e.$refs.menubutton.contains(t.target))&&i&&e.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindResizeListener:function(){var e=this;this.resizeListener||(this.resizeListener=function(i){t.DomHandler.isTouchDevice()||e.hide(i,!0),e.mobileActive=!1},window.addEventListener("resize",this.resizeListener))},unbindResizeListener:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isItemMatched:function(e){return this.isValidItem(e)&&this.getProccessedItemLabel(e).toLocaleLowerCase().startsWith(this.searchValue.toLocaleLowerCase())},isValidItem:function(e){return!!e&&!this.isItemDisabled(e.item)&&!this.isItemSeparator(e.item)},isValidSelectedItem:function(e){return this.isValidItem(e)&&this.isSelected(e)},isSelected:function(e){return this.activeItemPath.some((function(t){return t.key===e.key}))},findFirstItemIndex:function(){var e=this;return this.visibleItems.findIndex((function(t){return e.isValidItem(t)}))},findLastItemIndex:function(){var e=this;return t.ObjectUtils.findLastIndex(this.visibleItems,(function(t){return e.isValidItem(t)}))},findNextItemIndex:function(e){var t=this,i=e<this.visibleItems.length-1?this.visibleItems.slice(e+1).findIndex((function(e){return t.isValidItem(e)})):-1;return i>-1?i+e+1:e},findPrevItemIndex:function(e){var i=this,n=e>0?t.ObjectUtils.findLastIndex(this.visibleItems.slice(0,e),(function(e){return i.isValidItem(e)})):-1;return n>-1?n:e},findSelectedItemIndex:function(){var e=this;return this.visibleItems.findIndex((function(t){return e.isValidSelectedItem(t)}))},findFirstFocusedItemIndex:function(){var e=this.findSelectedItemIndex();return e<0?this.findFirstItemIndex():e},findLastFocusedItemIndex:function(){var e=this.findSelectedItemIndex();return e<0?this.findLastItemIndex():e},searchItems:function(e,t){var i=this;this.searchValue=(this.searchValue||"")+t;var n=-1,s=!1;return-1!==(n=-1!==this.focusedItemInfo.index?-1===(n=this.visibleItems.slice(this.focusedItemInfo.index).findIndex((function(e){return i.isItemMatched(e)})))?this.visibleItems.slice(0,this.focusedItemInfo.index).findIndex((function(e){return i.isItemMatched(e)})):n+this.focusedItemInfo.index:this.visibleItems.findIndex((function(e){return i.isItemMatched(e)})))&&(s=!0),-1===n&&-1===this.focusedItemInfo.index&&(n=this.findFirstFocusedItemIndex()),-1!==n&&this.changeFocusedItemIndex(e,n),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((function(){i.searchValue="",i.searchTimeout=null}),500),s},changeFocusedItemIndex:function(e,t){this.focusedItemInfo.index!==t&&(this.focusedItemInfo.index=t,this.scrollInView())},scrollInView:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,i=-1!==e?"".concat(this.id,"_").concat(e):this.focusedItemId,n=t.DomHandler.findSingle(this.menubar,'li[id="'.concat(i,'"]'));n&&n.scrollIntoView&&n.scrollIntoView({block:"nearest",inline:"start"})},createProcessedItems:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",o=[];return e&&e.forEach((function(e,r){var c=(""!==s?s+"_":"")+r,a={item:e,index:r,level:i,key:c,parent:n,parentKey:s};a.items=t.createProcessedItems(e.items,i+1,a,c),o.push(a)})),o},containerRef:function(e){this.container=e},menubarRef:function(e){this.menubar=e?e.$el:void 0}},computed:{processedItems:function(){return this.createProcessedItems(this.model||[])},visibleItems:function(){var e=this,t=this.activeItemPath.find((function(t){return t.key===e.focusedItemInfo.parentKey}));return t?t.items:this.processedItems},focusedItemId:function(){return-1!==this.focusedItemInfo.index?"".concat(this.id).concat(t.ObjectUtils.isNotEmpty(this.focusedItemInfo.parentKey)?"_"+this.focusedItemInfo.parentKey:"","_").concat(this.focusedItemInfo.index):null}},components:{MenubarSub:h,BarsIcon:u.default}};function g(e){return g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},g(e)}function x(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function k(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?x(Object(i),!0).forEach((function(t){P(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):x(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function P(e,t,i){return(t=K(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function K(e){var t=L(e,"string");return"symbol"===g(t)?t:String(t)}function L(e,t){if("object"!==g(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!==g(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var E=["aria-haspopup","aria-expanded","aria-controls","aria-label"];return y.render=function(e,t,i,n,s,o){var r,a=c.resolveComponent("BarsIcon"),u=c.resolveComponent("MenubarSub");return c.openBlock(),c.createElementBlock("div",c.mergeProps({ref:o.containerRef,class:e.cx("root")},e.ptm("root")),[e.$slots.start?(c.openBlock(),c.createElementBlock("div",c.mergeProps({key:0,class:e.cx("start")},e.ptm("start")),[c.renderSlot(e.$slots,"start")],16)):c.createCommentVNode("",!0),e.model&&e.model.length>0?(c.openBlock(),c.createElementBlock("a",c.mergeProps({key:1,ref:"menubutton",role:"button",tabindex:"0",class:e.cx("button"),"aria-haspopup":!!(e.model.length&&e.model.length>0),"aria-expanded":s.mobileActive,"aria-controls":s.id,"aria-label":null===(r=e.$primevue.config.locale.aria)||void 0===r?void 0:r.navigation,onClick:t[0]||(t[0]=function(e){return o.menuButtonClick(e)}),onKeydown:t[1]||(t[1]=function(e){return o.menuButtonKeydown(e)})},k(k({},e.buttonProps),e.ptm("button"))),[c.renderSlot(e.$slots,"popupicon",{},(function(){return[c.createVNode(a,c.normalizeProps(c.guardReactiveProps(e.ptm("popupIcon"))),null,16)]}))],16,E)):c.createCommentVNode("",!0),c.createVNode(u,{ref:o.menubarRef,id:s.id,role:"menubar",items:o.processedItems,templates:e.$slots,root:!0,mobileActive:s.mobileActive,tabindex:"0","aria-activedescendant":s.focused?o.focusedItemId:void 0,menuId:s.id,focusedItemId:s.focused?o.focusedItemId:void 0,activeItemPath:s.activeItemPath,level:0,"aria-labelledby":e.ariaLabelledby,"aria-label":e.ariaLabel,pt:e.pt,unstyled:e.unstyled,onFocus:o.onFocus,onBlur:o.onBlur,onKeydown:o.onKeyDown,onItemClick:o.onItemClick,onItemMouseenter:o.onItemMouseEnter},null,8,["id","items","templates","mobileActive","aria-activedescendant","menuId","focusedItemId","activeItemPath","aria-labelledby","aria-label","pt","unstyled","onFocus","onBlur","onKeydown","onItemClick","onItemMouseenter"]),e.$slots.end?(c.openBlock(),c.createElementBlock("div",c.mergeProps({key:2,class:e.cx("end")},e.ptm("end")),[c.renderSlot(e.$slots,"end")],16)):c.createCommentVNode("",!0)],16)},y}(primevue.icons.bars,primevue.utils,primevue.basecomponent,primevue.menubar.style,primevue.icons.angledown,primevue.icons.angleright,primevue.ripple,Vue);
|
|
@@ -6,7 +6,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
6
6
|
|
|
7
7
|
var BaseStyle__default = /*#__PURE__*/_interopDefaultLegacy(BaseStyle);
|
|
8
8
|
|
|
9
|
-
var css = "\n@layer primevue {\n .p-menubar {\n display: flex;\n align-items: center;\n }\n\n .p-menubar ul {\n margin: 0;\n padding: 0;\n list-style: none;\n }\n\n .p-menubar .p-menuitem-link {\n cursor: pointer;\n display: flex;\n align-items: center;\n text-decoration: none;\n overflow: hidden;\n position: relative;\n }\n\n .p-menubar .p-menuitem-text {\n line-height: 1;\n }\n\n .p-menubar .p-menuitem {\n position: relative;\n }\n\n .p-menubar-root-list {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n }\n\n .p-menubar-root-list > li ul {\n display: none;\n z-index: 1;\n }\n\n .p-menubar-root-list > .p-menuitem-active > .p-submenu-list {\n display: block;\n }\n\n .p-menubar .p-submenu-list {\n display: none;\n position: absolute;\n z-index: 1;\n }\n\n .p-menubar .p-submenu-list > .p-menuitem-active > .p-submenu-list {\n display: block;\n left: 100%;\n top: 0;\n }\n\n .p-menubar .p-submenu-list .p-menuitem .p-menuitem-content .p-menuitem-link .p-submenu-icon {\n margin-left: auto;\n }\n\n .p-menubar .p-menubar-end {\n margin-left: auto;\n align-self: center;\n }\n\n .p-menubar-button {\n display: none;\n cursor: pointer;\n align-items: center;\n justify-content: center;\n text-decoration: none;\n }\n}\n";
|
|
9
|
+
var css = "\n@layer primevue {\n .p-menubar {\n display: flex;\n align-items: center;\n }\n\n .p-menubar ul {\n margin: 0;\n padding: 0;\n list-style: none;\n }\n\n .p-menubar .p-menuitem-link {\n cursor: pointer;\n display: flex;\n align-items: center;\n text-decoration: none;\n overflow: hidden;\n position: relative;\n }\n\n .p-menubar .p-menuitem-text {\n line-height: 1;\n }\n\n .p-menubar .p-menuitem {\n position: relative;\n }\n\n .p-menubar-root-list {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n }\n\n .p-menubar-root-list > li ul {\n display: none;\n z-index: 1;\n }\n\n .p-menubar-root-list > .p-menuitem-active > .p-submenu-list {\n display: block;\n }\n\n .p-menubar .p-submenu-list {\n display: none;\n position: absolute;\n z-index: 1;\n }\n\n .p-menubar .p-submenu-list > .p-menuitem-active > .p-submenu-list {\n display: block;\n left: 100%;\n top: 0;\n }\n\n .p-menubar .p-submenu-list .p-menuitem .p-menuitem-content .p-menuitem-link .p-submenu-icon {\n margin-left: auto;\n }\n\n .p-menubar .p-menubar-end {\n margin-left: auto;\n align-self: center;\n }\n\n .p-menubar-button {\n display: none;\n cursor: pointer;\n align-items: center;\n justify-content: center;\n text-decoration: none;\n }\n\n .p-menubar.p-menubar-mobile {\n position: relative; \n }\n\n .p-menubar.p-menubar-mobile .p-menubar-button {\n display: flex;\n }\n\n .p-menubar.p-menubar-mobile .p-menubar-root-list {\n position: absolute;\n display: none;\n width: 100%;\n }\n\n .p-menubar.p-menubar-mobile .p-submenu-list {\n width: 100%;\n position: static;\n box-shadow: none;\n border: 0 none;\n }\n\n .p-menubar.p-menubar-mobile .p-menubar-root-list .p-menuitem {\n width: 100%;\n position: static;\n }\n\n .p-menubar.p-menubar-mobile-active .p-menubar-root-list {\n display: flex;\n flex-direction: column;\n top: 100%;\n left: 0;\n z-index: 1;\n }\n}\n";
|
|
10
10
|
var inlineStyles = {
|
|
11
11
|
submenu: function submenu(_ref) {
|
|
12
12
|
var instance = _ref.instance,
|
|
@@ -20,6 +20,7 @@ var classes = {
|
|
|
20
20
|
root: function root(_ref2) {
|
|
21
21
|
var instance = _ref2.instance;
|
|
22
22
|
return ['p-menubar p-component', {
|
|
23
|
+
'p-menubar-mobile': instance.queryMatches,
|
|
23
24
|
'p-menubar-mobile-active': instance.mobileActive
|
|
24
25
|
}];
|
|
25
26
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function n(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var e=n(require("primevue/base/style")).default.extend({name:"menubar",css:"\n@layer primevue {\n .p-menubar {\n display: flex;\n align-items: center;\n }\n\n .p-menubar ul {\n margin: 0;\n padding: 0;\n list-style: none;\n }\n\n .p-menubar .p-menuitem-link {\n cursor: pointer;\n display: flex;\n align-items: center;\n text-decoration: none;\n overflow: hidden;\n position: relative;\n }\n\n .p-menubar .p-menuitem-text {\n line-height: 1;\n }\n\n .p-menubar .p-menuitem {\n position: relative;\n }\n\n .p-menubar-root-list {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n }\n\n .p-menubar-root-list > li ul {\n display: none;\n z-index: 1;\n }\n\n .p-menubar-root-list > .p-menuitem-active > .p-submenu-list {\n display: block;\n }\n\n .p-menubar .p-submenu-list {\n display: none;\n position: absolute;\n z-index: 1;\n }\n\n .p-menubar .p-submenu-list > .p-menuitem-active > .p-submenu-list {\n display: block;\n left: 100%;\n top: 0;\n }\n\n .p-menubar .p-submenu-list .p-menuitem .p-menuitem-content .p-menuitem-link .p-submenu-icon {\n margin-left: auto;\n }\n\n .p-menubar .p-menubar-end {\n margin-left: auto;\n align-self: center;\n }\n\n .p-menubar-button {\n display: none;\n cursor: pointer;\n align-items: center;\n justify-content: center;\n text-decoration: none;\n }\n}\n",classes:{root:function(n){return["p-menubar p-component",{"p-menubar-mobile-active":
|
|
1
|
+
"use strict";function n(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var e=n(require("primevue/base/style")).default.extend({name:"menubar",css:"\n@layer primevue {\n .p-menubar {\n display: flex;\n align-items: center;\n }\n\n .p-menubar ul {\n margin: 0;\n padding: 0;\n list-style: none;\n }\n\n .p-menubar .p-menuitem-link {\n cursor: pointer;\n display: flex;\n align-items: center;\n text-decoration: none;\n overflow: hidden;\n position: relative;\n }\n\n .p-menubar .p-menuitem-text {\n line-height: 1;\n }\n\n .p-menubar .p-menuitem {\n position: relative;\n }\n\n .p-menubar-root-list {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n }\n\n .p-menubar-root-list > li ul {\n display: none;\n z-index: 1;\n }\n\n .p-menubar-root-list > .p-menuitem-active > .p-submenu-list {\n display: block;\n }\n\n .p-menubar .p-submenu-list {\n display: none;\n position: absolute;\n z-index: 1;\n }\n\n .p-menubar .p-submenu-list > .p-menuitem-active > .p-submenu-list {\n display: block;\n left: 100%;\n top: 0;\n }\n\n .p-menubar .p-submenu-list .p-menuitem .p-menuitem-content .p-menuitem-link .p-submenu-icon {\n margin-left: auto;\n }\n\n .p-menubar .p-menubar-end {\n margin-left: auto;\n align-self: center;\n }\n\n .p-menubar-button {\n display: none;\n cursor: pointer;\n align-items: center;\n justify-content: center;\n text-decoration: none;\n }\n\n .p-menubar.p-menubar-mobile {\n position: relative; \n }\n\n .p-menubar.p-menubar-mobile .p-menubar-button {\n display: flex;\n }\n\n .p-menubar.p-menubar-mobile .p-menubar-root-list {\n position: absolute;\n display: none;\n width: 100%;\n }\n\n .p-menubar.p-menubar-mobile .p-submenu-list {\n width: 100%;\n position: static;\n box-shadow: none;\n border: 0 none;\n }\n\n .p-menubar.p-menubar-mobile .p-menubar-root-list .p-menuitem {\n width: 100%;\n position: static;\n }\n\n .p-menubar.p-menubar-mobile-active .p-menubar-root-list {\n display: flex;\n flex-direction: column;\n top: 100%;\n left: 0;\n z-index: 1;\n }\n}\n",classes:{root:function(n){var e=n.instance;return["p-menubar p-component",{"p-menubar-mobile":e.queryMatches,"p-menubar-mobile-active":e.mobileActive}]},start:"p-menubar-start",button:"p-menubar-button",menu:"p-menubar-root-list",menuitem:function(n){var e=n.instance,t=n.processedItem;return["p-menuitem",{"p-menuitem-active p-highlight":e.isItemActive(t),"p-focus":e.isItemFocused(t),"p-disabled":e.isItemDisabled(t)}]},content:"p-menuitem-content",action:"p-menuitem-link",icon:"p-menuitem-icon",label:"p-menuitem-text",submenuIcon:"p-submenu-icon",submenu:"p-submenu-list",separator:"p-menuitem-separator",end:"p-menubar-end"},inlineStyles:{submenu:function(n){return{display:n.instance.isItemActive(n.processedItem)?"block":"none"}}}});module.exports=e;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import BaseStyle from 'primevue/base/style';
|
|
2
2
|
|
|
3
|
-
var css = "\n@layer primevue {\n .p-menubar {\n display: flex;\n align-items: center;\n }\n\n .p-menubar ul {\n margin: 0;\n padding: 0;\n list-style: none;\n }\n\n .p-menubar .p-menuitem-link {\n cursor: pointer;\n display: flex;\n align-items: center;\n text-decoration: none;\n overflow: hidden;\n position: relative;\n }\n\n .p-menubar .p-menuitem-text {\n line-height: 1;\n }\n\n .p-menubar .p-menuitem {\n position: relative;\n }\n\n .p-menubar-root-list {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n }\n\n .p-menubar-root-list > li ul {\n display: none;\n z-index: 1;\n }\n\n .p-menubar-root-list > .p-menuitem-active > .p-submenu-list {\n display: block;\n }\n\n .p-menubar .p-submenu-list {\n display: none;\n position: absolute;\n z-index: 1;\n }\n\n .p-menubar .p-submenu-list > .p-menuitem-active > .p-submenu-list {\n display: block;\n left: 100%;\n top: 0;\n }\n\n .p-menubar .p-submenu-list .p-menuitem .p-menuitem-content .p-menuitem-link .p-submenu-icon {\n margin-left: auto;\n }\n\n .p-menubar .p-menubar-end {\n margin-left: auto;\n align-self: center;\n }\n\n .p-menubar-button {\n display: none;\n cursor: pointer;\n align-items: center;\n justify-content: center;\n text-decoration: none;\n }\n}\n";
|
|
3
|
+
var css = "\n@layer primevue {\n .p-menubar {\n display: flex;\n align-items: center;\n }\n\n .p-menubar ul {\n margin: 0;\n padding: 0;\n list-style: none;\n }\n\n .p-menubar .p-menuitem-link {\n cursor: pointer;\n display: flex;\n align-items: center;\n text-decoration: none;\n overflow: hidden;\n position: relative;\n }\n\n .p-menubar .p-menuitem-text {\n line-height: 1;\n }\n\n .p-menubar .p-menuitem {\n position: relative;\n }\n\n .p-menubar-root-list {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n }\n\n .p-menubar-root-list > li ul {\n display: none;\n z-index: 1;\n }\n\n .p-menubar-root-list > .p-menuitem-active > .p-submenu-list {\n display: block;\n }\n\n .p-menubar .p-submenu-list {\n display: none;\n position: absolute;\n z-index: 1;\n }\n\n .p-menubar .p-submenu-list > .p-menuitem-active > .p-submenu-list {\n display: block;\n left: 100%;\n top: 0;\n }\n\n .p-menubar .p-submenu-list .p-menuitem .p-menuitem-content .p-menuitem-link .p-submenu-icon {\n margin-left: auto;\n }\n\n .p-menubar .p-menubar-end {\n margin-left: auto;\n align-self: center;\n }\n\n .p-menubar-button {\n display: none;\n cursor: pointer;\n align-items: center;\n justify-content: center;\n text-decoration: none;\n }\n\n .p-menubar.p-menubar-mobile {\n position: relative; \n }\n\n .p-menubar.p-menubar-mobile .p-menubar-button {\n display: flex;\n }\n\n .p-menubar.p-menubar-mobile .p-menubar-root-list {\n position: absolute;\n display: none;\n width: 100%;\n }\n\n .p-menubar.p-menubar-mobile .p-submenu-list {\n width: 100%;\n position: static;\n box-shadow: none;\n border: 0 none;\n }\n\n .p-menubar.p-menubar-mobile .p-menubar-root-list .p-menuitem {\n width: 100%;\n position: static;\n }\n\n .p-menubar.p-menubar-mobile-active .p-menubar-root-list {\n display: flex;\n flex-direction: column;\n top: 100%;\n left: 0;\n z-index: 1;\n }\n}\n";
|
|
4
4
|
var inlineStyles = {
|
|
5
5
|
submenu: function submenu(_ref) {
|
|
6
6
|
var instance = _ref.instance,
|
|
@@ -14,6 +14,7 @@ var classes = {
|
|
|
14
14
|
root: function root(_ref2) {
|
|
15
15
|
var instance = _ref2.instance;
|
|
16
16
|
return ['p-menubar p-component', {
|
|
17
|
+
'p-menubar-mobile': instance.queryMatches,
|
|
17
18
|
'p-menubar-mobile-active': instance.mobileActive
|
|
18
19
|
}];
|
|
19
20
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import n from"primevue/base/style";var e=n.extend({name:"menubar",css:"\n@layer primevue {\n .p-menubar {\n display: flex;\n align-items: center;\n }\n\n .p-menubar ul {\n margin: 0;\n padding: 0;\n list-style: none;\n }\n\n .p-menubar .p-menuitem-link {\n cursor: pointer;\n display: flex;\n align-items: center;\n text-decoration: none;\n overflow: hidden;\n position: relative;\n }\n\n .p-menubar .p-menuitem-text {\n line-height: 1;\n }\n\n .p-menubar .p-menuitem {\n position: relative;\n }\n\n .p-menubar-root-list {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n }\n\n .p-menubar-root-list > li ul {\n display: none;\n z-index: 1;\n }\n\n .p-menubar-root-list > .p-menuitem-active > .p-submenu-list {\n display: block;\n }\n\n .p-menubar .p-submenu-list {\n display: none;\n position: absolute;\n z-index: 1;\n }\n\n .p-menubar .p-submenu-list > .p-menuitem-active > .p-submenu-list {\n display: block;\n left: 100%;\n top: 0;\n }\n\n .p-menubar .p-submenu-list .p-menuitem .p-menuitem-content .p-menuitem-link .p-submenu-icon {\n margin-left: auto;\n }\n\n .p-menubar .p-menubar-end {\n margin-left: auto;\n align-self: center;\n }\n\n .p-menubar-button {\n display: none;\n cursor: pointer;\n align-items: center;\n justify-content: center;\n text-decoration: none;\n }\n}\n",classes:{root:function(n){return["p-menubar p-component",{"p-menubar-mobile-active":
|
|
1
|
+
import n from"primevue/base/style";var e=n.extend({name:"menubar",css:"\n@layer primevue {\n .p-menubar {\n display: flex;\n align-items: center;\n }\n\n .p-menubar ul {\n margin: 0;\n padding: 0;\n list-style: none;\n }\n\n .p-menubar .p-menuitem-link {\n cursor: pointer;\n display: flex;\n align-items: center;\n text-decoration: none;\n overflow: hidden;\n position: relative;\n }\n\n .p-menubar .p-menuitem-text {\n line-height: 1;\n }\n\n .p-menubar .p-menuitem {\n position: relative;\n }\n\n .p-menubar-root-list {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n }\n\n .p-menubar-root-list > li ul {\n display: none;\n z-index: 1;\n }\n\n .p-menubar-root-list > .p-menuitem-active > .p-submenu-list {\n display: block;\n }\n\n .p-menubar .p-submenu-list {\n display: none;\n position: absolute;\n z-index: 1;\n }\n\n .p-menubar .p-submenu-list > .p-menuitem-active > .p-submenu-list {\n display: block;\n left: 100%;\n top: 0;\n }\n\n .p-menubar .p-submenu-list .p-menuitem .p-menuitem-content .p-menuitem-link .p-submenu-icon {\n margin-left: auto;\n }\n\n .p-menubar .p-menubar-end {\n margin-left: auto;\n align-self: center;\n }\n\n .p-menubar-button {\n display: none;\n cursor: pointer;\n align-items: center;\n justify-content: center;\n text-decoration: none;\n }\n\n .p-menubar.p-menubar-mobile {\n position: relative; \n }\n\n .p-menubar.p-menubar-mobile .p-menubar-button {\n display: flex;\n }\n\n .p-menubar.p-menubar-mobile .p-menubar-root-list {\n position: absolute;\n display: none;\n width: 100%;\n }\n\n .p-menubar.p-menubar-mobile .p-submenu-list {\n width: 100%;\n position: static;\n box-shadow: none;\n border: 0 none;\n }\n\n .p-menubar.p-menubar-mobile .p-menubar-root-list .p-menuitem {\n width: 100%;\n position: static;\n }\n\n .p-menubar.p-menubar-mobile-active .p-menubar-root-list {\n display: flex;\n flex-direction: column;\n top: 100%;\n left: 0;\n z-index: 1;\n }\n}\n",classes:{root:function(n){var e=n.instance;return["p-menubar p-component",{"p-menubar-mobile":e.queryMatches,"p-menubar-mobile-active":e.mobileActive}]},start:"p-menubar-start",button:"p-menubar-button",menu:"p-menubar-root-list",menuitem:function(n){var e=n.instance,t=n.processedItem;return["p-menuitem",{"p-menuitem-active p-highlight":e.isItemActive(t),"p-focus":e.isItemFocused(t),"p-disabled":e.isItemDisabled(t)}]},content:"p-menuitem-content",action:"p-menuitem-link",icon:"p-menuitem-icon",label:"p-menuitem-text",submenuIcon:"p-submenu-icon",submenu:"p-submenu-list",separator:"p-menuitem-separator",end:"p-menubar-end"},inlineStyles:{submenu:function(n){return{display:n.instance.isItemActive(n.processedItem)?"block":"none"}}}});export{e as default};
|
|
@@ -7,7 +7,7 @@ this.primevue.menubar.style = (function (BaseStyle) {
|
|
|
7
7
|
|
|
8
8
|
var BaseStyle__default = /*#__PURE__*/_interopDefaultLegacy(BaseStyle);
|
|
9
9
|
|
|
10
|
-
var css = "\n@layer primevue {\n .p-menubar {\n display: flex;\n align-items: center;\n }\n\n .p-menubar ul {\n margin: 0;\n padding: 0;\n list-style: none;\n }\n\n .p-menubar .p-menuitem-link {\n cursor: pointer;\n display: flex;\n align-items: center;\n text-decoration: none;\n overflow: hidden;\n position: relative;\n }\n\n .p-menubar .p-menuitem-text {\n line-height: 1;\n }\n\n .p-menubar .p-menuitem {\n position: relative;\n }\n\n .p-menubar-root-list {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n }\n\n .p-menubar-root-list > li ul {\n display: none;\n z-index: 1;\n }\n\n .p-menubar-root-list > .p-menuitem-active > .p-submenu-list {\n display: block;\n }\n\n .p-menubar .p-submenu-list {\n display: none;\n position: absolute;\n z-index: 1;\n }\n\n .p-menubar .p-submenu-list > .p-menuitem-active > .p-submenu-list {\n display: block;\n left: 100%;\n top: 0;\n }\n\n .p-menubar .p-submenu-list .p-menuitem .p-menuitem-content .p-menuitem-link .p-submenu-icon {\n margin-left: auto;\n }\n\n .p-menubar .p-menubar-end {\n margin-left: auto;\n align-self: center;\n }\n\n .p-menubar-button {\n display: none;\n cursor: pointer;\n align-items: center;\n justify-content: center;\n text-decoration: none;\n }\n}\n";
|
|
10
|
+
var css = "\n@layer primevue {\n .p-menubar {\n display: flex;\n align-items: center;\n }\n\n .p-menubar ul {\n margin: 0;\n padding: 0;\n list-style: none;\n }\n\n .p-menubar .p-menuitem-link {\n cursor: pointer;\n display: flex;\n align-items: center;\n text-decoration: none;\n overflow: hidden;\n position: relative;\n }\n\n .p-menubar .p-menuitem-text {\n line-height: 1;\n }\n\n .p-menubar .p-menuitem {\n position: relative;\n }\n\n .p-menubar-root-list {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n }\n\n .p-menubar-root-list > li ul {\n display: none;\n z-index: 1;\n }\n\n .p-menubar-root-list > .p-menuitem-active > .p-submenu-list {\n display: block;\n }\n\n .p-menubar .p-submenu-list {\n display: none;\n position: absolute;\n z-index: 1;\n }\n\n .p-menubar .p-submenu-list > .p-menuitem-active > .p-submenu-list {\n display: block;\n left: 100%;\n top: 0;\n }\n\n .p-menubar .p-submenu-list .p-menuitem .p-menuitem-content .p-menuitem-link .p-submenu-icon {\n margin-left: auto;\n }\n\n .p-menubar .p-menubar-end {\n margin-left: auto;\n align-self: center;\n }\n\n .p-menubar-button {\n display: none;\n cursor: pointer;\n align-items: center;\n justify-content: center;\n text-decoration: none;\n }\n\n .p-menubar.p-menubar-mobile {\n position: relative; \n }\n\n .p-menubar.p-menubar-mobile .p-menubar-button {\n display: flex;\n }\n\n .p-menubar.p-menubar-mobile .p-menubar-root-list {\n position: absolute;\n display: none;\n width: 100%;\n }\n\n .p-menubar.p-menubar-mobile .p-submenu-list {\n width: 100%;\n position: static;\n box-shadow: none;\n border: 0 none;\n }\n\n .p-menubar.p-menubar-mobile .p-menubar-root-list .p-menuitem {\n width: 100%;\n position: static;\n }\n\n .p-menubar.p-menubar-mobile-active .p-menubar-root-list {\n display: flex;\n flex-direction: column;\n top: 100%;\n left: 0;\n z-index: 1;\n }\n}\n";
|
|
11
11
|
var inlineStyles = {
|
|
12
12
|
submenu: function submenu(_ref) {
|
|
13
13
|
var instance = _ref.instance,
|
|
@@ -21,6 +21,7 @@ this.primevue.menubar.style = (function (BaseStyle) {
|
|
|
21
21
|
root: function root(_ref2) {
|
|
22
22
|
var instance = _ref2.instance;
|
|
23
23
|
return ['p-menubar p-component', {
|
|
24
|
+
'p-menubar-mobile': instance.queryMatches,
|
|
24
25
|
'p-menubar-mobile-active': instance.mobileActive
|
|
25
26
|
}];
|
|
26
27
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primevue=this.primevue||{},this.primevue.menubar=this.primevue.menubar||{},this.primevue.menubar.style=function(n){"use strict";function e(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}return e(primevue.base.style).default.extend({name:"menubar",css:"\n@layer primevue {\n .p-menubar {\n display: flex;\n align-items: center;\n }\n\n .p-menubar ul {\n margin: 0;\n padding: 0;\n list-style: none;\n }\n\n .p-menubar .p-menuitem-link {\n cursor: pointer;\n display: flex;\n align-items: center;\n text-decoration: none;\n overflow: hidden;\n position: relative;\n }\n\n .p-menubar .p-menuitem-text {\n line-height: 1;\n }\n\n .p-menubar .p-menuitem {\n position: relative;\n }\n\n .p-menubar-root-list {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n }\n\n .p-menubar-root-list > li ul {\n display: none;\n z-index: 1;\n }\n\n .p-menubar-root-list > .p-menuitem-active > .p-submenu-list {\n display: block;\n }\n\n .p-menubar .p-submenu-list {\n display: none;\n position: absolute;\n z-index: 1;\n }\n\n .p-menubar .p-submenu-list > .p-menuitem-active > .p-submenu-list {\n display: block;\n left: 100%;\n top: 0;\n }\n\n .p-menubar .p-submenu-list .p-menuitem .p-menuitem-content .p-menuitem-link .p-submenu-icon {\n margin-left: auto;\n }\n\n .p-menubar .p-menubar-end {\n margin-left: auto;\n align-self: center;\n }\n\n .p-menubar-button {\n display: none;\n cursor: pointer;\n align-items: center;\n justify-content: center;\n text-decoration: none;\n }\n}\n",classes:{root:function(n){return["p-menubar p-component",{"p-menubar-mobile-active":
|
|
1
|
+
this.primevue=this.primevue||{},this.primevue.menubar=this.primevue.menubar||{},this.primevue.menubar.style=function(n){"use strict";function e(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}return e(primevue.base.style).default.extend({name:"menubar",css:"\n@layer primevue {\n .p-menubar {\n display: flex;\n align-items: center;\n }\n\n .p-menubar ul {\n margin: 0;\n padding: 0;\n list-style: none;\n }\n\n .p-menubar .p-menuitem-link {\n cursor: pointer;\n display: flex;\n align-items: center;\n text-decoration: none;\n overflow: hidden;\n position: relative;\n }\n\n .p-menubar .p-menuitem-text {\n line-height: 1;\n }\n\n .p-menubar .p-menuitem {\n position: relative;\n }\n\n .p-menubar-root-list {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n }\n\n .p-menubar-root-list > li ul {\n display: none;\n z-index: 1;\n }\n\n .p-menubar-root-list > .p-menuitem-active > .p-submenu-list {\n display: block;\n }\n\n .p-menubar .p-submenu-list {\n display: none;\n position: absolute;\n z-index: 1;\n }\n\n .p-menubar .p-submenu-list > .p-menuitem-active > .p-submenu-list {\n display: block;\n left: 100%;\n top: 0;\n }\n\n .p-menubar .p-submenu-list .p-menuitem .p-menuitem-content .p-menuitem-link .p-submenu-icon {\n margin-left: auto;\n }\n\n .p-menubar .p-menubar-end {\n margin-left: auto;\n align-self: center;\n }\n\n .p-menubar-button {\n display: none;\n cursor: pointer;\n align-items: center;\n justify-content: center;\n text-decoration: none;\n }\n\n .p-menubar.p-menubar-mobile {\n position: relative; \n }\n\n .p-menubar.p-menubar-mobile .p-menubar-button {\n display: flex;\n }\n\n .p-menubar.p-menubar-mobile .p-menubar-root-list {\n position: absolute;\n display: none;\n width: 100%;\n }\n\n .p-menubar.p-menubar-mobile .p-submenu-list {\n width: 100%;\n position: static;\n box-shadow: none;\n border: 0 none;\n }\n\n .p-menubar.p-menubar-mobile .p-menubar-root-list .p-menuitem {\n width: 100%;\n position: static;\n }\n\n .p-menubar.p-menubar-mobile-active .p-menubar-root-list {\n display: flex;\n flex-direction: column;\n top: 100%;\n left: 0;\n z-index: 1;\n }\n}\n",classes:{root:function(n){var e=n.instance;return["p-menubar p-component",{"p-menubar-mobile":e.queryMatches,"p-menubar-mobile-active":e.mobileActive}]},start:"p-menubar-start",button:"p-menubar-button",menu:"p-menubar-root-list",menuitem:function(n){var e=n.instance,t=n.processedItem;return["p-menuitem",{"p-menuitem-active p-highlight":e.isItemActive(t),"p-focus":e.isItemFocused(t),"p-disabled":e.isItemDisabled(t)}]},content:"p-menuitem-content",action:"p-menuitem-link",icon:"p-menuitem-icon",label:"p-menuitem-text",submenuIcon:"p-submenu-icon",submenu:"p-submenu-list",separator:"p-menuitem-separator",end:"p-menubar-end"},inlineStyles:{submenu:function(n){return{display:n.instance.isItemActive(n.processedItem)?"block":"none"}}}})}();
|
package/orderlist/OrderList.vue
CHANGED
|
@@ -139,7 +139,7 @@ export default {
|
|
|
139
139
|
return ObjectUtils.findIndexInList(item, this.d_selection) != -1;
|
|
140
140
|
},
|
|
141
141
|
onListFocus(event) {
|
|
142
|
-
const selectedFirstItem = DomHandler.findSingle(this.list, '[data-p-highlight="true"]');
|
|
142
|
+
const selectedFirstItem = DomHandler.findSingle(this.list, '[data-p-highlight="true"]') || DomHandler.findSingle(this.list, '[data-pc-section="item"]');
|
|
143
143
|
|
|
144
144
|
if (selectedFirstItem) {
|
|
145
145
|
const findIndex = ObjectUtils.findIndexInList(selectedFirstItem, this.list.children);
|
|
@@ -187,6 +187,8 @@ export default {
|
|
|
187
187
|
if (event.ctrlKey) {
|
|
188
188
|
this.d_selection = [...this.modelValue];
|
|
189
189
|
this.$emit('update:selection', this.d_selection);
|
|
190
|
+
|
|
191
|
+
event.preventDefault();
|
|
190
192
|
}
|
|
191
193
|
|
|
192
194
|
default:
|
|
@@ -227,6 +229,10 @@ export default {
|
|
|
227
229
|
|
|
228
230
|
this.d_selection = [...this.modelValue].slice(0, matchedOptionIndex + 1);
|
|
229
231
|
this.$emit('update:selection', this.d_selection);
|
|
232
|
+
this.$emit('selection-change', {
|
|
233
|
+
originalEvent: event,
|
|
234
|
+
value: this.d_selection
|
|
235
|
+
});
|
|
230
236
|
} else {
|
|
231
237
|
this.changeFocusedOptionIndex(0);
|
|
232
238
|
}
|
|
@@ -241,6 +247,10 @@ export default {
|
|
|
241
247
|
|
|
242
248
|
this.d_selection = [...this.modelValue].slice(matchedOptionIndex, items.length);
|
|
243
249
|
this.$emit('update:selection', this.d_selection);
|
|
250
|
+
this.$emit('selection-change', {
|
|
251
|
+
originalEvent: event,
|
|
252
|
+
value: this.d_selection
|
|
253
|
+
});
|
|
244
254
|
} else {
|
|
245
255
|
this.changeFocusedOptionIndex(DomHandler.find(this.list, '[data-pc-section="item"]').length - 1);
|
|
246
256
|
}
|
|
@@ -257,7 +267,9 @@ export default {
|
|
|
257
267
|
event.preventDefault();
|
|
258
268
|
},
|
|
259
269
|
onSpaceKey(event) {
|
|
260
|
-
|
|
270
|
+
event.preventDefault();
|
|
271
|
+
|
|
272
|
+
if (event.shiftKey && this.d_selection && this.d_selection.length > 0) {
|
|
261
273
|
const items = DomHandler.find(this.list, '[data-pc-section="item"]');
|
|
262
274
|
const selectedItemIndex = ObjectUtils.findIndexInList(this.d_selection[0], [...this.modelValue]);
|
|
263
275
|
const focusedItem = DomHandler.findSingle(this.list, `[data-pc-section="item"][id=${this.focusedOptionIndex}]`);
|
|
@@ -265,6 +277,10 @@ export default {
|
|
|
265
277
|
|
|
266
278
|
this.d_selection = [...this.modelValue].slice(Math.min(selectedItemIndex, matchedOptionIndex), Math.max(selectedItemIndex, matchedOptionIndex) + 1);
|
|
267
279
|
this.$emit('update:selection', this.d_selection);
|
|
280
|
+
this.$emit('selection-change', {
|
|
281
|
+
originalEvent: event,
|
|
282
|
+
value: this.d_selection
|
|
283
|
+
});
|
|
268
284
|
} else {
|
|
269
285
|
this.onEnterKey(event);
|
|
270
286
|
}
|
|
@@ -157,7 +157,7 @@ var script = {
|
|
|
157
157
|
return utils.ObjectUtils.findIndexInList(item, this.d_selection) != -1;
|
|
158
158
|
},
|
|
159
159
|
onListFocus: function onListFocus(event) {
|
|
160
|
-
var selectedFirstItem = utils.DomHandler.findSingle(this.list, '[data-p-highlight="true"]');
|
|
160
|
+
var selectedFirstItem = utils.DomHandler.findSingle(this.list, '[data-p-highlight="true"]') || utils.DomHandler.findSingle(this.list, '[data-pc-section="item"]');
|
|
161
161
|
if (selectedFirstItem) {
|
|
162
162
|
var findIndex = utils.ObjectUtils.findIndexInList(selectedFirstItem, this.list.children);
|
|
163
163
|
this.focused = true;
|
|
@@ -195,6 +195,7 @@ var script = {
|
|
|
195
195
|
if (event.ctrlKey) {
|
|
196
196
|
this.d_selection = _toConsumableArray(this.modelValue);
|
|
197
197
|
this.$emit('update:selection', this.d_selection);
|
|
198
|
+
event.preventDefault();
|
|
198
199
|
}
|
|
199
200
|
}
|
|
200
201
|
},
|
|
@@ -227,6 +228,10 @@ var script = {
|
|
|
227
228
|
});
|
|
228
229
|
this.d_selection = _toConsumableArray(this.modelValue).slice(0, matchedOptionIndex + 1);
|
|
229
230
|
this.$emit('update:selection', this.d_selection);
|
|
231
|
+
this.$emit('selection-change', {
|
|
232
|
+
originalEvent: event,
|
|
233
|
+
value: this.d_selection
|
|
234
|
+
});
|
|
230
235
|
} else {
|
|
231
236
|
this.changeFocusedOptionIndex(0);
|
|
232
237
|
}
|
|
@@ -241,6 +246,10 @@ var script = {
|
|
|
241
246
|
});
|
|
242
247
|
this.d_selection = _toConsumableArray(this.modelValue).slice(matchedOptionIndex, items.length);
|
|
243
248
|
this.$emit('update:selection', this.d_selection);
|
|
249
|
+
this.$emit('selection-change', {
|
|
250
|
+
originalEvent: event,
|
|
251
|
+
value: this.d_selection
|
|
252
|
+
});
|
|
244
253
|
} else {
|
|
245
254
|
this.changeFocusedOptionIndex(utils.DomHandler.find(this.list, '[data-pc-section="item"]').length - 1);
|
|
246
255
|
}
|
|
@@ -256,7 +265,8 @@ var script = {
|
|
|
256
265
|
event.preventDefault();
|
|
257
266
|
},
|
|
258
267
|
onSpaceKey: function onSpaceKey(event) {
|
|
259
|
-
|
|
268
|
+
event.preventDefault();
|
|
269
|
+
if (event.shiftKey && this.d_selection && this.d_selection.length > 0) {
|
|
260
270
|
var items = utils.DomHandler.find(this.list, '[data-pc-section="item"]');
|
|
261
271
|
var selectedItemIndex = utils.ObjectUtils.findIndexInList(this.d_selection[0], _toConsumableArray(this.modelValue));
|
|
262
272
|
var focusedItem = utils.DomHandler.findSingle(this.list, "[data-pc-section=\"item\"][id=".concat(this.focusedOptionIndex, "]"));
|
|
@@ -265,6 +275,10 @@ var script = {
|
|
|
265
275
|
});
|
|
266
276
|
this.d_selection = _toConsumableArray(this.modelValue).slice(Math.min(selectedItemIndex, matchedOptionIndex), Math.max(selectedItemIndex, matchedOptionIndex) + 1);
|
|
267
277
|
this.$emit('update:selection', this.d_selection);
|
|
278
|
+
this.$emit('selection-change', {
|
|
279
|
+
originalEvent: event,
|
|
280
|
+
value: this.d_selection
|
|
281
|
+
});
|
|
268
282
|
} else {
|
|
269
283
|
this.onEnterKey(event);
|
|
270
284
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("primevue/button"),t=require("primevue/icons/angledoubledown"),n=require("primevue/icons/angledoubleup"),i=require("primevue/icons/angledown"),o=require("primevue/icons/angleup"),r=require("primevue/ripple"),l=require("primevue/utils"),s=require("primevue/basecomponent"),c=require("primevue/orderlist/style"),a=require("vue");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=d(e),p=d(t),m=d(n),h=d(i),f=d(o),v=d(r);function b(e){return D(e)||I(e)||g(e)||y()}function y(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function g(e,t){if(e){if("string"==typeof e)return x(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?x(e,t):void 0}}function I(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function D(e){if(Array.isArray(e))return x(e)}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var O={name:"OrderList",extends:{name:"BaseOrderList",extends:d(s).default,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}},style:d(c).default,provide:function(){return{$parentInstance:this}}},emits:["update:modelValue","reorder","update:selection","selection-change","focus","blur"],itemTouched:!1,reorderDirection:null,styleElement:null,list:null,data:function(){return{id:this.$attrs.id,d_selection:this.selection,focused:!1,focusedOptionIndex:-1}},watch:{"$attrs.id":function(e){this.id=e||l.UniqueComponentId()}},beforeUnmount:function(){this.destroyStyle()},updated:function(){this.reorderDirection&&(this.updateListScroll(),this.reorderDirection=null)},mounted:function(){this.id=this.id||l.UniqueComponentId(),this.responsive&&this.createStyle()},methods:{getItemKey:function(e,t){return this.dataKey?l.ObjectUtils.resolveFieldData(e,this.dataKey):t},getPTOptions:function(e,t,n){return this.ptm(t,{context:{active:this.isSelected(e),focused:"".concat(this.id,"_").concat(n)===this.focusedOptionId}})},isSelected:function(e){return-1!=l.ObjectUtils.findIndexInList(e,this.d_selection)},onListFocus:function(e){var t=l.DomHandler.findSingle(this.list,'[data-p-highlight="true"]');if(t){var n=l.ObjectUtils.findIndexInList(t,this.list.children);this.focused=!0,this.changeFocusedOptionIndex(-1!==this.focusedOptionIndex?this.focusedOptionIndex:t?n:-1),this.$emit("focus",e)}},onListBlur:function(e){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onListKeyDown:function(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=b(this.modelValue),this.$emit("update:selection",this.d_selection))}},onOptionMouseDown:function(e){this.focused=!0,this.focusedOptionIndex=e},onArrowDownKey:function(e){var t=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.shiftKey&&this.onEnterKey(e),e.preventDefault()},onArrowUpKey:function(e){var t=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.shiftKey&&this.onEnterKey(e),e.preventDefault()},onHomeKey:function(e){if(e.ctrlKey&&e.shiftKey){var t=l.DomHandler.find(this.list,'[data-pc-section="item"]'),n=l.DomHandler.findSingle(this.list,'[data-pc-section="item"][id='.concat(this.focusedOptionIndex,"]")),i=b(t).findIndex((function(e){return e===n}));this.d_selection=b(this.modelValue).slice(0,i+1),this.$emit("update:selection",this.d_selection)}else this.changeFocusedOptionIndex(0);e.preventDefault()},onEndKey:function(e){if(e.ctrlKey&&e.shiftKey){var t=l.DomHandler.find(this.list,'[data-pc-section="item"]'),n=l.DomHandler.findSingle(this.list,'[data-pc-section="item"][id='.concat(this.focusedOptionIndex,"]")),i=b(t).findIndex((function(e){return e===n}));this.d_selection=b(this.modelValue).slice(i,t.length),this.$emit("update:selection",this.d_selection)}else this.changeFocusedOptionIndex(l.DomHandler.find(this.list,'[data-pc-section="item"]').length-1);e.preventDefault()},onEnterKey:function(e){var t=l.DomHandler.find(this.list,'[data-pc-section="item"]'),n=l.DomHandler.findSingle(this.list,'[data-pc-section="item"][id='.concat(this.focusedOptionIndex,"]")),i=b(t).findIndex((function(e){return e===n}));this.onItemClick(e,this.modelValue[i],i),e.preventDefault()},onSpaceKey:function(e){if(e.shiftKey){var t=l.DomHandler.find(this.list,'[data-pc-section="item"]'),n=l.ObjectUtils.findIndexInList(this.d_selection[0],b(this.modelValue)),i=l.DomHandler.findSingle(this.list,'[data-pc-section="item"][id='.concat(this.focusedOptionIndex,"]")),o=b(t).findIndex((function(e){return e===i}));this.d_selection=b(this.modelValue).slice(Math.min(n,o),Math.max(n,o)+1),this.$emit("update:selection",this.d_selection)}else this.onEnterKey(e)},findNextOptionIndex:function(e){var t=b(l.DomHandler.find(this.list,'[data-pc-section="item"]')).findIndex((function(t){return t.id===e}));return t>-1?t+1:0},findPrevOptionIndex:function(e){var t=b(l.DomHandler.find(this.list,'[data-pc-section="item"]')).findIndex((function(t){return t.id===e}));return t>-1?t-1:0},changeFocusedOptionIndex:function(e){var t=l.DomHandler.find(this.list,'[data-pc-section="item"]'),n=e>=t.length?t.length-1:e<0?0:e;this.focusedOptionIndex=t[n]?t[n].getAttribute("id"):-1,this.scrollInView(this.focusedOptionIndex)},scrollInView:function(e){var t=l.DomHandler.findSingle(this.list,'[data-pc-section="item"][id="'.concat(e,'"]'));t&&t.scrollIntoView&&t.scrollIntoView({block:"nearest",inline:"start"})},moveUp:function(e){if(this.d_selection){for(var t=b(this.modelValue),n=0;n<this.d_selection.length;n++){var i=l.ObjectUtils.findIndexInList(this.d_selection[n],t);if(0===i)break;var o=t[i-1];t[i-1]=t[i],t[i]=o}this.reorderDirection="up",this.$emit("update:modelValue",t),this.$emit("reorder",{originalEvent:e,value:t,direction:this.reorderDirection})}},moveTop:function(e){if(this.d_selection){for(var t=b(this.modelValue),n=0;n<this.d_selection.length;n++){var i=l.ObjectUtils.findIndexInList(this.d_selection[n],t);if(0===i)break;var o=t.splice(i,1)[0];t.unshift(o)}this.reorderDirection="top",this.$emit("update:modelValue",t),this.$emit("reorder",{originalEvent:e,value:t,direction:this.reorderDirection})}},moveDown:function(e){if(this.d_selection){for(var t=b(this.modelValue),n=this.d_selection.length-1;n>=0;n--){var i=l.ObjectUtils.findIndexInList(this.d_selection[n],t);if(i===t.length-1)break;var o=t[i+1];t[i+1]=t[i],t[i]=o}this.reorderDirection="down",this.$emit("update:modelValue",t),this.$emit("reorder",{originalEvent:e,value:t,direction:this.reorderDirection})}},moveBottom:function(e){if(this.d_selection){for(var t=b(this.modelValue),n=this.d_selection.length-1;n>=0;n--){var i=l.ObjectUtils.findIndexInList(this.d_selection[n],t);if(i===t.length-1)break;var o=t.splice(i,1)[0];t.push(o)}this.reorderDirection="bottom",this.$emit("update:modelValue",t),this.$emit("reorder",{originalEvent:e,value:t,direction:this.reorderDirection})}},onItemClick:function(e,t,n){this.itemTouched=!1;var i=l.ObjectUtils.findIndexInList(t,this.d_selection),o=-1!=i,r=!this.itemTouched&&this.metaKeySelection,s=l.DomHandler.find(this.list,'[data-pc-section="item"]')[n].getAttribute("id");if(this.focusedOptionIndex=s,r){var c=e.metaKey||e.ctrlKey;o&&c?this.d_selection=this.d_selection.filter((function(e,t){return t!==i})):(this.d_selection=c&&this.d_selection?b(this.d_selection):[],l.ObjectUtils.insertIntoOrderedArray(t,n,this.d_selection,this.modelValue))}else o?this.d_selection=this.d_selection.filter((function(e,t){return t!==i})):(this.d_selection=this.d_selection?b(this.d_selection):[],l.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:function(){this.itemTouched=!0},findNextItem:function(e){var t=e.nextElementSibling;return t?"item"!==l.DomHandler.getAttribute(t,"data-pc-section")?this.findNextItem(t):t:null},findPrevItem:function(e){var t=e.previousElementSibling;return t?"item"!==l.DomHandler.getAttribute(nextItem,"data-pc-section")?this.findPrevItem(t):t:null},updateListScroll:function(){var e=l.DomHandler.find(this.list,'[data-pc-section="item"][data-p-highlight="true"]');if(e&&e.length)switch(this.reorderDirection){case"up":l.DomHandler.scrollInView(this.list,e[0]);break;case"top":this.list.scrollTop=0;break;case"down":l.DomHandler.scrollInView(this.list,e[e.length-1]);break;case"bottom":this.list.scrollTop=this.list.scrollHeight}},createStyle:function(){if(!this.styleElement&&!this.isUnstyled){var e;this.$el.setAttribute(this.attributeSelector,""),this.styleElement=document.createElement("style"),this.styleElement.type="text/css",l.DomHandler.setAttribute(this.styleElement,"nonce",null===(e=this.$primevue)||void 0===e||null===(e=e.config)||void 0===e||null===(e=e.csp)||void 0===e?void 0:e.nonce),document.head.appendChild(this.styleElement);var t="\n@media screen and (max-width: ".concat(this.breakpoint,") {\n .p-orderlist[").concat(this.attributeSelector,"] {\n flex-direction: column;\n }\n\n .p-orderlist[").concat(this.attributeSelector,"] .p-orderlist-controls {\n padding: var(--content-padding);\n flex-direction: row;\n }\n\n .p-orderlist[").concat(this.attributeSelector,"] .p-orderlist-controls .p-button {\n margin-right: var(--inline-spacing);\n margin-bottom: 0;\n }\n\n .p-orderlist[").concat(this.attributeSelector,"] .p-orderlist-controls .p-button:last-child {\n margin-right: 0;\n }\n}\n");this.styleElement.innerHTML=t}},destroyStyle:function(){this.styleElement&&(document.head.removeChild(this.styleElement),this.styleElement=null)},moveDisabled:function(){if(!this.d_selection||!this.d_selection.length)return!0},listRef:function(e){this.list=e?e.$el:void 0}},computed:{attributeSelector:function(){return l.UniqueComponentId()},focusedOptionId:function(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null},moveUpAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.moveUp:void 0},moveTopAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.moveTop:void 0},moveDownAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.moveDown:void 0},moveBottomAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.moveBottom:void 0}},components:{OLButton:u.default,AngleUpIcon:f.default,AngleDownIcon:h.default,AngleDoubleUpIcon:m.default,AngleDoubleDownIcon:p.default},directives:{ripple:v.default}};function w(e){return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},w(e)}function S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function _(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?S(Object(n),!0).forEach((function(t){B(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function B(e,t,n){return(t=P(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P(e){var t=k(e,"string");return"symbol"===w(t)?t:String(t)}function k(e,t){if("object"!==w(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==w(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var A=["id","onClick","aria-selected","onMousedown","data-p-highlight","data-p-focused"];O.render=function(e,t,n,i,o,r){var l=a.resolveComponent("AngleUpIcon"),s=a.resolveComponent("OLButton"),c=a.resolveComponent("AngleDoubleUpIcon"),d=a.resolveComponent("AngleDownIcon"),u=a.resolveComponent("AngleDoubleDownIcon"),p=a.resolveDirective("ripple");return a.openBlock(),a.createElementBlock("div",a.mergeProps({class:e.cx("root")},e.ptm("root")),[a.createElementVNode("div",a.mergeProps({class:e.cx("controls")},e.ptm("controls")),[a.renderSlot(e.$slots,"controlsstart"),a.createVNode(s,a.mergeProps({type:"button",onClick:r.moveUp,"aria-label":r.moveUpAriaLabel,disabled:r.moveDisabled(),pt:e.ptm("moveUpButton")},e.moveUpButtonProps,{"data-pc-section":"moveupbutton",unstyled:e.unstyled}),{icon:a.withCtx((function(){return[a.renderSlot(e.$slots,"moveupicon",{},(function(){return[a.createVNode(l,a.mergeProps(e.ptm("moveUpButton").icon,{"data-pc-section":"moveupicon"}),null,16)]}))]})),_:3},16,["onClick","aria-label","disabled","pt","unstyled"]),a.createVNode(s,a.mergeProps({type:"button",onClick:r.moveTop,"aria-label":r.moveTopAriaLabel,disabled:r.moveDisabled(),pt:e.ptm("moveTopButton")},e.moveTopButtonProps,{"data-pc-section":"movetopbutton",unstyled:e.unstyled}),{icon:a.withCtx((function(){return[a.renderSlot(e.$slots,"movetopicon",{},(function(){return[a.createVNode(c,a.mergeProps(e.ptm("moveTopButton").icon,{"data-pc-section":"movetopicon"}),null,16)]}))]})),_:3},16,["onClick","aria-label","disabled","pt","unstyled"]),a.createVNode(s,a.mergeProps({type:"button",onClick:r.moveDown,"aria-label":r.moveDownAriaLabel,disabled:r.moveDisabled(),pt:e.ptm("moveDownButton")},e.moveDownButtonProps,{"data-pc-section":"movedownbutton",unstyled:e.unstyled}),{icon:a.withCtx((function(){return[a.renderSlot(e.$slots,"movedownicon",{},(function(){return[a.createVNode(d,a.mergeProps(e.ptm("moveDownButton").icon,{"data-pc-section":"movedownicon"}),null,16)]}))]})),_:3},16,["onClick","aria-label","disabled","pt","unstyled"]),a.createVNode(s,a.mergeProps({type:"button",onClick:r.moveBottom,"aria-label":r.moveBottomAriaLabel,disabled:r.moveDisabled(),pt:e.ptm("moveBottomButton")},e.moveBottomButtonProps,{"data-pc-section":"movebottombutton",unstyled:e.unstyled}),{icon:a.withCtx((function(){return[a.renderSlot(e.$slots,"movebottomicon",{},(function(){return[a.createVNode(u,a.mergeProps(e.ptm("moveBottomButton").icon,{"data-pc-section":"movebottomicon"}),null,16)]}))]})),_:3},16,["onClick","aria-label","disabled","pt","unstyled"]),a.renderSlot(e.$slots,"controlsend")],16),a.createElementVNode("div",a.mergeProps({class:e.cx("container")},e.ptm("container")),[e.$slots.header?(a.openBlock(),a.createElementBlock("div",a.mergeProps({key:0,class:e.cx("header")},e.ptm("header")),[a.renderSlot(e.$slots,"header")],16)):a.createCommentVNode("",!0),a.createVNode(a.TransitionGroup,a.mergeProps({ref:r.listRef,id:o.id+"_list",name:"p-orderlist-flip",tag:"ul",class:e.cx("list"),style:e.listStyle,role:"listbox","aria-multiselectable":"true",tabindex:e.tabindex,"aria-activedescendant":o.focused?r.focusedOptionId:void 0,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,onFocus:r.onListFocus,onBlur:r.onListBlur,onKeydown:r.onListKeyDown},_(_(_({},e.listProps),e.ptm("list")),e.ptm("transition"))),{default:a.withCtx((function(){return[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.modelValue,(function(n,i){return a.withDirectives((a.openBlock(),a.createElementBlock("li",a.mergeProps({key:r.getItemKey(n,i),id:o.id+"_"+i,role:"option",class:e.cx("item",{item:n,id:"".concat(o.id,"_").concat(i)}),onClick:function(e){return r.onItemClick(e,n,i)},onTouchend:t[0]||(t[0]=function(){return r.onItemTouchEnd&&r.onItemTouchEnd.apply(r,arguments)}),"aria-selected":r.isSelected(n),onMousedown:function(e){return r.onOptionMouseDown(i)}},r.getPTOptions(n,"item",i),{"data-p-highlight":r.isSelected(n),"data-p-focused":"".concat(o.id,"_").concat(i)===r.focusedOptionId}),[a.renderSlot(e.$slots,"item",{item:n,index:i})],16,A)),[[p]])})),128))]})),_:3},16,["id","class","style","tabindex","aria-activedescendant","aria-label","aria-labelledby","onFocus","onBlur","onKeydown"])],16)],16)},module.exports=O;
|
|
1
|
+
"use strict";var e=require("primevue/button"),t=require("primevue/icons/angledoubledown"),n=require("primevue/icons/angledoubleup"),i=require("primevue/icons/angledown"),o=require("primevue/icons/angleup"),r=require("primevue/ripple"),l=require("primevue/utils"),s=require("primevue/basecomponent"),c=require("primevue/orderlist/style"),a=require("vue");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=d(e),p=d(t),m=d(n),h=d(i),f=d(o),v=d(r);function b(e){return D(e)||I(e)||g(e)||y()}function y(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function g(e,t){if(e){if("string"==typeof e)return x(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?x(e,t):void 0}}function I(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function D(e){if(Array.isArray(e))return x(e)}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var O={name:"OrderList",extends:{name:"BaseOrderList",extends:d(s).default,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}},style:d(c).default,provide:function(){return{$parentInstance:this}}},emits:["update:modelValue","reorder","update:selection","selection-change","focus","blur"],itemTouched:!1,reorderDirection:null,styleElement:null,list:null,data:function(){return{id:this.$attrs.id,d_selection:this.selection,focused:!1,focusedOptionIndex:-1}},watch:{"$attrs.id":function(e){this.id=e||l.UniqueComponentId()}},beforeUnmount:function(){this.destroyStyle()},updated:function(){this.reorderDirection&&(this.updateListScroll(),this.reorderDirection=null)},mounted:function(){this.id=this.id||l.UniqueComponentId(),this.responsive&&this.createStyle()},methods:{getItemKey:function(e,t){return this.dataKey?l.ObjectUtils.resolveFieldData(e,this.dataKey):t},getPTOptions:function(e,t,n){return this.ptm(t,{context:{active:this.isSelected(e),focused:"".concat(this.id,"_").concat(n)===this.focusedOptionId}})},isSelected:function(e){return-1!=l.ObjectUtils.findIndexInList(e,this.d_selection)},onListFocus:function(e){var t=l.DomHandler.findSingle(this.list,'[data-p-highlight="true"]')||l.DomHandler.findSingle(this.list,'[data-pc-section="item"]');if(t){var n=l.ObjectUtils.findIndexInList(t,this.list.children);this.focused=!0,this.changeFocusedOptionIndex(-1!==this.focusedOptionIndex?this.focusedOptionIndex:t?n:-1),this.$emit("focus",e)}},onListBlur:function(e){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onListKeyDown:function(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=b(this.modelValue),this.$emit("update:selection",this.d_selection),e.preventDefault())}},onOptionMouseDown:function(e){this.focused=!0,this.focusedOptionIndex=e},onArrowDownKey:function(e){var t=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.shiftKey&&this.onEnterKey(e),e.preventDefault()},onArrowUpKey:function(e){var t=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.shiftKey&&this.onEnterKey(e),e.preventDefault()},onHomeKey:function(e){if(e.ctrlKey&&e.shiftKey){var t=l.DomHandler.find(this.list,'[data-pc-section="item"]'),n=l.DomHandler.findSingle(this.list,'[data-pc-section="item"][id='.concat(this.focusedOptionIndex,"]")),i=b(t).findIndex((function(e){return e===n}));this.d_selection=b(this.modelValue).slice(0,i+1),this.$emit("update:selection",this.d_selection),this.$emit("selection-change",{originalEvent:e,value:this.d_selection})}else this.changeFocusedOptionIndex(0);e.preventDefault()},onEndKey:function(e){if(e.ctrlKey&&e.shiftKey){var t=l.DomHandler.find(this.list,'[data-pc-section="item"]'),n=l.DomHandler.findSingle(this.list,'[data-pc-section="item"][id='.concat(this.focusedOptionIndex,"]")),i=b(t).findIndex((function(e){return e===n}));this.d_selection=b(this.modelValue).slice(i,t.length),this.$emit("update:selection",this.d_selection),this.$emit("selection-change",{originalEvent:e,value:this.d_selection})}else this.changeFocusedOptionIndex(l.DomHandler.find(this.list,'[data-pc-section="item"]').length-1);e.preventDefault()},onEnterKey:function(e){var t=l.DomHandler.find(this.list,'[data-pc-section="item"]'),n=l.DomHandler.findSingle(this.list,'[data-pc-section="item"][id='.concat(this.focusedOptionIndex,"]")),i=b(t).findIndex((function(e){return e===n}));this.onItemClick(e,this.modelValue[i],i),e.preventDefault()},onSpaceKey:function(e){if(e.preventDefault(),e.shiftKey&&this.d_selection&&this.d_selection.length>0){var t=l.DomHandler.find(this.list,'[data-pc-section="item"]'),n=l.ObjectUtils.findIndexInList(this.d_selection[0],b(this.modelValue)),i=l.DomHandler.findSingle(this.list,'[data-pc-section="item"][id='.concat(this.focusedOptionIndex,"]")),o=b(t).findIndex((function(e){return e===i}));this.d_selection=b(this.modelValue).slice(Math.min(n,o),Math.max(n,o)+1),this.$emit("update:selection",this.d_selection),this.$emit("selection-change",{originalEvent:e,value:this.d_selection})}else this.onEnterKey(e)},findNextOptionIndex:function(e){var t=b(l.DomHandler.find(this.list,'[data-pc-section="item"]')).findIndex((function(t){return t.id===e}));return t>-1?t+1:0},findPrevOptionIndex:function(e){var t=b(l.DomHandler.find(this.list,'[data-pc-section="item"]')).findIndex((function(t){return t.id===e}));return t>-1?t-1:0},changeFocusedOptionIndex:function(e){var t=l.DomHandler.find(this.list,'[data-pc-section="item"]'),n=e>=t.length?t.length-1:e<0?0:e;this.focusedOptionIndex=t[n]?t[n].getAttribute("id"):-1,this.scrollInView(this.focusedOptionIndex)},scrollInView:function(e){var t=l.DomHandler.findSingle(this.list,'[data-pc-section="item"][id="'.concat(e,'"]'));t&&t.scrollIntoView&&t.scrollIntoView({block:"nearest",inline:"start"})},moveUp:function(e){if(this.d_selection){for(var t=b(this.modelValue),n=0;n<this.d_selection.length;n++){var i=l.ObjectUtils.findIndexInList(this.d_selection[n],t);if(0===i)break;var o=t[i-1];t[i-1]=t[i],t[i]=o}this.reorderDirection="up",this.$emit("update:modelValue",t),this.$emit("reorder",{originalEvent:e,value:t,direction:this.reorderDirection})}},moveTop:function(e){if(this.d_selection){for(var t=b(this.modelValue),n=0;n<this.d_selection.length;n++){var i=l.ObjectUtils.findIndexInList(this.d_selection[n],t);if(0===i)break;var o=t.splice(i,1)[0];t.unshift(o)}this.reorderDirection="top",this.$emit("update:modelValue",t),this.$emit("reorder",{originalEvent:e,value:t,direction:this.reorderDirection})}},moveDown:function(e){if(this.d_selection){for(var t=b(this.modelValue),n=this.d_selection.length-1;n>=0;n--){var i=l.ObjectUtils.findIndexInList(this.d_selection[n],t);if(i===t.length-1)break;var o=t[i+1];t[i+1]=t[i],t[i]=o}this.reorderDirection="down",this.$emit("update:modelValue",t),this.$emit("reorder",{originalEvent:e,value:t,direction:this.reorderDirection})}},moveBottom:function(e){if(this.d_selection){for(var t=b(this.modelValue),n=this.d_selection.length-1;n>=0;n--){var i=l.ObjectUtils.findIndexInList(this.d_selection[n],t);if(i===t.length-1)break;var o=t.splice(i,1)[0];t.push(o)}this.reorderDirection="bottom",this.$emit("update:modelValue",t),this.$emit("reorder",{originalEvent:e,value:t,direction:this.reorderDirection})}},onItemClick:function(e,t,n){this.itemTouched=!1;var i=l.ObjectUtils.findIndexInList(t,this.d_selection),o=-1!=i,r=!this.itemTouched&&this.metaKeySelection,s=l.DomHandler.find(this.list,'[data-pc-section="item"]')[n].getAttribute("id");if(this.focusedOptionIndex=s,r){var c=e.metaKey||e.ctrlKey;o&&c?this.d_selection=this.d_selection.filter((function(e,t){return t!==i})):(this.d_selection=c&&this.d_selection?b(this.d_selection):[],l.ObjectUtils.insertIntoOrderedArray(t,n,this.d_selection,this.modelValue))}else o?this.d_selection=this.d_selection.filter((function(e,t){return t!==i})):(this.d_selection=this.d_selection?b(this.d_selection):[],l.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:function(){this.itemTouched=!0},findNextItem:function(e){var t=e.nextElementSibling;return t?"item"!==l.DomHandler.getAttribute(t,"data-pc-section")?this.findNextItem(t):t:null},findPrevItem:function(e){var t=e.previousElementSibling;return t?"item"!==l.DomHandler.getAttribute(nextItem,"data-pc-section")?this.findPrevItem(t):t:null},updateListScroll:function(){var e=l.DomHandler.find(this.list,'[data-pc-section="item"][data-p-highlight="true"]');if(e&&e.length)switch(this.reorderDirection){case"up":l.DomHandler.scrollInView(this.list,e[0]);break;case"top":this.list.scrollTop=0;break;case"down":l.DomHandler.scrollInView(this.list,e[e.length-1]);break;case"bottom":this.list.scrollTop=this.list.scrollHeight}},createStyle:function(){if(!this.styleElement&&!this.isUnstyled){var e;this.$el.setAttribute(this.attributeSelector,""),this.styleElement=document.createElement("style"),this.styleElement.type="text/css",l.DomHandler.setAttribute(this.styleElement,"nonce",null===(e=this.$primevue)||void 0===e||null===(e=e.config)||void 0===e||null===(e=e.csp)||void 0===e?void 0:e.nonce),document.head.appendChild(this.styleElement);var t="\n@media screen and (max-width: ".concat(this.breakpoint,") {\n .p-orderlist[").concat(this.attributeSelector,"] {\n flex-direction: column;\n }\n\n .p-orderlist[").concat(this.attributeSelector,"] .p-orderlist-controls {\n padding: var(--content-padding);\n flex-direction: row;\n }\n\n .p-orderlist[").concat(this.attributeSelector,"] .p-orderlist-controls .p-button {\n margin-right: var(--inline-spacing);\n margin-bottom: 0;\n }\n\n .p-orderlist[").concat(this.attributeSelector,"] .p-orderlist-controls .p-button:last-child {\n margin-right: 0;\n }\n}\n");this.styleElement.innerHTML=t}},destroyStyle:function(){this.styleElement&&(document.head.removeChild(this.styleElement),this.styleElement=null)},moveDisabled:function(){if(!this.d_selection||!this.d_selection.length)return!0},listRef:function(e){this.list=e?e.$el:void 0}},computed:{attributeSelector:function(){return l.UniqueComponentId()},focusedOptionId:function(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null},moveUpAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.moveUp:void 0},moveTopAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.moveTop:void 0},moveDownAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.moveDown:void 0},moveBottomAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.moveBottom:void 0}},components:{OLButton:u.default,AngleUpIcon:f.default,AngleDownIcon:h.default,AngleDoubleUpIcon:m.default,AngleDoubleDownIcon:p.default},directives:{ripple:v.default}};function w(e){return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},w(e)}function S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function _(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?S(Object(n),!0).forEach((function(t){B(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function B(e,t,n){return(t=E(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E(e){var t=$(e,"string");return"symbol"===w(t)?t:String(t)}function $(e,t){if("object"!==w(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==w(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var P=["id","onClick","aria-selected","onMousedown","data-p-highlight","data-p-focused"];O.render=function(e,t,n,i,o,r){var l=a.resolveComponent("AngleUpIcon"),s=a.resolveComponent("OLButton"),c=a.resolveComponent("AngleDoubleUpIcon"),d=a.resolveComponent("AngleDownIcon"),u=a.resolveComponent("AngleDoubleDownIcon"),p=a.resolveDirective("ripple");return a.openBlock(),a.createElementBlock("div",a.mergeProps({class:e.cx("root")},e.ptm("root")),[a.createElementVNode("div",a.mergeProps({class:e.cx("controls")},e.ptm("controls")),[a.renderSlot(e.$slots,"controlsstart"),a.createVNode(s,a.mergeProps({type:"button",onClick:r.moveUp,"aria-label":r.moveUpAriaLabel,disabled:r.moveDisabled(),pt:e.ptm("moveUpButton")},e.moveUpButtonProps,{"data-pc-section":"moveupbutton",unstyled:e.unstyled}),{icon:a.withCtx((function(){return[a.renderSlot(e.$slots,"moveupicon",{},(function(){return[a.createVNode(l,a.mergeProps(e.ptm("moveUpButton").icon,{"data-pc-section":"moveupicon"}),null,16)]}))]})),_:3},16,["onClick","aria-label","disabled","pt","unstyled"]),a.createVNode(s,a.mergeProps({type:"button",onClick:r.moveTop,"aria-label":r.moveTopAriaLabel,disabled:r.moveDisabled(),pt:e.ptm("moveTopButton")},e.moveTopButtonProps,{"data-pc-section":"movetopbutton",unstyled:e.unstyled}),{icon:a.withCtx((function(){return[a.renderSlot(e.$slots,"movetopicon",{},(function(){return[a.createVNode(c,a.mergeProps(e.ptm("moveTopButton").icon,{"data-pc-section":"movetopicon"}),null,16)]}))]})),_:3},16,["onClick","aria-label","disabled","pt","unstyled"]),a.createVNode(s,a.mergeProps({type:"button",onClick:r.moveDown,"aria-label":r.moveDownAriaLabel,disabled:r.moveDisabled(),pt:e.ptm("moveDownButton")},e.moveDownButtonProps,{"data-pc-section":"movedownbutton",unstyled:e.unstyled}),{icon:a.withCtx((function(){return[a.renderSlot(e.$slots,"movedownicon",{},(function(){return[a.createVNode(d,a.mergeProps(e.ptm("moveDownButton").icon,{"data-pc-section":"movedownicon"}),null,16)]}))]})),_:3},16,["onClick","aria-label","disabled","pt","unstyled"]),a.createVNode(s,a.mergeProps({type:"button",onClick:r.moveBottom,"aria-label":r.moveBottomAriaLabel,disabled:r.moveDisabled(),pt:e.ptm("moveBottomButton")},e.moveBottomButtonProps,{"data-pc-section":"movebottombutton",unstyled:e.unstyled}),{icon:a.withCtx((function(){return[a.renderSlot(e.$slots,"movebottomicon",{},(function(){return[a.createVNode(u,a.mergeProps(e.ptm("moveBottomButton").icon,{"data-pc-section":"movebottomicon"}),null,16)]}))]})),_:3},16,["onClick","aria-label","disabled","pt","unstyled"]),a.renderSlot(e.$slots,"controlsend")],16),a.createElementVNode("div",a.mergeProps({class:e.cx("container")},e.ptm("container")),[e.$slots.header?(a.openBlock(),a.createElementBlock("div",a.mergeProps({key:0,class:e.cx("header")},e.ptm("header")),[a.renderSlot(e.$slots,"header")],16)):a.createCommentVNode("",!0),a.createVNode(a.TransitionGroup,a.mergeProps({ref:r.listRef,id:o.id+"_list",name:"p-orderlist-flip",tag:"ul",class:e.cx("list"),style:e.listStyle,role:"listbox","aria-multiselectable":"true",tabindex:e.tabindex,"aria-activedescendant":o.focused?r.focusedOptionId:void 0,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,onFocus:r.onListFocus,onBlur:r.onListBlur,onKeydown:r.onListKeyDown},_(_(_({},e.listProps),e.ptm("list")),e.ptm("transition"))),{default:a.withCtx((function(){return[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.modelValue,(function(n,i){return a.withDirectives((a.openBlock(),a.createElementBlock("li",a.mergeProps({key:r.getItemKey(n,i),id:o.id+"_"+i,role:"option",class:e.cx("item",{item:n,id:"".concat(o.id,"_").concat(i)}),onClick:function(e){return r.onItemClick(e,n,i)},onTouchend:t[0]||(t[0]=function(){return r.onItemTouchEnd&&r.onItemTouchEnd.apply(r,arguments)}),"aria-selected":r.isSelected(n),onMousedown:function(e){return r.onOptionMouseDown(i)}},r.getPTOptions(n,"item",i),{"data-p-highlight":r.isSelected(n),"data-p-focused":"".concat(o.id,"_").concat(i)===r.focusedOptionId}),[a.renderSlot(e.$slots,"item",{item:n,index:i})],16,P)),[[p]])})),128))]})),_:3},16,["id","class","style","tabindex","aria-activedescendant","aria-label","aria-labelledby","onFocus","onBlur","onKeydown"])],16)],16)},module.exports=O;
|
|
@@ -144,7 +144,7 @@ var script = {
|
|
|
144
144
|
return ObjectUtils.findIndexInList(item, this.d_selection) != -1;
|
|
145
145
|
},
|
|
146
146
|
onListFocus: function onListFocus(event) {
|
|
147
|
-
var selectedFirstItem = DomHandler.findSingle(this.list, '[data-p-highlight="true"]');
|
|
147
|
+
var selectedFirstItem = DomHandler.findSingle(this.list, '[data-p-highlight="true"]') || DomHandler.findSingle(this.list, '[data-pc-section="item"]');
|
|
148
148
|
if (selectedFirstItem) {
|
|
149
149
|
var findIndex = ObjectUtils.findIndexInList(selectedFirstItem, this.list.children);
|
|
150
150
|
this.focused = true;
|
|
@@ -182,6 +182,7 @@ var script = {
|
|
|
182
182
|
if (event.ctrlKey) {
|
|
183
183
|
this.d_selection = _toConsumableArray(this.modelValue);
|
|
184
184
|
this.$emit('update:selection', this.d_selection);
|
|
185
|
+
event.preventDefault();
|
|
185
186
|
}
|
|
186
187
|
}
|
|
187
188
|
},
|
|
@@ -214,6 +215,10 @@ var script = {
|
|
|
214
215
|
});
|
|
215
216
|
this.d_selection = _toConsumableArray(this.modelValue).slice(0, matchedOptionIndex + 1);
|
|
216
217
|
this.$emit('update:selection', this.d_selection);
|
|
218
|
+
this.$emit('selection-change', {
|
|
219
|
+
originalEvent: event,
|
|
220
|
+
value: this.d_selection
|
|
221
|
+
});
|
|
217
222
|
} else {
|
|
218
223
|
this.changeFocusedOptionIndex(0);
|
|
219
224
|
}
|
|
@@ -228,6 +233,10 @@ var script = {
|
|
|
228
233
|
});
|
|
229
234
|
this.d_selection = _toConsumableArray(this.modelValue).slice(matchedOptionIndex, items.length);
|
|
230
235
|
this.$emit('update:selection', this.d_selection);
|
|
236
|
+
this.$emit('selection-change', {
|
|
237
|
+
originalEvent: event,
|
|
238
|
+
value: this.d_selection
|
|
239
|
+
});
|
|
231
240
|
} else {
|
|
232
241
|
this.changeFocusedOptionIndex(DomHandler.find(this.list, '[data-pc-section="item"]').length - 1);
|
|
233
242
|
}
|
|
@@ -243,7 +252,8 @@ var script = {
|
|
|
243
252
|
event.preventDefault();
|
|
244
253
|
},
|
|
245
254
|
onSpaceKey: function onSpaceKey(event) {
|
|
246
|
-
|
|
255
|
+
event.preventDefault();
|
|
256
|
+
if (event.shiftKey && this.d_selection && this.d_selection.length > 0) {
|
|
247
257
|
var items = DomHandler.find(this.list, '[data-pc-section="item"]');
|
|
248
258
|
var selectedItemIndex = ObjectUtils.findIndexInList(this.d_selection[0], _toConsumableArray(this.modelValue));
|
|
249
259
|
var focusedItem = DomHandler.findSingle(this.list, "[data-pc-section=\"item\"][id=".concat(this.focusedOptionIndex, "]"));
|
|
@@ -252,6 +262,10 @@ var script = {
|
|
|
252
262
|
});
|
|
253
263
|
this.d_selection = _toConsumableArray(this.modelValue).slice(Math.min(selectedItemIndex, matchedOptionIndex), Math.max(selectedItemIndex, matchedOptionIndex) + 1);
|
|
254
264
|
this.$emit('update:selection', this.d_selection);
|
|
265
|
+
this.$emit('selection-change', {
|
|
266
|
+
originalEvent: event,
|
|
267
|
+
value: this.d_selection
|
|
268
|
+
});
|
|
255
269
|
} else {
|
|
256
270
|
this.onEnterKey(event);
|
|
257
271
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"primevue/button";import e from"primevue/icons/angledoubledown";import i from"primevue/icons/angledoubleup";import n from"primevue/icons/angledown";import o from"primevue/icons/angleup";import r from"primevue/ripple";import{UniqueComponentId as s,ObjectUtils as l,DomHandler as c}from"primevue/utils";import a from"primevue/basecomponent";import d from"primevue/orderlist/style";import{resolveComponent as u,resolveDirective as p,openBlock as m,createElementBlock as h,mergeProps as f,createElementVNode as v,renderSlot as y,createVNode as b,withCtx as g,createCommentVNode as I,TransitionGroup as x,Fragment as w,renderList as O,withDirectives as D}from"vue";function S(t){return K(t)||$(t)||A(t)||_()}function _(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function A(t,e){if(t){if("string"==typeof t)return B(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?B(t,e):void 0}}function $(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function K(t){if(Array.isArray(t))return B(t)}function B(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}var E={name:"OrderList",extends:{name:"BaseOrderList",extends:a,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}},style:d,provide:function(){return{$parentInstance:this}}},emits:["update:modelValue","reorder","update:selection","selection-change","focus","blur"],itemTouched:!1,reorderDirection:null,styleElement:null,list:null,data:function(){return{id:this.$attrs.id,d_selection:this.selection,focused:!1,focusedOptionIndex:-1}},watch:{"$attrs.id":function(t){this.id=t||s()}},beforeUnmount:function(){this.destroyStyle()},updated:function(){this.reorderDirection&&(this.updateListScroll(),this.reorderDirection=null)},mounted:function(){this.id=this.id||s(),this.responsive&&this.createStyle()},methods:{getItemKey:function(t,e){return this.dataKey?l.resolveFieldData(t,this.dataKey):e},getPTOptions:function(t,e,i){return this.ptm(e,{context:{active:this.isSelected(t),focused:"".concat(this.id,"_").concat(i)===this.focusedOptionId}})},isSelected:function(t){return-1!=l.findIndexInList(t,this.d_selection)},onListFocus:function(t){var e=c.findSingle(this.list,'[data-p-highlight="true"]');if(e){var i=l.findIndexInList(e,this.list.children);this.focused=!0,this.changeFocusedOptionIndex(-1!==this.focusedOptionIndex?this.focusedOptionIndex:e?i:-1),this.$emit("focus",t)}},onListBlur:function(t){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",t)},onListKeyDown:function(t){switch(t.code){case"ArrowDown":this.onArrowDownKey(t);break;case"ArrowUp":this.onArrowUpKey(t);break;case"Home":this.onHomeKey(t);break;case"End":this.onEndKey(t);break;case"Enter":this.onEnterKey(t);break;case"Space":this.onSpaceKey(t);break;case"KeyA":t.ctrlKey&&(this.d_selection=S(this.modelValue),this.$emit("update:selection",this.d_selection))}},onOptionMouseDown:function(t){this.focused=!0,this.focusedOptionIndex=t},onArrowDownKey:function(t){var e=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(e),t.shiftKey&&this.onEnterKey(t),t.preventDefault()},onArrowUpKey:function(t){var e=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(e),t.shiftKey&&this.onEnterKey(t),t.preventDefault()},onHomeKey:function(t){if(t.ctrlKey&&t.shiftKey){var e=c.find(this.list,'[data-pc-section="item"]'),i=c.findSingle(this.list,'[data-pc-section="item"][id='.concat(this.focusedOptionIndex,"]")),n=S(e).findIndex((function(t){return t===i}));this.d_selection=S(this.modelValue).slice(0,n+1),this.$emit("update:selection",this.d_selection)}else this.changeFocusedOptionIndex(0);t.preventDefault()},onEndKey:function(t){if(t.ctrlKey&&t.shiftKey){var e=c.find(this.list,'[data-pc-section="item"]'),i=c.findSingle(this.list,'[data-pc-section="item"][id='.concat(this.focusedOptionIndex,"]")),n=S(e).findIndex((function(t){return t===i}));this.d_selection=S(this.modelValue).slice(n,e.length),this.$emit("update:selection",this.d_selection)}else this.changeFocusedOptionIndex(c.find(this.list,'[data-pc-section="item"]').length-1);t.preventDefault()},onEnterKey:function(t){var e=c.find(this.list,'[data-pc-section="item"]'),i=c.findSingle(this.list,'[data-pc-section="item"][id='.concat(this.focusedOptionIndex,"]")),n=S(e).findIndex((function(t){return t===i}));this.onItemClick(t,this.modelValue[n],n),t.preventDefault()},onSpaceKey:function(t){if(t.shiftKey){var e=c.find(this.list,'[data-pc-section="item"]'),i=l.findIndexInList(this.d_selection[0],S(this.modelValue)),n=c.findSingle(this.list,'[data-pc-section="item"][id='.concat(this.focusedOptionIndex,"]")),o=S(e).findIndex((function(t){return t===n}));this.d_selection=S(this.modelValue).slice(Math.min(i,o),Math.max(i,o)+1),this.$emit("update:selection",this.d_selection)}else this.onEnterKey(t)},findNextOptionIndex:function(t){var e=S(c.find(this.list,'[data-pc-section="item"]')).findIndex((function(e){return e.id===t}));return e>-1?e+1:0},findPrevOptionIndex:function(t){var e=S(c.find(this.list,'[data-pc-section="item"]')).findIndex((function(e){return e.id===t}));return e>-1?e-1:0},changeFocusedOptionIndex:function(t){var e=c.find(this.list,'[data-pc-section="item"]'),i=t>=e.length?e.length-1:t<0?0:t;this.focusedOptionIndex=e[i]?e[i].getAttribute("id"):-1,this.scrollInView(this.focusedOptionIndex)},scrollInView:function(t){var e=c.findSingle(this.list,'[data-pc-section="item"][id="'.concat(t,'"]'));e&&e.scrollIntoView&&e.scrollIntoView({block:"nearest",inline:"start"})},moveUp:function(t){if(this.d_selection){for(var e=S(this.modelValue),i=0;i<this.d_selection.length;i++){var n=l.findIndexInList(this.d_selection[i],e);if(0===n)break;var o=e[n-1];e[n-1]=e[n],e[n]=o}this.reorderDirection="up",this.$emit("update:modelValue",e),this.$emit("reorder",{originalEvent:t,value:e,direction:this.reorderDirection})}},moveTop:function(t){if(this.d_selection){for(var e=S(this.modelValue),i=0;i<this.d_selection.length;i++){var n=l.findIndexInList(this.d_selection[i],e);if(0===n)break;var o=e.splice(n,1)[0];e.unshift(o)}this.reorderDirection="top",this.$emit("update:modelValue",e),this.$emit("reorder",{originalEvent:t,value:e,direction:this.reorderDirection})}},moveDown:function(t){if(this.d_selection){for(var e=S(this.modelValue),i=this.d_selection.length-1;i>=0;i--){var n=l.findIndexInList(this.d_selection[i],e);if(n===e.length-1)break;var o=e[n+1];e[n+1]=e[n],e[n]=o}this.reorderDirection="down",this.$emit("update:modelValue",e),this.$emit("reorder",{originalEvent:t,value:e,direction:this.reorderDirection})}},moveBottom:function(t){if(this.d_selection){for(var e=S(this.modelValue),i=this.d_selection.length-1;i>=0;i--){var n=l.findIndexInList(this.d_selection[i],e);if(n===e.length-1)break;var o=e.splice(n,1)[0];e.push(o)}this.reorderDirection="bottom",this.$emit("update:modelValue",e),this.$emit("reorder",{originalEvent:t,value:e,direction:this.reorderDirection})}},onItemClick:function(t,e,i){this.itemTouched=!1;var n=l.findIndexInList(e,this.d_selection),o=-1!=n,r=!this.itemTouched&&this.metaKeySelection,s=c.find(this.list,'[data-pc-section="item"]')[i].getAttribute("id");if(this.focusedOptionIndex=s,r){var a=t.metaKey||t.ctrlKey;o&&a?this.d_selection=this.d_selection.filter((function(t,e){return e!==n})):(this.d_selection=a&&this.d_selection?S(this.d_selection):[],l.insertIntoOrderedArray(e,i,this.d_selection,this.modelValue))}else o?this.d_selection=this.d_selection.filter((function(t,e){return e!==n})):(this.d_selection=this.d_selection?S(this.d_selection):[],l.insertIntoOrderedArray(e,i,this.d_selection,this.modelValue));this.$emit("update:selection",this.d_selection),this.$emit("selection-change",{originalEvent:t,value:this.d_selection})},onItemTouchEnd:function(){this.itemTouched=!0},findNextItem:function(t){var e=t.nextElementSibling;return e?"item"!==c.getAttribute(e,"data-pc-section")?this.findNextItem(e):e:null},findPrevItem:function(t){var e=t.previousElementSibling;return e?"item"!==c.getAttribute(nextItem,"data-pc-section")?this.findPrevItem(e):e:null},updateListScroll:function(){var t=c.find(this.list,'[data-pc-section="item"][data-p-highlight="true"]');if(t&&t.length)switch(this.reorderDirection){case"up":c.scrollInView(this.list,t[0]);break;case"top":this.list.scrollTop=0;break;case"down":c.scrollInView(this.list,t[t.length-1]);break;case"bottom":this.list.scrollTop=this.list.scrollHeight}},createStyle:function(){if(!this.styleElement&&!this.isUnstyled){var t;this.$el.setAttribute(this.attributeSelector,""),this.styleElement=document.createElement("style"),this.styleElement.type="text/css",c.setAttribute(this.styleElement,"nonce",null===(t=this.$primevue)||void 0===t||null===(t=t.config)||void 0===t||null===(t=t.csp)||void 0===t?void 0:t.nonce),document.head.appendChild(this.styleElement);var e="\n@media screen and (max-width: ".concat(this.breakpoint,") {\n .p-orderlist[").concat(this.attributeSelector,"] {\n flex-direction: column;\n }\n\n .p-orderlist[").concat(this.attributeSelector,"] .p-orderlist-controls {\n padding: var(--content-padding);\n flex-direction: row;\n }\n\n .p-orderlist[").concat(this.attributeSelector,"] .p-orderlist-controls .p-button {\n margin-right: var(--inline-spacing);\n margin-bottom: 0;\n }\n\n .p-orderlist[").concat(this.attributeSelector,"] .p-orderlist-controls .p-button:last-child {\n margin-right: 0;\n }\n}\n");this.styleElement.innerHTML=e}},destroyStyle:function(){this.styleElement&&(document.head.removeChild(this.styleElement),this.styleElement=null)},moveDisabled:function(){if(!this.d_selection||!this.d_selection.length)return!0},listRef:function(t){this.list=t?t.$el:void 0}},computed:{attributeSelector:function(){return s()},focusedOptionId:function(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null},moveUpAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.moveUp:void 0},moveTopAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.moveTop:void 0},moveDownAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.moveDown:void 0},moveBottomAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.moveBottom:void 0}},components:{OLButton:t,AngleUpIcon:o,AngleDownIcon:n,AngleDoubleUpIcon:i,AngleDoubleDownIcon:e},directives:{ripple:r}};function k(t){return k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},k(t)}function L(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function P(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?L(Object(i),!0).forEach((function(e){V(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):L(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function V(t,e,i){return(e=T(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function T(t){var e=U(t,"string");return"symbol"===k(e)?e:String(e)}function U(t,e){if("object"!==k(t)||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!==k(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var j=["id","onClick","aria-selected","onMousedown","data-p-highlight","data-p-focused"];E.render=function(t,e,i,n,o,r){var s=u("AngleUpIcon"),l=u("OLButton"),c=u("AngleDoubleUpIcon"),a=u("AngleDownIcon"),d=u("AngleDoubleDownIcon"),S=p("ripple");return m(),h("div",f({class:t.cx("root")},t.ptm("root")),[v("div",f({class:t.cx("controls")},t.ptm("controls")),[y(t.$slots,"controlsstart"),b(l,f({type:"button",onClick:r.moveUp,"aria-label":r.moveUpAriaLabel,disabled:r.moveDisabled(),pt:t.ptm("moveUpButton")},t.moveUpButtonProps,{"data-pc-section":"moveupbutton",unstyled:t.unstyled}),{icon:g((function(){return[y(t.$slots,"moveupicon",{},(function(){return[b(s,f(t.ptm("moveUpButton").icon,{"data-pc-section":"moveupicon"}),null,16)]}))]})),_:3},16,["onClick","aria-label","disabled","pt","unstyled"]),b(l,f({type:"button",onClick:r.moveTop,"aria-label":r.moveTopAriaLabel,disabled:r.moveDisabled(),pt:t.ptm("moveTopButton")},t.moveTopButtonProps,{"data-pc-section":"movetopbutton",unstyled:t.unstyled}),{icon:g((function(){return[y(t.$slots,"movetopicon",{},(function(){return[b(c,f(t.ptm("moveTopButton").icon,{"data-pc-section":"movetopicon"}),null,16)]}))]})),_:3},16,["onClick","aria-label","disabled","pt","unstyled"]),b(l,f({type:"button",onClick:r.moveDown,"aria-label":r.moveDownAriaLabel,disabled:r.moveDisabled(),pt:t.ptm("moveDownButton")},t.moveDownButtonProps,{"data-pc-section":"movedownbutton",unstyled:t.unstyled}),{icon:g((function(){return[y(t.$slots,"movedownicon",{},(function(){return[b(a,f(t.ptm("moveDownButton").icon,{"data-pc-section":"movedownicon"}),null,16)]}))]})),_:3},16,["onClick","aria-label","disabled","pt","unstyled"]),b(l,f({type:"button",onClick:r.moveBottom,"aria-label":r.moveBottomAriaLabel,disabled:r.moveDisabled(),pt:t.ptm("moveBottomButton")},t.moveBottomButtonProps,{"data-pc-section":"movebottombutton",unstyled:t.unstyled}),{icon:g((function(){return[y(t.$slots,"movebottomicon",{},(function(){return[b(d,f(t.ptm("moveBottomButton").icon,{"data-pc-section":"movebottomicon"}),null,16)]}))]})),_:3},16,["onClick","aria-label","disabled","pt","unstyled"]),y(t.$slots,"controlsend")],16),v("div",f({class:t.cx("container")},t.ptm("container")),[t.$slots.header?(m(),h("div",f({key:0,class:t.cx("header")},t.ptm("header")),[y(t.$slots,"header")],16)):I("",!0),b(x,f({ref:r.listRef,id:o.id+"_list",name:"p-orderlist-flip",tag:"ul",class:t.cx("list"),style:t.listStyle,role:"listbox","aria-multiselectable":"true",tabindex:t.tabindex,"aria-activedescendant":o.focused?r.focusedOptionId:void 0,"aria-label":t.ariaLabel,"aria-labelledby":t.ariaLabelledby,onFocus:r.onListFocus,onBlur:r.onListBlur,onKeydown:r.onListKeyDown},P(P(P({},t.listProps),t.ptm("list")),t.ptm("transition"))),{default:g((function(){return[(m(!0),h(w,null,O(t.modelValue,(function(i,n){return D((m(),h("li",f({key:r.getItemKey(i,n),id:o.id+"_"+n,role:"option",class:t.cx("item",{item:i,id:"".concat(o.id,"_").concat(n)}),onClick:function(t){return r.onItemClick(t,i,n)},onTouchend:e[0]||(e[0]=function(){return r.onItemTouchEnd&&r.onItemTouchEnd.apply(r,arguments)}),"aria-selected":r.isSelected(i),onMousedown:function(t){return r.onOptionMouseDown(n)}},r.getPTOptions(i,"item",n),{"data-p-highlight":r.isSelected(i),"data-p-focused":"".concat(o.id,"_").concat(n)===r.focusedOptionId}),[y(t.$slots,"item",{item:i,index:n})],16,j)),[[S]])})),128))]})),_:3},16,["id","class","style","tabindex","aria-activedescendant","aria-label","aria-labelledby","onFocus","onBlur","onKeydown"])],16)],16)};export{E as default};
|
|
1
|
+
import t from"primevue/button";import e from"primevue/icons/angledoubledown";import i from"primevue/icons/angledoubleup";import n from"primevue/icons/angledown";import o from"primevue/icons/angleup";import r from"primevue/ripple";import{UniqueComponentId as s,ObjectUtils as l,DomHandler as c}from"primevue/utils";import a from"primevue/basecomponent";import d from"primevue/orderlist/style";import{resolveComponent as u,resolveDirective as p,openBlock as h,createElementBlock as m,mergeProps as f,createElementVNode as v,renderSlot as y,createVNode as b,withCtx as g,createCommentVNode as I,TransitionGroup as x,Fragment as w,renderList as O,withDirectives as _}from"vue";function D(t){return E(t)||A(t)||$(t)||S()}function S(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function $(t,e){if(t){if("string"==typeof t)return K(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?K(t,e):void 0}}function A(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function E(t){if(Array.isArray(t))return K(t)}function K(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}var B={name:"OrderList",extends:{name:"BaseOrderList",extends:a,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}},style:d,provide:function(){return{$parentInstance:this}}},emits:["update:modelValue","reorder","update:selection","selection-change","focus","blur"],itemTouched:!1,reorderDirection:null,styleElement:null,list:null,data:function(){return{id:this.$attrs.id,d_selection:this.selection,focused:!1,focusedOptionIndex:-1}},watch:{"$attrs.id":function(t){this.id=t||s()}},beforeUnmount:function(){this.destroyStyle()},updated:function(){this.reorderDirection&&(this.updateListScroll(),this.reorderDirection=null)},mounted:function(){this.id=this.id||s(),this.responsive&&this.createStyle()},methods:{getItemKey:function(t,e){return this.dataKey?l.resolveFieldData(t,this.dataKey):e},getPTOptions:function(t,e,i){return this.ptm(e,{context:{active:this.isSelected(t),focused:"".concat(this.id,"_").concat(i)===this.focusedOptionId}})},isSelected:function(t){return-1!=l.findIndexInList(t,this.d_selection)},onListFocus:function(t){var e=c.findSingle(this.list,'[data-p-highlight="true"]')||c.findSingle(this.list,'[data-pc-section="item"]');if(e){var i=l.findIndexInList(e,this.list.children);this.focused=!0,this.changeFocusedOptionIndex(-1!==this.focusedOptionIndex?this.focusedOptionIndex:e?i:-1),this.$emit("focus",t)}},onListBlur:function(t){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",t)},onListKeyDown:function(t){switch(t.code){case"ArrowDown":this.onArrowDownKey(t);break;case"ArrowUp":this.onArrowUpKey(t);break;case"Home":this.onHomeKey(t);break;case"End":this.onEndKey(t);break;case"Enter":this.onEnterKey(t);break;case"Space":this.onSpaceKey(t);break;case"KeyA":t.ctrlKey&&(this.d_selection=D(this.modelValue),this.$emit("update:selection",this.d_selection),t.preventDefault())}},onOptionMouseDown:function(t){this.focused=!0,this.focusedOptionIndex=t},onArrowDownKey:function(t){var e=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(e),t.shiftKey&&this.onEnterKey(t),t.preventDefault()},onArrowUpKey:function(t){var e=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(e),t.shiftKey&&this.onEnterKey(t),t.preventDefault()},onHomeKey:function(t){if(t.ctrlKey&&t.shiftKey){var e=c.find(this.list,'[data-pc-section="item"]'),i=c.findSingle(this.list,'[data-pc-section="item"][id='.concat(this.focusedOptionIndex,"]")),n=D(e).findIndex((function(t){return t===i}));this.d_selection=D(this.modelValue).slice(0,n+1),this.$emit("update:selection",this.d_selection),this.$emit("selection-change",{originalEvent:t,value:this.d_selection})}else this.changeFocusedOptionIndex(0);t.preventDefault()},onEndKey:function(t){if(t.ctrlKey&&t.shiftKey){var e=c.find(this.list,'[data-pc-section="item"]'),i=c.findSingle(this.list,'[data-pc-section="item"][id='.concat(this.focusedOptionIndex,"]")),n=D(e).findIndex((function(t){return t===i}));this.d_selection=D(this.modelValue).slice(n,e.length),this.$emit("update:selection",this.d_selection),this.$emit("selection-change",{originalEvent:t,value:this.d_selection})}else this.changeFocusedOptionIndex(c.find(this.list,'[data-pc-section="item"]').length-1);t.preventDefault()},onEnterKey:function(t){var e=c.find(this.list,'[data-pc-section="item"]'),i=c.findSingle(this.list,'[data-pc-section="item"][id='.concat(this.focusedOptionIndex,"]")),n=D(e).findIndex((function(t){return t===i}));this.onItemClick(t,this.modelValue[n],n),t.preventDefault()},onSpaceKey:function(t){if(t.preventDefault(),t.shiftKey&&this.d_selection&&this.d_selection.length>0){var e=c.find(this.list,'[data-pc-section="item"]'),i=l.findIndexInList(this.d_selection[0],D(this.modelValue)),n=c.findSingle(this.list,'[data-pc-section="item"][id='.concat(this.focusedOptionIndex,"]")),o=D(e).findIndex((function(t){return t===n}));this.d_selection=D(this.modelValue).slice(Math.min(i,o),Math.max(i,o)+1),this.$emit("update:selection",this.d_selection),this.$emit("selection-change",{originalEvent:t,value:this.d_selection})}else this.onEnterKey(t)},findNextOptionIndex:function(t){var e=D(c.find(this.list,'[data-pc-section="item"]')).findIndex((function(e){return e.id===t}));return e>-1?e+1:0},findPrevOptionIndex:function(t){var e=D(c.find(this.list,'[data-pc-section="item"]')).findIndex((function(e){return e.id===t}));return e>-1?e-1:0},changeFocusedOptionIndex:function(t){var e=c.find(this.list,'[data-pc-section="item"]'),i=t>=e.length?e.length-1:t<0?0:t;this.focusedOptionIndex=e[i]?e[i].getAttribute("id"):-1,this.scrollInView(this.focusedOptionIndex)},scrollInView:function(t){var e=c.findSingle(this.list,'[data-pc-section="item"][id="'.concat(t,'"]'));e&&e.scrollIntoView&&e.scrollIntoView({block:"nearest",inline:"start"})},moveUp:function(t){if(this.d_selection){for(var e=D(this.modelValue),i=0;i<this.d_selection.length;i++){var n=l.findIndexInList(this.d_selection[i],e);if(0===n)break;var o=e[n-1];e[n-1]=e[n],e[n]=o}this.reorderDirection="up",this.$emit("update:modelValue",e),this.$emit("reorder",{originalEvent:t,value:e,direction:this.reorderDirection})}},moveTop:function(t){if(this.d_selection){for(var e=D(this.modelValue),i=0;i<this.d_selection.length;i++){var n=l.findIndexInList(this.d_selection[i],e);if(0===n)break;var o=e.splice(n,1)[0];e.unshift(o)}this.reorderDirection="top",this.$emit("update:modelValue",e),this.$emit("reorder",{originalEvent:t,value:e,direction:this.reorderDirection})}},moveDown:function(t){if(this.d_selection){for(var e=D(this.modelValue),i=this.d_selection.length-1;i>=0;i--){var n=l.findIndexInList(this.d_selection[i],e);if(n===e.length-1)break;var o=e[n+1];e[n+1]=e[n],e[n]=o}this.reorderDirection="down",this.$emit("update:modelValue",e),this.$emit("reorder",{originalEvent:t,value:e,direction:this.reorderDirection})}},moveBottom:function(t){if(this.d_selection){for(var e=D(this.modelValue),i=this.d_selection.length-1;i>=0;i--){var n=l.findIndexInList(this.d_selection[i],e);if(n===e.length-1)break;var o=e.splice(n,1)[0];e.push(o)}this.reorderDirection="bottom",this.$emit("update:modelValue",e),this.$emit("reorder",{originalEvent:t,value:e,direction:this.reorderDirection})}},onItemClick:function(t,e,i){this.itemTouched=!1;var n=l.findIndexInList(e,this.d_selection),o=-1!=n,r=!this.itemTouched&&this.metaKeySelection,s=c.find(this.list,'[data-pc-section="item"]')[i].getAttribute("id");if(this.focusedOptionIndex=s,r){var a=t.metaKey||t.ctrlKey;o&&a?this.d_selection=this.d_selection.filter((function(t,e){return e!==n})):(this.d_selection=a&&this.d_selection?D(this.d_selection):[],l.insertIntoOrderedArray(e,i,this.d_selection,this.modelValue))}else o?this.d_selection=this.d_selection.filter((function(t,e){return e!==n})):(this.d_selection=this.d_selection?D(this.d_selection):[],l.insertIntoOrderedArray(e,i,this.d_selection,this.modelValue));this.$emit("update:selection",this.d_selection),this.$emit("selection-change",{originalEvent:t,value:this.d_selection})},onItemTouchEnd:function(){this.itemTouched=!0},findNextItem:function(t){var e=t.nextElementSibling;return e?"item"!==c.getAttribute(e,"data-pc-section")?this.findNextItem(e):e:null},findPrevItem:function(t){var e=t.previousElementSibling;return e?"item"!==c.getAttribute(nextItem,"data-pc-section")?this.findPrevItem(e):e:null},updateListScroll:function(){var t=c.find(this.list,'[data-pc-section="item"][data-p-highlight="true"]');if(t&&t.length)switch(this.reorderDirection){case"up":c.scrollInView(this.list,t[0]);break;case"top":this.list.scrollTop=0;break;case"down":c.scrollInView(this.list,t[t.length-1]);break;case"bottom":this.list.scrollTop=this.list.scrollHeight}},createStyle:function(){if(!this.styleElement&&!this.isUnstyled){var t;this.$el.setAttribute(this.attributeSelector,""),this.styleElement=document.createElement("style"),this.styleElement.type="text/css",c.setAttribute(this.styleElement,"nonce",null===(t=this.$primevue)||void 0===t||null===(t=t.config)||void 0===t||null===(t=t.csp)||void 0===t?void 0:t.nonce),document.head.appendChild(this.styleElement);var e="\n@media screen and (max-width: ".concat(this.breakpoint,") {\n .p-orderlist[").concat(this.attributeSelector,"] {\n flex-direction: column;\n }\n\n .p-orderlist[").concat(this.attributeSelector,"] .p-orderlist-controls {\n padding: var(--content-padding);\n flex-direction: row;\n }\n\n .p-orderlist[").concat(this.attributeSelector,"] .p-orderlist-controls .p-button {\n margin-right: var(--inline-spacing);\n margin-bottom: 0;\n }\n\n .p-orderlist[").concat(this.attributeSelector,"] .p-orderlist-controls .p-button:last-child {\n margin-right: 0;\n }\n}\n");this.styleElement.innerHTML=e}},destroyStyle:function(){this.styleElement&&(document.head.removeChild(this.styleElement),this.styleElement=null)},moveDisabled:function(){if(!this.d_selection||!this.d_selection.length)return!0},listRef:function(t){this.list=t?t.$el:void 0}},computed:{attributeSelector:function(){return s()},focusedOptionId:function(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null},moveUpAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.moveUp:void 0},moveTopAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.moveTop:void 0},moveDownAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.moveDown:void 0},moveBottomAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.moveBottom:void 0}},components:{OLButton:t,AngleUpIcon:o,AngleDownIcon:n,AngleDoubleUpIcon:i,AngleDoubleDownIcon:e},directives:{ripple:r}};function k(t){return k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},k(t)}function L(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function P(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?L(Object(i),!0).forEach((function(e){V(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):L(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function V(t,e,i){return(e=T(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function T(t){var e=U(t,"string");return"symbol"===k(e)?e:String(e)}function U(t,e){if("object"!==k(t)||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!==k(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var j=["id","onClick","aria-selected","onMousedown","data-p-highlight","data-p-focused"];B.render=function(t,e,i,n,o,r){var s=u("AngleUpIcon"),l=u("OLButton"),c=u("AngleDoubleUpIcon"),a=u("AngleDownIcon"),d=u("AngleDoubleDownIcon"),D=p("ripple");return h(),m("div",f({class:t.cx("root")},t.ptm("root")),[v("div",f({class:t.cx("controls")},t.ptm("controls")),[y(t.$slots,"controlsstart"),b(l,f({type:"button",onClick:r.moveUp,"aria-label":r.moveUpAriaLabel,disabled:r.moveDisabled(),pt:t.ptm("moveUpButton")},t.moveUpButtonProps,{"data-pc-section":"moveupbutton",unstyled:t.unstyled}),{icon:g((function(){return[y(t.$slots,"moveupicon",{},(function(){return[b(s,f(t.ptm("moveUpButton").icon,{"data-pc-section":"moveupicon"}),null,16)]}))]})),_:3},16,["onClick","aria-label","disabled","pt","unstyled"]),b(l,f({type:"button",onClick:r.moveTop,"aria-label":r.moveTopAriaLabel,disabled:r.moveDisabled(),pt:t.ptm("moveTopButton")},t.moveTopButtonProps,{"data-pc-section":"movetopbutton",unstyled:t.unstyled}),{icon:g((function(){return[y(t.$slots,"movetopicon",{},(function(){return[b(c,f(t.ptm("moveTopButton").icon,{"data-pc-section":"movetopicon"}),null,16)]}))]})),_:3},16,["onClick","aria-label","disabled","pt","unstyled"]),b(l,f({type:"button",onClick:r.moveDown,"aria-label":r.moveDownAriaLabel,disabled:r.moveDisabled(),pt:t.ptm("moveDownButton")},t.moveDownButtonProps,{"data-pc-section":"movedownbutton",unstyled:t.unstyled}),{icon:g((function(){return[y(t.$slots,"movedownicon",{},(function(){return[b(a,f(t.ptm("moveDownButton").icon,{"data-pc-section":"movedownicon"}),null,16)]}))]})),_:3},16,["onClick","aria-label","disabled","pt","unstyled"]),b(l,f({type:"button",onClick:r.moveBottom,"aria-label":r.moveBottomAriaLabel,disabled:r.moveDisabled(),pt:t.ptm("moveBottomButton")},t.moveBottomButtonProps,{"data-pc-section":"movebottombutton",unstyled:t.unstyled}),{icon:g((function(){return[y(t.$slots,"movebottomicon",{},(function(){return[b(d,f(t.ptm("moveBottomButton").icon,{"data-pc-section":"movebottomicon"}),null,16)]}))]})),_:3},16,["onClick","aria-label","disabled","pt","unstyled"]),y(t.$slots,"controlsend")],16),v("div",f({class:t.cx("container")},t.ptm("container")),[t.$slots.header?(h(),m("div",f({key:0,class:t.cx("header")},t.ptm("header")),[y(t.$slots,"header")],16)):I("",!0),b(x,f({ref:r.listRef,id:o.id+"_list",name:"p-orderlist-flip",tag:"ul",class:t.cx("list"),style:t.listStyle,role:"listbox","aria-multiselectable":"true",tabindex:t.tabindex,"aria-activedescendant":o.focused?r.focusedOptionId:void 0,"aria-label":t.ariaLabel,"aria-labelledby":t.ariaLabelledby,onFocus:r.onListFocus,onBlur:r.onListBlur,onKeydown:r.onListKeyDown},P(P(P({},t.listProps),t.ptm("list")),t.ptm("transition"))),{default:g((function(){return[(h(!0),m(w,null,O(t.modelValue,(function(i,n){return _((h(),m("li",f({key:r.getItemKey(i,n),id:o.id+"_"+n,role:"option",class:t.cx("item",{item:i,id:"".concat(o.id,"_").concat(n)}),onClick:function(t){return r.onItemClick(t,i,n)},onTouchend:e[0]||(e[0]=function(){return r.onItemTouchEnd&&r.onItemTouchEnd.apply(r,arguments)}),"aria-selected":r.isSelected(i),onMousedown:function(t){return r.onOptionMouseDown(n)}},r.getPTOptions(i,"item",n),{"data-p-highlight":r.isSelected(i),"data-p-focused":"".concat(o.id,"_").concat(n)===r.focusedOptionId}),[y(t.$slots,"item",{item:i,index:n})],16,j)),[[D]])})),128))]})),_:3},16,["id","class","style","tabindex","aria-activedescendant","aria-label","aria-labelledby","onFocus","onBlur","onKeydown"])],16)],16)};export{B as default};
|