primevue 3.22.0 → 3.22.2

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.
Files changed (42) hide show
  1. package/core/core.js +15 -12
  2. package/core/core.min.js +2 -2
  3. package/divider/Divider.vue +1 -1
  4. package/divider/divider.cjs.js +1 -1
  5. package/divider/divider.cjs.min.js +1 -1
  6. package/divider/divider.esm.js +1 -1
  7. package/divider/divider.esm.min.js +1 -1
  8. package/divider/divider.js +1 -1
  9. package/divider/divider.min.js +1 -1
  10. package/menu/Menu.vue +1 -1
  11. package/menu/menu.cjs.js +1 -1
  12. package/menu/menu.cjs.min.js +1 -1
  13. package/menu/menu.esm.js +1 -1
  14. package/menu/menu.esm.min.js +1 -1
  15. package/menu/menu.js +1 -1
  16. package/menu/menu.min.js +1 -1
  17. package/package.json +1 -1
  18. package/paginator/JumpToPageInput.vue +11 -8
  19. package/paginator/Paginator.vue +1 -1
  20. package/paginator/paginator.cjs.js +14 -11
  21. package/paginator/paginator.cjs.min.js +1 -1
  22. package/paginator/paginator.esm.js +14 -11
  23. package/paginator/paginator.esm.min.js +1 -1
  24. package/paginator/paginator.js +14 -11
  25. package/paginator/paginator.min.js +1 -1
  26. package/rating/Rating.vue +1 -0
  27. package/rating/rating.cjs.js +1 -1
  28. package/rating/rating.cjs.min.js +1 -1
  29. package/rating/rating.esm.js +1 -1
  30. package/rating/rating.esm.min.js +1 -1
  31. package/rating/rating.js +1 -1
  32. package/rating/rating.min.js +1 -1
  33. package/resources/primevue.css +1 -0
  34. package/resources/primevue.min.css +1 -1
  35. package/sidebar/Sidebar.vue +61 -51
  36. package/sidebar/sidebar.cjs.js +124 -103
  37. package/sidebar/sidebar.cjs.min.js +1 -1
  38. package/sidebar/sidebar.esm.js +125 -104
  39. package/sidebar/sidebar.esm.min.js +1 -1
  40. package/sidebar/sidebar.js +124 -103
  41. package/sidebar/sidebar.min.js +1 -1
  42. package/web-types.json +1 -1
@@ -1 +1 @@
1
- import e from"primevue/overlayeventbus";import t from"primevue/portal";import{ObjectUtils as i,ZIndexUtils as n,DomHandler as s,ConnectedOverlayScrollHandler as l,UniqueComponentId as o}from"primevue/utils";import a from"primevue/ripple";import{resolveComponent as r,resolveDirective as d,openBlock as c,createElementBlock as u,normalizeClass as p,normalizeStyle as h,createElementVNode as m,Fragment as b,createBlock as f,withCtx as v,withDirectives as y,createCommentVNode as k,toDisplayString as x,resolveDynamicComponent as g,createVNode as I,Transition as L,mergeProps as O,renderList as C,renderSlot as E,createTextVNode as w}from"vue";var A={name:"Menuitem",inheritAttrs:!1,emits:["item-click"],props:{item:null,template:null,exact:null,id:null,focusedOptionId:null},methods:{getItemProp:(e,t)=>e&&e.item?i.getItemValue(e.item[t]):void 0,onItemActionClick(e,t){t&&t(e)},onItemClick(e){const t=this.getItemProp(this.item,"command");t&&t({originalEvent:e,item:this.item.item}),this.$emit("item-click",{originalEvent:e,item:this.item,id:this.id})},containerClass(){return["p-menuitem",this.item.class,{"p-focus":this.id===this.focusedOptionId,"p-disabled":this.disabled()}]},linkClass(e){return["p-menuitem-link",{"router-link-active":e&&e.isActive,"router-link-active-exact":this.exact&&e&&e.isExactActive}]},visible(){return"function"==typeof this.item.visible?this.item.visible():!1!==this.item.visible},disabled(){return"function"==typeof this.item.disabled?this.item.disabled():this.item.disabled},label(){return"function"==typeof this.item.label?this.item.label():this.item.label}},directives:{ripple:a}};const S=["id","aria-label","aria-disabled"],K=["href","onClick"],z={class:"p-menuitem-text"},$=["href","target"],D={class:"p-menuitem-text"};A.render=function(e,t,i,n,s,l){const o=r("router-link"),a=d("ripple");return l.visible()?(c(),u("li",{key:0,id:i.id,class:p(l.containerClass()),role:"menuitem",style:h(i.item.style),"aria-label":l.label(),"aria-disabled":l.disabled()},[m("div",{class:"p-menuitem-content",onClick:t[0]||(t[0]=e=>l.onItemClick(e))},[i.template?(c(),f(g(i.template),{key:1,item:i.item},null,8,["item"])):(c(),u(b,{key:0},[i.item.to&&!l.disabled()?(c(),f(o,{key:0,to:i.item.to,custom:""},{default:v((({navigate:e,href:t,isActive:n,isExactActive:s})=>[y((c(),u("a",{href:t,class:p(l.linkClass({isActive:n,isExactActive:s})),tabindex:"-1","aria-hidden":"true",onClick:t=>l.onItemActionClick(t,e)},[i.item.icon?(c(),u("span",{key:0,class:p(["p-menuitem-icon",i.item.icon])},null,2)):k("",!0),m("span",z,x(l.label()),1)],10,K)),[[a]])])),_:1},8,["to"])):y((c(),u("a",{key:1,href:i.item.url,class:p(l.linkClass()),target:i.item.target,tabindex:"-1","aria-hidden":"true"},[i.item.icon?(c(),u("span",{key:0,class:p(["p-menuitem-icon",i.item.icon])},null,2)):k("",!0),m("span",D,x(l.label()),1)],10,$)),[[a]])],64))])],14,S)):k("",!0)};var V={name:"Menu",inheritAttrs:!1,emits:["show","hide","focus","blur"],props:{popup:{type:Boolean,default:!1},model:{type:Array,default:null},appendTo:{type:String,default:"body"},autoZIndex:{type:Boolean,default:!0},baseZIndex:{type:Number,default:0},exact:{type:Boolean,default:!0},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},data:()=>({overlayVisible:!1,focused:!1,focusedOptionIndex:-1,selectedOptionIndex:-1}),target:null,outsideClickListener:null,scrollHandler:null,resizeListener:null,container:null,list:null,mounted(){this.popup||(this.bindResizeListener(),this.bindOutsideClickListener())},beforeUnmount(){this.unbindResizeListener(),this.unbindOutsideClickListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.target=null,this.container&&this.autoZIndex&&n.clear(this.container),this.container=null},methods:{itemClick(e){const t=e.item;this.disabled(t)||(t.command&&t.command(e),t.to&&e.navigate&&e.navigate(e.originalEvent),this.overlayVisible&&this.hide(),this.popup||this.focusedOptionIndex===e.id||(this.focusedOptionIndex=e.id))},onListFocus(e){this.focused=!0,this.popup||(-1!==this.selectedOptionIndex?(this.changeFocusedOptionIndex(this.selectedOptionIndex),this.selectedOptionIndex=-1):this.changeFocusedOptionIndex(0)),this.$emit("focus",e)},onListBlur(e){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onListKeyDown(e){switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"Enter":this.onEnterKey(e);break;case"Space":this.onSpaceKey(e);break;case"Escape":this.popup&&(s.focus(this.target),this.hide());case"Tab":this.overlayVisible&&this.hide()}},onArrowDownKey(e){const t=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.preventDefault()},onArrowUpKey(e){if(e.altKey&&this.popup)s.focus(this.target),this.hide(),e.preventDefault();else{const t=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.preventDefault()}},onHomeKey(e){this.changeFocusedOptionIndex(0),e.preventDefault()},onEndKey(e){this.changeFocusedOptionIndex(s.find(this.container,"li.p-menuitem:not(.p-disabled)").length-1),e.preventDefault()},onEnterKey(e){const t=s.findSingle(this.list,`li[id="${this.focusedOptionIndex}"]`),i=t&&s.findSingle(t,".p-menuitem-link");this.popup&&s.focus(this.target),i?i.click():t&&t.click(),e.preventDefault()},onSpaceKey(e){this.onEnterKey(e)},findNextOptionIndex(e){const t=[...s.find(this.container,"li.p-menuitem:not(.p-disabled)")].findIndex((t=>t.id===e));return t>-1?t+1:0},findPrevOptionIndex(e){const t=[...s.find(this.container,"li.p-menuitem:not(.p-disabled)")].findIndex((t=>t.id===e));return t>-1?t-1:0},changeFocusedOptionIndex(e){const t=s.find(this.container,"li.p-menuitem:not(.p-disabled)");let i=e>=t.length?t.length-1:e<0?0:e;this.focusedOptionIndex=t[i].getAttribute("id")},toggle(e){this.overlayVisible?this.hide():this.show(e)},show(e){this.overlayVisible=!0,this.target=e.currentTarget},hide(){this.overlayVisible=!1,this.target=null},onEnter(e){this.alignOverlay(),this.bindOutsideClickListener(),this.bindResizeListener(),this.bindScrollListener(),this.autoZIndex&&n.set("menu",e,this.baseZIndex+this.$primevue.config.zIndex.menu),this.popup&&(s.focus(this.list),this.changeFocusedOptionIndex(0)),this.$emit("show")},onLeave(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.unbindScrollListener(),this.$emit("hide")},onAfterLeave(e){this.autoZIndex&&n.clear(e)},alignOverlay(){s.absolutePosition(this.container,this.target),this.container.style.minWidth=s.getOuterWidth(this.target)+"px"},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{const t=this.container&&!this.container.contains(e.target),i=!(this.target&&(this.target===e.target||this.target.contains(e.target)));this.overlayVisible&&t&&i?this.hide():!this.popup&&t&&i&&(this.focusedOptionIndex=-1)},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new l(this.target,(()=>{this.overlayVisible&&this.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!s.isTouchDevice()&&this.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},visible:e=>"function"==typeof e.visible?e.visible():!1!==e.visible,disabled:e=>"function"==typeof e.disabled?e.disabled():e.disabled,label:e=>"function"==typeof e.label?e.label():e.label,separatorClass:e=>["p-menuitem-separator",e.class],onOverlayClick(t){e.emit("overlay-click",{originalEvent:t,target:this.target})},containerRef(e){this.container=e},listRef(e){this.list=e}},computed:{containerClass(){return["p-menu p-component",{"p-menu-overlay":this.popup,"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},id(){return this.$attrs.id||o()},focusedOptionId(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null}},components:{PVMenuitem:A,Portal:t}};const F=["id"],H=["id","tabindex","aria-activedescendant","aria-label","aria-labelledby"],R=["id"];!function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css","top"===i&&n.firstChild?n.insertBefore(s,n.firstChild):n.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}}("\n.p-menu-overlay {\n position: absolute;\n top: 0;\n left: 0;\n}\n.p-menu ul {\n margin: 0;\n padding: 0;\n list-style: none;\n}\n.p-menu .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.p-menu .p-menuitem-text {\n line-height: 1;\n}\n"),V.render=function(e,t,i,n,s,l){const o=r("PVMenuitem"),a=r("Portal");return c(),f(a,{appendTo:i.appendTo,disabled:!i.popup},{default:v((()=>[I(L,{name:"p-connected-overlay",onEnter:l.onEnter,onLeave:l.onLeave,onAfterLeave:l.onAfterLeave},{default:v((()=>[!i.popup||s.overlayVisible?(c(),u("div",O({key:0,ref:l.containerRef,id:l.id,class:l.containerClass},e.$attrs,{onClick:t[3]||(t[3]=(...e)=>l.onOverlayClick&&l.onOverlayClick(...e))}),[m("ul",{ref:l.listRef,id:l.id+"_list",class:"p-menu-list p-reset",role:"menu",tabindex:i.tabindex,"aria-activedescendant":s.focused?l.focusedOptionId:void 0,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,onFocus:t[0]||(t[0]=(...e)=>l.onListFocus&&l.onListFocus(...e)),onBlur:t[1]||(t[1]=(...e)=>l.onListBlur&&l.onListBlur(...e)),onKeydown:t[2]||(t[2]=(...e)=>l.onListKeyDown&&l.onListKeyDown(...e))},[(c(!0),u(b,null,C(i.model,((t,n)=>(c(),u(b,{key:l.label(t)+n.toString()},[t.items&&l.visible(t)&&!t.separator?(c(),u(b,{key:0},[t.items?(c(),u("li",{key:0,id:l.id+"_"+n,class:"p-submenu-header",role:"none"},[E(e.$slots,"item",{item:t},(()=>[w(x(l.label(t)),1)]))],8,R)):k("",!0),(c(!0),u(b,null,C(t.items,((s,a)=>(c(),u(b,{key:s.label+n+"_"+a},[l.visible(s)&&!s.separator?(c(),f(o,{key:0,id:l.id+"_"+n+"_"+a,item:s,template:e.$slots.item,exact:i.exact,focusedOptionId:l.focusedOptionId,onItemClick:l.itemClick},null,8,["id","item","template","exact","focusedOptionId","onItemClick"])):l.visible(s)&&s.separator?(c(),u("li",{key:"separator"+n+a,class:p(l.separatorClass(t)),style:h(s.style),role:"separator"},null,6)):k("",!0)],64)))),128))],64)):l.visible(t)&&t.separator?(c(),u("li",{key:"separator"+n.toString(),class:p(l.separatorClass(t)),style:h(t.style),role:"separator"},null,6)):(c(),f(o,{key:l.label(t)+n.toString(),id:l.id+"_"+n,item:t,template:e.$slots.item,exact:i.exact,focusedOptionId:l.focusedOptionId,onItemClick:l.itemClick},null,8,["id","item","template","exact","focusedOptionId","onItemClick"]))],64)))),128))],40,H)],16,F)):k("",!0)])),_:3},8,["onEnter","onLeave","onAfterLeave"])])),_:3},8,["appendTo","disabled"])};export{V as default};
1
+ import e from"primevue/overlayeventbus";import t from"primevue/portal";import{ObjectUtils as i,ZIndexUtils as n,DomHandler as s,ConnectedOverlayScrollHandler as l,UniqueComponentId as o}from"primevue/utils";import a from"primevue/ripple";import{resolveComponent as r,resolveDirective as d,openBlock as c,createElementBlock as u,normalizeClass as p,normalizeStyle as h,createElementVNode as m,Fragment as b,createBlock as f,withCtx as v,withDirectives as y,createCommentVNode as k,toDisplayString as x,resolveDynamicComponent as g,createVNode as I,Transition as L,mergeProps as O,renderList as C,renderSlot as E,createTextVNode as w}from"vue";var A={name:"Menuitem",inheritAttrs:!1,emits:["item-click"],props:{item:null,template:null,exact:null,id:null,focusedOptionId:null},methods:{getItemProp:(e,t)=>e&&e.item?i.getItemValue(e.item[t]):void 0,onItemActionClick(e,t){t&&t(e)},onItemClick(e){const t=this.getItemProp(this.item,"command");t&&t({originalEvent:e,item:this.item.item}),this.$emit("item-click",{originalEvent:e,item:this.item,id:this.id})},containerClass(){return["p-menuitem",this.item.class,{"p-focus":this.id===this.focusedOptionId,"p-disabled":this.disabled()}]},linkClass(e){return["p-menuitem-link",{"router-link-active":e&&e.isActive,"router-link-active-exact":this.exact&&e&&e.isExactActive}]},visible(){return"function"==typeof this.item.visible?this.item.visible():!1!==this.item.visible},disabled(){return"function"==typeof this.item.disabled?this.item.disabled():this.item.disabled},label(){return"function"==typeof this.item.label?this.item.label():this.item.label}},directives:{ripple:a}};const S=["id","aria-label","aria-disabled"],K=["href","onClick"],z={class:"p-menuitem-text"},$=["href","target"],D={class:"p-menuitem-text"};A.render=function(e,t,i,n,s,l){const o=r("router-link"),a=d("ripple");return l.visible()?(c(),u("li",{key:0,id:i.id,class:p(l.containerClass()),role:"menuitem",style:h(i.item.style),"aria-label":l.label(),"aria-disabled":l.disabled()},[m("div",{class:"p-menuitem-content",onClick:t[0]||(t[0]=e=>l.onItemClick(e))},[i.template?(c(),f(g(i.template),{key:1,item:i.item},null,8,["item"])):(c(),u(b,{key:0},[i.item.to&&!l.disabled()?(c(),f(o,{key:0,to:i.item.to,custom:""},{default:v((({navigate:e,href:t,isActive:n,isExactActive:s})=>[y((c(),u("a",{href:t,class:p(l.linkClass({isActive:n,isExactActive:s})),tabindex:"-1","aria-hidden":"true",onClick:t=>l.onItemActionClick(t,e)},[i.item.icon?(c(),u("span",{key:0,class:p(["p-menuitem-icon",i.item.icon])},null,2)):k("",!0),m("span",z,x(l.label()),1)],10,K)),[[a]])])),_:1},8,["to"])):y((c(),u("a",{key:1,href:i.item.url,class:p(l.linkClass()),target:i.item.target,tabindex:"-1","aria-hidden":"true"},[i.item.icon?(c(),u("span",{key:0,class:p(["p-menuitem-icon",i.item.icon])},null,2)):k("",!0),m("span",D,x(l.label()),1)],10,$)),[[a]])],64))])],14,S)):k("",!0)};var V={name:"Menu",inheritAttrs:!1,emits:["show","hide","focus","blur"],props:{popup:{type:Boolean,default:!1},model:{type:Array,default:null},appendTo:{type:String,default:"body"},autoZIndex:{type:Boolean,default:!0},baseZIndex:{type:Number,default:0},exact:{type:Boolean,default:!0},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},data:()=>({overlayVisible:!1,focused:!1,focusedOptionIndex:-1,selectedOptionIndex:-1}),target:null,outsideClickListener:null,scrollHandler:null,resizeListener:null,container:null,list:null,mounted(){this.popup||(this.bindResizeListener(),this.bindOutsideClickListener())},beforeUnmount(){this.unbindResizeListener(),this.unbindOutsideClickListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.target=null,this.container&&this.autoZIndex&&n.clear(this.container),this.container=null},methods:{itemClick(e){const t=e.item;this.disabled(t)||(t.command&&t.command(e),t.to&&e.navigate&&e.navigate(e.originalEvent),this.overlayVisible&&this.hide(),this.popup||this.focusedOptionIndex===e.id||(this.focusedOptionIndex=e.id))},onListFocus(e){this.focused=!0,this.popup||(-1!==this.selectedOptionIndex?(this.changeFocusedOptionIndex(this.selectedOptionIndex),this.selectedOptionIndex=-1):this.changeFocusedOptionIndex(0)),this.$emit("focus",e)},onListBlur(e){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onListKeyDown(e){switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"Enter":this.onEnterKey(e);break;case"Space":this.onSpaceKey(e);break;case"Escape":this.popup&&(s.focus(this.target),this.hide());case"Tab":this.overlayVisible&&this.hide()}},onArrowDownKey(e){const t=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.preventDefault()},onArrowUpKey(e){if(e.altKey&&this.popup)s.focus(this.target),this.hide(),e.preventDefault();else{const t=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.preventDefault()}},onHomeKey(e){this.changeFocusedOptionIndex(0),e.preventDefault()},onEndKey(e){this.changeFocusedOptionIndex(s.find(this.container,"li.p-menuitem:not(.p-disabled)").length-1),e.preventDefault()},onEnterKey(e){const t=s.findSingle(this.list,`li[id="${this.focusedOptionIndex}"]`),i=t&&s.findSingle(t,".p-menuitem-link");this.popup&&s.focus(this.target),i?i.click():t&&t.click(),e.preventDefault()},onSpaceKey(e){this.onEnterKey(e)},findNextOptionIndex(e){const t=[...s.find(this.container,"li.p-menuitem:not(.p-disabled)")].findIndex((t=>t.id===e));return t>-1?t+1:0},findPrevOptionIndex(e){const t=[...s.find(this.container,"li.p-menuitem:not(.p-disabled)")].findIndex((t=>t.id===e));return t>-1?t-1:0},changeFocusedOptionIndex(e){const t=s.find(this.container,"li.p-menuitem:not(.p-disabled)");let i=e>=t.length?t.length-1:e<0?0:e;i>-1&&(this.focusedOptionIndex=t[i].getAttribute("id"))},toggle(e){this.overlayVisible?this.hide():this.show(e)},show(e){this.overlayVisible=!0,this.target=e.currentTarget},hide(){this.overlayVisible=!1,this.target=null},onEnter(e){this.alignOverlay(),this.bindOutsideClickListener(),this.bindResizeListener(),this.bindScrollListener(),this.autoZIndex&&n.set("menu",e,this.baseZIndex+this.$primevue.config.zIndex.menu),this.popup&&(s.focus(this.list),this.changeFocusedOptionIndex(0)),this.$emit("show")},onLeave(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.unbindScrollListener(),this.$emit("hide")},onAfterLeave(e){this.autoZIndex&&n.clear(e)},alignOverlay(){s.absolutePosition(this.container,this.target),this.container.style.minWidth=s.getOuterWidth(this.target)+"px"},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{const t=this.container&&!this.container.contains(e.target),i=!(this.target&&(this.target===e.target||this.target.contains(e.target)));this.overlayVisible&&t&&i?this.hide():!this.popup&&t&&i&&(this.focusedOptionIndex=-1)},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new l(this.target,(()=>{this.overlayVisible&&this.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!s.isTouchDevice()&&this.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},visible:e=>"function"==typeof e.visible?e.visible():!1!==e.visible,disabled:e=>"function"==typeof e.disabled?e.disabled():e.disabled,label:e=>"function"==typeof e.label?e.label():e.label,separatorClass:e=>["p-menuitem-separator",e.class],onOverlayClick(t){e.emit("overlay-click",{originalEvent:t,target:this.target})},containerRef(e){this.container=e},listRef(e){this.list=e}},computed:{containerClass(){return["p-menu p-component",{"p-menu-overlay":this.popup,"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},id(){return this.$attrs.id||o()},focusedOptionId(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null}},components:{PVMenuitem:A,Portal:t}};const F=["id"],H=["id","tabindex","aria-activedescendant","aria-label","aria-labelledby"],R=["id"];!function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css","top"===i&&n.firstChild?n.insertBefore(s,n.firstChild):n.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}}("\n.p-menu-overlay {\n position: absolute;\n top: 0;\n left: 0;\n}\n.p-menu ul {\n margin: 0;\n padding: 0;\n list-style: none;\n}\n.p-menu .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.p-menu .p-menuitem-text {\n line-height: 1;\n}\n"),V.render=function(e,t,i,n,s,l){const o=r("PVMenuitem"),a=r("Portal");return c(),f(a,{appendTo:i.appendTo,disabled:!i.popup},{default:v((()=>[I(L,{name:"p-connected-overlay",onEnter:l.onEnter,onLeave:l.onLeave,onAfterLeave:l.onAfterLeave},{default:v((()=>[!i.popup||s.overlayVisible?(c(),u("div",O({key:0,ref:l.containerRef,id:l.id,class:l.containerClass},e.$attrs,{onClick:t[3]||(t[3]=(...e)=>l.onOverlayClick&&l.onOverlayClick(...e))}),[m("ul",{ref:l.listRef,id:l.id+"_list",class:"p-menu-list p-reset",role:"menu",tabindex:i.tabindex,"aria-activedescendant":s.focused?l.focusedOptionId:void 0,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,onFocus:t[0]||(t[0]=(...e)=>l.onListFocus&&l.onListFocus(...e)),onBlur:t[1]||(t[1]=(...e)=>l.onListBlur&&l.onListBlur(...e)),onKeydown:t[2]||(t[2]=(...e)=>l.onListKeyDown&&l.onListKeyDown(...e))},[(c(!0),u(b,null,C(i.model,((t,n)=>(c(),u(b,{key:l.label(t)+n.toString()},[t.items&&l.visible(t)&&!t.separator?(c(),u(b,{key:0},[t.items?(c(),u("li",{key:0,id:l.id+"_"+n,class:"p-submenu-header",role:"none"},[E(e.$slots,"item",{item:t},(()=>[w(x(l.label(t)),1)]))],8,R)):k("",!0),(c(!0),u(b,null,C(t.items,((s,a)=>(c(),u(b,{key:s.label+n+"_"+a},[l.visible(s)&&!s.separator?(c(),f(o,{key:0,id:l.id+"_"+n+"_"+a,item:s,template:e.$slots.item,exact:i.exact,focusedOptionId:l.focusedOptionId,onItemClick:l.itemClick},null,8,["id","item","template","exact","focusedOptionId","onItemClick"])):l.visible(s)&&s.separator?(c(),u("li",{key:"separator"+n+a,class:p(l.separatorClass(t)),style:h(s.style),role:"separator"},null,6)):k("",!0)],64)))),128))],64)):l.visible(t)&&t.separator?(c(),u("li",{key:"separator"+n.toString(),class:p(l.separatorClass(t)),style:h(t.style),role:"separator"},null,6)):(c(),f(o,{key:l.label(t)+n.toString(),id:l.id+"_"+n,item:t,template:e.$slots.item,exact:i.exact,focusedOptionId:l.focusedOptionId,onItemClick:l.itemClick},null,8,["id","item","template","exact","focusedOptionId","onItemClick"]))],64)))),128))],40,H)],16,F)):k("",!0)])),_:3},8,["onEnter","onLeave","onAfterLeave"])])),_:3},8,["appendTo","disabled"])};export{V as default};
package/menu/menu.js CHANGED
@@ -351,7 +351,7 @@ this.primevue.menu = (function (OverlayEventBus, Portal, utils, Ripple, vue) {
351
351
  const links = utils.DomHandler.find(this.container, 'li.p-menuitem:not(.p-disabled)');
352
352
  let order = index >= links.length ? links.length - 1 : index < 0 ? 0 : index;
353
353
 
354
- this.focusedOptionIndex = links[order].getAttribute('id');
354
+ order > -1 && (this.focusedOptionIndex = links[order].getAttribute('id'));
355
355
  },
356
356
  toggle(event) {
357
357
  if (this.overlayVisible) this.hide();
package/menu/menu.min.js CHANGED
@@ -1 +1 @@
1
- this.primevue=this.primevue||{},this.primevue.menu=function(e,t,i,n,s){"use strict";function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=l(e),a=l(t),r={name:"Menuitem",inheritAttrs:!1,emits:["item-click"],props:{item:null,template:null,exact:null,id:null,focusedOptionId:null},methods:{getItemProp:(e,t)=>e&&e.item?i.ObjectUtils.getItemValue(e.item[t]):void 0,onItemActionClick(e,t){t&&t(e)},onItemClick(e){const t=this.getItemProp(this.item,"command");t&&t({originalEvent:e,item:this.item.item}),this.$emit("item-click",{originalEvent:e,item:this.item,id:this.id})},containerClass(){return["p-menuitem",this.item.class,{"p-focus":this.id===this.focusedOptionId,"p-disabled":this.disabled()}]},linkClass(e){return["p-menuitem-link",{"router-link-active":e&&e.isActive,"router-link-active-exact":this.exact&&e&&e.isExactActive}]},visible(){return"function"==typeof this.item.visible?this.item.visible():!1!==this.item.visible},disabled(){return"function"==typeof this.item.disabled?this.item.disabled():this.item.disabled},label(){return"function"==typeof this.item.label?this.item.label():this.item.label}},directives:{ripple:l(n).default}};const d=["id","aria-label","aria-disabled"],c=["href","onClick"],u={class:"p-menuitem-text"},p=["href","target"],m={class:"p-menuitem-text"};r.render=function(e,t,i,n,l,o){const a=s.resolveComponent("router-link"),r=s.resolveDirective("ripple");return o.visible()?(s.openBlock(),s.createElementBlock("li",{key:0,id:i.id,class:s.normalizeClass(o.containerClass()),role:"menuitem",style:s.normalizeStyle(i.item.style),"aria-label":o.label(),"aria-disabled":o.disabled()},[s.createElementVNode("div",{class:"p-menuitem-content",onClick:t[0]||(t[0]=e=>o.onItemClick(e))},[i.template?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(i.template),{key:1,item:i.item},null,8,["item"])):(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[i.item.to&&!o.disabled()?(s.openBlock(),s.createBlock(a,{key:0,to:i.item.to,custom:""},{default:s.withCtx((({navigate:e,href:t,isActive:n,isExactActive:l})=>[s.withDirectives((s.openBlock(),s.createElementBlock("a",{href:t,class:s.normalizeClass(o.linkClass({isActive:n,isExactActive:l})),tabindex:"-1","aria-hidden":"true",onClick:t=>o.onItemActionClick(t,e)},[i.item.icon?(s.openBlock(),s.createElementBlock("span",{key:0,class:s.normalizeClass(["p-menuitem-icon",i.item.icon])},null,2)):s.createCommentVNode("",!0),s.createElementVNode("span",u,s.toDisplayString(o.label()),1)],10,c)),[[r]])])),_:1},8,["to"])):s.withDirectives((s.openBlock(),s.createElementBlock("a",{key:1,href:i.item.url,class:s.normalizeClass(o.linkClass()),target:i.item.target,tabindex:"-1","aria-hidden":"true"},[i.item.icon?(s.openBlock(),s.createElementBlock("span",{key:0,class:s.normalizeClass(["p-menuitem-icon",i.item.icon])},null,2)):s.createCommentVNode("",!0),s.createElementVNode("span",m,s.toDisplayString(o.label()),1)],10,p)),[[r]])],64))])],14,d)):s.createCommentVNode("",!0)};var h={name:"Menu",inheritAttrs:!1,emits:["show","hide","focus","blur"],props:{popup:{type:Boolean,default:!1},model:{type:Array,default:null},appendTo:{type:String,default:"body"},autoZIndex:{type:Boolean,default:!0},baseZIndex:{type:Number,default:0},exact:{type:Boolean,default:!0},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},data:()=>({overlayVisible:!1,focused:!1,focusedOptionIndex:-1,selectedOptionIndex:-1}),target:null,outsideClickListener:null,scrollHandler:null,resizeListener:null,container:null,list:null,mounted(){this.popup||(this.bindResizeListener(),this.bindOutsideClickListener())},beforeUnmount(){this.unbindResizeListener(),this.unbindOutsideClickListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.target=null,this.container&&this.autoZIndex&&i.ZIndexUtils.clear(this.container),this.container=null},methods:{itemClick(e){const t=e.item;this.disabled(t)||(t.command&&t.command(e),t.to&&e.navigate&&e.navigate(e.originalEvent),this.overlayVisible&&this.hide(),this.popup||this.focusedOptionIndex===e.id||(this.focusedOptionIndex=e.id))},onListFocus(e){this.focused=!0,this.popup||(-1!==this.selectedOptionIndex?(this.changeFocusedOptionIndex(this.selectedOptionIndex),this.selectedOptionIndex=-1):this.changeFocusedOptionIndex(0)),this.$emit("focus",e)},onListBlur(e){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onListKeyDown(e){switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"Enter":this.onEnterKey(e);break;case"Space":this.onSpaceKey(e);break;case"Escape":this.popup&&(i.DomHandler.focus(this.target),this.hide());case"Tab":this.overlayVisible&&this.hide()}},onArrowDownKey(e){const t=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.preventDefault()},onArrowUpKey(e){if(e.altKey&&this.popup)i.DomHandler.focus(this.target),this.hide(),e.preventDefault();else{const t=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.preventDefault()}},onHomeKey(e){this.changeFocusedOptionIndex(0),e.preventDefault()},onEndKey(e){this.changeFocusedOptionIndex(i.DomHandler.find(this.container,"li.p-menuitem:not(.p-disabled)").length-1),e.preventDefault()},onEnterKey(e){const t=i.DomHandler.findSingle(this.list,`li[id="${this.focusedOptionIndex}"]`),n=t&&i.DomHandler.findSingle(t,".p-menuitem-link");this.popup&&i.DomHandler.focus(this.target),n?n.click():t&&t.click(),e.preventDefault()},onSpaceKey(e){this.onEnterKey(e)},findNextOptionIndex(e){const t=[...i.DomHandler.find(this.container,"li.p-menuitem:not(.p-disabled)")].findIndex((t=>t.id===e));return t>-1?t+1:0},findPrevOptionIndex(e){const t=[...i.DomHandler.find(this.container,"li.p-menuitem:not(.p-disabled)")].findIndex((t=>t.id===e));return t>-1?t-1:0},changeFocusedOptionIndex(e){const t=i.DomHandler.find(this.container,"li.p-menuitem:not(.p-disabled)");let n=e>=t.length?t.length-1:e<0?0:e;this.focusedOptionIndex=t[n].getAttribute("id")},toggle(e){this.overlayVisible?this.hide():this.show(e)},show(e){this.overlayVisible=!0,this.target=e.currentTarget},hide(){this.overlayVisible=!1,this.target=null},onEnter(e){this.alignOverlay(),this.bindOutsideClickListener(),this.bindResizeListener(),this.bindScrollListener(),this.autoZIndex&&i.ZIndexUtils.set("menu",e,this.baseZIndex+this.$primevue.config.zIndex.menu),this.popup&&(i.DomHandler.focus(this.list),this.changeFocusedOptionIndex(0)),this.$emit("show")},onLeave(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.unbindScrollListener(),this.$emit("hide")},onAfterLeave(e){this.autoZIndex&&i.ZIndexUtils.clear(e)},alignOverlay(){i.DomHandler.absolutePosition(this.container,this.target),this.container.style.minWidth=i.DomHandler.getOuterWidth(this.target)+"px"},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{const t=this.container&&!this.container.contains(e.target),i=!(this.target&&(this.target===e.target||this.target.contains(e.target)));this.overlayVisible&&t&&i?this.hide():!this.popup&&t&&i&&(this.focusedOptionIndex=-1)},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new i.ConnectedOverlayScrollHandler(this.target,(()=>{this.overlayVisible&&this.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!i.DomHandler.isTouchDevice()&&this.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},visible:e=>"function"==typeof e.visible?e.visible():!1!==e.visible,disabled:e=>"function"==typeof e.disabled?e.disabled():e.disabled,label:e=>"function"==typeof e.label?e.label():e.label,separatorClass:e=>["p-menuitem-separator",e.class],onOverlayClick(e){o.default.emit("overlay-click",{originalEvent:e,target:this.target})},containerRef(e){this.container=e},listRef(e){this.list=e}},computed:{containerClass(){return["p-menu p-component",{"p-menu-overlay":this.popup,"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},id(){return this.$attrs.id||i.UniqueComponentId()},focusedOptionId(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null}},components:{PVMenuitem:r,Portal:a.default}};const b=["id"],f=["id","tabindex","aria-activedescendant","aria-label","aria-labelledby"],k=["id"];return function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css","top"===i&&n.firstChild?n.insertBefore(s,n.firstChild):n.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}}("\n.p-menu-overlay {\n position: absolute;\n top: 0;\n left: 0;\n}\n.p-menu ul {\n margin: 0;\n padding: 0;\n list-style: none;\n}\n.p-menu .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.p-menu .p-menuitem-text {\n line-height: 1;\n}\n"),h.render=function(e,t,i,n,l,o){const a=s.resolveComponent("PVMenuitem"),r=s.resolveComponent("Portal");return s.openBlock(),s.createBlock(r,{appendTo:i.appendTo,disabled:!i.popup},{default:s.withCtx((()=>[s.createVNode(s.Transition,{name:"p-connected-overlay",onEnter:o.onEnter,onLeave:o.onLeave,onAfterLeave:o.onAfterLeave},{default:s.withCtx((()=>[!i.popup||l.overlayVisible?(s.openBlock(),s.createElementBlock("div",s.mergeProps({key:0,ref:o.containerRef,id:o.id,class:o.containerClass},e.$attrs,{onClick:t[3]||(t[3]=(...e)=>o.onOverlayClick&&o.onOverlayClick(...e))}),[s.createElementVNode("ul",{ref:o.listRef,id:o.id+"_list",class:"p-menu-list p-reset",role:"menu",tabindex:i.tabindex,"aria-activedescendant":l.focused?o.focusedOptionId:void 0,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,onFocus:t[0]||(t[0]=(...e)=>o.onListFocus&&o.onListFocus(...e)),onBlur:t[1]||(t[1]=(...e)=>o.onListBlur&&o.onListBlur(...e)),onKeydown:t[2]||(t[2]=(...e)=>o.onListKeyDown&&o.onListKeyDown(...e))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.model,((t,n)=>(s.openBlock(),s.createElementBlock(s.Fragment,{key:o.label(t)+n.toString()},[t.items&&o.visible(t)&&!t.separator?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[t.items?(s.openBlock(),s.createElementBlock("li",{key:0,id:o.id+"_"+n,class:"p-submenu-header",role:"none"},[s.renderSlot(e.$slots,"item",{item:t},(()=>[s.createTextVNode(s.toDisplayString(o.label(t)),1)]))],8,k)):s.createCommentVNode("",!0),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.items,((l,r)=>(s.openBlock(),s.createElementBlock(s.Fragment,{key:l.label+n+"_"+r},[o.visible(l)&&!l.separator?(s.openBlock(),s.createBlock(a,{key:0,id:o.id+"_"+n+"_"+r,item:l,template:e.$slots.item,exact:i.exact,focusedOptionId:o.focusedOptionId,onItemClick:o.itemClick},null,8,["id","item","template","exact","focusedOptionId","onItemClick"])):o.visible(l)&&l.separator?(s.openBlock(),s.createElementBlock("li",{key:"separator"+n+r,class:s.normalizeClass(o.separatorClass(t)),style:s.normalizeStyle(l.style),role:"separator"},null,6)):s.createCommentVNode("",!0)],64)))),128))],64)):o.visible(t)&&t.separator?(s.openBlock(),s.createElementBlock("li",{key:"separator"+n.toString(),class:s.normalizeClass(o.separatorClass(t)),style:s.normalizeStyle(t.style),role:"separator"},null,6)):(s.openBlock(),s.createBlock(a,{key:o.label(t)+n.toString(),id:o.id+"_"+n,item:t,template:e.$slots.item,exact:i.exact,focusedOptionId:o.focusedOptionId,onItemClick:o.itemClick},null,8,["id","item","template","exact","focusedOptionId","onItemClick"]))],64)))),128))],40,f)],16,b)):s.createCommentVNode("",!0)])),_:3},8,["onEnter","onLeave","onAfterLeave"])])),_:3},8,["appendTo","disabled"])},h}(primevue.overlayeventbus,primevue.portal,primevue.utils,primevue.ripple,Vue);
1
+ this.primevue=this.primevue||{},this.primevue.menu=function(e,t,i,n,s){"use strict";function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=l(e),a=l(t),r={name:"Menuitem",inheritAttrs:!1,emits:["item-click"],props:{item:null,template:null,exact:null,id:null,focusedOptionId:null},methods:{getItemProp:(e,t)=>e&&e.item?i.ObjectUtils.getItemValue(e.item[t]):void 0,onItemActionClick(e,t){t&&t(e)},onItemClick(e){const t=this.getItemProp(this.item,"command");t&&t({originalEvent:e,item:this.item.item}),this.$emit("item-click",{originalEvent:e,item:this.item,id:this.id})},containerClass(){return["p-menuitem",this.item.class,{"p-focus":this.id===this.focusedOptionId,"p-disabled":this.disabled()}]},linkClass(e){return["p-menuitem-link",{"router-link-active":e&&e.isActive,"router-link-active-exact":this.exact&&e&&e.isExactActive}]},visible(){return"function"==typeof this.item.visible?this.item.visible():!1!==this.item.visible},disabled(){return"function"==typeof this.item.disabled?this.item.disabled():this.item.disabled},label(){return"function"==typeof this.item.label?this.item.label():this.item.label}},directives:{ripple:l(n).default}};const d=["id","aria-label","aria-disabled"],c=["href","onClick"],u={class:"p-menuitem-text"},p=["href","target"],m={class:"p-menuitem-text"};r.render=function(e,t,i,n,l,o){const a=s.resolveComponent("router-link"),r=s.resolveDirective("ripple");return o.visible()?(s.openBlock(),s.createElementBlock("li",{key:0,id:i.id,class:s.normalizeClass(o.containerClass()),role:"menuitem",style:s.normalizeStyle(i.item.style),"aria-label":o.label(),"aria-disabled":o.disabled()},[s.createElementVNode("div",{class:"p-menuitem-content",onClick:t[0]||(t[0]=e=>o.onItemClick(e))},[i.template?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(i.template),{key:1,item:i.item},null,8,["item"])):(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[i.item.to&&!o.disabled()?(s.openBlock(),s.createBlock(a,{key:0,to:i.item.to,custom:""},{default:s.withCtx((({navigate:e,href:t,isActive:n,isExactActive:l})=>[s.withDirectives((s.openBlock(),s.createElementBlock("a",{href:t,class:s.normalizeClass(o.linkClass({isActive:n,isExactActive:l})),tabindex:"-1","aria-hidden":"true",onClick:t=>o.onItemActionClick(t,e)},[i.item.icon?(s.openBlock(),s.createElementBlock("span",{key:0,class:s.normalizeClass(["p-menuitem-icon",i.item.icon])},null,2)):s.createCommentVNode("",!0),s.createElementVNode("span",u,s.toDisplayString(o.label()),1)],10,c)),[[r]])])),_:1},8,["to"])):s.withDirectives((s.openBlock(),s.createElementBlock("a",{key:1,href:i.item.url,class:s.normalizeClass(o.linkClass()),target:i.item.target,tabindex:"-1","aria-hidden":"true"},[i.item.icon?(s.openBlock(),s.createElementBlock("span",{key:0,class:s.normalizeClass(["p-menuitem-icon",i.item.icon])},null,2)):s.createCommentVNode("",!0),s.createElementVNode("span",m,s.toDisplayString(o.label()),1)],10,p)),[[r]])],64))])],14,d)):s.createCommentVNode("",!0)};var h={name:"Menu",inheritAttrs:!1,emits:["show","hide","focus","blur"],props:{popup:{type:Boolean,default:!1},model:{type:Array,default:null},appendTo:{type:String,default:"body"},autoZIndex:{type:Boolean,default:!0},baseZIndex:{type:Number,default:0},exact:{type:Boolean,default:!0},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},data:()=>({overlayVisible:!1,focused:!1,focusedOptionIndex:-1,selectedOptionIndex:-1}),target:null,outsideClickListener:null,scrollHandler:null,resizeListener:null,container:null,list:null,mounted(){this.popup||(this.bindResizeListener(),this.bindOutsideClickListener())},beforeUnmount(){this.unbindResizeListener(),this.unbindOutsideClickListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.target=null,this.container&&this.autoZIndex&&i.ZIndexUtils.clear(this.container),this.container=null},methods:{itemClick(e){const t=e.item;this.disabled(t)||(t.command&&t.command(e),t.to&&e.navigate&&e.navigate(e.originalEvent),this.overlayVisible&&this.hide(),this.popup||this.focusedOptionIndex===e.id||(this.focusedOptionIndex=e.id))},onListFocus(e){this.focused=!0,this.popup||(-1!==this.selectedOptionIndex?(this.changeFocusedOptionIndex(this.selectedOptionIndex),this.selectedOptionIndex=-1):this.changeFocusedOptionIndex(0)),this.$emit("focus",e)},onListBlur(e){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onListKeyDown(e){switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"Enter":this.onEnterKey(e);break;case"Space":this.onSpaceKey(e);break;case"Escape":this.popup&&(i.DomHandler.focus(this.target),this.hide());case"Tab":this.overlayVisible&&this.hide()}},onArrowDownKey(e){const t=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.preventDefault()},onArrowUpKey(e){if(e.altKey&&this.popup)i.DomHandler.focus(this.target),this.hide(),e.preventDefault();else{const t=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.preventDefault()}},onHomeKey(e){this.changeFocusedOptionIndex(0),e.preventDefault()},onEndKey(e){this.changeFocusedOptionIndex(i.DomHandler.find(this.container,"li.p-menuitem:not(.p-disabled)").length-1),e.preventDefault()},onEnterKey(e){const t=i.DomHandler.findSingle(this.list,`li[id="${this.focusedOptionIndex}"]`),n=t&&i.DomHandler.findSingle(t,".p-menuitem-link");this.popup&&i.DomHandler.focus(this.target),n?n.click():t&&t.click(),e.preventDefault()},onSpaceKey(e){this.onEnterKey(e)},findNextOptionIndex(e){const t=[...i.DomHandler.find(this.container,"li.p-menuitem:not(.p-disabled)")].findIndex((t=>t.id===e));return t>-1?t+1:0},findPrevOptionIndex(e){const t=[...i.DomHandler.find(this.container,"li.p-menuitem:not(.p-disabled)")].findIndex((t=>t.id===e));return t>-1?t-1:0},changeFocusedOptionIndex(e){const t=i.DomHandler.find(this.container,"li.p-menuitem:not(.p-disabled)");let n=e>=t.length?t.length-1:e<0?0:e;n>-1&&(this.focusedOptionIndex=t[n].getAttribute("id"))},toggle(e){this.overlayVisible?this.hide():this.show(e)},show(e){this.overlayVisible=!0,this.target=e.currentTarget},hide(){this.overlayVisible=!1,this.target=null},onEnter(e){this.alignOverlay(),this.bindOutsideClickListener(),this.bindResizeListener(),this.bindScrollListener(),this.autoZIndex&&i.ZIndexUtils.set("menu",e,this.baseZIndex+this.$primevue.config.zIndex.menu),this.popup&&(i.DomHandler.focus(this.list),this.changeFocusedOptionIndex(0)),this.$emit("show")},onLeave(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.unbindScrollListener(),this.$emit("hide")},onAfterLeave(e){this.autoZIndex&&i.ZIndexUtils.clear(e)},alignOverlay(){i.DomHandler.absolutePosition(this.container,this.target),this.container.style.minWidth=i.DomHandler.getOuterWidth(this.target)+"px"},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{const t=this.container&&!this.container.contains(e.target),i=!(this.target&&(this.target===e.target||this.target.contains(e.target)));this.overlayVisible&&t&&i?this.hide():!this.popup&&t&&i&&(this.focusedOptionIndex=-1)},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new i.ConnectedOverlayScrollHandler(this.target,(()=>{this.overlayVisible&&this.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!i.DomHandler.isTouchDevice()&&this.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},visible:e=>"function"==typeof e.visible?e.visible():!1!==e.visible,disabled:e=>"function"==typeof e.disabled?e.disabled():e.disabled,label:e=>"function"==typeof e.label?e.label():e.label,separatorClass:e=>["p-menuitem-separator",e.class],onOverlayClick(e){o.default.emit("overlay-click",{originalEvent:e,target:this.target})},containerRef(e){this.container=e},listRef(e){this.list=e}},computed:{containerClass(){return["p-menu p-component",{"p-menu-overlay":this.popup,"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},id(){return this.$attrs.id||i.UniqueComponentId()},focusedOptionId(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null}},components:{PVMenuitem:r,Portal:a.default}};const b=["id"],f=["id","tabindex","aria-activedescendant","aria-label","aria-labelledby"],k=["id"];return function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css","top"===i&&n.firstChild?n.insertBefore(s,n.firstChild):n.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}}("\n.p-menu-overlay {\n position: absolute;\n top: 0;\n left: 0;\n}\n.p-menu ul {\n margin: 0;\n padding: 0;\n list-style: none;\n}\n.p-menu .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.p-menu .p-menuitem-text {\n line-height: 1;\n}\n"),h.render=function(e,t,i,n,l,o){const a=s.resolveComponent("PVMenuitem"),r=s.resolveComponent("Portal");return s.openBlock(),s.createBlock(r,{appendTo:i.appendTo,disabled:!i.popup},{default:s.withCtx((()=>[s.createVNode(s.Transition,{name:"p-connected-overlay",onEnter:o.onEnter,onLeave:o.onLeave,onAfterLeave:o.onAfterLeave},{default:s.withCtx((()=>[!i.popup||l.overlayVisible?(s.openBlock(),s.createElementBlock("div",s.mergeProps({key:0,ref:o.containerRef,id:o.id,class:o.containerClass},e.$attrs,{onClick:t[3]||(t[3]=(...e)=>o.onOverlayClick&&o.onOverlayClick(...e))}),[s.createElementVNode("ul",{ref:o.listRef,id:o.id+"_list",class:"p-menu-list p-reset",role:"menu",tabindex:i.tabindex,"aria-activedescendant":l.focused?o.focusedOptionId:void 0,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,onFocus:t[0]||(t[0]=(...e)=>o.onListFocus&&o.onListFocus(...e)),onBlur:t[1]||(t[1]=(...e)=>o.onListBlur&&o.onListBlur(...e)),onKeydown:t[2]||(t[2]=(...e)=>o.onListKeyDown&&o.onListKeyDown(...e))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.model,((t,n)=>(s.openBlock(),s.createElementBlock(s.Fragment,{key:o.label(t)+n.toString()},[t.items&&o.visible(t)&&!t.separator?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[t.items?(s.openBlock(),s.createElementBlock("li",{key:0,id:o.id+"_"+n,class:"p-submenu-header",role:"none"},[s.renderSlot(e.$slots,"item",{item:t},(()=>[s.createTextVNode(s.toDisplayString(o.label(t)),1)]))],8,k)):s.createCommentVNode("",!0),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.items,((l,r)=>(s.openBlock(),s.createElementBlock(s.Fragment,{key:l.label+n+"_"+r},[o.visible(l)&&!l.separator?(s.openBlock(),s.createBlock(a,{key:0,id:o.id+"_"+n+"_"+r,item:l,template:e.$slots.item,exact:i.exact,focusedOptionId:o.focusedOptionId,onItemClick:o.itemClick},null,8,["id","item","template","exact","focusedOptionId","onItemClick"])):o.visible(l)&&l.separator?(s.openBlock(),s.createElementBlock("li",{key:"separator"+n+r,class:s.normalizeClass(o.separatorClass(t)),style:s.normalizeStyle(l.style),role:"separator"},null,6)):s.createCommentVNode("",!0)],64)))),128))],64)):o.visible(t)&&t.separator?(s.openBlock(),s.createElementBlock("li",{key:"separator"+n.toString(),class:s.normalizeClass(o.separatorClass(t)),style:s.normalizeStyle(t.style),role:"separator"},null,6)):(s.openBlock(),s.createBlock(a,{key:o.label(t)+n.toString(),id:o.id+"_"+n,item:t,template:e.$slots.item,exact:i.exact,focusedOptionId:o.focusedOptionId,onItemClick:o.itemClick},null,8,["id","item","template","exact","focusedOptionId","onItemClick"]))],64)))),128))],40,f)],16,b)):s.createCommentVNode("",!0)])),_:3},8,["onEnter","onLeave","onAfterLeave"])])),_:3},8,["appendTo","disabled"])},h}(primevue.overlayeventbus,primevue.portal,primevue.utils,primevue.ripple,Vue);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "primevue",
3
- "version": "3.22.0",
3
+ "version": "3.22.2",
4
4
  "homepage": "https://www.primefaces.org/primevue",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <JTPInput ref="jtpInput" v-model="d_page" class="p-paginator-page-input" :aria-label="inputArialabel" :disabled="disabled"></JTPInput>
2
+ <JTPInput ref="jtpInput" :modelValue="d_page" class="p-paginator-page-input" :aria-label="inputArialabel" :disabled="disabled" @update:modelValue="onChange"></JTPInput>
3
3
  </template>
4
4
 
5
5
  <script>
@@ -16,18 +16,21 @@ export default {
16
16
  },
17
17
  data() {
18
18
  return {
19
- d_page: null
19
+ d_page: this.page
20
20
  };
21
21
  },
22
22
  watch: {
23
- d_page(newValue) {
24
- if (this.$refs.jtpInput && !this.$refs.jtpInput.focused) return;
25
-
26
- this.$emit('page-change', newValue - 1);
23
+ page(newValue) {
24
+ this.d_page = newValue;
27
25
  }
28
26
  },
29
- mounted() {
30
- this.d_page = this.page;
27
+ methods: {
28
+ onChange(value) {
29
+ if (value !== this.page) {
30
+ this.d_page = value;
31
+ this.$emit('page-change', value - 1);
32
+ }
33
+ }
31
34
  },
32
35
  computed: {
33
36
  inputArialabel() {
@@ -23,7 +23,7 @@
23
23
  />
24
24
  <RowsPerPageDropdown v-else-if="item === 'RowsPerPageDropdown' && rowsPerPageOptions" :aria-label="getAriaLabel('rowsPerPageLabel')" :rows="d_rows" :options="rowsPerPageOptions" @rows-change="onRowChange($event)" :disabled="empty" />
25
25
  <JumpToPageDropdown v-else-if="item === 'JumpToPageDropdown'" :aria-label="getAriaLabel('jumpToPageDropdownLabel')" :page="page" :pageCount="pageCount" @page-change="changePage($event)" :disabled="empty" />
26
- <JumpToPageInput v-else-if="item === 'JumpToPageInput' && currentPage" :page="currentPage" @page-change="changePage($event)" :disabled="empty" />
26
+ <JumpToPageInput v-else-if="item === 'JumpToPageInput'" :page="currentPage" @page-change="changePage($event)" :disabled="empty" />
27
27
  </template>
28
28
  <div v-if="$slots.end" class="p-paginator-right-content">
29
29
  <slot name="end" :state="currentState"></slot>
@@ -158,18 +158,21 @@ var script$6 = {
158
158
  },
159
159
  data() {
160
160
  return {
161
- d_page: null
161
+ d_page: this.page
162
162
  };
163
163
  },
164
164
  watch: {
165
- d_page(newValue) {
166
- if (this.$refs.jtpInput && !this.$refs.jtpInput.focused) return;
167
-
168
- this.$emit('page-change', newValue - 1);
165
+ page(newValue) {
166
+ this.d_page = newValue;
169
167
  }
170
168
  },
171
- mounted() {
172
- this.d_page = this.page;
169
+ methods: {
170
+ onChange(value) {
171
+ if (value !== this.page) {
172
+ this.d_page = value;
173
+ this.$emit('page-change', value - 1);
174
+ }
175
+ }
173
176
  },
174
177
  computed: {
175
178
  inputArialabel() {
@@ -187,11 +190,11 @@ function render$6(_ctx, _cache, $props, $setup, $data, $options) {
187
190
  return (vue.openBlock(), vue.createBlock(_component_JTPInput, {
188
191
  ref: "jtpInput",
189
192
  modelValue: $data.d_page,
190
- "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (($data.d_page) = $event)),
191
193
  class: "p-paginator-page-input",
192
194
  "aria-label": $options.inputArialabel,
193
- disabled: $props.disabled
194
- }, null, 8, ["modelValue", "aria-label", "disabled"]))
195
+ disabled: $props.disabled,
196
+ "onUpdate:modelValue": $options.onChange
197
+ }, null, 8, ["modelValue", "aria-label", "disabled", "onUpdate:modelValue"]))
195
198
  }
196
199
 
197
200
  script$6.render = render$6;
@@ -776,7 +779,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
776
779
  onPageChange: _cache[6] || (_cache[6] = $event => ($options.changePage($event))),
777
780
  disabled: $options.empty
778
781
  }, null, 8, ["aria-label", "page", "pageCount", "disabled"]))
779
- : (item === 'JumpToPageInput' && $options.currentPage)
782
+ : (item === 'JumpToPageInput')
780
783
  ? (vue.openBlock(), vue.createBlock(_component_JumpToPageInput, {
781
784
  key: 8,
782
785
  page: $options.currentPage,
@@ -1 +1 @@
1
- "use strict";var e=require("primevue/utils"),t=require("vue"),a=require("primevue/ripple"),n=require("primevue/dropdown"),r=require("primevue/inputnumber");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=o(a),s=o(n),l=o(r),p={name:"CurrentPageReport",props:{pageCount:{type:Number,default:0},currentPage:{type:Number,default:0},page:{type:Number,default:0},first:{type:Number,default:0},rows:{type:Number,default:0},totalRecords:{type:Number,default:0},template:{type:String,default:"({currentPage} of {totalPages})"}},computed:{text(){return this.template.replace("{currentPage}",this.currentPage).replace("{totalPages}",this.pageCount).replace("{first}",this.pageCount>0?this.first+1:0).replace("{last}",Math.min(this.first+this.rows,this.totalRecords)).replace("{rows}",this.rows).replace("{totalRecords}",this.totalRecords)}}};const c={class:"p-paginator-current"};p.render=function(e,a,n,r,o,i){return t.openBlock(),t.createElementBlock("span",c,t.toDisplayString(i.text),1)};var g={name:"FirstPageLink",computed:{containerClass(){return["p-paginator-first p-paginator-element p-link",{"p-disabled":this.$attrs.disabled}]}},directives:{ripple:i.default}};const u=[t.createElementVNode("span",{class:"p-paginator-icon pi pi-angle-double-left"},null,-1)];g.render=function(e,a,n,r,o,i){const s=t.resolveDirective("ripple");return t.withDirectives((t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass(i.containerClass),type:"button"},u,2)),[[s]])};var d={name:"JumpToPageDropdown",emits:["page-change"],props:{page:Number,pageCount:Number,disabled:Boolean},methods:{onChange(e){this.$emit("page-change",e)}},computed:{pageOptions(){let e=[];for(let t=0;t<this.pageCount;t++)e.push({label:String(t+1),value:t});return e}},components:{JTPDropdown:s.default}};d.render=function(e,a,n,r,o,i){const s=t.resolveComponent("JTPDropdown");return t.openBlock(),t.createBlock(s,{modelValue:n.page,options:i.pageOptions,optionLabel:"label",optionValue:"value","onUpdate:modelValue":a[0]||(a[0]=e=>i.onChange(e)),class:"p-paginator-page-options",disabled:n.disabled},null,8,["modelValue","options","disabled"])};var m={name:"JumpToPageInput",inheritAttrs:!1,emits:["page-change"],props:{page:Number,pageCount:Number,disabled:Boolean},data:()=>({d_page:null}),watch:{d_page(e){this.$refs.jtpInput&&!this.$refs.jtpInput.focused||this.$emit("page-change",e-1)}},mounted(){this.d_page=this.page},computed:{inputArialabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.jumpToPageInputLabel:void 0}},components:{JTPInput:l.default}};m.render=function(e,a,n,r,o,i){const s=t.resolveComponent("JTPInput");return t.openBlock(),t.createBlock(s,{ref:"jtpInput",modelValue:o.d_page,"onUpdate:modelValue":a[0]||(a[0]=e=>o.d_page=e),class:"p-paginator-page-input","aria-label":i.inputArialabel,disabled:n.disabled},null,8,["modelValue","aria-label","disabled"])};var h={name:"LastPageLink",computed:{containerClass(){return["p-paginator-last p-paginator-element p-link",{"p-disabled":this.$attrs.disabled}]}},directives:{ripple:i.default}};const P=[t.createElementVNode("span",{class:"p-paginator-icon pi pi-angle-double-right"},null,-1)];h.render=function(e,a,n,r,o,i){const s=t.resolveDirective("ripple");return t.withDirectives((t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass(i.containerClass),type:"button"},P,2)),[[s]])};var k={name:"NextPageLink",computed:{containerClass(){return["p-paginator-next p-paginator-element p-link",{"p-disabled":this.$attrs.disabled}]}},directives:{ripple:i.default}};const f=[t.createElementVNode("span",{class:"p-paginator-icon pi pi-angle-right"},null,-1)];k.render=function(e,a,n,r,o,i){const s=t.resolveDirective("ripple");return t.withDirectives((t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass(i.containerClass),type:"button"},f,2)),[[s]])};var b={name:"PageLinks",inheritAttrs:!1,emits:["click"],props:{value:Array,page:Number},methods:{onPageLinkClick(e,t){this.$emit("click",{originalEvent:e,value:t})},ariaPageLabel(e){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.pageLabel.replace(/{page}/g,e):void 0}},computed:{},directives:{ripple:i.default}};const v={class:"p-paginator-pages"},C=["aria-label","aria-current","onClick"];b.render=function(e,a,n,r,o,i){const s=t.resolveDirective("ripple");return t.openBlock(),t.createElementBlock("span",v,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.value,(e=>t.withDirectives((t.openBlock(),t.createElementBlock("button",{key:e,class:t.normalizeClass(["p-paginator-page p-paginator-element p-link",{"p-highlight":e-1===n.page}]),type:"button","aria-label":i.ariaPageLabel(e),"aria-current":e-1===n.page?"page":void 0,onClick:t=>i.onPageLinkClick(t,e)},[t.createTextVNode(t.toDisplayString(e),1)],10,C)),[[s]]))),128))])};var L={name:"PrevPageLink",computed:{containerClass(){return["p-paginator-prev p-paginator-element p-link",{"p-disabled":this.$attrs.disabled}]}},directives:{ripple:i.default}};const w=[t.createElementVNode("span",{class:"p-paginator-icon pi pi-angle-left"},null,-1)];L.render=function(e,a,n,r,o,i){const s=t.resolveDirective("ripple");return t.withDirectives((t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass(i.containerClass),type:"button"},w,2)),[[s]])};var y={name:"RowsPerPageDropdown",emits:["rows-change"],props:{options:Array,rows:Number,disabled:Boolean},methods:{onChange(e){this.$emit("rows-change",e)}},computed:{rowsOptions(){let e=[];if(this.options)for(let t=0;t<this.options.length;t++)e.push({label:String(this.options[t]),value:this.options[t]});return e}},components:{RPPDropdown:s.default}};y.render=function(e,a,n,r,o,i){const s=t.resolveComponent("RPPDropdown");return t.openBlock(),t.createBlock(s,{modelValue:n.rows,options:i.rowsOptions,optionLabel:"label",optionValue:"value","onUpdate:modelValue":a[0]||(a[0]=e=>i.onChange(e)),class:"p-paginator-rpp-options",disabled:n.disabled},null,8,["modelValue","options","disabled"])};var B={name:"Paginator",emits:["update:first","update:rows","page"],props:{totalRecords:{type:Number,default:0},rows:{type:Number,default:0},first:{type:Number,default:0},pageLinkSize:{type:Number,default:5},rowsPerPageOptions:{type:Array,default:null},template:{type:[Object,String],default:"FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown"},currentPageReportTemplate:{type:null,default:"({currentPage} of {totalPages})"},alwaysShow:{type:Boolean,default:!0}},data(){return{d_first:this.first,d_rows:this.rows}},watch:{first(e){this.d_first=e},rows(e){this.d_rows=e},totalRecords(e){this.page>0&&e&&this.d_first>=e&&this.changePage(this.pageCount-1)}},mounted(){this.setPaginatorAttribute(),this.createStyle()},methods:{changePage(e){const t=this.pageCount;if(e>=0&&e<t){this.d_first=this.d_rows*e;const a={page:e,first:this.d_first,rows:this.d_rows,pageCount:t};this.$emit("update:first",this.d_first),this.$emit("update:rows",this.d_rows),this.$emit("page",a)}},changePageToFirst(e){this.isFirstPage||this.changePage(0),e.preventDefault()},changePageToPrev(e){this.changePage(this.page-1),e.preventDefault()},changePageLink(e){this.changePage(e.value-1),e.originalEvent.preventDefault()},changePageToNext(e){this.changePage(this.page+1),e.preventDefault()},changePageToLast(e){this.isLastPage||this.changePage(this.pageCount-1),e.preventDefault()},onRowChange(e){this.d_rows=e,this.changePage(this.page)},createStyle(){if(this.hasBreakpoints()){this.styleElement=document.createElement("style"),this.styleElement.type="text/css",document.head.appendChild(this.styleElement);let e="";const t=Object.keys(this.template),a={};t.sort(((e,t)=>parseInt(e)-parseInt(t))).forEach((e=>{a[e]=this.template[e]}));for(const[t,[n]]of Object.entries(Object.entries(a))){const r=Object.entries(a)[t-1]?`and (min-width:${Object.keys(a)[t-1]})`:"";e+="default"===n?`\n @media screen ${r} {\n .paginator[${this.attributeSelector}],\n .p-paginator-default{\n display: flex !important;\n }\n }\n `:`\n .paginator[${this.attributeSelector}], .p-paginator-${n} {\n display: none !important;\n }\n @media screen ${r} and (max-width: ${n}) {\n .paginator[${this.attributeSelector}], .p-paginator-${n} {\n display: flex !important;\n }\n .paginator[${this.attributeSelector}],\n .p-paginator-default{\n display: none !important;\n }\n }\n `}this.styleElement.innerHTML=e}},hasBreakpoints(){return"object"==typeof this.template},getPaginatorClasses(e){return[{"p-paginator-default":!this.hasBreakpoints(),[`p-paginator-${e}`]:this.hasBreakpoints()}]},setPaginatorAttribute(){this.$refs.paginator&&this.$refs.paginator.length>=0&&[...this.$refs.paginator].forEach((e=>{e.setAttribute(this.attributeSelector,"")}))},getAriaLabel(e){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria[e]:void 0}},computed:{templateItems(){let e={};if(this.hasBreakpoints()){e=this.template,e.default||(e.default="FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown");for(const t in e)e[t]=this.template[t].split(" ").map((e=>e.trim()));return e}return e.default=this.template.split(" ").map((e=>e.trim())),e},page(){return Math.floor(this.d_first/this.d_rows)},pageCount(){return Math.ceil(this.totalRecords/this.d_rows)},isFirstPage(){return 0===this.page},isLastPage(){return this.page===this.pageCount-1},calculatePageLinkBoundaries(){const e=this.pageCount,t=Math.min(this.pageLinkSize,e);let a=Math.max(0,Math.ceil(this.page-t/2)),n=Math.min(e-1,a+t-1);const r=this.pageLinkSize-(n-a+1);return a=Math.max(0,a-r),[a,n]},pageLinks(){let e=[],t=this.calculatePageLinkBoundaries,a=t[0],n=t[1];for(var r=a;r<=n;r++)e.push(r+1);return e},currentState(){return{page:this.page,first:this.d_first,rows:this.d_rows}},empty(){return 0===this.pageCount},currentPage(){return this.pageCount>0?this.page+1:0},attributeSelector:()=>e.UniqueComponentId()},components:{CurrentPageReport:p,FirstPageLink:g,LastPageLink:h,NextPageLink:k,PageLinks:b,PrevPageLink:L,RowsPerPageDropdown:y,JumpToPageDropdown:d,JumpToPageInput:m}};const $={key:0},N={key:0,class:"p-paginator-left-content"},D={key:1,class:"p-paginator-right-content"};!function(e,t){void 0===t&&(t={});var a=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===a&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}("\n.p-paginator-default {\n display: flex;\n}\n.p-paginator {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-wrap: wrap;\n}\n.p-paginator-left-content {\n margin-right: auto;\n}\n.p-paginator-right-content {\n margin-left: auto;\n}\n.p-paginator-page,\n.p-paginator-next,\n.p-paginator-last,\n.p-paginator-first,\n.p-paginator-prev,\n.p-paginator-current {\n cursor: pointer;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n line-height: 1;\n user-select: none;\n overflow: hidden;\n position: relative;\n}\n.p-paginator-element:focus {\n z-index: 1;\n position: relative;\n}\n"),B.render=function(e,a,n,r,o,i){const s=t.resolveComponent("FirstPageLink"),l=t.resolveComponent("PrevPageLink"),p=t.resolveComponent("NextPageLink"),c=t.resolveComponent("LastPageLink"),g=t.resolveComponent("PageLinks"),u=t.resolveComponent("CurrentPageReport"),d=t.resolveComponent("RowsPerPageDropdown"),m=t.resolveComponent("JumpToPageDropdown"),h=t.resolveComponent("JumpToPageInput");return n.alwaysShow||i.pageLinks&&i.pageLinks.length>1?(t.openBlock(),t.createElementBlock("nav",$,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.templateItems,((r,P)=>(t.openBlock(),t.createElementBlock("div",{key:P,ref_for:!0,ref:"paginator",class:t.normalizeClass(["p-paginator p-component",i.getPaginatorClasses(P)])},[e.$slots.start?(t.openBlock(),t.createElementBlock("div",N,[t.renderSlot(e.$slots,"start",{state:i.currentState})])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r,(e=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:e},["FirstPageLink"===e?(t.openBlock(),t.createBlock(s,{key:0,"aria-label":i.getAriaLabel("firstPageLabel"),onClick:a[0]||(a[0]=e=>i.changePageToFirst(e)),disabled:i.isFirstPage||i.empty},null,8,["aria-label","disabled"])):"PrevPageLink"===e?(t.openBlock(),t.createBlock(l,{key:1,"aria-label":i.getAriaLabel("prevPageLabel"),onClick:a[1]||(a[1]=e=>i.changePageToPrev(e)),disabled:i.isFirstPage||i.empty},null,8,["aria-label","disabled"])):"NextPageLink"===e?(t.openBlock(),t.createBlock(p,{key:2,"aria-label":i.getAriaLabel("nextPageLabel"),onClick:a[2]||(a[2]=e=>i.changePageToNext(e)),disabled:i.isLastPage||i.empty},null,8,["aria-label","disabled"])):"LastPageLink"===e?(t.openBlock(),t.createBlock(c,{key:3,"aria-label":i.getAriaLabel("lastPageLabel"),onClick:a[3]||(a[3]=e=>i.changePageToLast(e)),disabled:i.isLastPage||i.empty},null,8,["aria-label","disabled"])):"PageLinks"===e?(t.openBlock(),t.createBlock(g,{key:4,"aria-label":i.getAriaLabel("pageLabel"),value:i.pageLinks,page:i.page,onClick:a[4]||(a[4]=e=>i.changePageLink(e))},null,8,["aria-label","value","page"])):"CurrentPageReport"===e?(t.openBlock(),t.createBlock(u,{key:5,"aria-live":"polite",template:n.currentPageReportTemplate,currentPage:i.currentPage,page:i.page,pageCount:i.pageCount,first:o.d_first,rows:o.d_rows,totalRecords:n.totalRecords},null,8,["template","currentPage","page","pageCount","first","rows","totalRecords"])):"RowsPerPageDropdown"===e&&n.rowsPerPageOptions?(t.openBlock(),t.createBlock(d,{key:6,"aria-label":i.getAriaLabel("rowsPerPageLabel"),rows:o.d_rows,options:n.rowsPerPageOptions,onRowsChange:a[5]||(a[5]=e=>i.onRowChange(e)),disabled:i.empty},null,8,["aria-label","rows","options","disabled"])):"JumpToPageDropdown"===e?(t.openBlock(),t.createBlock(m,{key:7,"aria-label":i.getAriaLabel("jumpToPageDropdownLabel"),page:i.page,pageCount:i.pageCount,onPageChange:a[6]||(a[6]=e=>i.changePage(e)),disabled:i.empty},null,8,["aria-label","page","pageCount","disabled"])):"JumpToPageInput"===e&&i.currentPage?(t.openBlock(),t.createBlock(h,{key:8,page:i.currentPage,onPageChange:a[7]||(a[7]=e=>i.changePage(e)),disabled:i.empty},null,8,["page","disabled"])):t.createCommentVNode("",!0)],64)))),128)),e.$slots.end?(t.openBlock(),t.createElementBlock("div",D,[t.renderSlot(e.$slots,"end",{state:i.currentState})])):t.createCommentVNode("",!0)],2)))),128))])):t.createCommentVNode("",!0)},module.exports=B;
1
+ "use strict";var e=require("primevue/utils"),t=require("vue"),a=require("primevue/ripple"),n=require("primevue/dropdown"),r=require("primevue/inputnumber");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=o(a),s=o(n),l=o(r),p={name:"CurrentPageReport",props:{pageCount:{type:Number,default:0},currentPage:{type:Number,default:0},page:{type:Number,default:0},first:{type:Number,default:0},rows:{type:Number,default:0},totalRecords:{type:Number,default:0},template:{type:String,default:"({currentPage} of {totalPages})"}},computed:{text(){return this.template.replace("{currentPage}",this.currentPage).replace("{totalPages}",this.pageCount).replace("{first}",this.pageCount>0?this.first+1:0).replace("{last}",Math.min(this.first+this.rows,this.totalRecords)).replace("{rows}",this.rows).replace("{totalRecords}",this.totalRecords)}}};const g={class:"p-paginator-current"};p.render=function(e,a,n,r,o,i){return t.openBlock(),t.createElementBlock("span",g,t.toDisplayString(i.text),1)};var c={name:"FirstPageLink",computed:{containerClass(){return["p-paginator-first p-paginator-element p-link",{"p-disabled":this.$attrs.disabled}]}},directives:{ripple:i.default}};const u=[t.createElementVNode("span",{class:"p-paginator-icon pi pi-angle-double-left"},null,-1)];c.render=function(e,a,n,r,o,i){const s=t.resolveDirective("ripple");return t.withDirectives((t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass(i.containerClass),type:"button"},u,2)),[[s]])};var d={name:"JumpToPageDropdown",emits:["page-change"],props:{page:Number,pageCount:Number,disabled:Boolean},methods:{onChange(e){this.$emit("page-change",e)}},computed:{pageOptions(){let e=[];for(let t=0;t<this.pageCount;t++)e.push({label:String(t+1),value:t});return e}},components:{JTPDropdown:s.default}};d.render=function(e,a,n,r,o,i){const s=t.resolveComponent("JTPDropdown");return t.openBlock(),t.createBlock(s,{modelValue:n.page,options:i.pageOptions,optionLabel:"label",optionValue:"value","onUpdate:modelValue":a[0]||(a[0]=e=>i.onChange(e)),class:"p-paginator-page-options",disabled:n.disabled},null,8,["modelValue","options","disabled"])};var m={name:"JumpToPageInput",inheritAttrs:!1,emits:["page-change"],props:{page:Number,pageCount:Number,disabled:Boolean},data(){return{d_page:this.page}},watch:{page(e){this.d_page=e}},methods:{onChange(e){e!==this.page&&(this.d_page=e,this.$emit("page-change",e-1))}},computed:{inputArialabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.jumpToPageInputLabel:void 0}},components:{JTPInput:l.default}};m.render=function(e,a,n,r,o,i){const s=t.resolveComponent("JTPInput");return t.openBlock(),t.createBlock(s,{ref:"jtpInput",modelValue:o.d_page,class:"p-paginator-page-input","aria-label":i.inputArialabel,disabled:n.disabled,"onUpdate:modelValue":i.onChange},null,8,["modelValue","aria-label","disabled","onUpdate:modelValue"])};var h={name:"LastPageLink",computed:{containerClass(){return["p-paginator-last p-paginator-element p-link",{"p-disabled":this.$attrs.disabled}]}},directives:{ripple:i.default}};const P=[t.createElementVNode("span",{class:"p-paginator-icon pi pi-angle-double-right"},null,-1)];h.render=function(e,a,n,r,o,i){const s=t.resolveDirective("ripple");return t.withDirectives((t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass(i.containerClass),type:"button"},P,2)),[[s]])};var k={name:"NextPageLink",computed:{containerClass(){return["p-paginator-next p-paginator-element p-link",{"p-disabled":this.$attrs.disabled}]}},directives:{ripple:i.default}};const f=[t.createElementVNode("span",{class:"p-paginator-icon pi pi-angle-right"},null,-1)];k.render=function(e,a,n,r,o,i){const s=t.resolveDirective("ripple");return t.withDirectives((t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass(i.containerClass),type:"button"},f,2)),[[s]])};var b={name:"PageLinks",inheritAttrs:!1,emits:["click"],props:{value:Array,page:Number},methods:{onPageLinkClick(e,t){this.$emit("click",{originalEvent:e,value:t})},ariaPageLabel(e){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.pageLabel.replace(/{page}/g,e):void 0}},computed:{},directives:{ripple:i.default}};const v={class:"p-paginator-pages"},C=["aria-label","aria-current","onClick"];b.render=function(e,a,n,r,o,i){const s=t.resolveDirective("ripple");return t.openBlock(),t.createElementBlock("span",v,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.value,(e=>t.withDirectives((t.openBlock(),t.createElementBlock("button",{key:e,class:t.normalizeClass(["p-paginator-page p-paginator-element p-link",{"p-highlight":e-1===n.page}]),type:"button","aria-label":i.ariaPageLabel(e),"aria-current":e-1===n.page?"page":void 0,onClick:t=>i.onPageLinkClick(t,e)},[t.createTextVNode(t.toDisplayString(e),1)],10,C)),[[s]]))),128))])};var L={name:"PrevPageLink",computed:{containerClass(){return["p-paginator-prev p-paginator-element p-link",{"p-disabled":this.$attrs.disabled}]}},directives:{ripple:i.default}};const w=[t.createElementVNode("span",{class:"p-paginator-icon pi pi-angle-left"},null,-1)];L.render=function(e,a,n,r,o,i){const s=t.resolveDirective("ripple");return t.withDirectives((t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass(i.containerClass),type:"button"},w,2)),[[s]])};var y={name:"RowsPerPageDropdown",emits:["rows-change"],props:{options:Array,rows:Number,disabled:Boolean},methods:{onChange(e){this.$emit("rows-change",e)}},computed:{rowsOptions(){let e=[];if(this.options)for(let t=0;t<this.options.length;t++)e.push({label:String(this.options[t]),value:this.options[t]});return e}},components:{RPPDropdown:s.default}};y.render=function(e,a,n,r,o,i){const s=t.resolveComponent("RPPDropdown");return t.openBlock(),t.createBlock(s,{modelValue:n.rows,options:i.rowsOptions,optionLabel:"label",optionValue:"value","onUpdate:modelValue":a[0]||(a[0]=e=>i.onChange(e)),class:"p-paginator-rpp-options",disabled:n.disabled},null,8,["modelValue","options","disabled"])};var B={name:"Paginator",emits:["update:first","update:rows","page"],props:{totalRecords:{type:Number,default:0},rows:{type:Number,default:0},first:{type:Number,default:0},pageLinkSize:{type:Number,default:5},rowsPerPageOptions:{type:Array,default:null},template:{type:[Object,String],default:"FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown"},currentPageReportTemplate:{type:null,default:"({currentPage} of {totalPages})"},alwaysShow:{type:Boolean,default:!0}},data(){return{d_first:this.first,d_rows:this.rows}},watch:{first(e){this.d_first=e},rows(e){this.d_rows=e},totalRecords(e){this.page>0&&e&&this.d_first>=e&&this.changePage(this.pageCount-1)}},mounted(){this.setPaginatorAttribute(),this.createStyle()},methods:{changePage(e){const t=this.pageCount;if(e>=0&&e<t){this.d_first=this.d_rows*e;const a={page:e,first:this.d_first,rows:this.d_rows,pageCount:t};this.$emit("update:first",this.d_first),this.$emit("update:rows",this.d_rows),this.$emit("page",a)}},changePageToFirst(e){this.isFirstPage||this.changePage(0),e.preventDefault()},changePageToPrev(e){this.changePage(this.page-1),e.preventDefault()},changePageLink(e){this.changePage(e.value-1),e.originalEvent.preventDefault()},changePageToNext(e){this.changePage(this.page+1),e.preventDefault()},changePageToLast(e){this.isLastPage||this.changePage(this.pageCount-1),e.preventDefault()},onRowChange(e){this.d_rows=e,this.changePage(this.page)},createStyle(){if(this.hasBreakpoints()){this.styleElement=document.createElement("style"),this.styleElement.type="text/css",document.head.appendChild(this.styleElement);let e="";const t=Object.keys(this.template),a={};t.sort(((e,t)=>parseInt(e)-parseInt(t))).forEach((e=>{a[e]=this.template[e]}));for(const[t,[n]]of Object.entries(Object.entries(a))){const r=Object.entries(a)[t-1]?`and (min-width:${Object.keys(a)[t-1]})`:"";e+="default"===n?`\n @media screen ${r} {\n .paginator[${this.attributeSelector}],\n .p-paginator-default{\n display: flex !important;\n }\n }\n `:`\n .paginator[${this.attributeSelector}], .p-paginator-${n} {\n display: none !important;\n }\n @media screen ${r} and (max-width: ${n}) {\n .paginator[${this.attributeSelector}], .p-paginator-${n} {\n display: flex !important;\n }\n .paginator[${this.attributeSelector}],\n .p-paginator-default{\n display: none !important;\n }\n }\n `}this.styleElement.innerHTML=e}},hasBreakpoints(){return"object"==typeof this.template},getPaginatorClasses(e){return[{"p-paginator-default":!this.hasBreakpoints(),[`p-paginator-${e}`]:this.hasBreakpoints()}]},setPaginatorAttribute(){this.$refs.paginator&&this.$refs.paginator.length>=0&&[...this.$refs.paginator].forEach((e=>{e.setAttribute(this.attributeSelector,"")}))},getAriaLabel(e){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria[e]:void 0}},computed:{templateItems(){let e={};if(this.hasBreakpoints()){e=this.template,e.default||(e.default="FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown");for(const t in e)e[t]=this.template[t].split(" ").map((e=>e.trim()));return e}return e.default=this.template.split(" ").map((e=>e.trim())),e},page(){return Math.floor(this.d_first/this.d_rows)},pageCount(){return Math.ceil(this.totalRecords/this.d_rows)},isFirstPage(){return 0===this.page},isLastPage(){return this.page===this.pageCount-1},calculatePageLinkBoundaries(){const e=this.pageCount,t=Math.min(this.pageLinkSize,e);let a=Math.max(0,Math.ceil(this.page-t/2)),n=Math.min(e-1,a+t-1);const r=this.pageLinkSize-(n-a+1);return a=Math.max(0,a-r),[a,n]},pageLinks(){let e=[],t=this.calculatePageLinkBoundaries,a=t[0],n=t[1];for(var r=a;r<=n;r++)e.push(r+1);return e},currentState(){return{page:this.page,first:this.d_first,rows:this.d_rows}},empty(){return 0===this.pageCount},currentPage(){return this.pageCount>0?this.page+1:0},attributeSelector:()=>e.UniqueComponentId()},components:{CurrentPageReport:p,FirstPageLink:c,LastPageLink:h,NextPageLink:k,PageLinks:b,PrevPageLink:L,RowsPerPageDropdown:y,JumpToPageDropdown:d,JumpToPageInput:m}};const N={key:0},$={key:0,class:"p-paginator-left-content"},D={key:1,class:"p-paginator-right-content"};!function(e,t){void 0===t&&(t={});var a=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===a&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}("\n.p-paginator-default {\n display: flex;\n}\n.p-paginator {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-wrap: wrap;\n}\n.p-paginator-left-content {\n margin-right: auto;\n}\n.p-paginator-right-content {\n margin-left: auto;\n}\n.p-paginator-page,\n.p-paginator-next,\n.p-paginator-last,\n.p-paginator-first,\n.p-paginator-prev,\n.p-paginator-current {\n cursor: pointer;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n line-height: 1;\n user-select: none;\n overflow: hidden;\n position: relative;\n}\n.p-paginator-element:focus {\n z-index: 1;\n position: relative;\n}\n"),B.render=function(e,a,n,r,o,i){const s=t.resolveComponent("FirstPageLink"),l=t.resolveComponent("PrevPageLink"),p=t.resolveComponent("NextPageLink"),g=t.resolveComponent("LastPageLink"),c=t.resolveComponent("PageLinks"),u=t.resolveComponent("CurrentPageReport"),d=t.resolveComponent("RowsPerPageDropdown"),m=t.resolveComponent("JumpToPageDropdown"),h=t.resolveComponent("JumpToPageInput");return n.alwaysShow||i.pageLinks&&i.pageLinks.length>1?(t.openBlock(),t.createElementBlock("nav",N,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.templateItems,((r,P)=>(t.openBlock(),t.createElementBlock("div",{key:P,ref_for:!0,ref:"paginator",class:t.normalizeClass(["p-paginator p-component",i.getPaginatorClasses(P)])},[e.$slots.start?(t.openBlock(),t.createElementBlock("div",$,[t.renderSlot(e.$slots,"start",{state:i.currentState})])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r,(e=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:e},["FirstPageLink"===e?(t.openBlock(),t.createBlock(s,{key:0,"aria-label":i.getAriaLabel("firstPageLabel"),onClick:a[0]||(a[0]=e=>i.changePageToFirst(e)),disabled:i.isFirstPage||i.empty},null,8,["aria-label","disabled"])):"PrevPageLink"===e?(t.openBlock(),t.createBlock(l,{key:1,"aria-label":i.getAriaLabel("prevPageLabel"),onClick:a[1]||(a[1]=e=>i.changePageToPrev(e)),disabled:i.isFirstPage||i.empty},null,8,["aria-label","disabled"])):"NextPageLink"===e?(t.openBlock(),t.createBlock(p,{key:2,"aria-label":i.getAriaLabel("nextPageLabel"),onClick:a[2]||(a[2]=e=>i.changePageToNext(e)),disabled:i.isLastPage||i.empty},null,8,["aria-label","disabled"])):"LastPageLink"===e?(t.openBlock(),t.createBlock(g,{key:3,"aria-label":i.getAriaLabel("lastPageLabel"),onClick:a[3]||(a[3]=e=>i.changePageToLast(e)),disabled:i.isLastPage||i.empty},null,8,["aria-label","disabled"])):"PageLinks"===e?(t.openBlock(),t.createBlock(c,{key:4,"aria-label":i.getAriaLabel("pageLabel"),value:i.pageLinks,page:i.page,onClick:a[4]||(a[4]=e=>i.changePageLink(e))},null,8,["aria-label","value","page"])):"CurrentPageReport"===e?(t.openBlock(),t.createBlock(u,{key:5,"aria-live":"polite",template:n.currentPageReportTemplate,currentPage:i.currentPage,page:i.page,pageCount:i.pageCount,first:o.d_first,rows:o.d_rows,totalRecords:n.totalRecords},null,8,["template","currentPage","page","pageCount","first","rows","totalRecords"])):"RowsPerPageDropdown"===e&&n.rowsPerPageOptions?(t.openBlock(),t.createBlock(d,{key:6,"aria-label":i.getAriaLabel("rowsPerPageLabel"),rows:o.d_rows,options:n.rowsPerPageOptions,onRowsChange:a[5]||(a[5]=e=>i.onRowChange(e)),disabled:i.empty},null,8,["aria-label","rows","options","disabled"])):"JumpToPageDropdown"===e?(t.openBlock(),t.createBlock(m,{key:7,"aria-label":i.getAriaLabel("jumpToPageDropdownLabel"),page:i.page,pageCount:i.pageCount,onPageChange:a[6]||(a[6]=e=>i.changePage(e)),disabled:i.empty},null,8,["aria-label","page","pageCount","disabled"])):"JumpToPageInput"===e?(t.openBlock(),t.createBlock(h,{key:8,page:i.currentPage,onPageChange:a[7]||(a[7]=e=>i.changePage(e)),disabled:i.empty},null,8,["page","disabled"])):t.createCommentVNode("",!0)],64)))),128)),e.$slots.end?(t.openBlock(),t.createElementBlock("div",D,[t.renderSlot(e.$slots,"end",{state:i.currentState})])):t.createCommentVNode("",!0)],2)))),128))])):t.createCommentVNode("",!0)},module.exports=B;
@@ -150,18 +150,21 @@ var script$6 = {
150
150
  },
151
151
  data() {
152
152
  return {
153
- d_page: null
153
+ d_page: this.page
154
154
  };
155
155
  },
156
156
  watch: {
157
- d_page(newValue) {
158
- if (this.$refs.jtpInput && !this.$refs.jtpInput.focused) return;
159
-
160
- this.$emit('page-change', newValue - 1);
157
+ page(newValue) {
158
+ this.d_page = newValue;
161
159
  }
162
160
  },
163
- mounted() {
164
- this.d_page = this.page;
161
+ methods: {
162
+ onChange(value) {
163
+ if (value !== this.page) {
164
+ this.d_page = value;
165
+ this.$emit('page-change', value - 1);
166
+ }
167
+ }
165
168
  },
166
169
  computed: {
167
170
  inputArialabel() {
@@ -179,11 +182,11 @@ function render$6(_ctx, _cache, $props, $setup, $data, $options) {
179
182
  return (openBlock(), createBlock(_component_JTPInput, {
180
183
  ref: "jtpInput",
181
184
  modelValue: $data.d_page,
182
- "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (($data.d_page) = $event)),
183
185
  class: "p-paginator-page-input",
184
186
  "aria-label": $options.inputArialabel,
185
- disabled: $props.disabled
186
- }, null, 8, ["modelValue", "aria-label", "disabled"]))
187
+ disabled: $props.disabled,
188
+ "onUpdate:modelValue": $options.onChange
189
+ }, null, 8, ["modelValue", "aria-label", "disabled", "onUpdate:modelValue"]))
187
190
  }
188
191
 
189
192
  script$6.render = render$6;
@@ -768,7 +771,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
768
771
  onPageChange: _cache[6] || (_cache[6] = $event => ($options.changePage($event))),
769
772
  disabled: $options.empty
770
773
  }, null, 8, ["aria-label", "page", "pageCount", "disabled"]))
771
- : (item === 'JumpToPageInput' && $options.currentPage)
774
+ : (item === 'JumpToPageInput')
772
775
  ? (openBlock(), createBlock(_component_JumpToPageInput, {
773
776
  key: 8,
774
777
  page: $options.currentPage,
@@ -1 +1 @@
1
- import{UniqueComponentId as e}from"primevue/utils";import{openBlock as t,createElementBlock as a,toDisplayString as n,resolveDirective as i,withDirectives as r,normalizeClass as s,createElementVNode as o,resolveComponent as p,createBlock as l,Fragment as g,renderList as u,createTextVNode as d,renderSlot as c,createCommentVNode as h}from"vue";import m from"primevue/ripple";import P from"primevue/dropdown";import b from"primevue/inputnumber";var f={name:"CurrentPageReport",props:{pageCount:{type:Number,default:0},currentPage:{type:Number,default:0},page:{type:Number,default:0},first:{type:Number,default:0},rows:{type:Number,default:0},totalRecords:{type:Number,default:0},template:{type:String,default:"({currentPage} of {totalPages})"}},computed:{text(){return this.template.replace("{currentPage}",this.currentPage).replace("{totalPages}",this.pageCount).replace("{first}",this.pageCount>0?this.first+1:0).replace("{last}",Math.min(this.first+this.rows,this.totalRecords)).replace("{rows}",this.rows).replace("{totalRecords}",this.totalRecords)}}};const k={class:"p-paginator-current"};f.render=function(e,i,r,s,o,p){return t(),a("span",k,n(p.text),1)};var L={name:"FirstPageLink",computed:{containerClass(){return["p-paginator-first p-paginator-element p-link",{"p-disabled":this.$attrs.disabled}]}},directives:{ripple:m}};const y=[o("span",{class:"p-paginator-icon pi pi-angle-double-left"},null,-1)];L.render=function(e,n,o,p,l,g){const u=i("ripple");return r((t(),a("button",{class:s(g.containerClass),type:"button"},y,2)),[[u]])};var w={name:"JumpToPageDropdown",emits:["page-change"],props:{page:Number,pageCount:Number,disabled:Boolean},methods:{onChange(e){this.$emit("page-change",e)}},computed:{pageOptions(){let e=[];for(let t=0;t<this.pageCount;t++)e.push({label:String(t+1),value:t});return e}},components:{JTPDropdown:P}};w.render=function(e,a,n,i,r,s){const o=p("JTPDropdown");return t(),l(o,{modelValue:n.page,options:s.pageOptions,optionLabel:"label",optionValue:"value","onUpdate:modelValue":a[0]||(a[0]=e=>s.onChange(e)),class:"p-paginator-page-options",disabled:n.disabled},null,8,["modelValue","options","disabled"])};var v={name:"JumpToPageInput",inheritAttrs:!1,emits:["page-change"],props:{page:Number,pageCount:Number,disabled:Boolean},data:()=>({d_page:null}),watch:{d_page(e){this.$refs.jtpInput&&!this.$refs.jtpInput.focused||this.$emit("page-change",e-1)}},mounted(){this.d_page=this.page},computed:{inputArialabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.jumpToPageInputLabel:void 0}},components:{JTPInput:b}};v.render=function(e,a,n,i,r,s){const o=p("JTPInput");return t(),l(o,{ref:"jtpInput",modelValue:r.d_page,"onUpdate:modelValue":a[0]||(a[0]=e=>r.d_page=e),class:"p-paginator-page-input","aria-label":s.inputArialabel,disabled:n.disabled},null,8,["modelValue","aria-label","disabled"])};var C={name:"LastPageLink",computed:{containerClass(){return["p-paginator-last p-paginator-element p-link",{"p-disabled":this.$attrs.disabled}]}},directives:{ripple:m}};const $=[o("span",{class:"p-paginator-icon pi pi-angle-double-right"},null,-1)];C.render=function(e,n,o,p,l,g){const u=i("ripple");return r((t(),a("button",{class:s(g.containerClass),type:"button"},$,2)),[[u]])};var x={name:"NextPageLink",computed:{containerClass(){return["p-paginator-next p-paginator-element p-link",{"p-disabled":this.$attrs.disabled}]}},directives:{ripple:m}};const T=[o("span",{class:"p-paginator-icon pi pi-angle-right"},null,-1)];x.render=function(e,n,o,p,l,g){const u=i("ripple");return r((t(),a("button",{class:s(g.containerClass),type:"button"},T,2)),[[u]])};var R={name:"PageLinks",inheritAttrs:!1,emits:["click"],props:{value:Array,page:Number},methods:{onPageLinkClick(e,t){this.$emit("click",{originalEvent:e,value:t})},ariaPageLabel(e){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.pageLabel.replace(/{page}/g,e):void 0}},computed:{},directives:{ripple:m}};const N={class:"p-paginator-pages"},_=["aria-label","aria-current","onClick"];R.render=function(e,o,p,l,c,h){const m=i("ripple");return t(),a("span",N,[(t(!0),a(g,null,u(p.value,(e=>r((t(),a("button",{key:e,class:s(["p-paginator-page p-paginator-element p-link",{"p-highlight":e-1===p.page}]),type:"button","aria-label":h.ariaPageLabel(e),"aria-current":e-1===p.page?"page":void 0,onClick:t=>h.onPageLinkClick(t,e)},[d(n(e),1)],10,_)),[[m]]))),128))])};var S={name:"PrevPageLink",computed:{containerClass(){return["p-paginator-prev p-paginator-element p-link",{"p-disabled":this.$attrs.disabled}]}},directives:{ripple:m}};const D=[o("span",{class:"p-paginator-icon pi pi-angle-left"},null,-1)];S.render=function(e,n,o,p,l,g){const u=i("ripple");return r((t(),a("button",{class:s(g.containerClass),type:"button"},D,2)),[[u]])};var A={name:"RowsPerPageDropdown",emits:["rows-change"],props:{options:Array,rows:Number,disabled:Boolean},methods:{onChange(e){this.$emit("rows-change",e)}},computed:{rowsOptions(){let e=[];if(this.options)for(let t=0;t<this.options.length;t++)e.push({label:String(this.options[t]),value:this.options[t]});return e}},components:{RPPDropdown:P}};A.render=function(e,a,n,i,r,s){const o=p("RPPDropdown");return t(),l(o,{modelValue:n.rows,options:s.rowsOptions,optionLabel:"label",optionValue:"value","onUpdate:modelValue":a[0]||(a[0]=e=>s.onChange(e)),class:"p-paginator-rpp-options",disabled:n.disabled},null,8,["modelValue","options","disabled"])};var j={name:"Paginator",emits:["update:first","update:rows","page"],props:{totalRecords:{type:Number,default:0},rows:{type:Number,default:0},first:{type:Number,default:0},pageLinkSize:{type:Number,default:5},rowsPerPageOptions:{type:Array,default:null},template:{type:[Object,String],default:"FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown"},currentPageReportTemplate:{type:null,default:"({currentPage} of {totalPages})"},alwaysShow:{type:Boolean,default:!0}},data(){return{d_first:this.first,d_rows:this.rows}},watch:{first(e){this.d_first=e},rows(e){this.d_rows=e},totalRecords(e){this.page>0&&e&&this.d_first>=e&&this.changePage(this.pageCount-1)}},mounted(){this.setPaginatorAttribute(),this.createStyle()},methods:{changePage(e){const t=this.pageCount;if(e>=0&&e<t){this.d_first=this.d_rows*e;const a={page:e,first:this.d_first,rows:this.d_rows,pageCount:t};this.$emit("update:first",this.d_first),this.$emit("update:rows",this.d_rows),this.$emit("page",a)}},changePageToFirst(e){this.isFirstPage||this.changePage(0),e.preventDefault()},changePageToPrev(e){this.changePage(this.page-1),e.preventDefault()},changePageLink(e){this.changePage(e.value-1),e.originalEvent.preventDefault()},changePageToNext(e){this.changePage(this.page+1),e.preventDefault()},changePageToLast(e){this.isLastPage||this.changePage(this.pageCount-1),e.preventDefault()},onRowChange(e){this.d_rows=e,this.changePage(this.page)},createStyle(){if(this.hasBreakpoints()){this.styleElement=document.createElement("style"),this.styleElement.type="text/css",document.head.appendChild(this.styleElement);let e="";const t=Object.keys(this.template),a={};t.sort(((e,t)=>parseInt(e)-parseInt(t))).forEach((e=>{a[e]=this.template[e]}));for(const[t,[n]]of Object.entries(Object.entries(a))){const i=Object.entries(a)[t-1]?`and (min-width:${Object.keys(a)[t-1]})`:"";e+="default"===n?`\n @media screen ${i} {\n .paginator[${this.attributeSelector}],\n .p-paginator-default{\n display: flex !important;\n }\n }\n `:`\n .paginator[${this.attributeSelector}], .p-paginator-${n} {\n display: none !important;\n }\n @media screen ${i} and (max-width: ${n}) {\n .paginator[${this.attributeSelector}], .p-paginator-${n} {\n display: flex !important;\n }\n .paginator[${this.attributeSelector}],\n .p-paginator-default{\n display: none !important;\n }\n }\n `}this.styleElement.innerHTML=e}},hasBreakpoints(){return"object"==typeof this.template},getPaginatorClasses(e){return[{"p-paginator-default":!this.hasBreakpoints(),[`p-paginator-${e}`]:this.hasBreakpoints()}]},setPaginatorAttribute(){this.$refs.paginator&&this.$refs.paginator.length>=0&&[...this.$refs.paginator].forEach((e=>{e.setAttribute(this.attributeSelector,"")}))},getAriaLabel(e){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria[e]:void 0}},computed:{templateItems(){let e={};if(this.hasBreakpoints()){e=this.template,e.default||(e.default="FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown");for(const t in e)e[t]=this.template[t].split(" ").map((e=>e.trim()));return e}return e.default=this.template.split(" ").map((e=>e.trim())),e},page(){return Math.floor(this.d_first/this.d_rows)},pageCount(){return Math.ceil(this.totalRecords/this.d_rows)},isFirstPage(){return 0===this.page},isLastPage(){return this.page===this.pageCount-1},calculatePageLinkBoundaries(){const e=this.pageCount,t=Math.min(this.pageLinkSize,e);let a=Math.max(0,Math.ceil(this.page-t/2)),n=Math.min(e-1,a+t-1);const i=this.pageLinkSize-(n-a+1);return a=Math.max(0,a-i),[a,n]},pageLinks(){let e=[],t=this.calculatePageLinkBoundaries,a=t[0],n=t[1];for(var i=a;i<=n;i++)e.push(i+1);return e},currentState(){return{page:this.page,first:this.d_first,rows:this.d_rows}},empty(){return 0===this.pageCount},currentPage(){return this.pageCount>0?this.page+1:0},attributeSelector:()=>e()},components:{CurrentPageReport:f,FirstPageLink:L,LastPageLink:C,NextPageLink:x,PageLinks:R,PrevPageLink:S,RowsPerPageDropdown:A,JumpToPageDropdown:w,JumpToPageInput:v}};const I={key:0},B={key:0,class:"p-paginator-left-content"},O={key:1,class:"p-paginator-right-content"};!function(e,t){void 0===t&&(t={});var a=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===a&&n.firstChild?n.insertBefore(i,n.firstChild):n.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}("\n.p-paginator-default {\n display: flex;\n}\n.p-paginator {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-wrap: wrap;\n}\n.p-paginator-left-content {\n margin-right: auto;\n}\n.p-paginator-right-content {\n margin-left: auto;\n}\n.p-paginator-page,\n.p-paginator-next,\n.p-paginator-last,\n.p-paginator-first,\n.p-paginator-prev,\n.p-paginator-current {\n cursor: pointer;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n line-height: 1;\n user-select: none;\n overflow: hidden;\n position: relative;\n}\n.p-paginator-element:focus {\n z-index: 1;\n position: relative;\n}\n"),j.render=function(e,n,i,r,o,d){const m=p("FirstPageLink"),P=p("PrevPageLink"),b=p("NextPageLink"),f=p("LastPageLink"),k=p("PageLinks"),L=p("CurrentPageReport"),y=p("RowsPerPageDropdown"),w=p("JumpToPageDropdown"),v=p("JumpToPageInput");return i.alwaysShow||d.pageLinks&&d.pageLinks.length>1?(t(),a("nav",I,[(t(!0),a(g,null,u(d.templateItems,((r,p)=>(t(),a("div",{key:p,ref_for:!0,ref:"paginator",class:s(["p-paginator p-component",d.getPaginatorClasses(p)])},[e.$slots.start?(t(),a("div",B,[c(e.$slots,"start",{state:d.currentState})])):h("",!0),(t(!0),a(g,null,u(r,(e=>(t(),a(g,{key:e},["FirstPageLink"===e?(t(),l(m,{key:0,"aria-label":d.getAriaLabel("firstPageLabel"),onClick:n[0]||(n[0]=e=>d.changePageToFirst(e)),disabled:d.isFirstPage||d.empty},null,8,["aria-label","disabled"])):"PrevPageLink"===e?(t(),l(P,{key:1,"aria-label":d.getAriaLabel("prevPageLabel"),onClick:n[1]||(n[1]=e=>d.changePageToPrev(e)),disabled:d.isFirstPage||d.empty},null,8,["aria-label","disabled"])):"NextPageLink"===e?(t(),l(b,{key:2,"aria-label":d.getAriaLabel("nextPageLabel"),onClick:n[2]||(n[2]=e=>d.changePageToNext(e)),disabled:d.isLastPage||d.empty},null,8,["aria-label","disabled"])):"LastPageLink"===e?(t(),l(f,{key:3,"aria-label":d.getAriaLabel("lastPageLabel"),onClick:n[3]||(n[3]=e=>d.changePageToLast(e)),disabled:d.isLastPage||d.empty},null,8,["aria-label","disabled"])):"PageLinks"===e?(t(),l(k,{key:4,"aria-label":d.getAriaLabel("pageLabel"),value:d.pageLinks,page:d.page,onClick:n[4]||(n[4]=e=>d.changePageLink(e))},null,8,["aria-label","value","page"])):"CurrentPageReport"===e?(t(),l(L,{key:5,"aria-live":"polite",template:i.currentPageReportTemplate,currentPage:d.currentPage,page:d.page,pageCount:d.pageCount,first:o.d_first,rows:o.d_rows,totalRecords:i.totalRecords},null,8,["template","currentPage","page","pageCount","first","rows","totalRecords"])):"RowsPerPageDropdown"===e&&i.rowsPerPageOptions?(t(),l(y,{key:6,"aria-label":d.getAriaLabel("rowsPerPageLabel"),rows:o.d_rows,options:i.rowsPerPageOptions,onRowsChange:n[5]||(n[5]=e=>d.onRowChange(e)),disabled:d.empty},null,8,["aria-label","rows","options","disabled"])):"JumpToPageDropdown"===e?(t(),l(w,{key:7,"aria-label":d.getAriaLabel("jumpToPageDropdownLabel"),page:d.page,pageCount:d.pageCount,onPageChange:n[6]||(n[6]=e=>d.changePage(e)),disabled:d.empty},null,8,["aria-label","page","pageCount","disabled"])):"JumpToPageInput"===e&&d.currentPage?(t(),l(v,{key:8,page:d.currentPage,onPageChange:n[7]||(n[7]=e=>d.changePage(e)),disabled:d.empty},null,8,["page","disabled"])):h("",!0)],64)))),128)),e.$slots.end?(t(),a("div",O,[c(e.$slots,"end",{state:d.currentState})])):h("",!0)],2)))),128))])):h("",!0)};export{j as default};
1
+ import{UniqueComponentId as e}from"primevue/utils";import{openBlock as t,createElementBlock as a,toDisplayString as n,resolveDirective as i,withDirectives as r,normalizeClass as s,createElementVNode as o,resolveComponent as p,createBlock as l,Fragment as g,renderList as u,createTextVNode as d,renderSlot as c,createCommentVNode as h}from"vue";import m from"primevue/ripple";import P from"primevue/dropdown";import b from"primevue/inputnumber";var f={name:"CurrentPageReport",props:{pageCount:{type:Number,default:0},currentPage:{type:Number,default:0},page:{type:Number,default:0},first:{type:Number,default:0},rows:{type:Number,default:0},totalRecords:{type:Number,default:0},template:{type:String,default:"({currentPage} of {totalPages})"}},computed:{text(){return this.template.replace("{currentPage}",this.currentPage).replace("{totalPages}",this.pageCount).replace("{first}",this.pageCount>0?this.first+1:0).replace("{last}",Math.min(this.first+this.rows,this.totalRecords)).replace("{rows}",this.rows).replace("{totalRecords}",this.totalRecords)}}};const k={class:"p-paginator-current"};f.render=function(e,i,r,s,o,p){return t(),a("span",k,n(p.text),1)};var L={name:"FirstPageLink",computed:{containerClass(){return["p-paginator-first p-paginator-element p-link",{"p-disabled":this.$attrs.disabled}]}},directives:{ripple:m}};const y=[o("span",{class:"p-paginator-icon pi pi-angle-double-left"},null,-1)];L.render=function(e,n,o,p,l,g){const u=i("ripple");return r((t(),a("button",{class:s(g.containerClass),type:"button"},y,2)),[[u]])};var w={name:"JumpToPageDropdown",emits:["page-change"],props:{page:Number,pageCount:Number,disabled:Boolean},methods:{onChange(e){this.$emit("page-change",e)}},computed:{pageOptions(){let e=[];for(let t=0;t<this.pageCount;t++)e.push({label:String(t+1),value:t});return e}},components:{JTPDropdown:P}};w.render=function(e,a,n,i,r,s){const o=p("JTPDropdown");return t(),l(o,{modelValue:n.page,options:s.pageOptions,optionLabel:"label",optionValue:"value","onUpdate:modelValue":a[0]||(a[0]=e=>s.onChange(e)),class:"p-paginator-page-options",disabled:n.disabled},null,8,["modelValue","options","disabled"])};var v={name:"JumpToPageInput",inheritAttrs:!1,emits:["page-change"],props:{page:Number,pageCount:Number,disabled:Boolean},data(){return{d_page:this.page}},watch:{page(e){this.d_page=e}},methods:{onChange(e){e!==this.page&&(this.d_page=e,this.$emit("page-change",e-1))}},computed:{inputArialabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.jumpToPageInputLabel:void 0}},components:{JTPInput:b}};v.render=function(e,a,n,i,r,s){const o=p("JTPInput");return t(),l(o,{ref:"jtpInput",modelValue:r.d_page,class:"p-paginator-page-input","aria-label":s.inputArialabel,disabled:n.disabled,"onUpdate:modelValue":s.onChange},null,8,["modelValue","aria-label","disabled","onUpdate:modelValue"])};var C={name:"LastPageLink",computed:{containerClass(){return["p-paginator-last p-paginator-element p-link",{"p-disabled":this.$attrs.disabled}]}},directives:{ripple:m}};const $=[o("span",{class:"p-paginator-icon pi pi-angle-double-right"},null,-1)];C.render=function(e,n,o,p,l,g){const u=i("ripple");return r((t(),a("button",{class:s(g.containerClass),type:"button"},$,2)),[[u]])};var x={name:"NextPageLink",computed:{containerClass(){return["p-paginator-next p-paginator-element p-link",{"p-disabled":this.$attrs.disabled}]}},directives:{ripple:m}};const T=[o("span",{class:"p-paginator-icon pi pi-angle-right"},null,-1)];x.render=function(e,n,o,p,l,g){const u=i("ripple");return r((t(),a("button",{class:s(g.containerClass),type:"button"},T,2)),[[u]])};var R={name:"PageLinks",inheritAttrs:!1,emits:["click"],props:{value:Array,page:Number},methods:{onPageLinkClick(e,t){this.$emit("click",{originalEvent:e,value:t})},ariaPageLabel(e){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.pageLabel.replace(/{page}/g,e):void 0}},computed:{},directives:{ripple:m}};const N={class:"p-paginator-pages"},_=["aria-label","aria-current","onClick"];R.render=function(e,o,p,l,c,h){const m=i("ripple");return t(),a("span",N,[(t(!0),a(g,null,u(p.value,(e=>r((t(),a("button",{key:e,class:s(["p-paginator-page p-paginator-element p-link",{"p-highlight":e-1===p.page}]),type:"button","aria-label":h.ariaPageLabel(e),"aria-current":e-1===p.page?"page":void 0,onClick:t=>h.onPageLinkClick(t,e)},[d(n(e),1)],10,_)),[[m]]))),128))])};var S={name:"PrevPageLink",computed:{containerClass(){return["p-paginator-prev p-paginator-element p-link",{"p-disabled":this.$attrs.disabled}]}},directives:{ripple:m}};const D=[o("span",{class:"p-paginator-icon pi pi-angle-left"},null,-1)];S.render=function(e,n,o,p,l,g){const u=i("ripple");return r((t(),a("button",{class:s(g.containerClass),type:"button"},D,2)),[[u]])};var A={name:"RowsPerPageDropdown",emits:["rows-change"],props:{options:Array,rows:Number,disabled:Boolean},methods:{onChange(e){this.$emit("rows-change",e)}},computed:{rowsOptions(){let e=[];if(this.options)for(let t=0;t<this.options.length;t++)e.push({label:String(this.options[t]),value:this.options[t]});return e}},components:{RPPDropdown:P}};A.render=function(e,a,n,i,r,s){const o=p("RPPDropdown");return t(),l(o,{modelValue:n.rows,options:s.rowsOptions,optionLabel:"label",optionValue:"value","onUpdate:modelValue":a[0]||(a[0]=e=>s.onChange(e)),class:"p-paginator-rpp-options",disabled:n.disabled},null,8,["modelValue","options","disabled"])};var B={name:"Paginator",emits:["update:first","update:rows","page"],props:{totalRecords:{type:Number,default:0},rows:{type:Number,default:0},first:{type:Number,default:0},pageLinkSize:{type:Number,default:5},rowsPerPageOptions:{type:Array,default:null},template:{type:[Object,String],default:"FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown"},currentPageReportTemplate:{type:null,default:"({currentPage} of {totalPages})"},alwaysShow:{type:Boolean,default:!0}},data(){return{d_first:this.first,d_rows:this.rows}},watch:{first(e){this.d_first=e},rows(e){this.d_rows=e},totalRecords(e){this.page>0&&e&&this.d_first>=e&&this.changePage(this.pageCount-1)}},mounted(){this.setPaginatorAttribute(),this.createStyle()},methods:{changePage(e){const t=this.pageCount;if(e>=0&&e<t){this.d_first=this.d_rows*e;const a={page:e,first:this.d_first,rows:this.d_rows,pageCount:t};this.$emit("update:first",this.d_first),this.$emit("update:rows",this.d_rows),this.$emit("page",a)}},changePageToFirst(e){this.isFirstPage||this.changePage(0),e.preventDefault()},changePageToPrev(e){this.changePage(this.page-1),e.preventDefault()},changePageLink(e){this.changePage(e.value-1),e.originalEvent.preventDefault()},changePageToNext(e){this.changePage(this.page+1),e.preventDefault()},changePageToLast(e){this.isLastPage||this.changePage(this.pageCount-1),e.preventDefault()},onRowChange(e){this.d_rows=e,this.changePage(this.page)},createStyle(){if(this.hasBreakpoints()){this.styleElement=document.createElement("style"),this.styleElement.type="text/css",document.head.appendChild(this.styleElement);let e="";const t=Object.keys(this.template),a={};t.sort(((e,t)=>parseInt(e)-parseInt(t))).forEach((e=>{a[e]=this.template[e]}));for(const[t,[n]]of Object.entries(Object.entries(a))){const i=Object.entries(a)[t-1]?`and (min-width:${Object.keys(a)[t-1]})`:"";e+="default"===n?`\n @media screen ${i} {\n .paginator[${this.attributeSelector}],\n .p-paginator-default{\n display: flex !important;\n }\n }\n `:`\n .paginator[${this.attributeSelector}], .p-paginator-${n} {\n display: none !important;\n }\n @media screen ${i} and (max-width: ${n}) {\n .paginator[${this.attributeSelector}], .p-paginator-${n} {\n display: flex !important;\n }\n .paginator[${this.attributeSelector}],\n .p-paginator-default{\n display: none !important;\n }\n }\n `}this.styleElement.innerHTML=e}},hasBreakpoints(){return"object"==typeof this.template},getPaginatorClasses(e){return[{"p-paginator-default":!this.hasBreakpoints(),[`p-paginator-${e}`]:this.hasBreakpoints()}]},setPaginatorAttribute(){this.$refs.paginator&&this.$refs.paginator.length>=0&&[...this.$refs.paginator].forEach((e=>{e.setAttribute(this.attributeSelector,"")}))},getAriaLabel(e){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria[e]:void 0}},computed:{templateItems(){let e={};if(this.hasBreakpoints()){e=this.template,e.default||(e.default="FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown");for(const t in e)e[t]=this.template[t].split(" ").map((e=>e.trim()));return e}return e.default=this.template.split(" ").map((e=>e.trim())),e},page(){return Math.floor(this.d_first/this.d_rows)},pageCount(){return Math.ceil(this.totalRecords/this.d_rows)},isFirstPage(){return 0===this.page},isLastPage(){return this.page===this.pageCount-1},calculatePageLinkBoundaries(){const e=this.pageCount,t=Math.min(this.pageLinkSize,e);let a=Math.max(0,Math.ceil(this.page-t/2)),n=Math.min(e-1,a+t-1);const i=this.pageLinkSize-(n-a+1);return a=Math.max(0,a-i),[a,n]},pageLinks(){let e=[],t=this.calculatePageLinkBoundaries,a=t[0],n=t[1];for(var i=a;i<=n;i++)e.push(i+1);return e},currentState(){return{page:this.page,first:this.d_first,rows:this.d_rows}},empty(){return 0===this.pageCount},currentPage(){return this.pageCount>0?this.page+1:0},attributeSelector:()=>e()},components:{CurrentPageReport:f,FirstPageLink:L,LastPageLink:C,NextPageLink:x,PageLinks:R,PrevPageLink:S,RowsPerPageDropdown:A,JumpToPageDropdown:w,JumpToPageInput:v}};const O={key:0},j={key:0,class:"p-paginator-left-content"},F={key:1,class:"p-paginator-right-content"};!function(e,t){void 0===t&&(t={});var a=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===a&&n.firstChild?n.insertBefore(i,n.firstChild):n.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}("\n.p-paginator-default {\n display: flex;\n}\n.p-paginator {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-wrap: wrap;\n}\n.p-paginator-left-content {\n margin-right: auto;\n}\n.p-paginator-right-content {\n margin-left: auto;\n}\n.p-paginator-page,\n.p-paginator-next,\n.p-paginator-last,\n.p-paginator-first,\n.p-paginator-prev,\n.p-paginator-current {\n cursor: pointer;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n line-height: 1;\n user-select: none;\n overflow: hidden;\n position: relative;\n}\n.p-paginator-element:focus {\n z-index: 1;\n position: relative;\n}\n"),B.render=function(e,n,i,r,o,d){const m=p("FirstPageLink"),P=p("PrevPageLink"),b=p("NextPageLink"),f=p("LastPageLink"),k=p("PageLinks"),L=p("CurrentPageReport"),y=p("RowsPerPageDropdown"),w=p("JumpToPageDropdown"),v=p("JumpToPageInput");return i.alwaysShow||d.pageLinks&&d.pageLinks.length>1?(t(),a("nav",O,[(t(!0),a(g,null,u(d.templateItems,((r,p)=>(t(),a("div",{key:p,ref_for:!0,ref:"paginator",class:s(["p-paginator p-component",d.getPaginatorClasses(p)])},[e.$slots.start?(t(),a("div",j,[c(e.$slots,"start",{state:d.currentState})])):h("",!0),(t(!0),a(g,null,u(r,(e=>(t(),a(g,{key:e},["FirstPageLink"===e?(t(),l(m,{key:0,"aria-label":d.getAriaLabel("firstPageLabel"),onClick:n[0]||(n[0]=e=>d.changePageToFirst(e)),disabled:d.isFirstPage||d.empty},null,8,["aria-label","disabled"])):"PrevPageLink"===e?(t(),l(P,{key:1,"aria-label":d.getAriaLabel("prevPageLabel"),onClick:n[1]||(n[1]=e=>d.changePageToPrev(e)),disabled:d.isFirstPage||d.empty},null,8,["aria-label","disabled"])):"NextPageLink"===e?(t(),l(b,{key:2,"aria-label":d.getAriaLabel("nextPageLabel"),onClick:n[2]||(n[2]=e=>d.changePageToNext(e)),disabled:d.isLastPage||d.empty},null,8,["aria-label","disabled"])):"LastPageLink"===e?(t(),l(f,{key:3,"aria-label":d.getAriaLabel("lastPageLabel"),onClick:n[3]||(n[3]=e=>d.changePageToLast(e)),disabled:d.isLastPage||d.empty},null,8,["aria-label","disabled"])):"PageLinks"===e?(t(),l(k,{key:4,"aria-label":d.getAriaLabel("pageLabel"),value:d.pageLinks,page:d.page,onClick:n[4]||(n[4]=e=>d.changePageLink(e))},null,8,["aria-label","value","page"])):"CurrentPageReport"===e?(t(),l(L,{key:5,"aria-live":"polite",template:i.currentPageReportTemplate,currentPage:d.currentPage,page:d.page,pageCount:d.pageCount,first:o.d_first,rows:o.d_rows,totalRecords:i.totalRecords},null,8,["template","currentPage","page","pageCount","first","rows","totalRecords"])):"RowsPerPageDropdown"===e&&i.rowsPerPageOptions?(t(),l(y,{key:6,"aria-label":d.getAriaLabel("rowsPerPageLabel"),rows:o.d_rows,options:i.rowsPerPageOptions,onRowsChange:n[5]||(n[5]=e=>d.onRowChange(e)),disabled:d.empty},null,8,["aria-label","rows","options","disabled"])):"JumpToPageDropdown"===e?(t(),l(w,{key:7,"aria-label":d.getAriaLabel("jumpToPageDropdownLabel"),page:d.page,pageCount:d.pageCount,onPageChange:n[6]||(n[6]=e=>d.changePage(e)),disabled:d.empty},null,8,["aria-label","page","pageCount","disabled"])):"JumpToPageInput"===e?(t(),l(v,{key:8,page:d.currentPage,onPageChange:n[7]||(n[7]=e=>d.changePage(e)),disabled:d.empty},null,8,["page","disabled"])):h("",!0)],64)))),128)),e.$slots.end?(t(),a("div",F,[c(e.$slots,"end",{state:d.currentState})])):h("",!0)],2)))),128))])):h("",!0)};export{B as default};
@@ -154,18 +154,21 @@ this.primevue.paginator = (function (utils, vue, Ripple, Dropdown, InputNumber)
154
154
  },
155
155
  data() {
156
156
  return {
157
- d_page: null
157
+ d_page: this.page
158
158
  };
159
159
  },
160
160
  watch: {
161
- d_page(newValue) {
162
- if (this.$refs.jtpInput && !this.$refs.jtpInput.focused) return;
163
-
164
- this.$emit('page-change', newValue - 1);
161
+ page(newValue) {
162
+ this.d_page = newValue;
165
163
  }
166
164
  },
167
- mounted() {
168
- this.d_page = this.page;
165
+ methods: {
166
+ onChange(value) {
167
+ if (value !== this.page) {
168
+ this.d_page = value;
169
+ this.$emit('page-change', value - 1);
170
+ }
171
+ }
169
172
  },
170
173
  computed: {
171
174
  inputArialabel() {
@@ -183,11 +186,11 @@ this.primevue.paginator = (function (utils, vue, Ripple, Dropdown, InputNumber)
183
186
  return (vue.openBlock(), vue.createBlock(_component_JTPInput, {
184
187
  ref: "jtpInput",
185
188
  modelValue: $data.d_page,
186
- "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (($data.d_page) = $event)),
187
189
  class: "p-paginator-page-input",
188
190
  "aria-label": $options.inputArialabel,
189
- disabled: $props.disabled
190
- }, null, 8, ["modelValue", "aria-label", "disabled"]))
191
+ disabled: $props.disabled,
192
+ "onUpdate:modelValue": $options.onChange
193
+ }, null, 8, ["modelValue", "aria-label", "disabled", "onUpdate:modelValue"]))
191
194
  }
192
195
 
193
196
  script$6.render = render$6;
@@ -772,7 +775,7 @@ this.primevue.paginator = (function (utils, vue, Ripple, Dropdown, InputNumber)
772
775
  onPageChange: _cache[6] || (_cache[6] = $event => ($options.changePage($event))),
773
776
  disabled: $options.empty
774
777
  }, null, 8, ["aria-label", "page", "pageCount", "disabled"]))
775
- : (item === 'JumpToPageInput' && $options.currentPage)
778
+ : (item === 'JumpToPageInput')
776
779
  ? (vue.openBlock(), vue.createBlock(_component_JumpToPageInput, {
777
780
  key: 8,
778
781
  page: $options.currentPage,
@@ -1 +1 @@
1
- this.primevue=this.primevue||{},this.primevue.paginator=function(e,t,a,n,r){"use strict";function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=o(a),s=o(n),l=o(r),p={name:"CurrentPageReport",props:{pageCount:{type:Number,default:0},currentPage:{type:Number,default:0},page:{type:Number,default:0},first:{type:Number,default:0},rows:{type:Number,default:0},totalRecords:{type:Number,default:0},template:{type:String,default:"({currentPage} of {totalPages})"}},computed:{text(){return this.template.replace("{currentPage}",this.currentPage).replace("{totalPages}",this.pageCount).replace("{first}",this.pageCount>0?this.first+1:0).replace("{last}",Math.min(this.first+this.rows,this.totalRecords)).replace("{rows}",this.rows).replace("{totalRecords}",this.totalRecords)}}};const c={class:"p-paginator-current"};p.render=function(e,a,n,r,o,i){return t.openBlock(),t.createElementBlock("span",c,t.toDisplayString(i.text),1)};var g={name:"FirstPageLink",computed:{containerClass(){return["p-paginator-first p-paginator-element p-link",{"p-disabled":this.$attrs.disabled}]}},directives:{ripple:i.default}};const u=[t.createElementVNode("span",{class:"p-paginator-icon pi pi-angle-double-left"},null,-1)];g.render=function(e,a,n,r,o,i){const s=t.resolveDirective("ripple");return t.withDirectives((t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass(i.containerClass),type:"button"},u,2)),[[s]])};var d={name:"JumpToPageDropdown",emits:["page-change"],props:{page:Number,pageCount:Number,disabled:Boolean},methods:{onChange(e){this.$emit("page-change",e)}},computed:{pageOptions(){let e=[];for(let t=0;t<this.pageCount;t++)e.push({label:String(t+1),value:t});return e}},components:{JTPDropdown:s.default}};d.render=function(e,a,n,r,o,i){const s=t.resolveComponent("JTPDropdown");return t.openBlock(),t.createBlock(s,{modelValue:n.page,options:i.pageOptions,optionLabel:"label",optionValue:"value","onUpdate:modelValue":a[0]||(a[0]=e=>i.onChange(e)),class:"p-paginator-page-options",disabled:n.disabled},null,8,["modelValue","options","disabled"])};var m={name:"JumpToPageInput",inheritAttrs:!1,emits:["page-change"],props:{page:Number,pageCount:Number,disabled:Boolean},data:()=>({d_page:null}),watch:{d_page(e){this.$refs.jtpInput&&!this.$refs.jtpInput.focused||this.$emit("page-change",e-1)}},mounted(){this.d_page=this.page},computed:{inputArialabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.jumpToPageInputLabel:void 0}},components:{JTPInput:l.default}};m.render=function(e,a,n,r,o,i){const s=t.resolveComponent("JTPInput");return t.openBlock(),t.createBlock(s,{ref:"jtpInput",modelValue:o.d_page,"onUpdate:modelValue":a[0]||(a[0]=e=>o.d_page=e),class:"p-paginator-page-input","aria-label":i.inputArialabel,disabled:n.disabled},null,8,["modelValue","aria-label","disabled"])};var h={name:"LastPageLink",computed:{containerClass(){return["p-paginator-last p-paginator-element p-link",{"p-disabled":this.$attrs.disabled}]}},directives:{ripple:i.default}};const P=[t.createElementVNode("span",{class:"p-paginator-icon pi pi-angle-double-right"},null,-1)];h.render=function(e,a,n,r,o,i){const s=t.resolveDirective("ripple");return t.withDirectives((t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass(i.containerClass),type:"button"},P,2)),[[s]])};var k={name:"NextPageLink",computed:{containerClass(){return["p-paginator-next p-paginator-element p-link",{"p-disabled":this.$attrs.disabled}]}},directives:{ripple:i.default}};const f=[t.createElementVNode("span",{class:"p-paginator-icon pi pi-angle-right"},null,-1)];k.render=function(e,a,n,r,o,i){const s=t.resolveDirective("ripple");return t.withDirectives((t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass(i.containerClass),type:"button"},f,2)),[[s]])};var b={name:"PageLinks",inheritAttrs:!1,emits:["click"],props:{value:Array,page:Number},methods:{onPageLinkClick(e,t){this.$emit("click",{originalEvent:e,value:t})},ariaPageLabel(e){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.pageLabel.replace(/{page}/g,e):void 0}},computed:{},directives:{ripple:i.default}};const v={class:"p-paginator-pages"},C=["aria-label","aria-current","onClick"];b.render=function(e,a,n,r,o,i){const s=t.resolveDirective("ripple");return t.openBlock(),t.createElementBlock("span",v,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.value,(e=>t.withDirectives((t.openBlock(),t.createElementBlock("button",{key:e,class:t.normalizeClass(["p-paginator-page p-paginator-element p-link",{"p-highlight":e-1===n.page}]),type:"button","aria-label":i.ariaPageLabel(e),"aria-current":e-1===n.page?"page":void 0,onClick:t=>i.onPageLinkClick(t,e)},[t.createTextVNode(t.toDisplayString(e),1)],10,C)),[[s]]))),128))])};var L={name:"PrevPageLink",computed:{containerClass(){return["p-paginator-prev p-paginator-element p-link",{"p-disabled":this.$attrs.disabled}]}},directives:{ripple:i.default}};const w=[t.createElementVNode("span",{class:"p-paginator-icon pi pi-angle-left"},null,-1)];L.render=function(e,a,n,r,o,i){const s=t.resolveDirective("ripple");return t.withDirectives((t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass(i.containerClass),type:"button"},w,2)),[[s]])};var y={name:"RowsPerPageDropdown",emits:["rows-change"],props:{options:Array,rows:Number,disabled:Boolean},methods:{onChange(e){this.$emit("rows-change",e)}},computed:{rowsOptions(){let e=[];if(this.options)for(let t=0;t<this.options.length;t++)e.push({label:String(this.options[t]),value:this.options[t]});return e}},components:{RPPDropdown:s.default}};y.render=function(e,a,n,r,o,i){const s=t.resolveComponent("RPPDropdown");return t.openBlock(),t.createBlock(s,{modelValue:n.rows,options:i.rowsOptions,optionLabel:"label",optionValue:"value","onUpdate:modelValue":a[0]||(a[0]=e=>i.onChange(e)),class:"p-paginator-rpp-options",disabled:n.disabled},null,8,["modelValue","options","disabled"])};var B={name:"Paginator",emits:["update:first","update:rows","page"],props:{totalRecords:{type:Number,default:0},rows:{type:Number,default:0},first:{type:Number,default:0},pageLinkSize:{type:Number,default:5},rowsPerPageOptions:{type:Array,default:null},template:{type:[Object,String],default:"FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown"},currentPageReportTemplate:{type:null,default:"({currentPage} of {totalPages})"},alwaysShow:{type:Boolean,default:!0}},data(){return{d_first:this.first,d_rows:this.rows}},watch:{first(e){this.d_first=e},rows(e){this.d_rows=e},totalRecords(e){this.page>0&&e&&this.d_first>=e&&this.changePage(this.pageCount-1)}},mounted(){this.setPaginatorAttribute(),this.createStyle()},methods:{changePage(e){const t=this.pageCount;if(e>=0&&e<t){this.d_first=this.d_rows*e;const a={page:e,first:this.d_first,rows:this.d_rows,pageCount:t};this.$emit("update:first",this.d_first),this.$emit("update:rows",this.d_rows),this.$emit("page",a)}},changePageToFirst(e){this.isFirstPage||this.changePage(0),e.preventDefault()},changePageToPrev(e){this.changePage(this.page-1),e.preventDefault()},changePageLink(e){this.changePage(e.value-1),e.originalEvent.preventDefault()},changePageToNext(e){this.changePage(this.page+1),e.preventDefault()},changePageToLast(e){this.isLastPage||this.changePage(this.pageCount-1),e.preventDefault()},onRowChange(e){this.d_rows=e,this.changePage(this.page)},createStyle(){if(this.hasBreakpoints()){this.styleElement=document.createElement("style"),this.styleElement.type="text/css",document.head.appendChild(this.styleElement);let e="";const t=Object.keys(this.template),a={};t.sort(((e,t)=>parseInt(e)-parseInt(t))).forEach((e=>{a[e]=this.template[e]}));for(const[t,[n]]of Object.entries(Object.entries(a))){const r=Object.entries(a)[t-1]?`and (min-width:${Object.keys(a)[t-1]})`:"";e+="default"===n?`\n @media screen ${r} {\n .paginator[${this.attributeSelector}],\n .p-paginator-default{\n display: flex !important;\n }\n }\n `:`\n .paginator[${this.attributeSelector}], .p-paginator-${n} {\n display: none !important;\n }\n @media screen ${r} and (max-width: ${n}) {\n .paginator[${this.attributeSelector}], .p-paginator-${n} {\n display: flex !important;\n }\n .paginator[${this.attributeSelector}],\n .p-paginator-default{\n display: none !important;\n }\n }\n `}this.styleElement.innerHTML=e}},hasBreakpoints(){return"object"==typeof this.template},getPaginatorClasses(e){return[{"p-paginator-default":!this.hasBreakpoints(),[`p-paginator-${e}`]:this.hasBreakpoints()}]},setPaginatorAttribute(){this.$refs.paginator&&this.$refs.paginator.length>=0&&[...this.$refs.paginator].forEach((e=>{e.setAttribute(this.attributeSelector,"")}))},getAriaLabel(e){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria[e]:void 0}},computed:{templateItems(){let e={};if(this.hasBreakpoints()){e=this.template,e.default||(e.default="FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown");for(const t in e)e[t]=this.template[t].split(" ").map((e=>e.trim()));return e}return e.default=this.template.split(" ").map((e=>e.trim())),e},page(){return Math.floor(this.d_first/this.d_rows)},pageCount(){return Math.ceil(this.totalRecords/this.d_rows)},isFirstPage(){return 0===this.page},isLastPage(){return this.page===this.pageCount-1},calculatePageLinkBoundaries(){const e=this.pageCount,t=Math.min(this.pageLinkSize,e);let a=Math.max(0,Math.ceil(this.page-t/2)),n=Math.min(e-1,a+t-1);const r=this.pageLinkSize-(n-a+1);return a=Math.max(0,a-r),[a,n]},pageLinks(){let e=[],t=this.calculatePageLinkBoundaries,a=t[0],n=t[1];for(var r=a;r<=n;r++)e.push(r+1);return e},currentState(){return{page:this.page,first:this.d_first,rows:this.d_rows}},empty(){return 0===this.pageCount},currentPage(){return this.pageCount>0?this.page+1:0},attributeSelector:()=>e.UniqueComponentId()},components:{CurrentPageReport:p,FirstPageLink:g,LastPageLink:h,NextPageLink:k,PageLinks:b,PrevPageLink:L,RowsPerPageDropdown:y,JumpToPageDropdown:d,JumpToPageInput:m}};const $={key:0},N={key:0,class:"p-paginator-left-content"},D={key:1,class:"p-paginator-right-content"};return function(e,t){void 0===t&&(t={});var a=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===a&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}("\n.p-paginator-default {\n display: flex;\n}\n.p-paginator {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-wrap: wrap;\n}\n.p-paginator-left-content {\n margin-right: auto;\n}\n.p-paginator-right-content {\n margin-left: auto;\n}\n.p-paginator-page,\n.p-paginator-next,\n.p-paginator-last,\n.p-paginator-first,\n.p-paginator-prev,\n.p-paginator-current {\n cursor: pointer;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n line-height: 1;\n user-select: none;\n overflow: hidden;\n position: relative;\n}\n.p-paginator-element:focus {\n z-index: 1;\n position: relative;\n}\n"),B.render=function(e,a,n,r,o,i){const s=t.resolveComponent("FirstPageLink"),l=t.resolveComponent("PrevPageLink"),p=t.resolveComponent("NextPageLink"),c=t.resolveComponent("LastPageLink"),g=t.resolveComponent("PageLinks"),u=t.resolveComponent("CurrentPageReport"),d=t.resolveComponent("RowsPerPageDropdown"),m=t.resolveComponent("JumpToPageDropdown"),h=t.resolveComponent("JumpToPageInput");return n.alwaysShow||i.pageLinks&&i.pageLinks.length>1?(t.openBlock(),t.createElementBlock("nav",$,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.templateItems,((r,P)=>(t.openBlock(),t.createElementBlock("div",{key:P,ref_for:!0,ref:"paginator",class:t.normalizeClass(["p-paginator p-component",i.getPaginatorClasses(P)])},[e.$slots.start?(t.openBlock(),t.createElementBlock("div",N,[t.renderSlot(e.$slots,"start",{state:i.currentState})])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r,(e=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:e},["FirstPageLink"===e?(t.openBlock(),t.createBlock(s,{key:0,"aria-label":i.getAriaLabel("firstPageLabel"),onClick:a[0]||(a[0]=e=>i.changePageToFirst(e)),disabled:i.isFirstPage||i.empty},null,8,["aria-label","disabled"])):"PrevPageLink"===e?(t.openBlock(),t.createBlock(l,{key:1,"aria-label":i.getAriaLabel("prevPageLabel"),onClick:a[1]||(a[1]=e=>i.changePageToPrev(e)),disabled:i.isFirstPage||i.empty},null,8,["aria-label","disabled"])):"NextPageLink"===e?(t.openBlock(),t.createBlock(p,{key:2,"aria-label":i.getAriaLabel("nextPageLabel"),onClick:a[2]||(a[2]=e=>i.changePageToNext(e)),disabled:i.isLastPage||i.empty},null,8,["aria-label","disabled"])):"LastPageLink"===e?(t.openBlock(),t.createBlock(c,{key:3,"aria-label":i.getAriaLabel("lastPageLabel"),onClick:a[3]||(a[3]=e=>i.changePageToLast(e)),disabled:i.isLastPage||i.empty},null,8,["aria-label","disabled"])):"PageLinks"===e?(t.openBlock(),t.createBlock(g,{key:4,"aria-label":i.getAriaLabel("pageLabel"),value:i.pageLinks,page:i.page,onClick:a[4]||(a[4]=e=>i.changePageLink(e))},null,8,["aria-label","value","page"])):"CurrentPageReport"===e?(t.openBlock(),t.createBlock(u,{key:5,"aria-live":"polite",template:n.currentPageReportTemplate,currentPage:i.currentPage,page:i.page,pageCount:i.pageCount,first:o.d_first,rows:o.d_rows,totalRecords:n.totalRecords},null,8,["template","currentPage","page","pageCount","first","rows","totalRecords"])):"RowsPerPageDropdown"===e&&n.rowsPerPageOptions?(t.openBlock(),t.createBlock(d,{key:6,"aria-label":i.getAriaLabel("rowsPerPageLabel"),rows:o.d_rows,options:n.rowsPerPageOptions,onRowsChange:a[5]||(a[5]=e=>i.onRowChange(e)),disabled:i.empty},null,8,["aria-label","rows","options","disabled"])):"JumpToPageDropdown"===e?(t.openBlock(),t.createBlock(m,{key:7,"aria-label":i.getAriaLabel("jumpToPageDropdownLabel"),page:i.page,pageCount:i.pageCount,onPageChange:a[6]||(a[6]=e=>i.changePage(e)),disabled:i.empty},null,8,["aria-label","page","pageCount","disabled"])):"JumpToPageInput"===e&&i.currentPage?(t.openBlock(),t.createBlock(h,{key:8,page:i.currentPage,onPageChange:a[7]||(a[7]=e=>i.changePage(e)),disabled:i.empty},null,8,["page","disabled"])):t.createCommentVNode("",!0)],64)))),128)),e.$slots.end?(t.openBlock(),t.createElementBlock("div",D,[t.renderSlot(e.$slots,"end",{state:i.currentState})])):t.createCommentVNode("",!0)],2)))),128))])):t.createCommentVNode("",!0)},B}(primevue.utils,Vue,primevue.ripple,primevue.dropdown,primevue.inputnumber);
1
+ this.primevue=this.primevue||{},this.primevue.paginator=function(e,t,a,n,r){"use strict";function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=o(a),s=o(n),l=o(r),p={name:"CurrentPageReport",props:{pageCount:{type:Number,default:0},currentPage:{type:Number,default:0},page:{type:Number,default:0},first:{type:Number,default:0},rows:{type:Number,default:0},totalRecords:{type:Number,default:0},template:{type:String,default:"({currentPage} of {totalPages})"}},computed:{text(){return this.template.replace("{currentPage}",this.currentPage).replace("{totalPages}",this.pageCount).replace("{first}",this.pageCount>0?this.first+1:0).replace("{last}",Math.min(this.first+this.rows,this.totalRecords)).replace("{rows}",this.rows).replace("{totalRecords}",this.totalRecords)}}};const g={class:"p-paginator-current"};p.render=function(e,a,n,r,o,i){return t.openBlock(),t.createElementBlock("span",g,t.toDisplayString(i.text),1)};var c={name:"FirstPageLink",computed:{containerClass(){return["p-paginator-first p-paginator-element p-link",{"p-disabled":this.$attrs.disabled}]}},directives:{ripple:i.default}};const u=[t.createElementVNode("span",{class:"p-paginator-icon pi pi-angle-double-left"},null,-1)];c.render=function(e,a,n,r,o,i){const s=t.resolveDirective("ripple");return t.withDirectives((t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass(i.containerClass),type:"button"},u,2)),[[s]])};var d={name:"JumpToPageDropdown",emits:["page-change"],props:{page:Number,pageCount:Number,disabled:Boolean},methods:{onChange(e){this.$emit("page-change",e)}},computed:{pageOptions(){let e=[];for(let t=0;t<this.pageCount;t++)e.push({label:String(t+1),value:t});return e}},components:{JTPDropdown:s.default}};d.render=function(e,a,n,r,o,i){const s=t.resolveComponent("JTPDropdown");return t.openBlock(),t.createBlock(s,{modelValue:n.page,options:i.pageOptions,optionLabel:"label",optionValue:"value","onUpdate:modelValue":a[0]||(a[0]=e=>i.onChange(e)),class:"p-paginator-page-options",disabled:n.disabled},null,8,["modelValue","options","disabled"])};var m={name:"JumpToPageInput",inheritAttrs:!1,emits:["page-change"],props:{page:Number,pageCount:Number,disabled:Boolean},data(){return{d_page:this.page}},watch:{page(e){this.d_page=e}},methods:{onChange(e){e!==this.page&&(this.d_page=e,this.$emit("page-change",e-1))}},computed:{inputArialabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.jumpToPageInputLabel:void 0}},components:{JTPInput:l.default}};m.render=function(e,a,n,r,o,i){const s=t.resolveComponent("JTPInput");return t.openBlock(),t.createBlock(s,{ref:"jtpInput",modelValue:o.d_page,class:"p-paginator-page-input","aria-label":i.inputArialabel,disabled:n.disabled,"onUpdate:modelValue":i.onChange},null,8,["modelValue","aria-label","disabled","onUpdate:modelValue"])};var h={name:"LastPageLink",computed:{containerClass(){return["p-paginator-last p-paginator-element p-link",{"p-disabled":this.$attrs.disabled}]}},directives:{ripple:i.default}};const P=[t.createElementVNode("span",{class:"p-paginator-icon pi pi-angle-double-right"},null,-1)];h.render=function(e,a,n,r,o,i){const s=t.resolveDirective("ripple");return t.withDirectives((t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass(i.containerClass),type:"button"},P,2)),[[s]])};var k={name:"NextPageLink",computed:{containerClass(){return["p-paginator-next p-paginator-element p-link",{"p-disabled":this.$attrs.disabled}]}},directives:{ripple:i.default}};const f=[t.createElementVNode("span",{class:"p-paginator-icon pi pi-angle-right"},null,-1)];k.render=function(e,a,n,r,o,i){const s=t.resolveDirective("ripple");return t.withDirectives((t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass(i.containerClass),type:"button"},f,2)),[[s]])};var b={name:"PageLinks",inheritAttrs:!1,emits:["click"],props:{value:Array,page:Number},methods:{onPageLinkClick(e,t){this.$emit("click",{originalEvent:e,value:t})},ariaPageLabel(e){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.pageLabel.replace(/{page}/g,e):void 0}},computed:{},directives:{ripple:i.default}};const v={class:"p-paginator-pages"},C=["aria-label","aria-current","onClick"];b.render=function(e,a,n,r,o,i){const s=t.resolveDirective("ripple");return t.openBlock(),t.createElementBlock("span",v,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.value,(e=>t.withDirectives((t.openBlock(),t.createElementBlock("button",{key:e,class:t.normalizeClass(["p-paginator-page p-paginator-element p-link",{"p-highlight":e-1===n.page}]),type:"button","aria-label":i.ariaPageLabel(e),"aria-current":e-1===n.page?"page":void 0,onClick:t=>i.onPageLinkClick(t,e)},[t.createTextVNode(t.toDisplayString(e),1)],10,C)),[[s]]))),128))])};var L={name:"PrevPageLink",computed:{containerClass(){return["p-paginator-prev p-paginator-element p-link",{"p-disabled":this.$attrs.disabled}]}},directives:{ripple:i.default}};const w=[t.createElementVNode("span",{class:"p-paginator-icon pi pi-angle-left"},null,-1)];L.render=function(e,a,n,r,o,i){const s=t.resolveDirective("ripple");return t.withDirectives((t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass(i.containerClass),type:"button"},w,2)),[[s]])};var y={name:"RowsPerPageDropdown",emits:["rows-change"],props:{options:Array,rows:Number,disabled:Boolean},methods:{onChange(e){this.$emit("rows-change",e)}},computed:{rowsOptions(){let e=[];if(this.options)for(let t=0;t<this.options.length;t++)e.push({label:String(this.options[t]),value:this.options[t]});return e}},components:{RPPDropdown:s.default}};y.render=function(e,a,n,r,o,i){const s=t.resolveComponent("RPPDropdown");return t.openBlock(),t.createBlock(s,{modelValue:n.rows,options:i.rowsOptions,optionLabel:"label",optionValue:"value","onUpdate:modelValue":a[0]||(a[0]=e=>i.onChange(e)),class:"p-paginator-rpp-options",disabled:n.disabled},null,8,["modelValue","options","disabled"])};var B={name:"Paginator",emits:["update:first","update:rows","page"],props:{totalRecords:{type:Number,default:0},rows:{type:Number,default:0},first:{type:Number,default:0},pageLinkSize:{type:Number,default:5},rowsPerPageOptions:{type:Array,default:null},template:{type:[Object,String],default:"FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown"},currentPageReportTemplate:{type:null,default:"({currentPage} of {totalPages})"},alwaysShow:{type:Boolean,default:!0}},data(){return{d_first:this.first,d_rows:this.rows}},watch:{first(e){this.d_first=e},rows(e){this.d_rows=e},totalRecords(e){this.page>0&&e&&this.d_first>=e&&this.changePage(this.pageCount-1)}},mounted(){this.setPaginatorAttribute(),this.createStyle()},methods:{changePage(e){const t=this.pageCount;if(e>=0&&e<t){this.d_first=this.d_rows*e;const a={page:e,first:this.d_first,rows:this.d_rows,pageCount:t};this.$emit("update:first",this.d_first),this.$emit("update:rows",this.d_rows),this.$emit("page",a)}},changePageToFirst(e){this.isFirstPage||this.changePage(0),e.preventDefault()},changePageToPrev(e){this.changePage(this.page-1),e.preventDefault()},changePageLink(e){this.changePage(e.value-1),e.originalEvent.preventDefault()},changePageToNext(e){this.changePage(this.page+1),e.preventDefault()},changePageToLast(e){this.isLastPage||this.changePage(this.pageCount-1),e.preventDefault()},onRowChange(e){this.d_rows=e,this.changePage(this.page)},createStyle(){if(this.hasBreakpoints()){this.styleElement=document.createElement("style"),this.styleElement.type="text/css",document.head.appendChild(this.styleElement);let e="";const t=Object.keys(this.template),a={};t.sort(((e,t)=>parseInt(e)-parseInt(t))).forEach((e=>{a[e]=this.template[e]}));for(const[t,[n]]of Object.entries(Object.entries(a))){const r=Object.entries(a)[t-1]?`and (min-width:${Object.keys(a)[t-1]})`:"";e+="default"===n?`\n @media screen ${r} {\n .paginator[${this.attributeSelector}],\n .p-paginator-default{\n display: flex !important;\n }\n }\n `:`\n .paginator[${this.attributeSelector}], .p-paginator-${n} {\n display: none !important;\n }\n @media screen ${r} and (max-width: ${n}) {\n .paginator[${this.attributeSelector}], .p-paginator-${n} {\n display: flex !important;\n }\n .paginator[${this.attributeSelector}],\n .p-paginator-default{\n display: none !important;\n }\n }\n `}this.styleElement.innerHTML=e}},hasBreakpoints(){return"object"==typeof this.template},getPaginatorClasses(e){return[{"p-paginator-default":!this.hasBreakpoints(),[`p-paginator-${e}`]:this.hasBreakpoints()}]},setPaginatorAttribute(){this.$refs.paginator&&this.$refs.paginator.length>=0&&[...this.$refs.paginator].forEach((e=>{e.setAttribute(this.attributeSelector,"")}))},getAriaLabel(e){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria[e]:void 0}},computed:{templateItems(){let e={};if(this.hasBreakpoints()){e=this.template,e.default||(e.default="FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown");for(const t in e)e[t]=this.template[t].split(" ").map((e=>e.trim()));return e}return e.default=this.template.split(" ").map((e=>e.trim())),e},page(){return Math.floor(this.d_first/this.d_rows)},pageCount(){return Math.ceil(this.totalRecords/this.d_rows)},isFirstPage(){return 0===this.page},isLastPage(){return this.page===this.pageCount-1},calculatePageLinkBoundaries(){const e=this.pageCount,t=Math.min(this.pageLinkSize,e);let a=Math.max(0,Math.ceil(this.page-t/2)),n=Math.min(e-1,a+t-1);const r=this.pageLinkSize-(n-a+1);return a=Math.max(0,a-r),[a,n]},pageLinks(){let e=[],t=this.calculatePageLinkBoundaries,a=t[0],n=t[1];for(var r=a;r<=n;r++)e.push(r+1);return e},currentState(){return{page:this.page,first:this.d_first,rows:this.d_rows}},empty(){return 0===this.pageCount},currentPage(){return this.pageCount>0?this.page+1:0},attributeSelector:()=>e.UniqueComponentId()},components:{CurrentPageReport:p,FirstPageLink:c,LastPageLink:h,NextPageLink:k,PageLinks:b,PrevPageLink:L,RowsPerPageDropdown:y,JumpToPageDropdown:d,JumpToPageInput:m}};const N={key:0},$={key:0,class:"p-paginator-left-content"},D={key:1,class:"p-paginator-right-content"};return function(e,t){void 0===t&&(t={});var a=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===a&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}("\n.p-paginator-default {\n display: flex;\n}\n.p-paginator {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-wrap: wrap;\n}\n.p-paginator-left-content {\n margin-right: auto;\n}\n.p-paginator-right-content {\n margin-left: auto;\n}\n.p-paginator-page,\n.p-paginator-next,\n.p-paginator-last,\n.p-paginator-first,\n.p-paginator-prev,\n.p-paginator-current {\n cursor: pointer;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n line-height: 1;\n user-select: none;\n overflow: hidden;\n position: relative;\n}\n.p-paginator-element:focus {\n z-index: 1;\n position: relative;\n}\n"),B.render=function(e,a,n,r,o,i){const s=t.resolveComponent("FirstPageLink"),l=t.resolveComponent("PrevPageLink"),p=t.resolveComponent("NextPageLink"),g=t.resolveComponent("LastPageLink"),c=t.resolveComponent("PageLinks"),u=t.resolveComponent("CurrentPageReport"),d=t.resolveComponent("RowsPerPageDropdown"),m=t.resolveComponent("JumpToPageDropdown"),h=t.resolveComponent("JumpToPageInput");return n.alwaysShow||i.pageLinks&&i.pageLinks.length>1?(t.openBlock(),t.createElementBlock("nav",N,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.templateItems,((r,P)=>(t.openBlock(),t.createElementBlock("div",{key:P,ref_for:!0,ref:"paginator",class:t.normalizeClass(["p-paginator p-component",i.getPaginatorClasses(P)])},[e.$slots.start?(t.openBlock(),t.createElementBlock("div",$,[t.renderSlot(e.$slots,"start",{state:i.currentState})])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r,(e=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:e},["FirstPageLink"===e?(t.openBlock(),t.createBlock(s,{key:0,"aria-label":i.getAriaLabel("firstPageLabel"),onClick:a[0]||(a[0]=e=>i.changePageToFirst(e)),disabled:i.isFirstPage||i.empty},null,8,["aria-label","disabled"])):"PrevPageLink"===e?(t.openBlock(),t.createBlock(l,{key:1,"aria-label":i.getAriaLabel("prevPageLabel"),onClick:a[1]||(a[1]=e=>i.changePageToPrev(e)),disabled:i.isFirstPage||i.empty},null,8,["aria-label","disabled"])):"NextPageLink"===e?(t.openBlock(),t.createBlock(p,{key:2,"aria-label":i.getAriaLabel("nextPageLabel"),onClick:a[2]||(a[2]=e=>i.changePageToNext(e)),disabled:i.isLastPage||i.empty},null,8,["aria-label","disabled"])):"LastPageLink"===e?(t.openBlock(),t.createBlock(g,{key:3,"aria-label":i.getAriaLabel("lastPageLabel"),onClick:a[3]||(a[3]=e=>i.changePageToLast(e)),disabled:i.isLastPage||i.empty},null,8,["aria-label","disabled"])):"PageLinks"===e?(t.openBlock(),t.createBlock(c,{key:4,"aria-label":i.getAriaLabel("pageLabel"),value:i.pageLinks,page:i.page,onClick:a[4]||(a[4]=e=>i.changePageLink(e))},null,8,["aria-label","value","page"])):"CurrentPageReport"===e?(t.openBlock(),t.createBlock(u,{key:5,"aria-live":"polite",template:n.currentPageReportTemplate,currentPage:i.currentPage,page:i.page,pageCount:i.pageCount,first:o.d_first,rows:o.d_rows,totalRecords:n.totalRecords},null,8,["template","currentPage","page","pageCount","first","rows","totalRecords"])):"RowsPerPageDropdown"===e&&n.rowsPerPageOptions?(t.openBlock(),t.createBlock(d,{key:6,"aria-label":i.getAriaLabel("rowsPerPageLabel"),rows:o.d_rows,options:n.rowsPerPageOptions,onRowsChange:a[5]||(a[5]=e=>i.onRowChange(e)),disabled:i.empty},null,8,["aria-label","rows","options","disabled"])):"JumpToPageDropdown"===e?(t.openBlock(),t.createBlock(m,{key:7,"aria-label":i.getAriaLabel("jumpToPageDropdownLabel"),page:i.page,pageCount:i.pageCount,onPageChange:a[6]||(a[6]=e=>i.changePage(e)),disabled:i.empty},null,8,["aria-label","page","pageCount","disabled"])):"JumpToPageInput"===e?(t.openBlock(),t.createBlock(h,{key:8,page:i.currentPage,onPageChange:a[7]||(a[7]=e=>i.changePage(e)),disabled:i.empty},null,8,["page","disabled"])):t.createCommentVNode("",!0)],64)))),128)),e.$slots.end?(t.openBlock(),t.createElementBlock("div",D,[t.renderSlot(e.$slots,"end",{state:i.currentState})])):t.createCommentVNode("",!0)],2)))),128))])):t.createCommentVNode("",!0)},B}(primevue.utils,Vue,primevue.ripple,primevue.dropdown,primevue.inputnumber);
package/rating/Rating.vue CHANGED
@@ -143,6 +143,7 @@ export default {
143
143
 
144
144
  <style>
145
145
  .p-rating {
146
+ position: relative;
146
147
  display: flex;
147
148
  align-items: center;
148
149
  }