primevue 3.30.1 → 3.30.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.
- package/basecomponent/BaseComponent.vue +1 -1
- package/basecomponent/basecomponent.cjs.js +1 -1
- package/basecomponent/basecomponent.cjs.min.js +1 -1
- package/basecomponent/basecomponent.esm.js +1 -1
- package/basecomponent/basecomponent.esm.min.js +1 -1
- package/basecomponent/basecomponent.js +1 -1
- package/basecomponent/basecomponent.min.js +1 -1
- package/basedirective/basedirective.cjs.js +1 -1
- package/basedirective/basedirective.cjs.min.js +1 -1
- package/basedirective/basedirective.esm.js +1 -1
- package/basedirective/basedirective.esm.min.js +1 -1
- package/basedirective/basedirective.js +1 -1
- package/basedirective/basedirective.min.js +1 -1
- package/column/Column.d.ts +48 -0
- package/columngroup/ColumnGroup.d.ts +5 -0
- package/core/core.js +19 -13
- package/core/core.min.js +5 -5
- package/datatable/BaseDataTable.vue +7 -1
- package/datatable/BodyCell.vue +5 -3
- package/datatable/ColumnFilter.vue +43 -8
- package/datatable/DataTable.d.ts +30 -0
- package/datatable/FooterCell.vue +3 -1
- package/datatable/HeaderCell.vue +6 -2
- package/datatable/HeaderCheckbox.vue +5 -2
- package/datatable/RowCheckbox.vue +5 -2
- package/datatable/RowRadioButton.vue +5 -2
- package/datatable/TableBody.vue +33 -13
- package/datatable/TableFooter.vue +10 -2
- package/datatable/TableHeader.vue +12 -2
- package/datatable/datatable.cjs.js +149 -43
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.esm.js +149 -43
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +150 -44
- package/datatable/datatable.min.js +1 -1
- package/dialog/Dialog.vue +13 -1
- package/dialog/dialog.cjs.js +6 -2
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.esm.js +6 -2
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +6 -2
- package/dialog/dialog.min.js +1 -1
- package/dock/Dock.d.ts +4 -0
- package/dock/DockSub.vue +9 -8
- package/dock/dock.cjs.js +9 -8
- package/dock/dock.cjs.min.js +1 -1
- package/dock/dock.esm.js +9 -8
- package/dock/dock.esm.min.js +1 -1
- package/dock/dock.js +9 -8
- package/dock/dock.min.js +1 -1
- package/galleria/Galleria.d.ts +4 -0
- package/galleria/GalleriaContent.vue +16 -6
- package/galleria/GalleriaItem.vue +2 -1
- package/galleria/GalleriaThumbnails.vue +1 -0
- package/galleria/galleria.cjs.js +34 -17
- package/galleria/galleria.cjs.min.js +1 -1
- package/galleria/galleria.esm.js +35 -18
- package/galleria/galleria.esm.min.js +1 -1
- package/galleria/galleria.js +34 -17
- package/galleria/galleria.min.js +1 -1
- package/message/BaseMessage.vue +2 -2
- package/message/Message.d.ts +10 -0
- package/message/Message.vue +3 -3
- package/message/message.cjs.js +8 -8
- package/message/message.cjs.min.js +1 -1
- package/message/message.esm.js +8 -8
- package/message/message.esm.min.js +1 -1
- package/message/message.js +8 -8
- package/message/message.min.js +1 -1
- package/multiselect/MultiSelect.vue +2 -1
- package/multiselect/multiselect.cjs.js +4 -4
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.esm.js +5 -5
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +4 -4
- package/multiselect/multiselect.min.js +1 -1
- package/overlaypanel/OverlayPanel.vue +4 -2
- package/overlaypanel/overlaypanel.cjs.js +4 -2
- package/overlaypanel/overlaypanel.cjs.min.js +1 -1
- package/overlaypanel/overlaypanel.esm.js +4 -2
- package/overlaypanel/overlaypanel.esm.min.js +1 -1
- package/overlaypanel/overlaypanel.js +4 -2
- package/overlaypanel/overlaypanel.min.js +1 -1
- package/package.json +1 -1
- package/scrollpanel/ScrollPanel.vue +2 -0
- package/scrollpanel/scrollpanel.cjs.js +6 -2
- package/scrollpanel/scrollpanel.cjs.min.js +1 -1
- package/scrollpanel/scrollpanel.esm.js +6 -2
- package/scrollpanel/scrollpanel.esm.min.js +1 -1
- package/scrollpanel/scrollpanel.js +6 -2
- package/scrollpanel/scrollpanel.min.js +1 -1
- package/sidebar/Sidebar.vue +1 -1
- package/sidebar/sidebar.cjs.js +3 -1
- package/sidebar/sidebar.cjs.min.js +1 -1
- package/sidebar/sidebar.esm.js +3 -1
- package/sidebar/sidebar.esm.min.js +1 -1
- package/sidebar/sidebar.js +3 -1
- package/sidebar/sidebar.min.js +1 -1
- package/splitbutton/SplitButton.vue +2 -1
- package/splitbutton/splitbutton.cjs.js +4 -2
- package/splitbutton/splitbutton.cjs.min.js +1 -1
- package/splitbutton/splitbutton.esm.js +4 -2
- package/splitbutton/splitbutton.esm.min.js +1 -1
- package/splitbutton/splitbutton.js +4 -2
- package/splitbutton/splitbutton.min.js +1 -1
- package/tabmenu/TabMenu.vue +71 -72
- package/tabmenu/tabmenu.cjs.js +67 -75
- package/tabmenu/tabmenu.cjs.min.js +1 -1
- package/tabmenu/tabmenu.esm.js +67 -75
- package/tabmenu/tabmenu.esm.min.js +1 -1
- package/tabmenu/tabmenu.js +67 -75
- package/tabmenu/tabmenu.min.js +1 -1
- package/tabview/TabView.vue +2 -0
- package/tabview/tabview.cjs.js +6 -2
- package/tabview/tabview.cjs.min.js +1 -1
- package/tabview/tabview.esm.js +6 -2
- package/tabview/tabview.esm.min.js +1 -1
- package/tabview/tabview.js +6 -2
- package/tabview/tabview.min.js +1 -1
- package/toast/BaseToast.vue +2 -2
- package/toast/Toast.d.ts +10 -0
- package/toast/ToastMessage.vue +3 -2
- package/toast/toast.cjs.js +7 -6
- package/toast/toast.cjs.min.js +1 -1
- package/toast/toast.esm.js +7 -6
- package/toast/toast.esm.min.js +1 -1
- package/toast/toast.js +7 -6
- package/toast/toast.min.js +1 -1
- package/tree/Tree.d.ts +9 -0
- package/tree/TreeNode.vue +3 -1
- package/tree/tree.cjs.js +3 -1
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.esm.js +3 -1
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +3 -1
- package/tree/tree.min.js +1 -1
- package/treetable/BaseTreeTable.vue +7 -1
- package/treetable/BodyCell.vue +14 -4
- package/treetable/FooterCell.vue +3 -1
- package/treetable/HeaderCell.vue +9 -2
- package/treetable/TreeTable.d.ts +30 -8
- package/treetable/TreeTable.vue +9 -2
- package/treetable/TreeTableRow.vue +10 -1
- package/treetable/treetable.cjs.js +58 -13
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.esm.js +59 -14
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +58 -13
- package/treetable/treetable.min.js +1 -1
- package/vetur-attributes.json +8 -0
- package/vetur-tags.json +2 -0
- package/web-types.json +21 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("primevue/utils"),t=require("primevue/basecomponent"),n=require("primevue/usestyle"),o=require("vue");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=r(t),i=n.useStyle("\n.p-scrollpanel-wrapper {\n overflow: hidden;\n width: 100%;\n height: 100%;\n position: relative;\n z-index: 1;\n float: left;\n}\n\n.p-scrollpanel-content {\n height: calc(100% + 18px);\n width: calc(100% + 18px);\n padding: 0 18px 18px 0;\n position: relative;\n overflow: scroll;\n box-sizing: border-box;\n scrollbar-width: none;\n}\n\n.p-scrollpanel-content::-webkit-scrollbar {\n display: none;\n}\n\n.p-scrollpanel-bar {\n position: relative;\n background: #c1c1c1;\n border-radius: 3px;\n z-index: 2;\n cursor: pointer;\n opacity: 0;\n transition: opacity 0.25s linear;\n}\n\n.p-scrollpanel-bar-y {\n width: 9px;\n top: 0;\n}\n\n.p-scrollpanel-bar-x {\n height: 9px;\n bottom: 0;\n}\n\n.p-scrollpanel-hidden {\n visibility: hidden;\n}\n\n.p-scrollpanel:hover .p-scrollpanel-bar,\n.p-scrollpanel:active .p-scrollpanel-bar {\n opacity: 1;\n}\n\n.p-scrollpanel-grabbed {\n user-select: none;\n}\n",{name:"scrollpanel",manual:!0}),l={name:"ScrollPanel",extends:{name:"BaseScrollPanel",extends:s.default,props:{step:{type:Number,default:5}},css:{classes:{root:"p-scrollpanel p-component",wrapper:"p-scrollpanel-wrapper",content:"p-scrollpanel-content",barx:"p-scrollpanel-bar p-scrollpanel-bar-x",bary:"p-scrollpanel-bar p-scrollpanel-bar-y"},loadStyle:i.load},provide:function(){return{$parentInstance:this}}},initialized:!1,documentResizeListener:null,documentMouseMoveListener:null,documentMouseUpListener:null,frame:null,scrollXRatio:null,scrollYRatio:null,isXBarClicked:!1,isYBarClicked:!1,lastPageX:null,lastPageY:null,timer:null,outsideClickListener:null,data:function(){return{id:e.UniqueComponentId(),orientation:"vertical",lastScrollTop:0,lastScrollLeft:0}},mounted:function(){this.$el.offsetParent&&this.initialize()},updated:function(){!this.initialized&&this.$el.offsetParent&&this.initialize()},beforeUnmount:function(){this.unbindDocumentResizeListener(),this.frame&&window.cancelAnimationFrame(this.frame)},methods:{initialize:function(){this.moveBar(),this.bindDocumentResizeListener(),this.calculateContainerHeight()},calculateContainerHeight:function(){var t=getComputedStyle(this.$el),n=getComputedStyle(this.$refs.xBar),o=e.DomHandler.getHeight(this.$el)-parseInt(n.height,10);"none"!==t["max-height"]&&0===o&&(this.$el.style.height=this.$refs.content.offsetHeight+parseInt(n.height,10)>parseInt(t["max-height"],10)?t["max-height"]:this.$refs.content.offsetHeight+parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)+parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth)+"px")},moveBar:function(){var t=this,n=this.$refs.content.scrollWidth,o=-1*(this.$el.clientHeight-this.$refs.xBar.clientHeight);this.scrollXRatio=this.$refs.content.clientWidth/n;var r=this.$refs.content.scrollHeight,s=-1*(this.$el.clientWidth-this.$refs.yBar.clientWidth);this.scrollYRatio=this.$refs.content.clientHeight/r,this.frame=this.requestAnimationFrame((function(){t.scrollXRatio>=1?(t.$refs.xBar.setAttribute("data-p-scrollpanel-hidden","true"),!t.isUnstyled&&e.DomHandler.addClass(t.$refs.xBar,"p-scrollpanel-hidden")):(t.$refs.xBar.setAttribute("data-p-scrollpanel-hidden","false"),!t.isUnstyled&&e.DomHandler.removeClass(t.$refs.xBar,"p-scrollpanel-hidden"),t.$refs.xBar.style.cssText="width:"+Math.max(100*t.scrollXRatio,10)+"%; left:"+t.$refs.content.scrollLeft/n*100+"%;bottom:"+o+"px;"),t.scrollYRatio>=1?(t.$refs.yBar.setAttribute("data-p-scrollpanel-hidden","true"),!t.isUnstyled&&e.DomHandler.addClass(t.$refs.yBar,"p-scrollpanel-hidden")):(t.$refs.yBar.setAttribute("data-p-scrollpanel-hidden","false"),!t.isUnstyled&&e.DomHandler.removeClass(t.$refs.yBar,"p-scrollpanel-hidden"),t.$refs.yBar.style.cssText="height:"+Math.max(100*t.scrollYRatio,10)+"%; top: calc("+t.$refs.content.scrollTop/r*100+"% - "+t.$refs.xBar.clientHeight+"px);right:"+s+"px;")}))},onYBarMouseDown:function(t){this.isYBarClicked=!0,this.$refs.yBar.focus(),this.lastPageY=t.pageY,this.$refs.yBar.setAttribute("data-p-scrollpanel-grabbed","true"),!this.isUnstyled&&e.DomHandler.addClass(this.$refs.yBar,"p-scrollpanel-grabbed"),document.body.setAttribute("data-p-scrollpanel-grabbed","true"),!this.isUnstyled&&e.DomHandler.addClass(document.body,"p-scrollpanel-grabbed"),this.bindDocumentMouseListeners(),t.preventDefault()},onXBarMouseDown:function(t){this.isXBarClicked=!0,this.$refs.xBar.focus(),this.lastPageX=t.pageX,this.$refs.yBar.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&e.DomHandler.addClass(this.$refs.xBar,"p-scrollpanel-grabbed"),document.body.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&e.DomHandler.addClass(document.body,"p-scrollpanel-grabbed"),this.bindDocumentMouseListeners(),t.preventDefault()},onScroll:function(e){this.lastScrollLeft!==e.target.scrollLeft?(this.lastScrollLeft=e.target.scrollLeft,this.orientation="horizontal"):this.lastScrollTop!==e.target.scrollTop&&(this.lastScrollTop=e.target.scrollTop,this.orientation="vertical"),this.moveBar()},onKeyDown:function(e){if("vertical"===this.orientation)switch(e.code){case"ArrowDown":this.setTimer("scrollTop",this.step),e.preventDefault();break;case"ArrowUp":this.setTimer("scrollTop",-1*this.step),e.preventDefault();break;case"ArrowLeft":case"ArrowRight":e.preventDefault()}else if("horizontal"===this.orientation)switch(e.code){case"ArrowRight":this.setTimer("scrollLeft",this.step),e.preventDefault();break;case"ArrowLeft":this.setTimer("scrollLeft",-1*this.step),e.preventDefault();break;case"ArrowDown":case"ArrowUp":e.preventDefault()}},onKeyUp:function(){this.clearTimer()},repeat:function(e,t){this.$refs.content[e]+=t,this.moveBar()},setTimer:function(e,t){var n=this;this.clearTimer(),this.timer=setTimeout((function(){n.repeat(e,t)}),40)},clearTimer:function(){this.timer&&clearTimeout(this.timer)},onDocumentMouseMove:function(e){this.isXBarClicked?this.onMouseMoveForXBar(e):(this.isYBarClicked||this.onMouseMoveForXBar(e),this.onMouseMoveForYBar(e))},onMouseMoveForXBar:function(e){var t=this,n=e.pageX-this.lastPageX;this.lastPageX=e.pageX,this.frame=this.requestAnimationFrame((function(){t.$refs.content.scrollLeft+=n/t.scrollXRatio}))},onMouseMoveForYBar:function(e){var t=this,n=e.pageY-this.lastPageY;this.lastPageY=e.pageY,this.frame=this.requestAnimationFrame((function(){t.$refs.content.scrollTop+=n/t.scrollYRatio}))},onFocus:function(e){this.$refs.xBar.isSameNode(e.target)?this.orientation="horizontal":this.$refs.yBar.isSameNode(e.target)&&(this.orientation="vertical")},onBlur:function(){"horizontal"===this.orientation&&(this.orientation="vertical")},onDocumentMouseUp:function(){this.$refs.yBar.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&e.DomHandler.removeClass(this.$refs.yBar,"p-scrollpanel-grabbed"),this.$refs.xBar.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&e.DomHandler.removeClass(this.$refs.xBar,"p-scrollpanel-grabbed"),document.body.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&e.DomHandler.removeClass(document.body,"p-scrollpanel-grabbed"),this.unbindDocumentMouseListeners(),this.isXBarClicked=!1,this.isYBarClicked=!1},requestAnimationFrame:function(e){return(window.requestAnimationFrame||this.timeoutFrame)(e)},refresh:function(){this.moveBar()},scrollTop:function(e){var t=this.$refs.content.scrollHeight-this.$refs.content.clientHeight;this.$refs.content.scrollTop=e=e>t?t:e>0?e:0},timeoutFrame:function(e){setTimeout(e,0)},bindDocumentMouseListeners:function(){var e=this;this.documentMouseMoveListener||(this.documentMouseMoveListener=function(t){e.onDocumentMouseMove(t)},document.addEventListener("mousemove",this.documentMouseMoveListener)),this.documentMouseUpListener||(this.documentMouseUpListener=function(t){e.onDocumentMouseUp(t)},document.addEventListener("mouseup",this.documentMouseUpListener))},unbindDocumentMouseListeners:function(){this.documentMouseMoveListener&&(document.removeEventListener("mousemove",this.documentMouseMoveListener),this.documentMouseMoveListener=null),this.documentMouseUpListener&&(document.removeEventListener("mouseup",this.documentMouseUpListener),this.documentMouseUpListener=null)},bindDocumentResizeListener:function(){var e=this;this.documentResizeListener||(this.documentResizeListener=function(){e.moveBar()},window.addEventListener("resize",this.documentResizeListener))},unbindDocumentResizeListener:function(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)}}},a=["aria-valuenow"],c=["aria-valuenow"];l.render=function(e,t,n,r,s,i){return o.openBlock(),o.createElementBlock("div",o.mergeProps({class:e.cx("root")},e.ptm("root"),{"data-pc-name":"scrollpanel"}),[o.createElementVNode("div",o.mergeProps({class:e.cx("wrapper")},e.ptm("wrapper")),[o.createElementVNode("div",o.mergeProps({ref:"content",class:e.cx("content"),onScroll:t[0]||(t[0]=function(){return i.onScroll&&i.onScroll.apply(i,arguments)}),onMouseenter:t[1]||(t[1]=function(){return i.moveBar&&i.moveBar.apply(i,arguments)})},e.ptm("content")),[o.renderSlot(e.$slots,"default")],16)],16),o.createElementVNode("div",o.mergeProps({ref:"xBar",class:e.cx("barx"),tabindex:"0",role:"scrollbar","aria-orientation":"horizontal","aria-valuenow":s.lastScrollLeft,onMousedown:t[2]||(t[2]=function(){return i.onXBarMouseDown&&i.onXBarMouseDown.apply(i,arguments)}),onKeydown:t[3]||(t[3]=function(e){return i.onKeyDown(e)}),onKeyup:t[4]||(t[4]=function(){return i.onKeyUp&&i.onKeyUp.apply(i,arguments)}),onFocus:t[5]||(t[5]=function(){return i.onFocus&&i.onFocus.apply(i,arguments)}),onBlur:t[6]||(t[6]=function(){return i.onBlur&&i.onBlur.apply(i,arguments)})},e.ptm("barx")),null,16,a),o.createElementVNode("div",o.mergeProps({ref:"yBar",class:e.cx("bary"),tabindex:"0",role:"scrollbar","aria-orientation":"vertical","aria-valuenow":s.lastScrollTop,onMousedown:t[7]||(t[7]=function(){return i.onYBarMouseDown&&i.onYBarMouseDown.apply(i,arguments)}),onKeydown:t[8]||(t[8]=function(e){return i.onKeyDown(e)}),onKeyup:t[9]||(t[9]=function(){return i.onKeyUp&&i.onKeyUp.apply(i,arguments)}),onFocus:t[10]||(t[10]=function(){return i.onFocus&&i.onFocus.apply(i,arguments)})},e.ptm("bary")),null,16,c)],16)},module.exports=l;
|
|
1
|
+
"use strict";var e=require("primevue/utils"),t=require("primevue/basecomponent"),n=require("primevue/usestyle"),o=require("vue");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=r(t),i=n.useStyle("\n.p-scrollpanel-wrapper {\n overflow: hidden;\n width: 100%;\n height: 100%;\n position: relative;\n z-index: 1;\n float: left;\n}\n\n.p-scrollpanel-content {\n height: calc(100% + 18px);\n width: calc(100% + 18px);\n padding: 0 18px 18px 0;\n position: relative;\n overflow: scroll;\n box-sizing: border-box;\n scrollbar-width: none;\n}\n\n.p-scrollpanel-content::-webkit-scrollbar {\n display: none;\n}\n\n.p-scrollpanel-bar {\n position: relative;\n background: #c1c1c1;\n border-radius: 3px;\n z-index: 2;\n cursor: pointer;\n opacity: 0;\n transition: opacity 0.25s linear;\n}\n\n.p-scrollpanel-bar-y {\n width: 9px;\n top: 0;\n}\n\n.p-scrollpanel-bar-x {\n height: 9px;\n bottom: 0;\n}\n\n.p-scrollpanel-hidden {\n visibility: hidden;\n}\n\n.p-scrollpanel:hover .p-scrollpanel-bar,\n.p-scrollpanel:active .p-scrollpanel-bar {\n opacity: 1;\n}\n\n.p-scrollpanel-grabbed {\n user-select: none;\n}\n",{name:"scrollpanel",manual:!0}),a={name:"ScrollPanel",extends:{name:"BaseScrollPanel",extends:s.default,props:{step:{type:Number,default:5}},css:{classes:{root:"p-scrollpanel p-component",wrapper:"p-scrollpanel-wrapper",content:"p-scrollpanel-content",barx:"p-scrollpanel-bar p-scrollpanel-bar-x",bary:"p-scrollpanel-bar p-scrollpanel-bar-y"},loadStyle:i.load},provide:function(){return{$parentInstance:this}}},initialized:!1,documentResizeListener:null,documentMouseMoveListener:null,documentMouseUpListener:null,frame:null,scrollXRatio:null,scrollYRatio:null,isXBarClicked:!1,isYBarClicked:!1,lastPageX:null,lastPageY:null,timer:null,outsideClickListener:null,data:function(){return{id:e.UniqueComponentId(),orientation:"vertical",lastScrollTop:0,lastScrollLeft:0}},mounted:function(){this.$el.offsetParent&&this.initialize()},updated:function(){!this.initialized&&this.$el.offsetParent&&this.initialize()},beforeUnmount:function(){this.unbindDocumentResizeListener(),this.frame&&window.cancelAnimationFrame(this.frame)},methods:{initialize:function(){this.moveBar(),this.bindDocumentResizeListener(),this.calculateContainerHeight()},calculateContainerHeight:function(){var t=getComputedStyle(this.$el),n=getComputedStyle(this.$refs.xBar),o=e.DomHandler.getHeight(this.$el)-parseInt(n.height,10);"none"!==t["max-height"]&&0===o&&(this.$el.style.height=this.$refs.content.offsetHeight+parseInt(n.height,10)>parseInt(t["max-height"],10)?t["max-height"]:this.$refs.content.offsetHeight+parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)+parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth)+"px")},moveBar:function(){var t=this,n=this.$refs.content.scrollWidth,o=-1*(this.$el.clientHeight-this.$refs.xBar.clientHeight);this.scrollXRatio=this.$refs.content.clientWidth/n;var r=this.$refs.content.scrollHeight,s=-1*(this.$el.clientWidth-this.$refs.yBar.clientWidth);this.scrollYRatio=this.$refs.content.clientHeight/r,this.frame=this.requestAnimationFrame((function(){t.scrollXRatio>=1?(t.$refs.xBar.setAttribute("data-p-scrollpanel-hidden","true"),!t.isUnstyled&&e.DomHandler.addClass(t.$refs.xBar,"p-scrollpanel-hidden")):(t.$refs.xBar.setAttribute("data-p-scrollpanel-hidden","false"),!t.isUnstyled&&e.DomHandler.removeClass(t.$refs.xBar,"p-scrollpanel-hidden"),t.$refs.xBar.style.cssText="width:"+Math.max(100*t.scrollXRatio,10)+"%; left:"+t.$refs.content.scrollLeft/n*100+"%;bottom:"+o+"px;"),t.scrollYRatio>=1?(t.$refs.yBar.setAttribute("data-p-scrollpanel-hidden","true"),!t.isUnstyled&&e.DomHandler.addClass(t.$refs.yBar,"p-scrollpanel-hidden")):(t.$refs.yBar.setAttribute("data-p-scrollpanel-hidden","false"),!t.isUnstyled&&e.DomHandler.removeClass(t.$refs.yBar,"p-scrollpanel-hidden"),t.$refs.yBar.style.cssText="height:"+Math.max(100*t.scrollYRatio,10)+"%; top: calc("+t.$refs.content.scrollTop/r*100+"% - "+t.$refs.xBar.clientHeight+"px);right:"+s+"px;")}))},onYBarMouseDown:function(t){this.isYBarClicked=!0,this.$refs.yBar.focus(),this.lastPageY=t.pageY,this.$refs.yBar.setAttribute("data-p-scrollpanel-grabbed","true"),!this.isUnstyled&&e.DomHandler.addClass(this.$refs.yBar,"p-scrollpanel-grabbed"),document.body.setAttribute("data-p-scrollpanel-grabbed","true"),!this.isUnstyled&&e.DomHandler.addClass(document.body,"p-scrollpanel-grabbed"),this.bindDocumentMouseListeners(),t.preventDefault()},onXBarMouseDown:function(t){this.isXBarClicked=!0,this.$refs.xBar.focus(),this.lastPageX=t.pageX,this.$refs.yBar.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&e.DomHandler.addClass(this.$refs.xBar,"p-scrollpanel-grabbed"),document.body.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&e.DomHandler.addClass(document.body,"p-scrollpanel-grabbed"),this.bindDocumentMouseListeners(),t.preventDefault()},onScroll:function(e){this.lastScrollLeft!==e.target.scrollLeft?(this.lastScrollLeft=e.target.scrollLeft,this.orientation="horizontal"):this.lastScrollTop!==e.target.scrollTop&&(this.lastScrollTop=e.target.scrollTop,this.orientation="vertical"),this.moveBar()},onKeyDown:function(e){if("vertical"===this.orientation)switch(e.code){case"ArrowDown":this.setTimer("scrollTop",this.step),e.preventDefault();break;case"ArrowUp":this.setTimer("scrollTop",-1*this.step),e.preventDefault();break;case"ArrowLeft":case"ArrowRight":e.preventDefault()}else if("horizontal"===this.orientation)switch(e.code){case"ArrowRight":this.setTimer("scrollLeft",this.step),e.preventDefault();break;case"ArrowLeft":this.setTimer("scrollLeft",-1*this.step),e.preventDefault();break;case"ArrowDown":case"ArrowUp":e.preventDefault()}},onKeyUp:function(){this.clearTimer()},repeat:function(e,t){this.$refs.content[e]+=t,this.moveBar()},setTimer:function(e,t){var n=this;this.clearTimer(),this.timer=setTimeout((function(){n.repeat(e,t)}),40)},clearTimer:function(){this.timer&&clearTimeout(this.timer)},onDocumentMouseMove:function(e){this.isXBarClicked?this.onMouseMoveForXBar(e):(this.isYBarClicked||this.onMouseMoveForXBar(e),this.onMouseMoveForYBar(e))},onMouseMoveForXBar:function(e){var t=this,n=e.pageX-this.lastPageX;this.lastPageX=e.pageX,this.frame=this.requestAnimationFrame((function(){t.$refs.content.scrollLeft+=n/t.scrollXRatio}))},onMouseMoveForYBar:function(e){var t=this,n=e.pageY-this.lastPageY;this.lastPageY=e.pageY,this.frame=this.requestAnimationFrame((function(){t.$refs.content.scrollTop+=n/t.scrollYRatio}))},onFocus:function(e){this.$refs.xBar.isSameNode(e.target)?this.orientation="horizontal":this.$refs.yBar.isSameNode(e.target)&&(this.orientation="vertical")},onBlur:function(){"horizontal"===this.orientation&&(this.orientation="vertical")},onDocumentMouseUp:function(){this.$refs.yBar.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&e.DomHandler.removeClass(this.$refs.yBar,"p-scrollpanel-grabbed"),this.$refs.xBar.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&e.DomHandler.removeClass(this.$refs.xBar,"p-scrollpanel-grabbed"),document.body.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&e.DomHandler.removeClass(document.body,"p-scrollpanel-grabbed"),this.unbindDocumentMouseListeners(),this.isXBarClicked=!1,this.isYBarClicked=!1},requestAnimationFrame:function(e){return(window.requestAnimationFrame||this.timeoutFrame)(e)},refresh:function(){this.moveBar()},scrollTop:function(e){var t=this.$refs.content.scrollHeight-this.$refs.content.clientHeight;this.$refs.content.scrollTop=e=e>t?t:e>0?e:0},timeoutFrame:function(e){setTimeout(e,0)},bindDocumentMouseListeners:function(){var e=this;this.documentMouseMoveListener||(this.documentMouseMoveListener=function(t){e.onDocumentMouseMove(t)},document.addEventListener("mousemove",this.documentMouseMoveListener)),this.documentMouseUpListener||(this.documentMouseUpListener=function(t){e.onDocumentMouseUp(t)},document.addEventListener("mouseup",this.documentMouseUpListener))},unbindDocumentMouseListeners:function(){this.documentMouseMoveListener&&(document.removeEventListener("mousemove",this.documentMouseMoveListener),this.documentMouseMoveListener=null),this.documentMouseUpListener&&(document.removeEventListener("mouseup",this.documentMouseUpListener),this.documentMouseUpListener=null)},bindDocumentResizeListener:function(){var e=this;this.documentResizeListener||(this.documentResizeListener=function(){e.moveBar()},window.addEventListener("resize",this.documentResizeListener))},unbindDocumentResizeListener:function(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)}}},l=["aria-valuenow"],c=["aria-valuenow"];a.render=function(e,t,n,r,s,i){return o.openBlock(),o.createElementBlock("div",o.mergeProps({class:e.cx("root")},e.ptm("root"),{"data-pc-name":"scrollpanel"}),[o.createElementVNode("div",o.mergeProps({class:e.cx("wrapper")},e.ptm("wrapper")),[o.createElementVNode("div",o.mergeProps({ref:"content",class:e.cx("content"),onScroll:t[0]||(t[0]=function(){return i.onScroll&&i.onScroll.apply(i,arguments)}),onMouseenter:t[1]||(t[1]=function(){return i.moveBar&&i.moveBar.apply(i,arguments)})},e.ptm("content")),[o.renderSlot(e.$slots,"default")],16)],16),o.createElementVNode("div",o.mergeProps({ref:"xBar",class:e.cx("barx"),tabindex:"0",role:"scrollbar","aria-orientation":"horizontal","aria-valuenow":s.lastScrollLeft,onMousedown:t[2]||(t[2]=function(){return i.onXBarMouseDown&&i.onXBarMouseDown.apply(i,arguments)}),onKeydown:t[3]||(t[3]=function(e){return i.onKeyDown(e)}),onKeyup:t[4]||(t[4]=function(){return i.onKeyUp&&i.onKeyUp.apply(i,arguments)}),onFocus:t[5]||(t[5]=function(){return i.onFocus&&i.onFocus.apply(i,arguments)}),onBlur:t[6]||(t[6]=function(){return i.onBlur&&i.onBlur.apply(i,arguments)})},e.ptm("barx"),{"data-pc-group-section":"bar"}),null,16,l),o.createElementVNode("div",o.mergeProps({ref:"yBar",class:e.cx("bary"),tabindex:"0",role:"scrollbar","aria-orientation":"vertical","aria-valuenow":s.lastScrollTop,onMousedown:t[7]||(t[7]=function(){return i.onYBarMouseDown&&i.onYBarMouseDown.apply(i,arguments)}),onKeydown:t[8]||(t[8]=function(e){return i.onKeyDown(e)}),onKeyup:t[9]||(t[9]=function(){return i.onKeyUp&&i.onKeyUp.apply(i,arguments)}),onFocus:t[10]||(t[10]=function(){return i.onFocus&&i.onFocus.apply(i,arguments)})},e.ptm("bary"),{"data-pc-group-section":"bar"}),null,16,c)],16)},module.exports=a;
|
|
@@ -369,7 +369,9 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
369
369
|
onBlur: _cache[6] || (_cache[6] = function () {
|
|
370
370
|
return $options.onBlur && $options.onBlur.apply($options, arguments);
|
|
371
371
|
})
|
|
372
|
-
}, _ctx.ptm('barx')
|
|
372
|
+
}, _ctx.ptm('barx'), {
|
|
373
|
+
"data-pc-group-section": "bar"
|
|
374
|
+
}), null, 16, _hoisted_1), createElementVNode("div", mergeProps({
|
|
373
375
|
ref: "yBar",
|
|
374
376
|
"class": _ctx.cx('bary'),
|
|
375
377
|
tabindex: "0",
|
|
@@ -388,7 +390,9 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
388
390
|
onFocus: _cache[10] || (_cache[10] = function () {
|
|
389
391
|
return $options.onFocus && $options.onFocus.apply($options, arguments);
|
|
390
392
|
})
|
|
391
|
-
}, _ctx.ptm('bary')
|
|
393
|
+
}, _ctx.ptm('bary'), {
|
|
394
|
+
"data-pc-group-section": "bar"
|
|
395
|
+
}), null, 16, _hoisted_2)], 16);
|
|
392
396
|
}
|
|
393
397
|
|
|
394
398
|
script.render = render;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{UniqueComponentId as e,DomHandler as t}from"primevue/utils";import n from"primevue/basecomponent";import{useStyle as o}from"primevue/usestyle";import{openBlock as s,createElementBlock as r,mergeProps as i,createElementVNode as a,renderSlot as l}from"vue";var c=o("\n.p-scrollpanel-wrapper {\n overflow: hidden;\n width: 100%;\n height: 100%;\n position: relative;\n z-index: 1;\n float: left;\n}\n\n.p-scrollpanel-content {\n height: calc(100% + 18px);\n width: calc(100% + 18px);\n padding: 0 18px 18px 0;\n position: relative;\n overflow: scroll;\n box-sizing: border-box;\n scrollbar-width: none;\n}\n\n.p-scrollpanel-content::-webkit-scrollbar {\n display: none;\n}\n\n.p-scrollpanel-bar {\n position: relative;\n background: #c1c1c1;\n border-radius: 3px;\n z-index: 2;\n cursor: pointer;\n opacity: 0;\n transition: opacity 0.25s linear;\n}\n\n.p-scrollpanel-bar-y {\n width: 9px;\n top: 0;\n}\n\n.p-scrollpanel-bar-x {\n height: 9px;\n bottom: 0;\n}\n\n.p-scrollpanel-hidden {\n visibility: hidden;\n}\n\n.p-scrollpanel:hover .p-scrollpanel-bar,\n.p-scrollpanel:active .p-scrollpanel-bar {\n opacity: 1;\n}\n\n.p-scrollpanel-grabbed {\n user-select: none;\n}\n",{name:"scrollpanel",manual:!0}),u={name:"ScrollPanel",extends:{name:"BaseScrollPanel",extends:n,props:{step:{type:Number,default:5}},css:{classes:{root:"p-scrollpanel p-component",wrapper:"p-scrollpanel-wrapper",content:"p-scrollpanel-content",barx:"p-scrollpanel-bar p-scrollpanel-bar-x",bary:"p-scrollpanel-bar p-scrollpanel-bar-y"},loadStyle:c.load},provide:function(){return{$parentInstance:this}}},initialized:!1,documentResizeListener:null,documentMouseMoveListener:null,documentMouseUpListener:null,frame:null,scrollXRatio:null,scrollYRatio:null,isXBarClicked:!1,isYBarClicked:!1,lastPageX:null,lastPageY:null,timer:null,outsideClickListener:null,data:function(){return{id:e(),orientation:"vertical",lastScrollTop:0,lastScrollLeft:0}},mounted:function(){this.$el.offsetParent&&this.initialize()},updated:function(){!this.initialized&&this.$el.offsetParent&&this.initialize()},beforeUnmount:function(){this.unbindDocumentResizeListener(),this.frame&&window.cancelAnimationFrame(this.frame)},methods:{initialize:function(){this.moveBar(),this.bindDocumentResizeListener(),this.calculateContainerHeight()},calculateContainerHeight:function(){var e=getComputedStyle(this.$el),n=getComputedStyle(this.$refs.xBar),o=t.getHeight(this.$el)-parseInt(n.height,10);"none"!==e["max-height"]&&0===o&&(this.$el.style.height=this.$refs.content.offsetHeight+parseInt(n.height,10)>parseInt(e["max-height"],10)?e["max-height"]:this.$refs.content.offsetHeight+parseFloat(e.paddingTop)+parseFloat(e.paddingBottom)+parseFloat(e.borderTopWidth)+parseFloat(e.borderBottomWidth)+"px")},moveBar:function(){var e=this,n=this.$refs.content.scrollWidth,o=-1*(this.$el.clientHeight-this.$refs.xBar.clientHeight);this.scrollXRatio=this.$refs.content.clientWidth/n;var s=this.$refs.content.scrollHeight,r=-1*(this.$el.clientWidth-this.$refs.yBar.clientWidth);this.scrollYRatio=this.$refs.content.clientHeight/s,this.frame=this.requestAnimationFrame((function(){e.scrollXRatio>=1?(e.$refs.xBar.setAttribute("data-p-scrollpanel-hidden","true"),!e.isUnstyled&&t.addClass(e.$refs.xBar,"p-scrollpanel-hidden")):(e.$refs.xBar.setAttribute("data-p-scrollpanel-hidden","false"),!e.isUnstyled&&t.removeClass(e.$refs.xBar,"p-scrollpanel-hidden"),e.$refs.xBar.style.cssText="width:"+Math.max(100*e.scrollXRatio,10)+"%; left:"+e.$refs.content.scrollLeft/n*100+"%;bottom:"+o+"px;"),e.scrollYRatio>=1?(e.$refs.yBar.setAttribute("data-p-scrollpanel-hidden","true"),!e.isUnstyled&&t.addClass(e.$refs.yBar,"p-scrollpanel-hidden")):(e.$refs.yBar.setAttribute("data-p-scrollpanel-hidden","false"),!e.isUnstyled&&t.removeClass(e.$refs.yBar,"p-scrollpanel-hidden"),e.$refs.yBar.style.cssText="height:"+Math.max(100*e.scrollYRatio,10)+"%; top: calc("+e.$refs.content.scrollTop/s*100+"% - "+e.$refs.xBar.clientHeight+"px);right:"+r+"px;")}))},onYBarMouseDown:function(e){this.isYBarClicked=!0,this.$refs.yBar.focus(),this.lastPageY=e.pageY,this.$refs.yBar.setAttribute("data-p-scrollpanel-grabbed","true"),!this.isUnstyled&&t.addClass(this.$refs.yBar,"p-scrollpanel-grabbed"),document.body.setAttribute("data-p-scrollpanel-grabbed","true"),!this.isUnstyled&&t.addClass(document.body,"p-scrollpanel-grabbed"),this.bindDocumentMouseListeners(),e.preventDefault()},onXBarMouseDown:function(e){this.isXBarClicked=!0,this.$refs.xBar.focus(),this.lastPageX=e.pageX,this.$refs.yBar.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&t.addClass(this.$refs.xBar,"p-scrollpanel-grabbed"),document.body.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&t.addClass(document.body,"p-scrollpanel-grabbed"),this.bindDocumentMouseListeners(),e.preventDefault()},onScroll:function(e){this.lastScrollLeft!==e.target.scrollLeft?(this.lastScrollLeft=e.target.scrollLeft,this.orientation="horizontal"):this.lastScrollTop!==e.target.scrollTop&&(this.lastScrollTop=e.target.scrollTop,this.orientation="vertical"),this.moveBar()},onKeyDown:function(e){if("vertical"===this.orientation)switch(e.code){case"ArrowDown":this.setTimer("scrollTop",this.step),e.preventDefault();break;case"ArrowUp":this.setTimer("scrollTop",-1*this.step),e.preventDefault();break;case"ArrowLeft":case"ArrowRight":e.preventDefault()}else if("horizontal"===this.orientation)switch(e.code){case"ArrowRight":this.setTimer("scrollLeft",this.step),e.preventDefault();break;case"ArrowLeft":this.setTimer("scrollLeft",-1*this.step),e.preventDefault();break;case"ArrowDown":case"ArrowUp":e.preventDefault()}},onKeyUp:function(){this.clearTimer()},repeat:function(e,t){this.$refs.content[e]+=t,this.moveBar()},setTimer:function(e,t){var n=this;this.clearTimer(),this.timer=setTimeout((function(){n.repeat(e,t)}),40)},clearTimer:function(){this.timer&&clearTimeout(this.timer)},onDocumentMouseMove:function(e){this.isXBarClicked?this.onMouseMoveForXBar(e):(this.isYBarClicked||this.onMouseMoveForXBar(e),this.onMouseMoveForYBar(e))},onMouseMoveForXBar:function(e){var t=this,n=e.pageX-this.lastPageX;this.lastPageX=e.pageX,this.frame=this.requestAnimationFrame((function(){t.$refs.content.scrollLeft+=n/t.scrollXRatio}))},onMouseMoveForYBar:function(e){var t=this,n=e.pageY-this.lastPageY;this.lastPageY=e.pageY,this.frame=this.requestAnimationFrame((function(){t.$refs.content.scrollTop+=n/t.scrollYRatio}))},onFocus:function(e){this.$refs.xBar.isSameNode(e.target)?this.orientation="horizontal":this.$refs.yBar.isSameNode(e.target)&&(this.orientation="vertical")},onBlur:function(){"horizontal"===this.orientation&&(this.orientation="vertical")},onDocumentMouseUp:function(){this.$refs.yBar.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&t.removeClass(this.$refs.yBar,"p-scrollpanel-grabbed"),this.$refs.xBar.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&t.removeClass(this.$refs.xBar,"p-scrollpanel-grabbed"),document.body.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&t.removeClass(document.body,"p-scrollpanel-grabbed"),this.unbindDocumentMouseListeners(),this.isXBarClicked=!1,this.isYBarClicked=!1},requestAnimationFrame:function(e){return(window.requestAnimationFrame||this.timeoutFrame)(e)},refresh:function(){this.moveBar()},scrollTop:function(e){var t=this.$refs.content.scrollHeight-this.$refs.content.clientHeight;this.$refs.content.scrollTop=e=e>t?t:e>0?e:0},timeoutFrame:function(e){setTimeout(e,0)},bindDocumentMouseListeners:function(){var e=this;this.documentMouseMoveListener||(this.documentMouseMoveListener=function(t){e.onDocumentMouseMove(t)},document.addEventListener("mousemove",this.documentMouseMoveListener)),this.documentMouseUpListener||(this.documentMouseUpListener=function(t){e.onDocumentMouseUp(t)},document.addEventListener("mouseup",this.documentMouseUpListener))},unbindDocumentMouseListeners:function(){this.documentMouseMoveListener&&(document.removeEventListener("mousemove",this.documentMouseMoveListener),this.documentMouseMoveListener=null),this.documentMouseUpListener&&(document.removeEventListener("mouseup",this.documentMouseUpListener),this.documentMouseUpListener=null)},bindDocumentResizeListener:function(){var e=this;this.documentResizeListener||(this.documentResizeListener=function(){e.moveBar()},window.addEventListener("resize",this.documentResizeListener))},unbindDocumentResizeListener:function(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)}}},p=["aria-valuenow"],d=["aria-valuenow"];u.render=function(e,t,n,o,c,u){return s(),r("div",i({class:e.cx("root")},e.ptm("root"),{"data-pc-name":"scrollpanel"}),[a("div",i({class:e.cx("wrapper")},e.ptm("wrapper")),[a("div",i({ref:"content",class:e.cx("content"),onScroll:t[0]||(t[0]=function(){return u.onScroll&&u.onScroll.apply(u,arguments)}),onMouseenter:t[1]||(t[1]=function(){return u.moveBar&&u.moveBar.apply(u,arguments)})},e.ptm("content")),[l(e.$slots,"default")],16)],16),a("div",i({ref:"xBar",class:e.cx("barx"),tabindex:"0",role:"scrollbar","aria-orientation":"horizontal","aria-valuenow":c.lastScrollLeft,onMousedown:t[2]||(t[2]=function(){return u.onXBarMouseDown&&u.onXBarMouseDown.apply(u,arguments)}),onKeydown:t[3]||(t[3]=function(e){return u.onKeyDown(e)}),onKeyup:t[4]||(t[4]=function(){return u.onKeyUp&&u.onKeyUp.apply(u,arguments)}),onFocus:t[5]||(t[5]=function(){return u.onFocus&&u.onFocus.apply(u,arguments)}),onBlur:t[6]||(t[6]=function(){return u.onBlur&&u.onBlur.apply(u,arguments)})},e.ptm("barx")),null,16,p),a("div",i({ref:"yBar",class:e.cx("bary"),tabindex:"0",role:"scrollbar","aria-orientation":"vertical","aria-valuenow":c.lastScrollTop,onMousedown:t[7]||(t[7]=function(){return u.onYBarMouseDown&&u.onYBarMouseDown.apply(u,arguments)}),onKeydown:t[8]||(t[8]=function(e){return u.onKeyDown(e)}),onKeyup:t[9]||(t[9]=function(){return u.onKeyUp&&u.onKeyUp.apply(u,arguments)}),onFocus:t[10]||(t[10]=function(){return u.onFocus&&u.onFocus.apply(u,arguments)})},e.ptm("bary")),null,16,d)],16)};export{u as default};
|
|
1
|
+
import{UniqueComponentId as e,DomHandler as t}from"primevue/utils";import n from"primevue/basecomponent";import{useStyle as o}from"primevue/usestyle";import{openBlock as s,createElementBlock as r,mergeProps as i,createElementVNode as a,renderSlot as l}from"vue";var c=o("\n.p-scrollpanel-wrapper {\n overflow: hidden;\n width: 100%;\n height: 100%;\n position: relative;\n z-index: 1;\n float: left;\n}\n\n.p-scrollpanel-content {\n height: calc(100% + 18px);\n width: calc(100% + 18px);\n padding: 0 18px 18px 0;\n position: relative;\n overflow: scroll;\n box-sizing: border-box;\n scrollbar-width: none;\n}\n\n.p-scrollpanel-content::-webkit-scrollbar {\n display: none;\n}\n\n.p-scrollpanel-bar {\n position: relative;\n background: #c1c1c1;\n border-radius: 3px;\n z-index: 2;\n cursor: pointer;\n opacity: 0;\n transition: opacity 0.25s linear;\n}\n\n.p-scrollpanel-bar-y {\n width: 9px;\n top: 0;\n}\n\n.p-scrollpanel-bar-x {\n height: 9px;\n bottom: 0;\n}\n\n.p-scrollpanel-hidden {\n visibility: hidden;\n}\n\n.p-scrollpanel:hover .p-scrollpanel-bar,\n.p-scrollpanel:active .p-scrollpanel-bar {\n opacity: 1;\n}\n\n.p-scrollpanel-grabbed {\n user-select: none;\n}\n",{name:"scrollpanel",manual:!0}),u={name:"ScrollPanel",extends:{name:"BaseScrollPanel",extends:n,props:{step:{type:Number,default:5}},css:{classes:{root:"p-scrollpanel p-component",wrapper:"p-scrollpanel-wrapper",content:"p-scrollpanel-content",barx:"p-scrollpanel-bar p-scrollpanel-bar-x",bary:"p-scrollpanel-bar p-scrollpanel-bar-y"},loadStyle:c.load},provide:function(){return{$parentInstance:this}}},initialized:!1,documentResizeListener:null,documentMouseMoveListener:null,documentMouseUpListener:null,frame:null,scrollXRatio:null,scrollYRatio:null,isXBarClicked:!1,isYBarClicked:!1,lastPageX:null,lastPageY:null,timer:null,outsideClickListener:null,data:function(){return{id:e(),orientation:"vertical",lastScrollTop:0,lastScrollLeft:0}},mounted:function(){this.$el.offsetParent&&this.initialize()},updated:function(){!this.initialized&&this.$el.offsetParent&&this.initialize()},beforeUnmount:function(){this.unbindDocumentResizeListener(),this.frame&&window.cancelAnimationFrame(this.frame)},methods:{initialize:function(){this.moveBar(),this.bindDocumentResizeListener(),this.calculateContainerHeight()},calculateContainerHeight:function(){var e=getComputedStyle(this.$el),n=getComputedStyle(this.$refs.xBar),o=t.getHeight(this.$el)-parseInt(n.height,10);"none"!==e["max-height"]&&0===o&&(this.$el.style.height=this.$refs.content.offsetHeight+parseInt(n.height,10)>parseInt(e["max-height"],10)?e["max-height"]:this.$refs.content.offsetHeight+parseFloat(e.paddingTop)+parseFloat(e.paddingBottom)+parseFloat(e.borderTopWidth)+parseFloat(e.borderBottomWidth)+"px")},moveBar:function(){var e=this,n=this.$refs.content.scrollWidth,o=-1*(this.$el.clientHeight-this.$refs.xBar.clientHeight);this.scrollXRatio=this.$refs.content.clientWidth/n;var s=this.$refs.content.scrollHeight,r=-1*(this.$el.clientWidth-this.$refs.yBar.clientWidth);this.scrollYRatio=this.$refs.content.clientHeight/s,this.frame=this.requestAnimationFrame((function(){e.scrollXRatio>=1?(e.$refs.xBar.setAttribute("data-p-scrollpanel-hidden","true"),!e.isUnstyled&&t.addClass(e.$refs.xBar,"p-scrollpanel-hidden")):(e.$refs.xBar.setAttribute("data-p-scrollpanel-hidden","false"),!e.isUnstyled&&t.removeClass(e.$refs.xBar,"p-scrollpanel-hidden"),e.$refs.xBar.style.cssText="width:"+Math.max(100*e.scrollXRatio,10)+"%; left:"+e.$refs.content.scrollLeft/n*100+"%;bottom:"+o+"px;"),e.scrollYRatio>=1?(e.$refs.yBar.setAttribute("data-p-scrollpanel-hidden","true"),!e.isUnstyled&&t.addClass(e.$refs.yBar,"p-scrollpanel-hidden")):(e.$refs.yBar.setAttribute("data-p-scrollpanel-hidden","false"),!e.isUnstyled&&t.removeClass(e.$refs.yBar,"p-scrollpanel-hidden"),e.$refs.yBar.style.cssText="height:"+Math.max(100*e.scrollYRatio,10)+"%; top: calc("+e.$refs.content.scrollTop/s*100+"% - "+e.$refs.xBar.clientHeight+"px);right:"+r+"px;")}))},onYBarMouseDown:function(e){this.isYBarClicked=!0,this.$refs.yBar.focus(),this.lastPageY=e.pageY,this.$refs.yBar.setAttribute("data-p-scrollpanel-grabbed","true"),!this.isUnstyled&&t.addClass(this.$refs.yBar,"p-scrollpanel-grabbed"),document.body.setAttribute("data-p-scrollpanel-grabbed","true"),!this.isUnstyled&&t.addClass(document.body,"p-scrollpanel-grabbed"),this.bindDocumentMouseListeners(),e.preventDefault()},onXBarMouseDown:function(e){this.isXBarClicked=!0,this.$refs.xBar.focus(),this.lastPageX=e.pageX,this.$refs.yBar.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&t.addClass(this.$refs.xBar,"p-scrollpanel-grabbed"),document.body.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&t.addClass(document.body,"p-scrollpanel-grabbed"),this.bindDocumentMouseListeners(),e.preventDefault()},onScroll:function(e){this.lastScrollLeft!==e.target.scrollLeft?(this.lastScrollLeft=e.target.scrollLeft,this.orientation="horizontal"):this.lastScrollTop!==e.target.scrollTop&&(this.lastScrollTop=e.target.scrollTop,this.orientation="vertical"),this.moveBar()},onKeyDown:function(e){if("vertical"===this.orientation)switch(e.code){case"ArrowDown":this.setTimer("scrollTop",this.step),e.preventDefault();break;case"ArrowUp":this.setTimer("scrollTop",-1*this.step),e.preventDefault();break;case"ArrowLeft":case"ArrowRight":e.preventDefault()}else if("horizontal"===this.orientation)switch(e.code){case"ArrowRight":this.setTimer("scrollLeft",this.step),e.preventDefault();break;case"ArrowLeft":this.setTimer("scrollLeft",-1*this.step),e.preventDefault();break;case"ArrowDown":case"ArrowUp":e.preventDefault()}},onKeyUp:function(){this.clearTimer()},repeat:function(e,t){this.$refs.content[e]+=t,this.moveBar()},setTimer:function(e,t){var n=this;this.clearTimer(),this.timer=setTimeout((function(){n.repeat(e,t)}),40)},clearTimer:function(){this.timer&&clearTimeout(this.timer)},onDocumentMouseMove:function(e){this.isXBarClicked?this.onMouseMoveForXBar(e):(this.isYBarClicked||this.onMouseMoveForXBar(e),this.onMouseMoveForYBar(e))},onMouseMoveForXBar:function(e){var t=this,n=e.pageX-this.lastPageX;this.lastPageX=e.pageX,this.frame=this.requestAnimationFrame((function(){t.$refs.content.scrollLeft+=n/t.scrollXRatio}))},onMouseMoveForYBar:function(e){var t=this,n=e.pageY-this.lastPageY;this.lastPageY=e.pageY,this.frame=this.requestAnimationFrame((function(){t.$refs.content.scrollTop+=n/t.scrollYRatio}))},onFocus:function(e){this.$refs.xBar.isSameNode(e.target)?this.orientation="horizontal":this.$refs.yBar.isSameNode(e.target)&&(this.orientation="vertical")},onBlur:function(){"horizontal"===this.orientation&&(this.orientation="vertical")},onDocumentMouseUp:function(){this.$refs.yBar.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&t.removeClass(this.$refs.yBar,"p-scrollpanel-grabbed"),this.$refs.xBar.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&t.removeClass(this.$refs.xBar,"p-scrollpanel-grabbed"),document.body.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&t.removeClass(document.body,"p-scrollpanel-grabbed"),this.unbindDocumentMouseListeners(),this.isXBarClicked=!1,this.isYBarClicked=!1},requestAnimationFrame:function(e){return(window.requestAnimationFrame||this.timeoutFrame)(e)},refresh:function(){this.moveBar()},scrollTop:function(e){var t=this.$refs.content.scrollHeight-this.$refs.content.clientHeight;this.$refs.content.scrollTop=e=e>t?t:e>0?e:0},timeoutFrame:function(e){setTimeout(e,0)},bindDocumentMouseListeners:function(){var e=this;this.documentMouseMoveListener||(this.documentMouseMoveListener=function(t){e.onDocumentMouseMove(t)},document.addEventListener("mousemove",this.documentMouseMoveListener)),this.documentMouseUpListener||(this.documentMouseUpListener=function(t){e.onDocumentMouseUp(t)},document.addEventListener("mouseup",this.documentMouseUpListener))},unbindDocumentMouseListeners:function(){this.documentMouseMoveListener&&(document.removeEventListener("mousemove",this.documentMouseMoveListener),this.documentMouseMoveListener=null),this.documentMouseUpListener&&(document.removeEventListener("mouseup",this.documentMouseUpListener),this.documentMouseUpListener=null)},bindDocumentResizeListener:function(){var e=this;this.documentResizeListener||(this.documentResizeListener=function(){e.moveBar()},window.addEventListener("resize",this.documentResizeListener))},unbindDocumentResizeListener:function(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)}}},p=["aria-valuenow"],d=["aria-valuenow"];u.render=function(e,t,n,o,c,u){return s(),r("div",i({class:e.cx("root")},e.ptm("root"),{"data-pc-name":"scrollpanel"}),[a("div",i({class:e.cx("wrapper")},e.ptm("wrapper")),[a("div",i({ref:"content",class:e.cx("content"),onScroll:t[0]||(t[0]=function(){return u.onScroll&&u.onScroll.apply(u,arguments)}),onMouseenter:t[1]||(t[1]=function(){return u.moveBar&&u.moveBar.apply(u,arguments)})},e.ptm("content")),[l(e.$slots,"default")],16)],16),a("div",i({ref:"xBar",class:e.cx("barx"),tabindex:"0",role:"scrollbar","aria-orientation":"horizontal","aria-valuenow":c.lastScrollLeft,onMousedown:t[2]||(t[2]=function(){return u.onXBarMouseDown&&u.onXBarMouseDown.apply(u,arguments)}),onKeydown:t[3]||(t[3]=function(e){return u.onKeyDown(e)}),onKeyup:t[4]||(t[4]=function(){return u.onKeyUp&&u.onKeyUp.apply(u,arguments)}),onFocus:t[5]||(t[5]=function(){return u.onFocus&&u.onFocus.apply(u,arguments)}),onBlur:t[6]||(t[6]=function(){return u.onBlur&&u.onBlur.apply(u,arguments)})},e.ptm("barx"),{"data-pc-group-section":"bar"}),null,16,p),a("div",i({ref:"yBar",class:e.cx("bary"),tabindex:"0",role:"scrollbar","aria-orientation":"vertical","aria-valuenow":c.lastScrollTop,onMousedown:t[7]||(t[7]=function(){return u.onYBarMouseDown&&u.onYBarMouseDown.apply(u,arguments)}),onKeydown:t[8]||(t[8]=function(e){return u.onKeyDown(e)}),onKeyup:t[9]||(t[9]=function(){return u.onKeyUp&&u.onKeyUp.apply(u,arguments)}),onFocus:t[10]||(t[10]=function(){return u.onFocus&&u.onFocus.apply(u,arguments)})},e.ptm("bary"),{"data-pc-group-section":"bar"}),null,16,d)],16)};export{u as default};
|
|
@@ -372,7 +372,9 @@ this.primevue.scrollpanel = (function (utils, BaseComponent, usestyle, vue) {
|
|
|
372
372
|
onBlur: _cache[6] || (_cache[6] = function () {
|
|
373
373
|
return $options.onBlur && $options.onBlur.apply($options, arguments);
|
|
374
374
|
})
|
|
375
|
-
}, _ctx.ptm('barx')
|
|
375
|
+
}, _ctx.ptm('barx'), {
|
|
376
|
+
"data-pc-group-section": "bar"
|
|
377
|
+
}), null, 16, _hoisted_1), vue.createElementVNode("div", vue.mergeProps({
|
|
376
378
|
ref: "yBar",
|
|
377
379
|
"class": _ctx.cx('bary'),
|
|
378
380
|
tabindex: "0",
|
|
@@ -391,7 +393,9 @@ this.primevue.scrollpanel = (function (utils, BaseComponent, usestyle, vue) {
|
|
|
391
393
|
onFocus: _cache[10] || (_cache[10] = function () {
|
|
392
394
|
return $options.onFocus && $options.onFocus.apply($options, arguments);
|
|
393
395
|
})
|
|
394
|
-
}, _ctx.ptm('bary')
|
|
396
|
+
}, _ctx.ptm('bary'), {
|
|
397
|
+
"data-pc-group-section": "bar"
|
|
398
|
+
}), null, 16, _hoisted_2)], 16);
|
|
395
399
|
}
|
|
396
400
|
|
|
397
401
|
script.render = render;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primevue=this.primevue||{},this.primevue.scrollpanel=function(e,t,n,o){"use strict";function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=s(t),i=n.useStyle("\n.p-scrollpanel-wrapper {\n overflow: hidden;\n width: 100%;\n height: 100%;\n position: relative;\n z-index: 1;\n float: left;\n}\n\n.p-scrollpanel-content {\n height: calc(100% + 18px);\n width: calc(100% + 18px);\n padding: 0 18px 18px 0;\n position: relative;\n overflow: scroll;\n box-sizing: border-box;\n scrollbar-width: none;\n}\n\n.p-scrollpanel-content::-webkit-scrollbar {\n display: none;\n}\n\n.p-scrollpanel-bar {\n position: relative;\n background: #c1c1c1;\n border-radius: 3px;\n z-index: 2;\n cursor: pointer;\n opacity: 0;\n transition: opacity 0.25s linear;\n}\n\n.p-scrollpanel-bar-y {\n width: 9px;\n top: 0;\n}\n\n.p-scrollpanel-bar-x {\n height: 9px;\n bottom: 0;\n}\n\n.p-scrollpanel-hidden {\n visibility: hidden;\n}\n\n.p-scrollpanel:hover .p-scrollpanel-bar,\n.p-scrollpanel:active .p-scrollpanel-bar {\n opacity: 1;\n}\n\n.p-scrollpanel-grabbed {\n user-select: none;\n}\n",{name:"scrollpanel",manual:!0}),l={name:"ScrollPanel",extends:{name:"BaseScrollPanel",extends:r.default,props:{step:{type:Number,default:5}},css:{classes:{root:"p-scrollpanel p-component",wrapper:"p-scrollpanel-wrapper",content:"p-scrollpanel-content",barx:"p-scrollpanel-bar p-scrollpanel-bar-x",bary:"p-scrollpanel-bar p-scrollpanel-bar-y"},loadStyle:i.load},provide:function(){return{$parentInstance:this}}},initialized:!1,documentResizeListener:null,documentMouseMoveListener:null,documentMouseUpListener:null,frame:null,scrollXRatio:null,scrollYRatio:null,isXBarClicked:!1,isYBarClicked:!1,lastPageX:null,lastPageY:null,timer:null,outsideClickListener:null,data:function(){return{id:e.UniqueComponentId(),orientation:"vertical",lastScrollTop:0,lastScrollLeft:0}},mounted:function(){this.$el.offsetParent&&this.initialize()},updated:function(){!this.initialized&&this.$el.offsetParent&&this.initialize()},beforeUnmount:function(){this.unbindDocumentResizeListener(),this.frame&&window.cancelAnimationFrame(this.frame)},methods:{initialize:function(){this.moveBar(),this.bindDocumentResizeListener(),this.calculateContainerHeight()},calculateContainerHeight:function(){var t=getComputedStyle(this.$el),n=getComputedStyle(this.$refs.xBar),o=e.DomHandler.getHeight(this.$el)-parseInt(n.height,10);"none"!==t["max-height"]&&0===o&&(this.$el.style.height=this.$refs.content.offsetHeight+parseInt(n.height,10)>parseInt(t["max-height"],10)?t["max-height"]:this.$refs.content.offsetHeight+parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)+parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth)+"px")},moveBar:function(){var t=this,n=this.$refs.content.scrollWidth,o=-1*(this.$el.clientHeight-this.$refs.xBar.clientHeight);this.scrollXRatio=this.$refs.content.clientWidth/n;var s=this.$refs.content.scrollHeight,r=-1*(this.$el.clientWidth-this.$refs.yBar.clientWidth);this.scrollYRatio=this.$refs.content.clientHeight/s,this.frame=this.requestAnimationFrame((function(){t.scrollXRatio>=1?(t.$refs.xBar.setAttribute("data-p-scrollpanel-hidden","true"),!t.isUnstyled&&e.DomHandler.addClass(t.$refs.xBar,"p-scrollpanel-hidden")):(t.$refs.xBar.setAttribute("data-p-scrollpanel-hidden","false"),!t.isUnstyled&&e.DomHandler.removeClass(t.$refs.xBar,"p-scrollpanel-hidden"),t.$refs.xBar.style.cssText="width:"+Math.max(100*t.scrollXRatio,10)+"%; left:"+t.$refs.content.scrollLeft/n*100+"%;bottom:"+o+"px;"),t.scrollYRatio>=1?(t.$refs.yBar.setAttribute("data-p-scrollpanel-hidden","true"),!t.isUnstyled&&e.DomHandler.addClass(t.$refs.yBar,"p-scrollpanel-hidden")):(t.$refs.yBar.setAttribute("data-p-scrollpanel-hidden","false"),!t.isUnstyled&&e.DomHandler.removeClass(t.$refs.yBar,"p-scrollpanel-hidden"),t.$refs.yBar.style.cssText="height:"+Math.max(100*t.scrollYRatio,10)+"%; top: calc("+t.$refs.content.scrollTop/s*100+"% - "+t.$refs.xBar.clientHeight+"px);right:"+r+"px;")}))},onYBarMouseDown:function(t){this.isYBarClicked=!0,this.$refs.yBar.focus(),this.lastPageY=t.pageY,this.$refs.yBar.setAttribute("data-p-scrollpanel-grabbed","true"),!this.isUnstyled&&e.DomHandler.addClass(this.$refs.yBar,"p-scrollpanel-grabbed"),document.body.setAttribute("data-p-scrollpanel-grabbed","true"),!this.isUnstyled&&e.DomHandler.addClass(document.body,"p-scrollpanel-grabbed"),this.bindDocumentMouseListeners(),t.preventDefault()},onXBarMouseDown:function(t){this.isXBarClicked=!0,this.$refs.xBar.focus(),this.lastPageX=t.pageX,this.$refs.yBar.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&e.DomHandler.addClass(this.$refs.xBar,"p-scrollpanel-grabbed"),document.body.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&e.DomHandler.addClass(document.body,"p-scrollpanel-grabbed"),this.bindDocumentMouseListeners(),t.preventDefault()},onScroll:function(e){this.lastScrollLeft!==e.target.scrollLeft?(this.lastScrollLeft=e.target.scrollLeft,this.orientation="horizontal"):this.lastScrollTop!==e.target.scrollTop&&(this.lastScrollTop=e.target.scrollTop,this.orientation="vertical"),this.moveBar()},onKeyDown:function(e){if("vertical"===this.orientation)switch(e.code){case"ArrowDown":this.setTimer("scrollTop",this.step),e.preventDefault();break;case"ArrowUp":this.setTimer("scrollTop",-1*this.step),e.preventDefault();break;case"ArrowLeft":case"ArrowRight":e.preventDefault()}else if("horizontal"===this.orientation)switch(e.code){case"ArrowRight":this.setTimer("scrollLeft",this.step),e.preventDefault();break;case"ArrowLeft":this.setTimer("scrollLeft",-1*this.step),e.preventDefault();break;case"ArrowDown":case"ArrowUp":e.preventDefault()}},onKeyUp:function(){this.clearTimer()},repeat:function(e,t){this.$refs.content[e]+=t,this.moveBar()},setTimer:function(e,t){var n=this;this.clearTimer(),this.timer=setTimeout((function(){n.repeat(e,t)}),40)},clearTimer:function(){this.timer&&clearTimeout(this.timer)},onDocumentMouseMove:function(e){this.isXBarClicked?this.onMouseMoveForXBar(e):(this.isYBarClicked||this.onMouseMoveForXBar(e),this.onMouseMoveForYBar(e))},onMouseMoveForXBar:function(e){var t=this,n=e.pageX-this.lastPageX;this.lastPageX=e.pageX,this.frame=this.requestAnimationFrame((function(){t.$refs.content.scrollLeft+=n/t.scrollXRatio}))},onMouseMoveForYBar:function(e){var t=this,n=e.pageY-this.lastPageY;this.lastPageY=e.pageY,this.frame=this.requestAnimationFrame((function(){t.$refs.content.scrollTop+=n/t.scrollYRatio}))},onFocus:function(e){this.$refs.xBar.isSameNode(e.target)?this.orientation="horizontal":this.$refs.yBar.isSameNode(e.target)&&(this.orientation="vertical")},onBlur:function(){"horizontal"===this.orientation&&(this.orientation="vertical")},onDocumentMouseUp:function(){this.$refs.yBar.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&e.DomHandler.removeClass(this.$refs.yBar,"p-scrollpanel-grabbed"),this.$refs.xBar.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&e.DomHandler.removeClass(this.$refs.xBar,"p-scrollpanel-grabbed"),document.body.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&e.DomHandler.removeClass(document.body,"p-scrollpanel-grabbed"),this.unbindDocumentMouseListeners(),this.isXBarClicked=!1,this.isYBarClicked=!1},requestAnimationFrame:function(e){return(window.requestAnimationFrame||this.timeoutFrame)(e)},refresh:function(){this.moveBar()},scrollTop:function(e){var t=this.$refs.content.scrollHeight-this.$refs.content.clientHeight;this.$refs.content.scrollTop=e=e>t?t:e>0?e:0},timeoutFrame:function(e){setTimeout(e,0)},bindDocumentMouseListeners:function(){var e=this;this.documentMouseMoveListener||(this.documentMouseMoveListener=function(t){e.onDocumentMouseMove(t)},document.addEventListener("mousemove",this.documentMouseMoveListener)),this.documentMouseUpListener||(this.documentMouseUpListener=function(t){e.onDocumentMouseUp(t)},document.addEventListener("mouseup",this.documentMouseUpListener))},unbindDocumentMouseListeners:function(){this.documentMouseMoveListener&&(document.removeEventListener("mousemove",this.documentMouseMoveListener),this.documentMouseMoveListener=null),this.documentMouseUpListener&&(document.removeEventListener("mouseup",this.documentMouseUpListener),this.documentMouseUpListener=null)},bindDocumentResizeListener:function(){var e=this;this.documentResizeListener||(this.documentResizeListener=function(){e.moveBar()},window.addEventListener("resize",this.documentResizeListener))},unbindDocumentResizeListener:function(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)}}},a=["aria-valuenow"],c=["aria-valuenow"];return l.render=function(e,t,n,s,r,i){return o.openBlock(),o.createElementBlock("div",o.mergeProps({class:e.cx("root")},e.ptm("root"),{"data-pc-name":"scrollpanel"}),[o.createElementVNode("div",o.mergeProps({class:e.cx("wrapper")},e.ptm("wrapper")),[o.createElementVNode("div",o.mergeProps({ref:"content",class:e.cx("content"),onScroll:t[0]||(t[0]=function(){return i.onScroll&&i.onScroll.apply(i,arguments)}),onMouseenter:t[1]||(t[1]=function(){return i.moveBar&&i.moveBar.apply(i,arguments)})},e.ptm("content")),[o.renderSlot(e.$slots,"default")],16)],16),o.createElementVNode("div",o.mergeProps({ref:"xBar",class:e.cx("barx"),tabindex:"0",role:"scrollbar","aria-orientation":"horizontal","aria-valuenow":r.lastScrollLeft,onMousedown:t[2]||(t[2]=function(){return i.onXBarMouseDown&&i.onXBarMouseDown.apply(i,arguments)}),onKeydown:t[3]||(t[3]=function(e){return i.onKeyDown(e)}),onKeyup:t[4]||(t[4]=function(){return i.onKeyUp&&i.onKeyUp.apply(i,arguments)}),onFocus:t[5]||(t[5]=function(){return i.onFocus&&i.onFocus.apply(i,arguments)}),onBlur:t[6]||(t[6]=function(){return i.onBlur&&i.onBlur.apply(i,arguments)})},e.ptm("barx")),null,16,a),o.createElementVNode("div",o.mergeProps({ref:"yBar",class:e.cx("bary"),tabindex:"0",role:"scrollbar","aria-orientation":"vertical","aria-valuenow":r.lastScrollTop,onMousedown:t[7]||(t[7]=function(){return i.onYBarMouseDown&&i.onYBarMouseDown.apply(i,arguments)}),onKeydown:t[8]||(t[8]=function(e){return i.onKeyDown(e)}),onKeyup:t[9]||(t[9]=function(){return i.onKeyUp&&i.onKeyUp.apply(i,arguments)}),onFocus:t[10]||(t[10]=function(){return i.onFocus&&i.onFocus.apply(i,arguments)})},e.ptm("bary")),null,16,c)],16)},l}(primevue.utils,primevue.basecomponent,primevue.usestyle,Vue);
|
|
1
|
+
this.primevue=this.primevue||{},this.primevue.scrollpanel=function(e,t,n,o){"use strict";function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=s(t),i=n.useStyle("\n.p-scrollpanel-wrapper {\n overflow: hidden;\n width: 100%;\n height: 100%;\n position: relative;\n z-index: 1;\n float: left;\n}\n\n.p-scrollpanel-content {\n height: calc(100% + 18px);\n width: calc(100% + 18px);\n padding: 0 18px 18px 0;\n position: relative;\n overflow: scroll;\n box-sizing: border-box;\n scrollbar-width: none;\n}\n\n.p-scrollpanel-content::-webkit-scrollbar {\n display: none;\n}\n\n.p-scrollpanel-bar {\n position: relative;\n background: #c1c1c1;\n border-radius: 3px;\n z-index: 2;\n cursor: pointer;\n opacity: 0;\n transition: opacity 0.25s linear;\n}\n\n.p-scrollpanel-bar-y {\n width: 9px;\n top: 0;\n}\n\n.p-scrollpanel-bar-x {\n height: 9px;\n bottom: 0;\n}\n\n.p-scrollpanel-hidden {\n visibility: hidden;\n}\n\n.p-scrollpanel:hover .p-scrollpanel-bar,\n.p-scrollpanel:active .p-scrollpanel-bar {\n opacity: 1;\n}\n\n.p-scrollpanel-grabbed {\n user-select: none;\n}\n",{name:"scrollpanel",manual:!0}),a={name:"ScrollPanel",extends:{name:"BaseScrollPanel",extends:r.default,props:{step:{type:Number,default:5}},css:{classes:{root:"p-scrollpanel p-component",wrapper:"p-scrollpanel-wrapper",content:"p-scrollpanel-content",barx:"p-scrollpanel-bar p-scrollpanel-bar-x",bary:"p-scrollpanel-bar p-scrollpanel-bar-y"},loadStyle:i.load},provide:function(){return{$parentInstance:this}}},initialized:!1,documentResizeListener:null,documentMouseMoveListener:null,documentMouseUpListener:null,frame:null,scrollXRatio:null,scrollYRatio:null,isXBarClicked:!1,isYBarClicked:!1,lastPageX:null,lastPageY:null,timer:null,outsideClickListener:null,data:function(){return{id:e.UniqueComponentId(),orientation:"vertical",lastScrollTop:0,lastScrollLeft:0}},mounted:function(){this.$el.offsetParent&&this.initialize()},updated:function(){!this.initialized&&this.$el.offsetParent&&this.initialize()},beforeUnmount:function(){this.unbindDocumentResizeListener(),this.frame&&window.cancelAnimationFrame(this.frame)},methods:{initialize:function(){this.moveBar(),this.bindDocumentResizeListener(),this.calculateContainerHeight()},calculateContainerHeight:function(){var t=getComputedStyle(this.$el),n=getComputedStyle(this.$refs.xBar),o=e.DomHandler.getHeight(this.$el)-parseInt(n.height,10);"none"!==t["max-height"]&&0===o&&(this.$el.style.height=this.$refs.content.offsetHeight+parseInt(n.height,10)>parseInt(t["max-height"],10)?t["max-height"]:this.$refs.content.offsetHeight+parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)+parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth)+"px")},moveBar:function(){var t=this,n=this.$refs.content.scrollWidth,o=-1*(this.$el.clientHeight-this.$refs.xBar.clientHeight);this.scrollXRatio=this.$refs.content.clientWidth/n;var s=this.$refs.content.scrollHeight,r=-1*(this.$el.clientWidth-this.$refs.yBar.clientWidth);this.scrollYRatio=this.$refs.content.clientHeight/s,this.frame=this.requestAnimationFrame((function(){t.scrollXRatio>=1?(t.$refs.xBar.setAttribute("data-p-scrollpanel-hidden","true"),!t.isUnstyled&&e.DomHandler.addClass(t.$refs.xBar,"p-scrollpanel-hidden")):(t.$refs.xBar.setAttribute("data-p-scrollpanel-hidden","false"),!t.isUnstyled&&e.DomHandler.removeClass(t.$refs.xBar,"p-scrollpanel-hidden"),t.$refs.xBar.style.cssText="width:"+Math.max(100*t.scrollXRatio,10)+"%; left:"+t.$refs.content.scrollLeft/n*100+"%;bottom:"+o+"px;"),t.scrollYRatio>=1?(t.$refs.yBar.setAttribute("data-p-scrollpanel-hidden","true"),!t.isUnstyled&&e.DomHandler.addClass(t.$refs.yBar,"p-scrollpanel-hidden")):(t.$refs.yBar.setAttribute("data-p-scrollpanel-hidden","false"),!t.isUnstyled&&e.DomHandler.removeClass(t.$refs.yBar,"p-scrollpanel-hidden"),t.$refs.yBar.style.cssText="height:"+Math.max(100*t.scrollYRatio,10)+"%; top: calc("+t.$refs.content.scrollTop/s*100+"% - "+t.$refs.xBar.clientHeight+"px);right:"+r+"px;")}))},onYBarMouseDown:function(t){this.isYBarClicked=!0,this.$refs.yBar.focus(),this.lastPageY=t.pageY,this.$refs.yBar.setAttribute("data-p-scrollpanel-grabbed","true"),!this.isUnstyled&&e.DomHandler.addClass(this.$refs.yBar,"p-scrollpanel-grabbed"),document.body.setAttribute("data-p-scrollpanel-grabbed","true"),!this.isUnstyled&&e.DomHandler.addClass(document.body,"p-scrollpanel-grabbed"),this.bindDocumentMouseListeners(),t.preventDefault()},onXBarMouseDown:function(t){this.isXBarClicked=!0,this.$refs.xBar.focus(),this.lastPageX=t.pageX,this.$refs.yBar.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&e.DomHandler.addClass(this.$refs.xBar,"p-scrollpanel-grabbed"),document.body.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&e.DomHandler.addClass(document.body,"p-scrollpanel-grabbed"),this.bindDocumentMouseListeners(),t.preventDefault()},onScroll:function(e){this.lastScrollLeft!==e.target.scrollLeft?(this.lastScrollLeft=e.target.scrollLeft,this.orientation="horizontal"):this.lastScrollTop!==e.target.scrollTop&&(this.lastScrollTop=e.target.scrollTop,this.orientation="vertical"),this.moveBar()},onKeyDown:function(e){if("vertical"===this.orientation)switch(e.code){case"ArrowDown":this.setTimer("scrollTop",this.step),e.preventDefault();break;case"ArrowUp":this.setTimer("scrollTop",-1*this.step),e.preventDefault();break;case"ArrowLeft":case"ArrowRight":e.preventDefault()}else if("horizontal"===this.orientation)switch(e.code){case"ArrowRight":this.setTimer("scrollLeft",this.step),e.preventDefault();break;case"ArrowLeft":this.setTimer("scrollLeft",-1*this.step),e.preventDefault();break;case"ArrowDown":case"ArrowUp":e.preventDefault()}},onKeyUp:function(){this.clearTimer()},repeat:function(e,t){this.$refs.content[e]+=t,this.moveBar()},setTimer:function(e,t){var n=this;this.clearTimer(),this.timer=setTimeout((function(){n.repeat(e,t)}),40)},clearTimer:function(){this.timer&&clearTimeout(this.timer)},onDocumentMouseMove:function(e){this.isXBarClicked?this.onMouseMoveForXBar(e):(this.isYBarClicked||this.onMouseMoveForXBar(e),this.onMouseMoveForYBar(e))},onMouseMoveForXBar:function(e){var t=this,n=e.pageX-this.lastPageX;this.lastPageX=e.pageX,this.frame=this.requestAnimationFrame((function(){t.$refs.content.scrollLeft+=n/t.scrollXRatio}))},onMouseMoveForYBar:function(e){var t=this,n=e.pageY-this.lastPageY;this.lastPageY=e.pageY,this.frame=this.requestAnimationFrame((function(){t.$refs.content.scrollTop+=n/t.scrollYRatio}))},onFocus:function(e){this.$refs.xBar.isSameNode(e.target)?this.orientation="horizontal":this.$refs.yBar.isSameNode(e.target)&&(this.orientation="vertical")},onBlur:function(){"horizontal"===this.orientation&&(this.orientation="vertical")},onDocumentMouseUp:function(){this.$refs.yBar.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&e.DomHandler.removeClass(this.$refs.yBar,"p-scrollpanel-grabbed"),this.$refs.xBar.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&e.DomHandler.removeClass(this.$refs.xBar,"p-scrollpanel-grabbed"),document.body.setAttribute("data-p-scrollpanel-grabbed","false"),!this.isUnstyled&&e.DomHandler.removeClass(document.body,"p-scrollpanel-grabbed"),this.unbindDocumentMouseListeners(),this.isXBarClicked=!1,this.isYBarClicked=!1},requestAnimationFrame:function(e){return(window.requestAnimationFrame||this.timeoutFrame)(e)},refresh:function(){this.moveBar()},scrollTop:function(e){var t=this.$refs.content.scrollHeight-this.$refs.content.clientHeight;this.$refs.content.scrollTop=e=e>t?t:e>0?e:0},timeoutFrame:function(e){setTimeout(e,0)},bindDocumentMouseListeners:function(){var e=this;this.documentMouseMoveListener||(this.documentMouseMoveListener=function(t){e.onDocumentMouseMove(t)},document.addEventListener("mousemove",this.documentMouseMoveListener)),this.documentMouseUpListener||(this.documentMouseUpListener=function(t){e.onDocumentMouseUp(t)},document.addEventListener("mouseup",this.documentMouseUpListener))},unbindDocumentMouseListeners:function(){this.documentMouseMoveListener&&(document.removeEventListener("mousemove",this.documentMouseMoveListener),this.documentMouseMoveListener=null),this.documentMouseUpListener&&(document.removeEventListener("mouseup",this.documentMouseUpListener),this.documentMouseUpListener=null)},bindDocumentResizeListener:function(){var e=this;this.documentResizeListener||(this.documentResizeListener=function(){e.moveBar()},window.addEventListener("resize",this.documentResizeListener))},unbindDocumentResizeListener:function(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)}}},l=["aria-valuenow"],c=["aria-valuenow"];return a.render=function(e,t,n,s,r,i){return o.openBlock(),o.createElementBlock("div",o.mergeProps({class:e.cx("root")},e.ptm("root"),{"data-pc-name":"scrollpanel"}),[o.createElementVNode("div",o.mergeProps({class:e.cx("wrapper")},e.ptm("wrapper")),[o.createElementVNode("div",o.mergeProps({ref:"content",class:e.cx("content"),onScroll:t[0]||(t[0]=function(){return i.onScroll&&i.onScroll.apply(i,arguments)}),onMouseenter:t[1]||(t[1]=function(){return i.moveBar&&i.moveBar.apply(i,arguments)})},e.ptm("content")),[o.renderSlot(e.$slots,"default")],16)],16),o.createElementVNode("div",o.mergeProps({ref:"xBar",class:e.cx("barx"),tabindex:"0",role:"scrollbar","aria-orientation":"horizontal","aria-valuenow":r.lastScrollLeft,onMousedown:t[2]||(t[2]=function(){return i.onXBarMouseDown&&i.onXBarMouseDown.apply(i,arguments)}),onKeydown:t[3]||(t[3]=function(e){return i.onKeyDown(e)}),onKeyup:t[4]||(t[4]=function(){return i.onKeyUp&&i.onKeyUp.apply(i,arguments)}),onFocus:t[5]||(t[5]=function(){return i.onFocus&&i.onFocus.apply(i,arguments)}),onBlur:t[6]||(t[6]=function(){return i.onBlur&&i.onBlur.apply(i,arguments)})},e.ptm("barx"),{"data-pc-group-section":"bar"}),null,16,l),o.createElementVNode("div",o.mergeProps({ref:"yBar",class:e.cx("bary"),tabindex:"0",role:"scrollbar","aria-orientation":"vertical","aria-valuenow":r.lastScrollTop,onMousedown:t[7]||(t[7]=function(){return i.onYBarMouseDown&&i.onYBarMouseDown.apply(i,arguments)}),onKeydown:t[8]||(t[8]=function(e){return i.onKeyDown(e)}),onKeyup:t[9]||(t[9]=function(){return i.onKeyUp&&i.onKeyUp.apply(i,arguments)}),onFocus:t[10]||(t[10]=function(){return i.onFocus&&i.onFocus.apply(i,arguments)})},e.ptm("bary"),{"data-pc-group-section":"bar"}),null,16,c)],16)},a}(primevue.utils,primevue.basecomponent,primevue.usestyle,Vue);
|
package/sidebar/Sidebar.vue
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<div v-if="$slots.header" :class="cx('headerContent')" v-bind="ptm('headerContent')">
|
|
8
8
|
<slot name="header"></slot>
|
|
9
9
|
</div>
|
|
10
|
-
<button v-if="showCloseIcon" :ref="closeButtonRef" v-ripple autofocus type="button" :class="cx('closeButton')" :aria-label="closeAriaLabel" @click="hide" v-bind="ptm('closeButton')">
|
|
10
|
+
<button v-if="showCloseIcon" :ref="closeButtonRef" v-ripple autofocus type="button" :class="cx('closeButton')" :aria-label="closeAriaLabel" @click="hide" v-bind="ptm('closeButton')" data-pc-group-section="iconcontainer">
|
|
11
11
|
<slot name="closeicon">
|
|
12
12
|
<component :is="closeIcon ? 'span' : 'TimesIcon'" :class="[cx('closeIcon'), closeIcon]" v-bind="ptm('closeIcon')"></component>
|
|
13
13
|
</slot>
|
package/sidebar/sidebar.cjs.js
CHANGED
|
@@ -331,7 +331,9 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
331
331
|
onClick: _cache[0] || (_cache[0] = function () {
|
|
332
332
|
return $options.hide && $options.hide.apply($options, arguments);
|
|
333
333
|
})
|
|
334
|
-
}, _ctx.ptm('closeButton')
|
|
334
|
+
}, _ctx.ptm('closeButton'), {
|
|
335
|
+
"data-pc-group-section": "iconcontainer"
|
|
336
|
+
}), [vue.renderSlot(_ctx.$slots, "closeicon", {}, function () {
|
|
335
337
|
return [(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.closeIcon ? 'span' : 'TimesIcon'), vue.mergeProps({
|
|
336
338
|
"class": [_ctx.cx('closeIcon'), _ctx.closeIcon]
|
|
337
339
|
}, _ctx.ptm('closeIcon')), null, 16, ["class"]))];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("primevue/focustrap"),n=require("primevue/icons/times"),t=require("primevue/portal"),i=require("primevue/ripple"),r=require("primevue/utils"),o=require("primevue/basecomponent"),s=require("primevue/usestyle"),a=require("vue");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=l(e),c=l(n),p=l(t),u=l(i),f=l(o),m=s.useStyle("\n.p-sidebar-mask {\n display: none;\n pointer-events: none;\n background-color: transparent;\n transition-property: background-color;\n}\n\n.p-sidebar-mask.p-component-overlay {\n pointer-events: auto;\n}\n\n.p-sidebar-visible {\n display: flex;\n}\n\n.p-sidebar {\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n transform: translate3d(0px, 0px, 0px);\n position: relative;\n transition: transform 0.3s;\n}\n\n.p-sidebar-content {\n overflow-y: auto;\n flex-grow: 1;\n}\n\n.p-sidebar-header {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n flex-shrink: 0;\n}\n\n.p-sidebar-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n}\n\n.p-sidebar-full .p-sidebar {\n transition: none;\n transform: none;\n width: 100vw !important;\n height: 100vh !important;\n max-height: 100%;\n top: 0px !important;\n left: 0px !important;\n}\n\n/* Animation */\n/* Center */\n.p-sidebar-left .p-sidebar-enter-from,\n.p-sidebar-left .p-sidebar-leave-to {\n transform: translateX(-100%);\n}\n.p-sidebar-right .p-sidebar-enter-from,\n.p-sidebar-right .p-sidebar-leave-to {\n transform: translateX(100%);\n}\n.p-sidebar-top .p-sidebar-enter-from,\n.p-sidebar-top .p-sidebar-leave-to {\n transform: translateY(-100%);\n}\n.p-sidebar-bottom .p-sidebar-enter-from,\n.p-sidebar-bottom .p-sidebar-leave-to {\n transform: translateY(100%);\n}\n.p-sidebar-full .p-sidebar-enter-from,\n.p-sidebar-full .p-sidebar-leave-to {\n opacity: 0;\n}\n.p-sidebar-full .p-sidebar-enter-active,\n.p-sidebar-full .p-sidebar-leave-active {\n transition: opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1);\n}\n\n/* Size */\n.p-sidebar-left .p-sidebar {\n width: 20rem;\n height: 100%;\n}\n\n.p-sidebar-right .p-sidebar {\n width: 20rem;\n height: 100%;\n}\n\n.p-sidebar-top .p-sidebar {\n height: 10rem;\n width: 100%;\n}\n\n.p-sidebar-bottom .p-sidebar {\n height: 10rem;\n width: 100%;\n}\n\n.p-sidebar-left .p-sidebar-sm,\n.p-sidebar-right .p-sidebar-sm {\n width: 20rem;\n}\n\n.p-sidebar-left .p-sidebar-md,\n.p-sidebar-right .p-sidebar-md {\n width: 40rem;\n}\n\n.p-sidebar-left .p-sidebar-lg,\n.p-sidebar-right .p-sidebar-lg {\n width: 60rem;\n}\n\n.p-sidebar-top .p-sidebar-sm,\n.p-sidebar-bottom .p-sidebar-sm {\n height: 10rem;\n}\n\n.p-sidebar-top .p-sidebar-md,\n.p-sidebar-bottom .p-sidebar-md {\n height: 20rem;\n}\n\n.p-sidebar-top .p-sidebar-lg,\n.p-sidebar-bottom .p-sidebar-lg {\n height: 30rem;\n}\n\n.p-sidebar-left .p-sidebar-content,\n.p-sidebar-right .p-sidebar-content,\n.p-sidebar-top .p-sidebar-content,\n.p-sidebar-bottom .p-sidebar-content {\n width: 100%;\n height: 100%;\n}\n\n@media screen and (max-width: 64em) {\n .p-sidebar-left .p-sidebar-lg,\n .p-sidebar-left .p-sidebar-md,\n .p-sidebar-right .p-sidebar-lg,\n .p-sidebar-right .p-sidebar-md {\n width: 20rem;\n }\n}\n",{name:"sidebar",manual:!0}),b={name:"Sidebar",extends:{name:"BaseSidebar",extends:f.default,props:{visible:{type:Boolean,default:!1},position:{type:String,default:"left"},baseZIndex:{type:Number,default:0},autoZIndex:{type:Boolean,default:!0},dismissable:{type:Boolean,default:!0},showCloseIcon:{type:Boolean,default:!0},closeIcon:{type:String,default:void 0},modal:{type:Boolean,default:!0},blockScroll:{type:Boolean,default:!1}},css:{classes:{mask:function(e){var n=e.instance,t=e.props,i=["left","right","top","bottom"].find((function(e){return e===t.position}));return["p-sidebar-mask",{"p-component-overlay p-component-overlay-enter":t.modal,"p-sidebar-mask-scrollblocker":t.blockScroll,"p-sidebar-visible":n.containerVisible,"p-sidebar-full":n.fullScreen},i?"p-sidebar-".concat(i):""]},root:function(e){var n=e.instance;return["p-sidebar p-component",{"p-input-filled":"filled"===n.$primevue.config.inputStyle,"p-ripple-disabled":!1===n.$primevue.config.ripple,"p-sidebar-full":n.fullScreen}]},header:"p-sidebar-header",headerContent:"p-sidebar-header-content",closeButton:"p-sidebar-close p-sidebar-icon p-link",closeIcon:"p-sidebar-close-icon",content:"p-sidebar-content"},inlineStyles:{mask:function(e){var n=e.position;return{position:"fixed",height:"100%",width:"100%",left:0,top:0,display:"flex",justifyContent:"left"===n?"flex-start":"right"===n?"flex-end":"center",alignItems:"top"===n?"flex-start":"bottom"===n?"flex-end":"center"}}},loadStyle:m.load},provide:function(){return{$parentInstance:this}}},inheritAttrs:!1,emits:["update:visible","show","hide","after-hide"],data:function(){return{containerVisible:this.visible}},container:null,mask:null,content:null,headerContainer:null,closeButton:null,outsideClickListener:null,updated:function(){this.visible&&(this.containerVisible=this.visible)},beforeUnmount:function(){this.disableDocumentSettings(),this.mask&&this.autoZIndex&&r.ZIndexUtils.clear(this.mask),this.container=null,this.mask=null},methods:{hide:function(){this.$emit("update:visible",!1)},onEnter:function(){this.$emit("show"),this.focus(),this.autoZIndex&&r.ZIndexUtils.set("modal",this.mask,this.baseZIndex||this.$primevue.config.zIndex.modal)},onAfterEnter:function(){this.enableDocumentSettings()},onBeforeLeave:function(){this.modal&&!this.isUnstyled&&r.DomHandler.addClass(this.mask,"p-component-overlay-leave")},onLeave:function(){this.$emit("hide")},onAfterLeave:function(){this.autoZIndex&&r.ZIndexUtils.clear(this.mask),this.containerVisible=!1,this.disableDocumentSettings(),this.$emit("after-hide")},onMaskClick:function(e){this.dismissable&&this.modal&&this.mask===e.target&&this.hide()},focus:function(){var e=function(e){return e.querySelector("[autofocus]")},n=this.$slots.default&&e(this.content);n||(n=this.$slots.header&&e(this.headerContainer))||(n=e(this.container)),n&&n.focus()},enableDocumentSettings:function(){this.dismissable&&!this.modal&&this.bindOutsideClickListener(),this.blockScroll&&r.DomHandler.addClass(document.body,"p-overflow-hidden")},disableDocumentSettings:function(){this.unbindOutsideClickListener(),this.blockScroll&&r.DomHandler.removeClass(document.body,"p-overflow-hidden")},onKeydown:function(e){"Escape"===e.code&&this.hide()},containerRef:function(e){this.container=e},maskRef:function(e){this.mask=e},contentRef:function(e){this.content=e},headerContainerRef:function(e){this.headerContainer=e},closeButtonRef:function(e){this.closeButton=e},bindOutsideClickListener:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(n){e.isOutsideClicked(n)&&e.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},isOutsideClicked:function(e){return this.container&&!this.container.contains(e.target)}},computed:{fullScreen:function(){return"full"===this.position},closeAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.close:void 0}},directives:{focustrap:d.default,ripple:u.default},components:{Portal:p.default,TimesIcon:c.default}};function h(e){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h(e)}function v(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function y(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?v(Object(t),!0).forEach((function(n){k(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):v(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function k(e,n,t){return(n=g(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function g(e){var n=x(e,"string");return"symbol"===h(n)?n:String(n)}function x(e,n){if("object"!==h(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,n||"default");if("object"!==h(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}var w=["aria-modal"],C=["aria-label"];b.render=function(e,n,t,i,r,o){var s=a.resolveComponent("Portal"),l=a.resolveDirective("ripple"),d=a.resolveDirective("focustrap");return a.openBlock(),a.createBlock(s,null,{default:a.withCtx((function(){return[r.containerVisible?(a.openBlock(),a.createElementBlock("div",a.mergeProps({key:0,ref:o.maskRef,onMousedown:n[2]||(n[2]=function(){return o.onMaskClick&&o.onMaskClick.apply(o,arguments)}),class:e.cx("mask"),style:e.sx("mask",!0,{position:e.position})},e.ptm("mask")),[a.createVNode(a.Transition,{name:"p-sidebar",onEnter:o.onEnter,onAfterEnter:o.onAfterEnter,onBeforeLeave:o.onBeforeLeave,onLeave:o.onLeave,onAfterLeave:o.onAfterLeave,appear:""},{default:a.withCtx((function(){return[e.visible?a.withDirectives((a.openBlock(),a.createElementBlock("div",a.mergeProps({key:0,ref:o.containerRef,class:e.cx("root"),role:"complementary","aria-modal":e.modal,onKeydown:n[1]||(n[1]=function(){return o.onKeydown&&o.onKeydown.apply(o,arguments)})},y(y({},e.$attrs),e.ptm("root"))),[a.createElementVNode("div",a.mergeProps({ref:o.headerContainerRef,class:e.cx("header")},e.ptm("header")),[e.$slots.header?(a.openBlock(),a.createElementBlock("div",a.mergeProps({key:0,class:e.cx("headerContent")},e.ptm("headerContent")),[a.renderSlot(e.$slots,"header")],16)):a.createCommentVNode("",!0),e.showCloseIcon?a.withDirectives((a.openBlock(),a.createElementBlock("button",a.mergeProps({key:1,ref:o.closeButtonRef,autofocus:"",type:"button",class:e.cx("closeButton"),"aria-label":o.closeAriaLabel,onClick:n[0]||(n[0]=function(){return o.hide&&o.hide.apply(o,arguments)})},e.ptm("closeButton")),[a.renderSlot(e.$slots,"closeicon",{},(function(){return[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(e.closeIcon?"span":"TimesIcon"),a.mergeProps({class:[e.cx("closeIcon"),e.closeIcon]},e.ptm("closeIcon")),null,16,["class"]))]}))],16,C)),[[l]]):a.createCommentVNode("",!0)],16),a.createElementVNode("div",a.mergeProps({ref:o.contentRef,class:e.cx("content")},e.ptm("content")),[a.renderSlot(e.$slots,"default")],16)],16,w)),[[d]]):a.createCommentVNode("",!0)]})),_:3},8,["onEnter","onAfterEnter","onBeforeLeave","onLeave","onAfterLeave"])],16)):a.createCommentVNode("",!0)]})),_:3})},module.exports=b;
|
|
1
|
+
"use strict";var e=require("primevue/focustrap"),n=require("primevue/icons/times"),t=require("primevue/portal"),i=require("primevue/ripple"),r=require("primevue/utils"),o=require("primevue/basecomponent"),s=require("primevue/usestyle"),a=require("vue");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=l(e),c=l(n),p=l(t),u=l(i),f=l(o),m=s.useStyle("\n.p-sidebar-mask {\n display: none;\n pointer-events: none;\n background-color: transparent;\n transition-property: background-color;\n}\n\n.p-sidebar-mask.p-component-overlay {\n pointer-events: auto;\n}\n\n.p-sidebar-visible {\n display: flex;\n}\n\n.p-sidebar {\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n transform: translate3d(0px, 0px, 0px);\n position: relative;\n transition: transform 0.3s;\n}\n\n.p-sidebar-content {\n overflow-y: auto;\n flex-grow: 1;\n}\n\n.p-sidebar-header {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n flex-shrink: 0;\n}\n\n.p-sidebar-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n}\n\n.p-sidebar-full .p-sidebar {\n transition: none;\n transform: none;\n width: 100vw !important;\n height: 100vh !important;\n max-height: 100%;\n top: 0px !important;\n left: 0px !important;\n}\n\n/* Animation */\n/* Center */\n.p-sidebar-left .p-sidebar-enter-from,\n.p-sidebar-left .p-sidebar-leave-to {\n transform: translateX(-100%);\n}\n.p-sidebar-right .p-sidebar-enter-from,\n.p-sidebar-right .p-sidebar-leave-to {\n transform: translateX(100%);\n}\n.p-sidebar-top .p-sidebar-enter-from,\n.p-sidebar-top .p-sidebar-leave-to {\n transform: translateY(-100%);\n}\n.p-sidebar-bottom .p-sidebar-enter-from,\n.p-sidebar-bottom .p-sidebar-leave-to {\n transform: translateY(100%);\n}\n.p-sidebar-full .p-sidebar-enter-from,\n.p-sidebar-full .p-sidebar-leave-to {\n opacity: 0;\n}\n.p-sidebar-full .p-sidebar-enter-active,\n.p-sidebar-full .p-sidebar-leave-active {\n transition: opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1);\n}\n\n/* Size */\n.p-sidebar-left .p-sidebar {\n width: 20rem;\n height: 100%;\n}\n\n.p-sidebar-right .p-sidebar {\n width: 20rem;\n height: 100%;\n}\n\n.p-sidebar-top .p-sidebar {\n height: 10rem;\n width: 100%;\n}\n\n.p-sidebar-bottom .p-sidebar {\n height: 10rem;\n width: 100%;\n}\n\n.p-sidebar-left .p-sidebar-sm,\n.p-sidebar-right .p-sidebar-sm {\n width: 20rem;\n}\n\n.p-sidebar-left .p-sidebar-md,\n.p-sidebar-right .p-sidebar-md {\n width: 40rem;\n}\n\n.p-sidebar-left .p-sidebar-lg,\n.p-sidebar-right .p-sidebar-lg {\n width: 60rem;\n}\n\n.p-sidebar-top .p-sidebar-sm,\n.p-sidebar-bottom .p-sidebar-sm {\n height: 10rem;\n}\n\n.p-sidebar-top .p-sidebar-md,\n.p-sidebar-bottom .p-sidebar-md {\n height: 20rem;\n}\n\n.p-sidebar-top .p-sidebar-lg,\n.p-sidebar-bottom .p-sidebar-lg {\n height: 30rem;\n}\n\n.p-sidebar-left .p-sidebar-content,\n.p-sidebar-right .p-sidebar-content,\n.p-sidebar-top .p-sidebar-content,\n.p-sidebar-bottom .p-sidebar-content {\n width: 100%;\n height: 100%;\n}\n\n@media screen and (max-width: 64em) {\n .p-sidebar-left .p-sidebar-lg,\n .p-sidebar-left .p-sidebar-md,\n .p-sidebar-right .p-sidebar-lg,\n .p-sidebar-right .p-sidebar-md {\n width: 20rem;\n }\n}\n",{name:"sidebar",manual:!0}),b={name:"Sidebar",extends:{name:"BaseSidebar",extends:f.default,props:{visible:{type:Boolean,default:!1},position:{type:String,default:"left"},baseZIndex:{type:Number,default:0},autoZIndex:{type:Boolean,default:!0},dismissable:{type:Boolean,default:!0},showCloseIcon:{type:Boolean,default:!0},closeIcon:{type:String,default:void 0},modal:{type:Boolean,default:!0},blockScroll:{type:Boolean,default:!1}},css:{classes:{mask:function(e){var n=e.instance,t=e.props,i=["left","right","top","bottom"].find((function(e){return e===t.position}));return["p-sidebar-mask",{"p-component-overlay p-component-overlay-enter":t.modal,"p-sidebar-mask-scrollblocker":t.blockScroll,"p-sidebar-visible":n.containerVisible,"p-sidebar-full":n.fullScreen},i?"p-sidebar-".concat(i):""]},root:function(e){var n=e.instance;return["p-sidebar p-component",{"p-input-filled":"filled"===n.$primevue.config.inputStyle,"p-ripple-disabled":!1===n.$primevue.config.ripple,"p-sidebar-full":n.fullScreen}]},header:"p-sidebar-header",headerContent:"p-sidebar-header-content",closeButton:"p-sidebar-close p-sidebar-icon p-link",closeIcon:"p-sidebar-close-icon",content:"p-sidebar-content"},inlineStyles:{mask:function(e){var n=e.position;return{position:"fixed",height:"100%",width:"100%",left:0,top:0,display:"flex",justifyContent:"left"===n?"flex-start":"right"===n?"flex-end":"center",alignItems:"top"===n?"flex-start":"bottom"===n?"flex-end":"center"}}},loadStyle:m.load},provide:function(){return{$parentInstance:this}}},inheritAttrs:!1,emits:["update:visible","show","hide","after-hide"],data:function(){return{containerVisible:this.visible}},container:null,mask:null,content:null,headerContainer:null,closeButton:null,outsideClickListener:null,updated:function(){this.visible&&(this.containerVisible=this.visible)},beforeUnmount:function(){this.disableDocumentSettings(),this.mask&&this.autoZIndex&&r.ZIndexUtils.clear(this.mask),this.container=null,this.mask=null},methods:{hide:function(){this.$emit("update:visible",!1)},onEnter:function(){this.$emit("show"),this.focus(),this.autoZIndex&&r.ZIndexUtils.set("modal",this.mask,this.baseZIndex||this.$primevue.config.zIndex.modal)},onAfterEnter:function(){this.enableDocumentSettings()},onBeforeLeave:function(){this.modal&&!this.isUnstyled&&r.DomHandler.addClass(this.mask,"p-component-overlay-leave")},onLeave:function(){this.$emit("hide")},onAfterLeave:function(){this.autoZIndex&&r.ZIndexUtils.clear(this.mask),this.containerVisible=!1,this.disableDocumentSettings(),this.$emit("after-hide")},onMaskClick:function(e){this.dismissable&&this.modal&&this.mask===e.target&&this.hide()},focus:function(){var e=function(e){return e.querySelector("[autofocus]")},n=this.$slots.default&&e(this.content);n||(n=this.$slots.header&&e(this.headerContainer))||(n=e(this.container)),n&&n.focus()},enableDocumentSettings:function(){this.dismissable&&!this.modal&&this.bindOutsideClickListener(),this.blockScroll&&r.DomHandler.addClass(document.body,"p-overflow-hidden")},disableDocumentSettings:function(){this.unbindOutsideClickListener(),this.blockScroll&&r.DomHandler.removeClass(document.body,"p-overflow-hidden")},onKeydown:function(e){"Escape"===e.code&&this.hide()},containerRef:function(e){this.container=e},maskRef:function(e){this.mask=e},contentRef:function(e){this.content=e},headerContainerRef:function(e){this.headerContainer=e},closeButtonRef:function(e){this.closeButton=e},bindOutsideClickListener:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(n){e.isOutsideClicked(n)&&e.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},isOutsideClicked:function(e){return this.container&&!this.container.contains(e.target)}},computed:{fullScreen:function(){return"full"===this.position},closeAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.close:void 0}},directives:{focustrap:d.default,ripple:u.default},components:{Portal:p.default,TimesIcon:c.default}};function h(e){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h(e)}function v(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function y(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?v(Object(t),!0).forEach((function(n){g(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):v(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function g(e,n,t){return(n=k(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function k(e){var n=x(e,"string");return"symbol"===h(n)?n:String(n)}function x(e,n){if("object"!==h(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,n||"default");if("object"!==h(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}var w=["aria-modal"],C=["aria-label"];b.render=function(e,n,t,i,r,o){var s=a.resolveComponent("Portal"),l=a.resolveDirective("ripple"),d=a.resolveDirective("focustrap");return a.openBlock(),a.createBlock(s,null,{default:a.withCtx((function(){return[r.containerVisible?(a.openBlock(),a.createElementBlock("div",a.mergeProps({key:0,ref:o.maskRef,onMousedown:n[2]||(n[2]=function(){return o.onMaskClick&&o.onMaskClick.apply(o,arguments)}),class:e.cx("mask"),style:e.sx("mask",!0,{position:e.position})},e.ptm("mask")),[a.createVNode(a.Transition,{name:"p-sidebar",onEnter:o.onEnter,onAfterEnter:o.onAfterEnter,onBeforeLeave:o.onBeforeLeave,onLeave:o.onLeave,onAfterLeave:o.onAfterLeave,appear:""},{default:a.withCtx((function(){return[e.visible?a.withDirectives((a.openBlock(),a.createElementBlock("div",a.mergeProps({key:0,ref:o.containerRef,class:e.cx("root"),role:"complementary","aria-modal":e.modal,onKeydown:n[1]||(n[1]=function(){return o.onKeydown&&o.onKeydown.apply(o,arguments)})},y(y({},e.$attrs),e.ptm("root"))),[a.createElementVNode("div",a.mergeProps({ref:o.headerContainerRef,class:e.cx("header")},e.ptm("header")),[e.$slots.header?(a.openBlock(),a.createElementBlock("div",a.mergeProps({key:0,class:e.cx("headerContent")},e.ptm("headerContent")),[a.renderSlot(e.$slots,"header")],16)):a.createCommentVNode("",!0),e.showCloseIcon?a.withDirectives((a.openBlock(),a.createElementBlock("button",a.mergeProps({key:1,ref:o.closeButtonRef,autofocus:"",type:"button",class:e.cx("closeButton"),"aria-label":o.closeAriaLabel,onClick:n[0]||(n[0]=function(){return o.hide&&o.hide.apply(o,arguments)})},e.ptm("closeButton"),{"data-pc-group-section":"iconcontainer"}),[a.renderSlot(e.$slots,"closeicon",{},(function(){return[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(e.closeIcon?"span":"TimesIcon"),a.mergeProps({class:[e.cx("closeIcon"),e.closeIcon]},e.ptm("closeIcon")),null,16,["class"]))]}))],16,C)),[[l]]):a.createCommentVNode("",!0)],16),a.createElementVNode("div",a.mergeProps({ref:o.contentRef,class:e.cx("content")},e.ptm("content")),[a.renderSlot(e.$slots,"default")],16)],16,w)),[[d]]):a.createCommentVNode("",!0)]})),_:3},8,["onEnter","onAfterEnter","onBeforeLeave","onLeave","onAfterLeave"])],16)):a.createCommentVNode("",!0)]})),_:3})},module.exports=b;
|
package/sidebar/sidebar.esm.js
CHANGED
|
@@ -321,7 +321,9 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
321
321
|
onClick: _cache[0] || (_cache[0] = function () {
|
|
322
322
|
return $options.hide && $options.hide.apply($options, arguments);
|
|
323
323
|
})
|
|
324
|
-
}, _ctx.ptm('closeButton')
|
|
324
|
+
}, _ctx.ptm('closeButton'), {
|
|
325
|
+
"data-pc-group-section": "iconcontainer"
|
|
326
|
+
}), [renderSlot(_ctx.$slots, "closeicon", {}, function () {
|
|
325
327
|
return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.closeIcon ? 'span' : 'TimesIcon'), mergeProps({
|
|
326
328
|
"class": [_ctx.cx('closeIcon'), _ctx.closeIcon]
|
|
327
329
|
}, _ctx.ptm('closeIcon')), null, 16, ["class"]))];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"primevue/focustrap";import n from"primevue/icons/times";import t from"primevue/portal";import i from"primevue/ripple";import{ZIndexUtils as r,DomHandler as o}from"primevue/utils";import s from"primevue/basecomponent";import{useStyle as a}from"primevue/usestyle";import{resolveComponent as l,resolveDirective as d,openBlock as p,createBlock as c,withCtx as u,createElementBlock as f,mergeProps as b,createVNode as m,Transition as h,withDirectives as v,createElementVNode as y,renderSlot as g,createCommentVNode as k,resolveDynamicComponent as x}from"vue";var w=a("\n.p-sidebar-mask {\n display: none;\n pointer-events: none;\n background-color: transparent;\n transition-property: background-color;\n}\n\n.p-sidebar-mask.p-component-overlay {\n pointer-events: auto;\n}\n\n.p-sidebar-visible {\n display: flex;\n}\n\n.p-sidebar {\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n transform: translate3d(0px, 0px, 0px);\n position: relative;\n transition: transform 0.3s;\n}\n\n.p-sidebar-content {\n overflow-y: auto;\n flex-grow: 1;\n}\n\n.p-sidebar-header {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n flex-shrink: 0;\n}\n\n.p-sidebar-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n}\n\n.p-sidebar-full .p-sidebar {\n transition: none;\n transform: none;\n width: 100vw !important;\n height: 100vh !important;\n max-height: 100%;\n top: 0px !important;\n left: 0px !important;\n}\n\n/* Animation */\n/* Center */\n.p-sidebar-left .p-sidebar-enter-from,\n.p-sidebar-left .p-sidebar-leave-to {\n transform: translateX(-100%);\n}\n.p-sidebar-right .p-sidebar-enter-from,\n.p-sidebar-right .p-sidebar-leave-to {\n transform: translateX(100%);\n}\n.p-sidebar-top .p-sidebar-enter-from,\n.p-sidebar-top .p-sidebar-leave-to {\n transform: translateY(-100%);\n}\n.p-sidebar-bottom .p-sidebar-enter-from,\n.p-sidebar-bottom .p-sidebar-leave-to {\n transform: translateY(100%);\n}\n.p-sidebar-full .p-sidebar-enter-from,\n.p-sidebar-full .p-sidebar-leave-to {\n opacity: 0;\n}\n.p-sidebar-full .p-sidebar-enter-active,\n.p-sidebar-full .p-sidebar-leave-active {\n transition: opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1);\n}\n\n/* Size */\n.p-sidebar-left .p-sidebar {\n width: 20rem;\n height: 100%;\n}\n\n.p-sidebar-right .p-sidebar {\n width: 20rem;\n height: 100%;\n}\n\n.p-sidebar-top .p-sidebar {\n height: 10rem;\n width: 100%;\n}\n\n.p-sidebar-bottom .p-sidebar {\n height: 10rem;\n width: 100%;\n}\n\n.p-sidebar-left .p-sidebar-sm,\n.p-sidebar-right .p-sidebar-sm {\n width: 20rem;\n}\n\n.p-sidebar-left .p-sidebar-md,\n.p-sidebar-right .p-sidebar-md {\n width: 40rem;\n}\n\n.p-sidebar-left .p-sidebar-lg,\n.p-sidebar-right .p-sidebar-lg {\n width: 60rem;\n}\n\n.p-sidebar-top .p-sidebar-sm,\n.p-sidebar-bottom .p-sidebar-sm {\n height: 10rem;\n}\n\n.p-sidebar-top .p-sidebar-md,\n.p-sidebar-bottom .p-sidebar-md {\n height: 20rem;\n}\n\n.p-sidebar-top .p-sidebar-lg,\n.p-sidebar-bottom .p-sidebar-lg {\n height: 30rem;\n}\n\n.p-sidebar-left .p-sidebar-content,\n.p-sidebar-right .p-sidebar-content,\n.p-sidebar-top .p-sidebar-content,\n.p-sidebar-bottom .p-sidebar-content {\n width: 100%;\n height: 100%;\n}\n\n@media screen and (max-width: 64em) {\n .p-sidebar-left .p-sidebar-lg,\n .p-sidebar-left .p-sidebar-md,\n .p-sidebar-right .p-sidebar-lg,\n .p-sidebar-right .p-sidebar-md {\n width: 20rem;\n }\n}\n",{name:"sidebar",manual:!0}),C={name:"Sidebar",extends:{name:"BaseSidebar",extends:s,props:{visible:{type:Boolean,default:!1},position:{type:String,default:"left"},baseZIndex:{type:Number,default:0},autoZIndex:{type:Boolean,default:!0},dismissable:{type:Boolean,default:!0},showCloseIcon:{type:Boolean,default:!0},closeIcon:{type:String,default:void 0},modal:{type:Boolean,default:!0},blockScroll:{type:Boolean,default:!1}},css:{classes:{mask:function(e){var n=e.instance,t=e.props,i=["left","right","top","bottom"].find((function(e){return e===t.position}));return["p-sidebar-mask",{"p-component-overlay p-component-overlay-enter":t.modal,"p-sidebar-mask-scrollblocker":t.blockScroll,"p-sidebar-visible":n.containerVisible,"p-sidebar-full":n.fullScreen},i?"p-sidebar-".concat(i):""]},root:function(e){var n=e.instance;return["p-sidebar p-component",{"p-input-filled":"filled"===n.$primevue.config.inputStyle,"p-ripple-disabled":!1===n.$primevue.config.ripple,"p-sidebar-full":n.fullScreen}]},header:"p-sidebar-header",headerContent:"p-sidebar-header-content",closeButton:"p-sidebar-close p-sidebar-icon p-link",closeIcon:"p-sidebar-close-icon",content:"p-sidebar-content"},inlineStyles:{mask:function(e){var n=e.position;return{position:"fixed",height:"100%",width:"100%",left:0,top:0,display:"flex",justifyContent:"left"===n?"flex-start":"right"===n?"flex-end":"center",alignItems:"top"===n?"flex-start":"bottom"===n?"flex-end":"center"}}},loadStyle:w.load},provide:function(){return{$parentInstance:this}}},inheritAttrs:!1,emits:["update:visible","show","hide","after-hide"],data:function(){return{containerVisible:this.visible}},container:null,mask:null,content:null,headerContainer:null,closeButton:null,outsideClickListener:null,updated:function(){this.visible&&(this.containerVisible=this.visible)},beforeUnmount:function(){this.disableDocumentSettings(),this.mask&&this.autoZIndex&&r.clear(this.mask),this.container=null,this.mask=null},methods:{hide:function(){this.$emit("update:visible",!1)},onEnter:function(){this.$emit("show"),this.focus(),this.autoZIndex&&r.set("modal",this.mask,this.baseZIndex||this.$primevue.config.zIndex.modal)},onAfterEnter:function(){this.enableDocumentSettings()},onBeforeLeave:function(){this.modal&&!this.isUnstyled&&o.addClass(this.mask,"p-component-overlay-leave")},onLeave:function(){this.$emit("hide")},onAfterLeave:function(){this.autoZIndex&&r.clear(this.mask),this.containerVisible=!1,this.disableDocumentSettings(),this.$emit("after-hide")},onMaskClick:function(e){this.dismissable&&this.modal&&this.mask===e.target&&this.hide()},focus:function(){var e=function(e){return e.querySelector("[autofocus]")},n=this.$slots.default&&e(this.content);n||(n=this.$slots.header&&e(this.headerContainer))||(n=e(this.container)),n&&n.focus()},enableDocumentSettings:function(){this.dismissable&&!this.modal&&this.bindOutsideClickListener(),this.blockScroll&&o.addClass(document.body,"p-overflow-hidden")},disableDocumentSettings:function(){this.unbindOutsideClickListener(),this.blockScroll&&o.removeClass(document.body,"p-overflow-hidden")},onKeydown:function(e){"Escape"===e.code&&this.hide()},containerRef:function(e){this.container=e},maskRef:function(e){this.mask=e},contentRef:function(e){this.content=e},headerContainerRef:function(e){this.headerContainer=e},closeButtonRef:function(e){this.closeButton=e},bindOutsideClickListener:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(n){e.isOutsideClicked(n)&&e.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},isOutsideClicked:function(e){return this.container&&!this.container.contains(e.target)}},computed:{fullScreen:function(){return"full"===this.position},closeAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.close:void 0}},directives:{focustrap:e,ripple:i},components:{Portal:t,TimesIcon:n}};function S(e){return S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},S(e)}function L(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function O(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?L(Object(t),!0).forEach((function(n){I(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):L(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function I(e,n,t){return(n=B(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function B(e){var n=j(e,"string");return"symbol"===S(n)?n:String(n)}function j(e,n){if("object"!==S(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,n||"default");if("object"!==S(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}var $=["aria-modal"],E=["aria-label"];C.render=function(e,n,t,i,r,o){var s=l("Portal"),a=d("ripple"),w=d("focustrap");return p(),c(s,null,{default:u((function(){return[r.containerVisible?(p(),f("div",b({key:0,ref:o.maskRef,onMousedown:n[2]||(n[2]=function(){return o.onMaskClick&&o.onMaskClick.apply(o,arguments)}),class:e.cx("mask"),style:e.sx("mask",!0,{position:e.position})},e.ptm("mask")),[m(h,{name:"p-sidebar",onEnter:o.onEnter,onAfterEnter:o.onAfterEnter,onBeforeLeave:o.onBeforeLeave,onLeave:o.onLeave,onAfterLeave:o.onAfterLeave,appear:""},{default:u((function(){return[e.visible?v((p(),f("div",b({key:0,ref:o.containerRef,class:e.cx("root"),role:"complementary","aria-modal":e.modal,onKeydown:n[1]||(n[1]=function(){return o.onKeydown&&o.onKeydown.apply(o,arguments)})},O(O({},e.$attrs),e.ptm("root"))),[y("div",b({ref:o.headerContainerRef,class:e.cx("header")},e.ptm("header")),[e.$slots.header?(p(),f("div",b({key:0,class:e.cx("headerContent")},e.ptm("headerContent")),[g(e.$slots,"header")],16)):k("",!0),e.showCloseIcon?v((p(),f("button",b({key:1,ref:o.closeButtonRef,autofocus:"",type:"button",class:e.cx("closeButton"),"aria-label":o.closeAriaLabel,onClick:n[0]||(n[0]=function(){return o.hide&&o.hide.apply(o,arguments)})},e.ptm("closeButton")),[g(e.$slots,"closeicon",{},(function(){return[(p(),c(x(e.closeIcon?"span":"TimesIcon"),b({class:[e.cx("closeIcon"),e.closeIcon]},e.ptm("closeIcon")),null,16,["class"]))]}))],16,E)),[[a]]):k("",!0)],16),y("div",b({ref:o.contentRef,class:e.cx("content")},e.ptm("content")),[g(e.$slots,"default")],16)],16,$)),[[w]]):k("",!0)]})),_:3},8,["onEnter","onAfterEnter","onBeforeLeave","onLeave","onAfterLeave"])],16)):k("",!0)]})),_:3})};export{C as default};
|
|
1
|
+
import e from"primevue/focustrap";import n from"primevue/icons/times";import t from"primevue/portal";import i from"primevue/ripple";import{ZIndexUtils as r,DomHandler as o}from"primevue/utils";import s from"primevue/basecomponent";import{useStyle as a}from"primevue/usestyle";import{resolveComponent as l,resolveDirective as d,openBlock as c,createBlock as p,withCtx as u,createElementBlock as f,mergeProps as b,createVNode as m,Transition as h,withDirectives as v,createElementVNode as y,renderSlot as g,createCommentVNode as k,resolveDynamicComponent as x}from"vue";var w=a("\n.p-sidebar-mask {\n display: none;\n pointer-events: none;\n background-color: transparent;\n transition-property: background-color;\n}\n\n.p-sidebar-mask.p-component-overlay {\n pointer-events: auto;\n}\n\n.p-sidebar-visible {\n display: flex;\n}\n\n.p-sidebar {\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n transform: translate3d(0px, 0px, 0px);\n position: relative;\n transition: transform 0.3s;\n}\n\n.p-sidebar-content {\n overflow-y: auto;\n flex-grow: 1;\n}\n\n.p-sidebar-header {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n flex-shrink: 0;\n}\n\n.p-sidebar-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n}\n\n.p-sidebar-full .p-sidebar {\n transition: none;\n transform: none;\n width: 100vw !important;\n height: 100vh !important;\n max-height: 100%;\n top: 0px !important;\n left: 0px !important;\n}\n\n/* Animation */\n/* Center */\n.p-sidebar-left .p-sidebar-enter-from,\n.p-sidebar-left .p-sidebar-leave-to {\n transform: translateX(-100%);\n}\n.p-sidebar-right .p-sidebar-enter-from,\n.p-sidebar-right .p-sidebar-leave-to {\n transform: translateX(100%);\n}\n.p-sidebar-top .p-sidebar-enter-from,\n.p-sidebar-top .p-sidebar-leave-to {\n transform: translateY(-100%);\n}\n.p-sidebar-bottom .p-sidebar-enter-from,\n.p-sidebar-bottom .p-sidebar-leave-to {\n transform: translateY(100%);\n}\n.p-sidebar-full .p-sidebar-enter-from,\n.p-sidebar-full .p-sidebar-leave-to {\n opacity: 0;\n}\n.p-sidebar-full .p-sidebar-enter-active,\n.p-sidebar-full .p-sidebar-leave-active {\n transition: opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1);\n}\n\n/* Size */\n.p-sidebar-left .p-sidebar {\n width: 20rem;\n height: 100%;\n}\n\n.p-sidebar-right .p-sidebar {\n width: 20rem;\n height: 100%;\n}\n\n.p-sidebar-top .p-sidebar {\n height: 10rem;\n width: 100%;\n}\n\n.p-sidebar-bottom .p-sidebar {\n height: 10rem;\n width: 100%;\n}\n\n.p-sidebar-left .p-sidebar-sm,\n.p-sidebar-right .p-sidebar-sm {\n width: 20rem;\n}\n\n.p-sidebar-left .p-sidebar-md,\n.p-sidebar-right .p-sidebar-md {\n width: 40rem;\n}\n\n.p-sidebar-left .p-sidebar-lg,\n.p-sidebar-right .p-sidebar-lg {\n width: 60rem;\n}\n\n.p-sidebar-top .p-sidebar-sm,\n.p-sidebar-bottom .p-sidebar-sm {\n height: 10rem;\n}\n\n.p-sidebar-top .p-sidebar-md,\n.p-sidebar-bottom .p-sidebar-md {\n height: 20rem;\n}\n\n.p-sidebar-top .p-sidebar-lg,\n.p-sidebar-bottom .p-sidebar-lg {\n height: 30rem;\n}\n\n.p-sidebar-left .p-sidebar-content,\n.p-sidebar-right .p-sidebar-content,\n.p-sidebar-top .p-sidebar-content,\n.p-sidebar-bottom .p-sidebar-content {\n width: 100%;\n height: 100%;\n}\n\n@media screen and (max-width: 64em) {\n .p-sidebar-left .p-sidebar-lg,\n .p-sidebar-left .p-sidebar-md,\n .p-sidebar-right .p-sidebar-lg,\n .p-sidebar-right .p-sidebar-md {\n width: 20rem;\n }\n}\n",{name:"sidebar",manual:!0}),C={name:"Sidebar",extends:{name:"BaseSidebar",extends:s,props:{visible:{type:Boolean,default:!1},position:{type:String,default:"left"},baseZIndex:{type:Number,default:0},autoZIndex:{type:Boolean,default:!0},dismissable:{type:Boolean,default:!0},showCloseIcon:{type:Boolean,default:!0},closeIcon:{type:String,default:void 0},modal:{type:Boolean,default:!0},blockScroll:{type:Boolean,default:!1}},css:{classes:{mask:function(e){var n=e.instance,t=e.props,i=["left","right","top","bottom"].find((function(e){return e===t.position}));return["p-sidebar-mask",{"p-component-overlay p-component-overlay-enter":t.modal,"p-sidebar-mask-scrollblocker":t.blockScroll,"p-sidebar-visible":n.containerVisible,"p-sidebar-full":n.fullScreen},i?"p-sidebar-".concat(i):""]},root:function(e){var n=e.instance;return["p-sidebar p-component",{"p-input-filled":"filled"===n.$primevue.config.inputStyle,"p-ripple-disabled":!1===n.$primevue.config.ripple,"p-sidebar-full":n.fullScreen}]},header:"p-sidebar-header",headerContent:"p-sidebar-header-content",closeButton:"p-sidebar-close p-sidebar-icon p-link",closeIcon:"p-sidebar-close-icon",content:"p-sidebar-content"},inlineStyles:{mask:function(e){var n=e.position;return{position:"fixed",height:"100%",width:"100%",left:0,top:0,display:"flex",justifyContent:"left"===n?"flex-start":"right"===n?"flex-end":"center",alignItems:"top"===n?"flex-start":"bottom"===n?"flex-end":"center"}}},loadStyle:w.load},provide:function(){return{$parentInstance:this}}},inheritAttrs:!1,emits:["update:visible","show","hide","after-hide"],data:function(){return{containerVisible:this.visible}},container:null,mask:null,content:null,headerContainer:null,closeButton:null,outsideClickListener:null,updated:function(){this.visible&&(this.containerVisible=this.visible)},beforeUnmount:function(){this.disableDocumentSettings(),this.mask&&this.autoZIndex&&r.clear(this.mask),this.container=null,this.mask=null},methods:{hide:function(){this.$emit("update:visible",!1)},onEnter:function(){this.$emit("show"),this.focus(),this.autoZIndex&&r.set("modal",this.mask,this.baseZIndex||this.$primevue.config.zIndex.modal)},onAfterEnter:function(){this.enableDocumentSettings()},onBeforeLeave:function(){this.modal&&!this.isUnstyled&&o.addClass(this.mask,"p-component-overlay-leave")},onLeave:function(){this.$emit("hide")},onAfterLeave:function(){this.autoZIndex&&r.clear(this.mask),this.containerVisible=!1,this.disableDocumentSettings(),this.$emit("after-hide")},onMaskClick:function(e){this.dismissable&&this.modal&&this.mask===e.target&&this.hide()},focus:function(){var e=function(e){return e.querySelector("[autofocus]")},n=this.$slots.default&&e(this.content);n||(n=this.$slots.header&&e(this.headerContainer))||(n=e(this.container)),n&&n.focus()},enableDocumentSettings:function(){this.dismissable&&!this.modal&&this.bindOutsideClickListener(),this.blockScroll&&o.addClass(document.body,"p-overflow-hidden")},disableDocumentSettings:function(){this.unbindOutsideClickListener(),this.blockScroll&&o.removeClass(document.body,"p-overflow-hidden")},onKeydown:function(e){"Escape"===e.code&&this.hide()},containerRef:function(e){this.container=e},maskRef:function(e){this.mask=e},contentRef:function(e){this.content=e},headerContainerRef:function(e){this.headerContainer=e},closeButtonRef:function(e){this.closeButton=e},bindOutsideClickListener:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(n){e.isOutsideClicked(n)&&e.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},isOutsideClicked:function(e){return this.container&&!this.container.contains(e.target)}},computed:{fullScreen:function(){return"full"===this.position},closeAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.close:void 0}},directives:{focustrap:e,ripple:i},components:{Portal:t,TimesIcon:n}};function S(e){return S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},S(e)}function L(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function O(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?L(Object(t),!0).forEach((function(n){I(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):L(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function I(e,n,t){return(n=B(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function B(e){var n=j(e,"string");return"symbol"===S(n)?n:String(n)}function j(e,n){if("object"!==S(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,n||"default");if("object"!==S(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}var $=["aria-modal"],E=["aria-label"];C.render=function(e,n,t,i,r,o){var s=l("Portal"),a=d("ripple"),w=d("focustrap");return c(),p(s,null,{default:u((function(){return[r.containerVisible?(c(),f("div",b({key:0,ref:o.maskRef,onMousedown:n[2]||(n[2]=function(){return o.onMaskClick&&o.onMaskClick.apply(o,arguments)}),class:e.cx("mask"),style:e.sx("mask",!0,{position:e.position})},e.ptm("mask")),[m(h,{name:"p-sidebar",onEnter:o.onEnter,onAfterEnter:o.onAfterEnter,onBeforeLeave:o.onBeforeLeave,onLeave:o.onLeave,onAfterLeave:o.onAfterLeave,appear:""},{default:u((function(){return[e.visible?v((c(),f("div",b({key:0,ref:o.containerRef,class:e.cx("root"),role:"complementary","aria-modal":e.modal,onKeydown:n[1]||(n[1]=function(){return o.onKeydown&&o.onKeydown.apply(o,arguments)})},O(O({},e.$attrs),e.ptm("root"))),[y("div",b({ref:o.headerContainerRef,class:e.cx("header")},e.ptm("header")),[e.$slots.header?(c(),f("div",b({key:0,class:e.cx("headerContent")},e.ptm("headerContent")),[g(e.$slots,"header")],16)):k("",!0),e.showCloseIcon?v((c(),f("button",b({key:1,ref:o.closeButtonRef,autofocus:"",type:"button",class:e.cx("closeButton"),"aria-label":o.closeAriaLabel,onClick:n[0]||(n[0]=function(){return o.hide&&o.hide.apply(o,arguments)})},e.ptm("closeButton"),{"data-pc-group-section":"iconcontainer"}),[g(e.$slots,"closeicon",{},(function(){return[(c(),p(x(e.closeIcon?"span":"TimesIcon"),b({class:[e.cx("closeIcon"),e.closeIcon]},e.ptm("closeIcon")),null,16,["class"]))]}))],16,E)),[[a]]):k("",!0)],16),y("div",b({ref:o.contentRef,class:e.cx("content")},e.ptm("content")),[g(e.$slots,"default")],16)],16,$)),[[w]]):k("",!0)]})),_:3},8,["onEnter","onAfterEnter","onBeforeLeave","onLeave","onAfterLeave"])],16)):k("",!0)]})),_:3})};export{C as default};
|
package/sidebar/sidebar.js
CHANGED
|
@@ -324,7 +324,9 @@ this.primevue.sidebar = (function (FocusTrap, TimesIcon, Portal, Ripple, utils,
|
|
|
324
324
|
onClick: _cache[0] || (_cache[0] = function () {
|
|
325
325
|
return $options.hide && $options.hide.apply($options, arguments);
|
|
326
326
|
})
|
|
327
|
-
}, _ctx.ptm('closeButton')
|
|
327
|
+
}, _ctx.ptm('closeButton'), {
|
|
328
|
+
"data-pc-group-section": "iconcontainer"
|
|
329
|
+
}), [vue.renderSlot(_ctx.$slots, "closeicon", {}, function () {
|
|
328
330
|
return [(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.closeIcon ? 'span' : 'TimesIcon'), vue.mergeProps({
|
|
329
331
|
"class": [_ctx.cx('closeIcon'), _ctx.closeIcon]
|
|
330
332
|
}, _ctx.ptm('closeIcon')), null, 16, ["class"]))];
|
package/sidebar/sidebar.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primevue=this.primevue||{},this.primevue.sidebar=function(e,n,t,i,r,o,s,a){"use strict";function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=l(e),c=l(n),p=l(t),u=l(i),f=l(o),m=s.useStyle("\n.p-sidebar-mask {\n display: none;\n pointer-events: none;\n background-color: transparent;\n transition-property: background-color;\n}\n\n.p-sidebar-mask.p-component-overlay {\n pointer-events: auto;\n}\n\n.p-sidebar-visible {\n display: flex;\n}\n\n.p-sidebar {\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n transform: translate3d(0px, 0px, 0px);\n position: relative;\n transition: transform 0.3s;\n}\n\n.p-sidebar-content {\n overflow-y: auto;\n flex-grow: 1;\n}\n\n.p-sidebar-header {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n flex-shrink: 0;\n}\n\n.p-sidebar-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n}\n\n.p-sidebar-full .p-sidebar {\n transition: none;\n transform: none;\n width: 100vw !important;\n height: 100vh !important;\n max-height: 100%;\n top: 0px !important;\n left: 0px !important;\n}\n\n/* Animation */\n/* Center */\n.p-sidebar-left .p-sidebar-enter-from,\n.p-sidebar-left .p-sidebar-leave-to {\n transform: translateX(-100%);\n}\n.p-sidebar-right .p-sidebar-enter-from,\n.p-sidebar-right .p-sidebar-leave-to {\n transform: translateX(100%);\n}\n.p-sidebar-top .p-sidebar-enter-from,\n.p-sidebar-top .p-sidebar-leave-to {\n transform: translateY(-100%);\n}\n.p-sidebar-bottom .p-sidebar-enter-from,\n.p-sidebar-bottom .p-sidebar-leave-to {\n transform: translateY(100%);\n}\n.p-sidebar-full .p-sidebar-enter-from,\n.p-sidebar-full .p-sidebar-leave-to {\n opacity: 0;\n}\n.p-sidebar-full .p-sidebar-enter-active,\n.p-sidebar-full .p-sidebar-leave-active {\n transition: opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1);\n}\n\n/* Size */\n.p-sidebar-left .p-sidebar {\n width: 20rem;\n height: 100%;\n}\n\n.p-sidebar-right .p-sidebar {\n width: 20rem;\n height: 100%;\n}\n\n.p-sidebar-top .p-sidebar {\n height: 10rem;\n width: 100%;\n}\n\n.p-sidebar-bottom .p-sidebar {\n height: 10rem;\n width: 100%;\n}\n\n.p-sidebar-left .p-sidebar-sm,\n.p-sidebar-right .p-sidebar-sm {\n width: 20rem;\n}\n\n.p-sidebar-left .p-sidebar-md,\n.p-sidebar-right .p-sidebar-md {\n width: 40rem;\n}\n\n.p-sidebar-left .p-sidebar-lg,\n.p-sidebar-right .p-sidebar-lg {\n width: 60rem;\n}\n\n.p-sidebar-top .p-sidebar-sm,\n.p-sidebar-bottom .p-sidebar-sm {\n height: 10rem;\n}\n\n.p-sidebar-top .p-sidebar-md,\n.p-sidebar-bottom .p-sidebar-md {\n height: 20rem;\n}\n\n.p-sidebar-top .p-sidebar-lg,\n.p-sidebar-bottom .p-sidebar-lg {\n height: 30rem;\n}\n\n.p-sidebar-left .p-sidebar-content,\n.p-sidebar-right .p-sidebar-content,\n.p-sidebar-top .p-sidebar-content,\n.p-sidebar-bottom .p-sidebar-content {\n width: 100%;\n height: 100%;\n}\n\n@media screen and (max-width: 64em) {\n .p-sidebar-left .p-sidebar-lg,\n .p-sidebar-left .p-sidebar-md,\n .p-sidebar-right .p-sidebar-lg,\n .p-sidebar-right .p-sidebar-md {\n width: 20rem;\n }\n}\n",{name:"sidebar",manual:!0}),b={name:"Sidebar",extends:{name:"BaseSidebar",extends:f.default,props:{visible:{type:Boolean,default:!1},position:{type:String,default:"left"},baseZIndex:{type:Number,default:0},autoZIndex:{type:Boolean,default:!0},dismissable:{type:Boolean,default:!0},showCloseIcon:{type:Boolean,default:!0},closeIcon:{type:String,default:void 0},modal:{type:Boolean,default:!0},blockScroll:{type:Boolean,default:!1}},css:{classes:{mask:function(e){var n=e.instance,t=e.props,i=["left","right","top","bottom"].find((function(e){return e===t.position}));return["p-sidebar-mask",{"p-component-overlay p-component-overlay-enter":t.modal,"p-sidebar-mask-scrollblocker":t.blockScroll,"p-sidebar-visible":n.containerVisible,"p-sidebar-full":n.fullScreen},i?"p-sidebar-".concat(i):""]},root:function(e){var n=e.instance;return["p-sidebar p-component",{"p-input-filled":"filled"===n.$primevue.config.inputStyle,"p-ripple-disabled":!1===n.$primevue.config.ripple,"p-sidebar-full":n.fullScreen}]},header:"p-sidebar-header",headerContent:"p-sidebar-header-content",closeButton:"p-sidebar-close p-sidebar-icon p-link",closeIcon:"p-sidebar-close-icon",content:"p-sidebar-content"},inlineStyles:{mask:function(e){var n=e.position;return{position:"fixed",height:"100%",width:"100%",left:0,top:0,display:"flex",justifyContent:"left"===n?"flex-start":"right"===n?"flex-end":"center",alignItems:"top"===n?"flex-start":"bottom"===n?"flex-end":"center"}}},loadStyle:m.load},provide:function(){return{$parentInstance:this}}},inheritAttrs:!1,emits:["update:visible","show","hide","after-hide"],data:function(){return{containerVisible:this.visible}},container:null,mask:null,content:null,headerContainer:null,closeButton:null,outsideClickListener:null,updated:function(){this.visible&&(this.containerVisible=this.visible)},beforeUnmount:function(){this.disableDocumentSettings(),this.mask&&this.autoZIndex&&r.ZIndexUtils.clear(this.mask),this.container=null,this.mask=null},methods:{hide:function(){this.$emit("update:visible",!1)},onEnter:function(){this.$emit("show"),this.focus(),this.autoZIndex&&r.ZIndexUtils.set("modal",this.mask,this.baseZIndex||this.$primevue.config.zIndex.modal)},onAfterEnter:function(){this.enableDocumentSettings()},onBeforeLeave:function(){this.modal&&!this.isUnstyled&&r.DomHandler.addClass(this.mask,"p-component-overlay-leave")},onLeave:function(){this.$emit("hide")},onAfterLeave:function(){this.autoZIndex&&r.ZIndexUtils.clear(this.mask),this.containerVisible=!1,this.disableDocumentSettings(),this.$emit("after-hide")},onMaskClick:function(e){this.dismissable&&this.modal&&this.mask===e.target&&this.hide()},focus:function(){var e=function(e){return e.querySelector("[autofocus]")},n=this.$slots.default&&e(this.content);n||(n=this.$slots.header&&e(this.headerContainer))||(n=e(this.container)),n&&n.focus()},enableDocumentSettings:function(){this.dismissable&&!this.modal&&this.bindOutsideClickListener(),this.blockScroll&&r.DomHandler.addClass(document.body,"p-overflow-hidden")},disableDocumentSettings:function(){this.unbindOutsideClickListener(),this.blockScroll&&r.DomHandler.removeClass(document.body,"p-overflow-hidden")},onKeydown:function(e){"Escape"===e.code&&this.hide()},containerRef:function(e){this.container=e},maskRef:function(e){this.mask=e},contentRef:function(e){this.content=e},headerContainerRef:function(e){this.headerContainer=e},closeButtonRef:function(e){this.closeButton=e},bindOutsideClickListener:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(n){e.isOutsideClicked(n)&&e.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},isOutsideClicked:function(e){return this.container&&!this.container.contains(e.target)}},computed:{fullScreen:function(){return"full"===this.position},closeAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.close:void 0}},directives:{focustrap:d.default,ripple:u.default},components:{Portal:p.default,TimesIcon:c.default}};function h(e){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h(e)}function v(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function y(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?v(Object(t),!0).forEach((function(n){k(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):v(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function k(e,n,t){return(n=g(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function g(e){var n=x(e,"string");return"symbol"===h(n)?n:String(n)}function x(e,n){if("object"!==h(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,n||"default");if("object"!==h(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}var w=["aria-modal"],C=["aria-label"];return b.render=function(e,n,t,i,r,o){var s=a.resolveComponent("Portal"),l=a.resolveDirective("ripple"),d=a.resolveDirective("focustrap");return a.openBlock(),a.createBlock(s,null,{default:a.withCtx((function(){return[r.containerVisible?(a.openBlock(),a.createElementBlock("div",a.mergeProps({key:0,ref:o.maskRef,onMousedown:n[2]||(n[2]=function(){return o.onMaskClick&&o.onMaskClick.apply(o,arguments)}),class:e.cx("mask"),style:e.sx("mask",!0,{position:e.position})},e.ptm("mask")),[a.createVNode(a.Transition,{name:"p-sidebar",onEnter:o.onEnter,onAfterEnter:o.onAfterEnter,onBeforeLeave:o.onBeforeLeave,onLeave:o.onLeave,onAfterLeave:o.onAfterLeave,appear:""},{default:a.withCtx((function(){return[e.visible?a.withDirectives((a.openBlock(),a.createElementBlock("div",a.mergeProps({key:0,ref:o.containerRef,class:e.cx("root"),role:"complementary","aria-modal":e.modal,onKeydown:n[1]||(n[1]=function(){return o.onKeydown&&o.onKeydown.apply(o,arguments)})},y(y({},e.$attrs),e.ptm("root"))),[a.createElementVNode("div",a.mergeProps({ref:o.headerContainerRef,class:e.cx("header")},e.ptm("header")),[e.$slots.header?(a.openBlock(),a.createElementBlock("div",a.mergeProps({key:0,class:e.cx("headerContent")},e.ptm("headerContent")),[a.renderSlot(e.$slots,"header")],16)):a.createCommentVNode("",!0),e.showCloseIcon?a.withDirectives((a.openBlock(),a.createElementBlock("button",a.mergeProps({key:1,ref:o.closeButtonRef,autofocus:"",type:"button",class:e.cx("closeButton"),"aria-label":o.closeAriaLabel,onClick:n[0]||(n[0]=function(){return o.hide&&o.hide.apply(o,arguments)})},e.ptm("closeButton")),[a.renderSlot(e.$slots,"closeicon",{},(function(){return[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(e.closeIcon?"span":"TimesIcon"),a.mergeProps({class:[e.cx("closeIcon"),e.closeIcon]},e.ptm("closeIcon")),null,16,["class"]))]}))],16,C)),[[l]]):a.createCommentVNode("",!0)],16),a.createElementVNode("div",a.mergeProps({ref:o.contentRef,class:e.cx("content")},e.ptm("content")),[a.renderSlot(e.$slots,"default")],16)],16,w)),[[d]]):a.createCommentVNode("",!0)]})),_:3},8,["onEnter","onAfterEnter","onBeforeLeave","onLeave","onAfterLeave"])],16)):a.createCommentVNode("",!0)]})),_:3})},b}(primevue.focustrap,primevue.icons.times,primevue.portal,primevue.ripple,primevue.utils,primevue.basecomponent,primevue.usestyle,Vue);
|
|
1
|
+
this.primevue=this.primevue||{},this.primevue.sidebar=function(e,n,t,i,r,o,s,a){"use strict";function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=l(e),c=l(n),p=l(t),u=l(i),f=l(o),m=s.useStyle("\n.p-sidebar-mask {\n display: none;\n pointer-events: none;\n background-color: transparent;\n transition-property: background-color;\n}\n\n.p-sidebar-mask.p-component-overlay {\n pointer-events: auto;\n}\n\n.p-sidebar-visible {\n display: flex;\n}\n\n.p-sidebar {\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n transform: translate3d(0px, 0px, 0px);\n position: relative;\n transition: transform 0.3s;\n}\n\n.p-sidebar-content {\n overflow-y: auto;\n flex-grow: 1;\n}\n\n.p-sidebar-header {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n flex-shrink: 0;\n}\n\n.p-sidebar-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n}\n\n.p-sidebar-full .p-sidebar {\n transition: none;\n transform: none;\n width: 100vw !important;\n height: 100vh !important;\n max-height: 100%;\n top: 0px !important;\n left: 0px !important;\n}\n\n/* Animation */\n/* Center */\n.p-sidebar-left .p-sidebar-enter-from,\n.p-sidebar-left .p-sidebar-leave-to {\n transform: translateX(-100%);\n}\n.p-sidebar-right .p-sidebar-enter-from,\n.p-sidebar-right .p-sidebar-leave-to {\n transform: translateX(100%);\n}\n.p-sidebar-top .p-sidebar-enter-from,\n.p-sidebar-top .p-sidebar-leave-to {\n transform: translateY(-100%);\n}\n.p-sidebar-bottom .p-sidebar-enter-from,\n.p-sidebar-bottom .p-sidebar-leave-to {\n transform: translateY(100%);\n}\n.p-sidebar-full .p-sidebar-enter-from,\n.p-sidebar-full .p-sidebar-leave-to {\n opacity: 0;\n}\n.p-sidebar-full .p-sidebar-enter-active,\n.p-sidebar-full .p-sidebar-leave-active {\n transition: opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1);\n}\n\n/* Size */\n.p-sidebar-left .p-sidebar {\n width: 20rem;\n height: 100%;\n}\n\n.p-sidebar-right .p-sidebar {\n width: 20rem;\n height: 100%;\n}\n\n.p-sidebar-top .p-sidebar {\n height: 10rem;\n width: 100%;\n}\n\n.p-sidebar-bottom .p-sidebar {\n height: 10rem;\n width: 100%;\n}\n\n.p-sidebar-left .p-sidebar-sm,\n.p-sidebar-right .p-sidebar-sm {\n width: 20rem;\n}\n\n.p-sidebar-left .p-sidebar-md,\n.p-sidebar-right .p-sidebar-md {\n width: 40rem;\n}\n\n.p-sidebar-left .p-sidebar-lg,\n.p-sidebar-right .p-sidebar-lg {\n width: 60rem;\n}\n\n.p-sidebar-top .p-sidebar-sm,\n.p-sidebar-bottom .p-sidebar-sm {\n height: 10rem;\n}\n\n.p-sidebar-top .p-sidebar-md,\n.p-sidebar-bottom .p-sidebar-md {\n height: 20rem;\n}\n\n.p-sidebar-top .p-sidebar-lg,\n.p-sidebar-bottom .p-sidebar-lg {\n height: 30rem;\n}\n\n.p-sidebar-left .p-sidebar-content,\n.p-sidebar-right .p-sidebar-content,\n.p-sidebar-top .p-sidebar-content,\n.p-sidebar-bottom .p-sidebar-content {\n width: 100%;\n height: 100%;\n}\n\n@media screen and (max-width: 64em) {\n .p-sidebar-left .p-sidebar-lg,\n .p-sidebar-left .p-sidebar-md,\n .p-sidebar-right .p-sidebar-lg,\n .p-sidebar-right .p-sidebar-md {\n width: 20rem;\n }\n}\n",{name:"sidebar",manual:!0}),b={name:"Sidebar",extends:{name:"BaseSidebar",extends:f.default,props:{visible:{type:Boolean,default:!1},position:{type:String,default:"left"},baseZIndex:{type:Number,default:0},autoZIndex:{type:Boolean,default:!0},dismissable:{type:Boolean,default:!0},showCloseIcon:{type:Boolean,default:!0},closeIcon:{type:String,default:void 0},modal:{type:Boolean,default:!0},blockScroll:{type:Boolean,default:!1}},css:{classes:{mask:function(e){var n=e.instance,t=e.props,i=["left","right","top","bottom"].find((function(e){return e===t.position}));return["p-sidebar-mask",{"p-component-overlay p-component-overlay-enter":t.modal,"p-sidebar-mask-scrollblocker":t.blockScroll,"p-sidebar-visible":n.containerVisible,"p-sidebar-full":n.fullScreen},i?"p-sidebar-".concat(i):""]},root:function(e){var n=e.instance;return["p-sidebar p-component",{"p-input-filled":"filled"===n.$primevue.config.inputStyle,"p-ripple-disabled":!1===n.$primevue.config.ripple,"p-sidebar-full":n.fullScreen}]},header:"p-sidebar-header",headerContent:"p-sidebar-header-content",closeButton:"p-sidebar-close p-sidebar-icon p-link",closeIcon:"p-sidebar-close-icon",content:"p-sidebar-content"},inlineStyles:{mask:function(e){var n=e.position;return{position:"fixed",height:"100%",width:"100%",left:0,top:0,display:"flex",justifyContent:"left"===n?"flex-start":"right"===n?"flex-end":"center",alignItems:"top"===n?"flex-start":"bottom"===n?"flex-end":"center"}}},loadStyle:m.load},provide:function(){return{$parentInstance:this}}},inheritAttrs:!1,emits:["update:visible","show","hide","after-hide"],data:function(){return{containerVisible:this.visible}},container:null,mask:null,content:null,headerContainer:null,closeButton:null,outsideClickListener:null,updated:function(){this.visible&&(this.containerVisible=this.visible)},beforeUnmount:function(){this.disableDocumentSettings(),this.mask&&this.autoZIndex&&r.ZIndexUtils.clear(this.mask),this.container=null,this.mask=null},methods:{hide:function(){this.$emit("update:visible",!1)},onEnter:function(){this.$emit("show"),this.focus(),this.autoZIndex&&r.ZIndexUtils.set("modal",this.mask,this.baseZIndex||this.$primevue.config.zIndex.modal)},onAfterEnter:function(){this.enableDocumentSettings()},onBeforeLeave:function(){this.modal&&!this.isUnstyled&&r.DomHandler.addClass(this.mask,"p-component-overlay-leave")},onLeave:function(){this.$emit("hide")},onAfterLeave:function(){this.autoZIndex&&r.ZIndexUtils.clear(this.mask),this.containerVisible=!1,this.disableDocumentSettings(),this.$emit("after-hide")},onMaskClick:function(e){this.dismissable&&this.modal&&this.mask===e.target&&this.hide()},focus:function(){var e=function(e){return e.querySelector("[autofocus]")},n=this.$slots.default&&e(this.content);n||(n=this.$slots.header&&e(this.headerContainer))||(n=e(this.container)),n&&n.focus()},enableDocumentSettings:function(){this.dismissable&&!this.modal&&this.bindOutsideClickListener(),this.blockScroll&&r.DomHandler.addClass(document.body,"p-overflow-hidden")},disableDocumentSettings:function(){this.unbindOutsideClickListener(),this.blockScroll&&r.DomHandler.removeClass(document.body,"p-overflow-hidden")},onKeydown:function(e){"Escape"===e.code&&this.hide()},containerRef:function(e){this.container=e},maskRef:function(e){this.mask=e},contentRef:function(e){this.content=e},headerContainerRef:function(e){this.headerContainer=e},closeButtonRef:function(e){this.closeButton=e},bindOutsideClickListener:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(n){e.isOutsideClicked(n)&&e.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},isOutsideClicked:function(e){return this.container&&!this.container.contains(e.target)}},computed:{fullScreen:function(){return"full"===this.position},closeAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.close:void 0}},directives:{focustrap:d.default,ripple:u.default},components:{Portal:p.default,TimesIcon:c.default}};function h(e){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h(e)}function v(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function y(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?v(Object(t),!0).forEach((function(n){g(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):v(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function g(e,n,t){return(n=k(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function k(e){var n=x(e,"string");return"symbol"===h(n)?n:String(n)}function x(e,n){if("object"!==h(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,n||"default");if("object"!==h(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}var w=["aria-modal"],C=["aria-label"];return b.render=function(e,n,t,i,r,o){var s=a.resolveComponent("Portal"),l=a.resolveDirective("ripple"),d=a.resolveDirective("focustrap");return a.openBlock(),a.createBlock(s,null,{default:a.withCtx((function(){return[r.containerVisible?(a.openBlock(),a.createElementBlock("div",a.mergeProps({key:0,ref:o.maskRef,onMousedown:n[2]||(n[2]=function(){return o.onMaskClick&&o.onMaskClick.apply(o,arguments)}),class:e.cx("mask"),style:e.sx("mask",!0,{position:e.position})},e.ptm("mask")),[a.createVNode(a.Transition,{name:"p-sidebar",onEnter:o.onEnter,onAfterEnter:o.onAfterEnter,onBeforeLeave:o.onBeforeLeave,onLeave:o.onLeave,onAfterLeave:o.onAfterLeave,appear:""},{default:a.withCtx((function(){return[e.visible?a.withDirectives((a.openBlock(),a.createElementBlock("div",a.mergeProps({key:0,ref:o.containerRef,class:e.cx("root"),role:"complementary","aria-modal":e.modal,onKeydown:n[1]||(n[1]=function(){return o.onKeydown&&o.onKeydown.apply(o,arguments)})},y(y({},e.$attrs),e.ptm("root"))),[a.createElementVNode("div",a.mergeProps({ref:o.headerContainerRef,class:e.cx("header")},e.ptm("header")),[e.$slots.header?(a.openBlock(),a.createElementBlock("div",a.mergeProps({key:0,class:e.cx("headerContent")},e.ptm("headerContent")),[a.renderSlot(e.$slots,"header")],16)):a.createCommentVNode("",!0),e.showCloseIcon?a.withDirectives((a.openBlock(),a.createElementBlock("button",a.mergeProps({key:1,ref:o.closeButtonRef,autofocus:"",type:"button",class:e.cx("closeButton"),"aria-label":o.closeAriaLabel,onClick:n[0]||(n[0]=function(){return o.hide&&o.hide.apply(o,arguments)})},e.ptm("closeButton"),{"data-pc-group-section":"iconcontainer"}),[a.renderSlot(e.$slots,"closeicon",{},(function(){return[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(e.closeIcon?"span":"TimesIcon"),a.mergeProps({class:[e.cx("closeIcon"),e.closeIcon]},e.ptm("closeIcon")),null,16,["class"]))]}))],16,C)),[[l]]):a.createCommentVNode("",!0)],16),a.createElementVNode("div",a.mergeProps({ref:o.contentRef,class:e.cx("content")},e.ptm("content")),[a.renderSlot(e.$slots,"default")],16)],16,w)),[[d]]):a.createCommentVNode("",!0)]})),_:3},8,["onEnter","onAfterEnter","onBeforeLeave","onLeave","onAfterLeave"])],16)):a.createCommentVNode("",!0)]})),_:3})},b}(primevue.focustrap,primevue.icons.times,primevue.portal,primevue.ripple,primevue.utils,primevue.basecomponent,primevue.usestyle,Vue);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :class="containerClass" :style="style" v-bind="ptm('root')" data-pc-name="splitbutton" :data-pc-severity="severity">
|
|
3
3
|
<slot>
|
|
4
|
-
<PVSButton type="button" :class="cx('button')" :label="label" :disabled="disabled" :aria-label="label" @click="onDefaultButtonClick" :pt="ptm('button')" v-bind="buttonProps" :unstyled="unstyled">
|
|
4
|
+
<PVSButton type="button" :class="cx('button')" :label="label" :disabled="disabled" :aria-label="label" @click="onDefaultButtonClick" :pt="ptm('button')" v-bind="buttonProps" :unstyled="unstyled" data-pc-section="button">
|
|
5
5
|
<template v-if="icon" #icon="slotProps">
|
|
6
6
|
<slot name="icon" :class="slotProps.class">
|
|
7
7
|
<span :class="[icon, slotProps.class]" v-bind="ptm('button')['icon']" />
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
:pt="ptm('menuButton')"
|
|
23
23
|
v-bind="menuButtonProps"
|
|
24
24
|
:unstyled="unstyled"
|
|
25
|
+
data-pc-section="menubutton"
|
|
25
26
|
>
|
|
26
27
|
<template #icon="slotProps">
|
|
27
28
|
<slot name="menubuttonicon" :class="slotProps.class">
|
|
@@ -197,7 +197,8 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
197
197
|
onClick: $options.onDefaultButtonClick,
|
|
198
198
|
pt: _ctx.ptm('button')
|
|
199
199
|
}, _ctx.buttonProps, {
|
|
200
|
-
unstyled: _ctx.unstyled
|
|
200
|
+
unstyled: _ctx.unstyled,
|
|
201
|
+
"data-pc-section": "button"
|
|
201
202
|
}), vue.createSlots({
|
|
202
203
|
_: 2
|
|
203
204
|
}, [_ctx.icon ? {
|
|
@@ -225,7 +226,8 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
225
226
|
onKeydown: $options.onDropdownKeydown,
|
|
226
227
|
pt: _ctx.ptm('menuButton')
|
|
227
228
|
}, _ctx.menuButtonProps, {
|
|
228
|
-
unstyled: _ctx.unstyled
|
|
229
|
+
unstyled: _ctx.unstyled,
|
|
230
|
+
"data-pc-section": "menubutton"
|
|
229
231
|
}), {
|
|
230
232
|
icon: vue.withCtx(function (slotProps) {
|
|
231
233
|
return [vue.renderSlot(_ctx.$slots, "menubuttonicon", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var t=require("primevue/button"),e=require("primevue/icons/chevrondown"),n=require("primevue/tieredmenu"),o=require("primevue/utils"),u=require("primevue/basecomponent"),l=require("primevue/usestyle"),r=require("vue");function i(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var a=i(t),s=i(e),p=i(n),d=i(u);function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function b(t,e,n){return(e=m(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function m(t){var e=f(t,"string");return"symbol"===c(e)?e:String(e)}function f(t,e){if("object"!==c(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!==c(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var y={root:function(t){var e,n=t.props;return["p-splitbutton p-component",(e={},b(e,"p-button-".concat(n.severity),n.severity),b(e,"p-button-raised",n.raised),b(e,"p-button-rounded",n.rounded),b(e,"p-button-text",n.text),b(e,"p-button-outlined",n.outlined),b(e,"p-button-sm","small"===n.size),b(e,"p-button-lg","large"===n.size),e)]},button:"p-splitbutton-defaultbutton",menuButton:"p-splitbutton-menubutton"},v=l.useStyle("\n.p-splitbutton {\n display: inline-flex;\n position: relative;\n}\n\n.p-splitbutton .p-splitbutton-defaultbutton,\n.p-splitbutton.p-button-rounded > .p-splitbutton-defaultbutton.p-button,\n.p-splitbutton.p-button-outlined > .p-splitbutton-defaultbutton.p-button {\n flex: 1 1 auto;\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n border-right: 0 none;\n}\n\n.p-splitbutton-menubutton,\n.p-splitbutton.p-button-rounded > .p-splitbutton-menubutton.p-button,\n.p-splitbutton.p-button-outlined > .p-splitbutton-menubutton.p-button {\n display: flex;\n align-items: center;\n justify-content: center;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n\n.p-splitbutton .p-menu {\n min-width: 100%;\n}\n\n.p-fluid .p-splitbutton {\n display: flex;\n}\n",{name:"splitbutton",manual:!0}),x={name:"SplitButton",extends:{name:"BaseSplitButton",extends:d.default,props:{label:{type:String,default:null},icon:{type:String,default:null},model:{type:Array,default:null},autoZIndex:{type:Boolean,default:!0},baseZIndex:{type:Number,default:0},appendTo:{type:String,default:"body"},disabled:{type:Boolean,default:!1},class:{type:null,default:null},style:{type:null,default:null},buttonProps:{type:null,default:null},menuButtonProps:{type:null,default:null},menuButtonIcon:{type:String,default:void 0},severity:{type:String,default:null},raised:{type:Boolean,default:!1},rounded:{type:Boolean,default:!1},text:{type:Boolean,default:!1},outlined:{type:Boolean,default:!1},size:{type:String,default:null},plain:{type:Boolean,default:!1}},css:{classes:y,loadStyle:v.load},provide:function(){return{$parentInstance:this}}},emits:["click"],data:function(){return{isExpanded:!1}},mounted:function(){var t=this;this.$watch("$refs.menu.visible",(function(e){t.isExpanded=e}))},methods:{onDropdownButtonClick:function(){this.$refs.menu.toggle({currentTarget:this.$el,relatedTarget:this.$refs.button.$el}),this.isExpanded=this.$refs.menu.visible},onDropdownKeydown:function(t){"ArrowDown"!==t.code&&"ArrowUp"!==t.code||(this.onDropdownButtonClick(),t.preventDefault())},onDefaultButtonClick:function(t){this.isExpanded&&this.$refs.menu.hide(t),this.$emit("click",t)}},computed:{ariaId:function(){return o.UniqueComponentId()},containerClass:function(){return[this.cx("root"),this.class]}},components:{PVSButton:a.default,PVSMenu:p.default,ChevronDownIcon:s.default}},B=["data-pc-severity"];x.render=function(t,e,n,o,u,l){var i=r.resolveComponent("PVSButton"),a=r.resolveComponent("PVSMenu");return r.openBlock(),r.createElementBlock("div",r.mergeProps({class:l.containerClass,style:t.style},t.ptm("root"),{"data-pc-name":"splitbutton","data-pc-severity":t.severity}),[r.renderSlot(t.$slots,"default",{},(function(){return[r.createVNode(i,r.mergeProps({type:"button",class:t.cx("button"),label:t.label,disabled:t.disabled,"aria-label":t.label,onClick:l.onDefaultButtonClick,pt:t.ptm("button")},t.buttonProps,{unstyled:t.unstyled}),r.createSlots({_:2},[t.icon?{name:"icon",fn:r.withCtx((function(e){return[r.renderSlot(t.$slots,"icon",{class:r.normalizeClass(e.class)},(function(){return[r.createElementVNode("span",r.mergeProps({class:[t.icon,e.class]},t.ptm("button").icon),null,16)]}))]})),key:"0"}:void 0]),1040,["class","label","disabled","aria-label","onClick","pt","unstyled"])]})),r.createVNode(i,r.mergeProps({ref:"button",type:"button",class:t.cx("menuButton"),disabled:t.disabled,"aria-haspopup":"true","aria-expanded":u.isExpanded,"aria-controls":l.ariaId+"_overlay",onClick:l.onDropdownButtonClick,onKeydown:l.onDropdownKeydown,pt:t.ptm("menuButton")},t.menuButtonProps,{unstyled:t.unstyled}),{icon:r.withCtx((function(e){return[r.renderSlot(t.$slots,"menubuttonicon",{class:r.normalizeClass(e.class)},(function(){return[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(t.menuButtonIcon?"span":"ChevronDownIcon"),r.mergeProps({class:[t.menuButtonIcon,e.class]},t.ptm("menuButton").icon),null,16,["class"]))]}))]})),_:3},16,["class","disabled","aria-expanded","aria-controls","onClick","onKeydown","pt","unstyled"]),r.createVNode(a,{ref:"menu",id:l.ariaId+"_overlay",model:t.model,popup:!0,autoZIndex:t.autoZIndex,baseZIndex:t.baseZIndex,appendTo:t.appendTo,unstyled:t.unstyled,pt:t.ptm("menu")},null,8,["id","model","autoZIndex","baseZIndex","appendTo","unstyled","pt"])],16,B)},module.exports=x;
|
|
1
|
+
"use strict";var t=require("primevue/button"),e=require("primevue/icons/chevrondown"),n=require("primevue/tieredmenu"),o=require("primevue/utils"),u=require("primevue/basecomponent"),l=require("primevue/usestyle"),r=require("vue");function i(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var a=i(t),s=i(e),p=i(n),d=i(u);function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function b(t,e,n){return(e=m(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function m(t){var e=f(t,"string");return"symbol"===c(e)?e:String(e)}function f(t,e){if("object"!==c(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!==c(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var y={root:function(t){var e,n=t.props;return["p-splitbutton p-component",(e={},b(e,"p-button-".concat(n.severity),n.severity),b(e,"p-button-raised",n.raised),b(e,"p-button-rounded",n.rounded),b(e,"p-button-text",n.text),b(e,"p-button-outlined",n.outlined),b(e,"p-button-sm","small"===n.size),b(e,"p-button-lg","large"===n.size),e)]},button:"p-splitbutton-defaultbutton",menuButton:"p-splitbutton-menubutton"},v=l.useStyle("\n.p-splitbutton {\n display: inline-flex;\n position: relative;\n}\n\n.p-splitbutton .p-splitbutton-defaultbutton,\n.p-splitbutton.p-button-rounded > .p-splitbutton-defaultbutton.p-button,\n.p-splitbutton.p-button-outlined > .p-splitbutton-defaultbutton.p-button {\n flex: 1 1 auto;\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n border-right: 0 none;\n}\n\n.p-splitbutton-menubutton,\n.p-splitbutton.p-button-rounded > .p-splitbutton-menubutton.p-button,\n.p-splitbutton.p-button-outlined > .p-splitbutton-menubutton.p-button {\n display: flex;\n align-items: center;\n justify-content: center;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n\n.p-splitbutton .p-menu {\n min-width: 100%;\n}\n\n.p-fluid .p-splitbutton {\n display: flex;\n}\n",{name:"splitbutton",manual:!0}),x={name:"SplitButton",extends:{name:"BaseSplitButton",extends:d.default,props:{label:{type:String,default:null},icon:{type:String,default:null},model:{type:Array,default:null},autoZIndex:{type:Boolean,default:!0},baseZIndex:{type:Number,default:0},appendTo:{type:String,default:"body"},disabled:{type:Boolean,default:!1},class:{type:null,default:null},style:{type:null,default:null},buttonProps:{type:null,default:null},menuButtonProps:{type:null,default:null},menuButtonIcon:{type:String,default:void 0},severity:{type:String,default:null},raised:{type:Boolean,default:!1},rounded:{type:Boolean,default:!1},text:{type:Boolean,default:!1},outlined:{type:Boolean,default:!1},size:{type:String,default:null},plain:{type:Boolean,default:!1}},css:{classes:y,loadStyle:v.load},provide:function(){return{$parentInstance:this}}},emits:["click"],data:function(){return{isExpanded:!1}},mounted:function(){var t=this;this.$watch("$refs.menu.visible",(function(e){t.isExpanded=e}))},methods:{onDropdownButtonClick:function(){this.$refs.menu.toggle({currentTarget:this.$el,relatedTarget:this.$refs.button.$el}),this.isExpanded=this.$refs.menu.visible},onDropdownKeydown:function(t){"ArrowDown"!==t.code&&"ArrowUp"!==t.code||(this.onDropdownButtonClick(),t.preventDefault())},onDefaultButtonClick:function(t){this.isExpanded&&this.$refs.menu.hide(t),this.$emit("click",t)}},computed:{ariaId:function(){return o.UniqueComponentId()},containerClass:function(){return[this.cx("root"),this.class]}},components:{PVSButton:a.default,PVSMenu:p.default,ChevronDownIcon:s.default}},B=["data-pc-severity"];x.render=function(t,e,n,o,u,l){var i=r.resolveComponent("PVSButton"),a=r.resolveComponent("PVSMenu");return r.openBlock(),r.createElementBlock("div",r.mergeProps({class:l.containerClass,style:t.style},t.ptm("root"),{"data-pc-name":"splitbutton","data-pc-severity":t.severity}),[r.renderSlot(t.$slots,"default",{},(function(){return[r.createVNode(i,r.mergeProps({type:"button",class:t.cx("button"),label:t.label,disabled:t.disabled,"aria-label":t.label,onClick:l.onDefaultButtonClick,pt:t.ptm("button")},t.buttonProps,{unstyled:t.unstyled,"data-pc-section":"button"}),r.createSlots({_:2},[t.icon?{name:"icon",fn:r.withCtx((function(e){return[r.renderSlot(t.$slots,"icon",{class:r.normalizeClass(e.class)},(function(){return[r.createElementVNode("span",r.mergeProps({class:[t.icon,e.class]},t.ptm("button").icon),null,16)]}))]})),key:"0"}:void 0]),1040,["class","label","disabled","aria-label","onClick","pt","unstyled"])]})),r.createVNode(i,r.mergeProps({ref:"button",type:"button",class:t.cx("menuButton"),disabled:t.disabled,"aria-haspopup":"true","aria-expanded":u.isExpanded,"aria-controls":l.ariaId+"_overlay",onClick:l.onDropdownButtonClick,onKeydown:l.onDropdownKeydown,pt:t.ptm("menuButton")},t.menuButtonProps,{unstyled:t.unstyled,"data-pc-section":"menubutton"}),{icon:r.withCtx((function(e){return[r.renderSlot(t.$slots,"menubuttonicon",{class:r.normalizeClass(e.class)},(function(){return[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(t.menuButtonIcon?"span":"ChevronDownIcon"),r.mergeProps({class:[t.menuButtonIcon,e.class]},t.ptm("menuButton").icon),null,16,["class"]))]}))]})),_:3},16,["class","disabled","aria-expanded","aria-controls","onClick","onKeydown","pt","unstyled"]),r.createVNode(a,{ref:"menu",id:l.ariaId+"_overlay",model:t.model,popup:!0,autoZIndex:t.autoZIndex,baseZIndex:t.baseZIndex,appendTo:t.appendTo,unstyled:t.unstyled,pt:t.ptm("menu")},null,8,["id","model","autoZIndex","baseZIndex","appendTo","unstyled","pt"])],16,B)},module.exports=x;
|
|
@@ -188,7 +188,8 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
188
188
|
onClick: $options.onDefaultButtonClick,
|
|
189
189
|
pt: _ctx.ptm('button')
|
|
190
190
|
}, _ctx.buttonProps, {
|
|
191
|
-
unstyled: _ctx.unstyled
|
|
191
|
+
unstyled: _ctx.unstyled,
|
|
192
|
+
"data-pc-section": "button"
|
|
192
193
|
}), createSlots({
|
|
193
194
|
_: 2
|
|
194
195
|
}, [_ctx.icon ? {
|
|
@@ -216,7 +217,8 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
216
217
|
onKeydown: $options.onDropdownKeydown,
|
|
217
218
|
pt: _ctx.ptm('menuButton')
|
|
218
219
|
}, _ctx.menuButtonProps, {
|
|
219
|
-
unstyled: _ctx.unstyled
|
|
220
|
+
unstyled: _ctx.unstyled,
|
|
221
|
+
"data-pc-section": "menubutton"
|
|
220
222
|
}), {
|
|
221
223
|
icon: withCtx(function (slotProps) {
|
|
222
224
|
return [renderSlot(_ctx.$slots, "menubuttonicon", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"primevue/button";import n from"primevue/icons/chevrondown";import e from"primevue/tieredmenu";import{UniqueComponentId as o}from"primevue/utils";import u from"primevue/basecomponent";import{useStyle as l}from"primevue/usestyle";import{resolveComponent as i,openBlock as r,createElementBlock as a,mergeProps as s,renderSlot as p,createVNode as d,createSlots as c,withCtx as b,normalizeClass as m,createElementVNode as f,createBlock as y,resolveDynamicComponent as v}from"vue";function x(t){return x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},x(t)}function h(t,n,e){return(n=B(n))in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function B(t){var n=g(t,"string");return"symbol"===x(n)?n:String(n)}function g(t,n){if("object"!==x(t)||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var o=e.call(t,n||"default");if("object"!==x(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}var S={root:function(t){var n,e=t.props;return["p-splitbutton p-component",(n={},h(n,"p-button-".concat(e.severity),e.severity),h(n,"p-button-raised",e.raised),h(n,"p-button-rounded",e.rounded),h(n,"p-button-text",e.text),h(n,"p-button-outlined",e.outlined),h(n,"p-button-sm","small"===e.size),h(n,"p-button-lg","large"===e.size),n)]},button:"p-splitbutton-defaultbutton",menuButton:"p-splitbutton-menubutton"},w=l("\n.p-splitbutton {\n display: inline-flex;\n position: relative;\n}\n\n.p-splitbutton .p-splitbutton-defaultbutton,\n.p-splitbutton.p-button-rounded > .p-splitbutton-defaultbutton.p-button,\n.p-splitbutton.p-button-outlined > .p-splitbutton-defaultbutton.p-button {\n flex: 1 1 auto;\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n border-right: 0 none;\n}\n\n.p-splitbutton-menubutton,\n.p-splitbutton.p-button-rounded > .p-splitbutton-menubutton.p-button,\n.p-splitbutton.p-button-outlined > .p-splitbutton-menubutton.p-button {\n display: flex;\n align-items: center;\n justify-content: center;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n\n.p-splitbutton .p-menu {\n min-width: 100%;\n}\n\n.p-fluid .p-splitbutton {\n display: flex;\n}\n",{name:"splitbutton",manual:!0}),I={name:"SplitButton",extends:{name:"BaseSplitButton",extends:u,props:{label:{type:String,default:null},icon:{type:String,default:null},model:{type:Array,default:null},autoZIndex:{type:Boolean,default:!0},baseZIndex:{type:Number,default:0},appendTo:{type:String,default:"body"},disabled:{type:Boolean,default:!1},class:{type:null,default:null},style:{type:null,default:null},buttonProps:{type:null,default:null},menuButtonProps:{type:null,default:null},menuButtonIcon:{type:String,default:void 0},severity:{type:String,default:null},raised:{type:Boolean,default:!1},rounded:{type:Boolean,default:!1},text:{type:Boolean,default:!1},outlined:{type:Boolean,default:!1},size:{type:String,default:null},plain:{type:Boolean,default:!1}},css:{classes:S,loadStyle:w.load},provide:function(){return{$parentInstance:this}}},emits:["click"],data:function(){return{isExpanded:!1}},mounted:function(){var t=this;this.$watch("$refs.menu.visible",(function(n){t.isExpanded=n}))},methods:{onDropdownButtonClick:function(){this.$refs.menu.toggle({currentTarget:this.$el,relatedTarget:this.$refs.button.$el}),this.isExpanded=this.$refs.menu.visible},onDropdownKeydown:function(t){"ArrowDown"!==t.code&&"ArrowUp"!==t.code||(this.onDropdownButtonClick(),t.preventDefault())},onDefaultButtonClick:function(t){this.isExpanded&&this.$refs.menu.hide(t),this.$emit("click",t)}},computed:{ariaId:function(){return o()},containerClass:function(){return[this.cx("root"),this.class]}},components:{PVSButton:t,PVSMenu:e,ChevronDownIcon:n}},C=["data-pc-severity"];I.render=function(t,n,e,o,u,l){var x=i("PVSButton"),h=i("PVSMenu");return r(),a("div",s({class:l.containerClass,style:t.style},t.ptm("root"),{"data-pc-name":"splitbutton","data-pc-severity":t.severity}),[p(t.$slots,"default",{},(function(){return[d(x,s({type:"button",class:t.cx("button"),label:t.label,disabled:t.disabled,"aria-label":t.label,onClick:l.onDefaultButtonClick,pt:t.ptm("button")},t.buttonProps,{unstyled:t.unstyled}),c({_:2},[t.icon?{name:"icon",fn:b((function(n){return[p(t.$slots,"icon",{class:m(n.class)},(function(){return[f("span",s({class:[t.icon,n.class]},t.ptm("button").icon),null,16)]}))]})),key:"0"}:void 0]),1040,["class","label","disabled","aria-label","onClick","pt","unstyled"])]})),d(x,s({ref:"button",type:"button",class:t.cx("menuButton"),disabled:t.disabled,"aria-haspopup":"true","aria-expanded":u.isExpanded,"aria-controls":l.ariaId+"_overlay",onClick:l.onDropdownButtonClick,onKeydown:l.onDropdownKeydown,pt:t.ptm("menuButton")},t.menuButtonProps,{unstyled:t.unstyled}),{icon:b((function(n){return[p(t.$slots,"menubuttonicon",{class:m(n.class)},(function(){return[(r(),y(v(t.menuButtonIcon?"span":"ChevronDownIcon"),s({class:[t.menuButtonIcon,n.class]},t.ptm("menuButton").icon),null,16,["class"]))]}))]})),_:3},16,["class","disabled","aria-expanded","aria-controls","onClick","onKeydown","pt","unstyled"]),d(h,{ref:"menu",id:l.ariaId+"_overlay",model:t.model,popup:!0,autoZIndex:t.autoZIndex,baseZIndex:t.baseZIndex,appendTo:t.appendTo,unstyled:t.unstyled,pt:t.ptm("menu")},null,8,["id","model","autoZIndex","baseZIndex","appendTo","unstyled","pt"])],16,C)};export{I as default};
|
|
1
|
+
import t from"primevue/button";import n from"primevue/icons/chevrondown";import e from"primevue/tieredmenu";import{UniqueComponentId as o}from"primevue/utils";import u from"primevue/basecomponent";import{useStyle as l}from"primevue/usestyle";import{resolveComponent as i,openBlock as r,createElementBlock as a,mergeProps as s,renderSlot as p,createVNode as d,createSlots as c,withCtx as b,normalizeClass as m,createElementVNode as f,createBlock as y,resolveDynamicComponent as v}from"vue";function x(t){return x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},x(t)}function h(t,n,e){return(n=B(n))in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function B(t){var n=g(t,"string");return"symbol"===x(n)?n:String(n)}function g(t,n){if("object"!==x(t)||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var o=e.call(t,n||"default");if("object"!==x(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}var S={root:function(t){var n,e=t.props;return["p-splitbutton p-component",(n={},h(n,"p-button-".concat(e.severity),e.severity),h(n,"p-button-raised",e.raised),h(n,"p-button-rounded",e.rounded),h(n,"p-button-text",e.text),h(n,"p-button-outlined",e.outlined),h(n,"p-button-sm","small"===e.size),h(n,"p-button-lg","large"===e.size),n)]},button:"p-splitbutton-defaultbutton",menuButton:"p-splitbutton-menubutton"},w=l("\n.p-splitbutton {\n display: inline-flex;\n position: relative;\n}\n\n.p-splitbutton .p-splitbutton-defaultbutton,\n.p-splitbutton.p-button-rounded > .p-splitbutton-defaultbutton.p-button,\n.p-splitbutton.p-button-outlined > .p-splitbutton-defaultbutton.p-button {\n flex: 1 1 auto;\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n border-right: 0 none;\n}\n\n.p-splitbutton-menubutton,\n.p-splitbutton.p-button-rounded > .p-splitbutton-menubutton.p-button,\n.p-splitbutton.p-button-outlined > .p-splitbutton-menubutton.p-button {\n display: flex;\n align-items: center;\n justify-content: center;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n\n.p-splitbutton .p-menu {\n min-width: 100%;\n}\n\n.p-fluid .p-splitbutton {\n display: flex;\n}\n",{name:"splitbutton",manual:!0}),I={name:"SplitButton",extends:{name:"BaseSplitButton",extends:u,props:{label:{type:String,default:null},icon:{type:String,default:null},model:{type:Array,default:null},autoZIndex:{type:Boolean,default:!0},baseZIndex:{type:Number,default:0},appendTo:{type:String,default:"body"},disabled:{type:Boolean,default:!1},class:{type:null,default:null},style:{type:null,default:null},buttonProps:{type:null,default:null},menuButtonProps:{type:null,default:null},menuButtonIcon:{type:String,default:void 0},severity:{type:String,default:null},raised:{type:Boolean,default:!1},rounded:{type:Boolean,default:!1},text:{type:Boolean,default:!1},outlined:{type:Boolean,default:!1},size:{type:String,default:null},plain:{type:Boolean,default:!1}},css:{classes:S,loadStyle:w.load},provide:function(){return{$parentInstance:this}}},emits:["click"],data:function(){return{isExpanded:!1}},mounted:function(){var t=this;this.$watch("$refs.menu.visible",(function(n){t.isExpanded=n}))},methods:{onDropdownButtonClick:function(){this.$refs.menu.toggle({currentTarget:this.$el,relatedTarget:this.$refs.button.$el}),this.isExpanded=this.$refs.menu.visible},onDropdownKeydown:function(t){"ArrowDown"!==t.code&&"ArrowUp"!==t.code||(this.onDropdownButtonClick(),t.preventDefault())},onDefaultButtonClick:function(t){this.isExpanded&&this.$refs.menu.hide(t),this.$emit("click",t)}},computed:{ariaId:function(){return o()},containerClass:function(){return[this.cx("root"),this.class]}},components:{PVSButton:t,PVSMenu:e,ChevronDownIcon:n}},C=["data-pc-severity"];I.render=function(t,n,e,o,u,l){var x=i("PVSButton"),h=i("PVSMenu");return r(),a("div",s({class:l.containerClass,style:t.style},t.ptm("root"),{"data-pc-name":"splitbutton","data-pc-severity":t.severity}),[p(t.$slots,"default",{},(function(){return[d(x,s({type:"button",class:t.cx("button"),label:t.label,disabled:t.disabled,"aria-label":t.label,onClick:l.onDefaultButtonClick,pt:t.ptm("button")},t.buttonProps,{unstyled:t.unstyled,"data-pc-section":"button"}),c({_:2},[t.icon?{name:"icon",fn:b((function(n){return[p(t.$slots,"icon",{class:m(n.class)},(function(){return[f("span",s({class:[t.icon,n.class]},t.ptm("button").icon),null,16)]}))]})),key:"0"}:void 0]),1040,["class","label","disabled","aria-label","onClick","pt","unstyled"])]})),d(x,s({ref:"button",type:"button",class:t.cx("menuButton"),disabled:t.disabled,"aria-haspopup":"true","aria-expanded":u.isExpanded,"aria-controls":l.ariaId+"_overlay",onClick:l.onDropdownButtonClick,onKeydown:l.onDropdownKeydown,pt:t.ptm("menuButton")},t.menuButtonProps,{unstyled:t.unstyled,"data-pc-section":"menubutton"}),{icon:b((function(n){return[p(t.$slots,"menubuttonicon",{class:m(n.class)},(function(){return[(r(),y(v(t.menuButtonIcon?"span":"ChevronDownIcon"),s({class:[t.menuButtonIcon,n.class]},t.ptm("menuButton").icon),null,16,["class"]))]}))]})),_:3},16,["class","disabled","aria-expanded","aria-controls","onClick","onKeydown","pt","unstyled"]),d(h,{ref:"menu",id:l.ariaId+"_overlay",model:t.model,popup:!0,autoZIndex:t.autoZIndex,baseZIndex:t.baseZIndex,appendTo:t.appendTo,unstyled:t.unstyled,pt:t.ptm("menu")},null,8,["id","model","autoZIndex","baseZIndex","appendTo","unstyled","pt"])],16,C)};export{I as default};
|
|
@@ -191,7 +191,8 @@ this.primevue.splitbutton = (function (Button, ChevronDownIcon, TieredMenu, util
|
|
|
191
191
|
onClick: $options.onDefaultButtonClick,
|
|
192
192
|
pt: _ctx.ptm('button')
|
|
193
193
|
}, _ctx.buttonProps, {
|
|
194
|
-
unstyled: _ctx.unstyled
|
|
194
|
+
unstyled: _ctx.unstyled,
|
|
195
|
+
"data-pc-section": "button"
|
|
195
196
|
}), vue.createSlots({
|
|
196
197
|
_: 2
|
|
197
198
|
}, [_ctx.icon ? {
|
|
@@ -219,7 +220,8 @@ this.primevue.splitbutton = (function (Button, ChevronDownIcon, TieredMenu, util
|
|
|
219
220
|
onKeydown: $options.onDropdownKeydown,
|
|
220
221
|
pt: _ctx.ptm('menuButton')
|
|
221
222
|
}, _ctx.menuButtonProps, {
|
|
222
|
-
unstyled: _ctx.unstyled
|
|
223
|
+
unstyled: _ctx.unstyled,
|
|
224
|
+
"data-pc-section": "menubutton"
|
|
223
225
|
}), {
|
|
224
226
|
icon: vue.withCtx(function (slotProps) {
|
|
225
227
|
return [vue.renderSlot(_ctx.$slots, "menubuttonicon", {
|