primevue
Version:
PrimeVue is an open source UI library for Vue featuring a rich set of 80+ components, a theme designer, various theme alternatives such as Material, Bootstrap, Tailwind, premium templates and professional support. In addition, it integrates with PrimeBloc
2 lines (1 loc) • 2.21 kB
JavaScript
this.primevue=this.primevue||{},this.primevue.blockui=function(e,t,o,s){"use strict";function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n={name:"BlockUI",extends:{name:"BaseBlockUI",extends:i(t).default,props:{blocked:{type:Boolean,default:!1},fullScreen:{type:Boolean,default:!1},baseZIndex:{type:Number,default:0},autoZIndex:{type:Boolean,default:!0}},style:i(o).default,provide:function(){return{$parentInstance:this}}},emits:["block","unblock"],mask:null,data:function(){return{isBlocked:!1}},watch:{blocked:function(e){!0===e?this.block():this.unblock()}},mounted:function(){this.blocked&&this.block()},methods:{block:function(){var t="p-blockui p-component-overlay p-component-overlay-enter";this.fullScreen?(t+=" p-blockui-document",this.mask=e.DomHandler.createElement("div",{"data-pc-section":"mask",style:{position:"fixed",top:"0",left:"0",width:"100%",height:"100%"},class:!this.isUnstyled&&t,"p-bind":this.ptm("mask")}),document.body.appendChild(this.mask),e.DomHandler.blockBodyScroll(),document.activeElement.blur()):(this.mask=e.DomHandler.createElement("div",{"data-pc-section":"mask",style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%"},class:!this.isUnstyled&&t,"p-bind":this.ptm("mask")}),this.$refs.container.appendChild(this.mask)),this.autoZIndex&&e.ZIndexUtils.set("modal",this.mask,this.baseZIndex+this.$primevue.config.zIndex.modal),this.isBlocked=!0,this.$emit("block")},unblock:function(){var t=this;!this.isUnstyled&&e.DomHandler.addClass(this.mask,"p-component-overlay-leave"),e.DomHandler.hasCSSAnimation(this.mask)>0?this.mask.addEventListener("animationend",(function(){t.removeMask()})):this.removeMask()},removeMask:function(){e.ZIndexUtils.clear(this.mask),this.fullScreen?(document.body.removeChild(this.mask),e.DomHandler.unblockBodyScroll()):this.$refs.container.removeChild(this.mask),this.isBlocked=!1,this.$emit("unblock")}}},l=["aria-busy"];return n.render=function(e,t,o,i,n,a){return s.openBlock(),s.createElementBlock("div",s.mergeProps({ref:"container",class:e.cx("root"),"aria-busy":n.isBlocked},e.ptm("root")),[s.renderSlot(e.$slots,"default")],16,l)},n}(primevue.utils,primevue.basecomponent,primevue.blockui.style,Vue);