mirror of
https://github.com/hpd840321/starRiverProperty.git
synced 2026-06-09 16:30:29 +08:00
86fc4eb695
Former-commit-id: 227ec9664fa803a11a731cf5336437c497f17066
2 lines
3.9 KiB
JavaScript
2 lines
3.9 KiB
JavaScript
"131:function(e,t,n){\"use strict\";n.r(t);var r=n(5),i=n.n(r),o=n(17),a=n.n(o),s=n(2),u=n(3),c=n(7),l=n.n(c),f={name:\"ElTooltip\",mixins:[i.a],props:{openDelay:{type:Number,default:0},disabled:Boolean,manual:Boolean,effect:{type:String,default:\"dark\"},arrowOffset:{type:Number,default:0},popperClass:String,content:String,visibleArrow:{default:!0},transition:{type:String,default:\"el-fade-in-linear\"},popperOptions:{default:function(){return{boundariesPadding:10,gpuAcceleration:!1}}},enterable:{type:Boolean,default:!0},hideAfter:{type:Number,default:0},tabindex:{type:Number,default:0}},data:function(){return{tooltipId:\"el-tooltip-\"+Object(u.generateId)(),timeoutPending:null,focusing:!1}},beforeCreate:function(){var e=this;this.$isServer||(this.popperVM=new l.a({data:{node:\"\"},render:function(e){return this.node}}).$mount(),this.debounceClose=a()(200,(function(){return e.handleClosePopper()})))},render:function(e){var t=this;this.popperVM&&(this.popperVM.node=e(\"transition\",{attrs:{name:this.transition},on:{afterLeave:this.doDestroy}},[e(\"div\",{on:{mouseleave:function(){t.setExpectedState(!1),t.debounceClose()},mouseenter:function(){t.setExpectedState(!0)}},ref:\"popper\",attrs:{role:\"tooltip\",id:this.tooltipId,\"aria-hidden\":this.disabled||!this.showPopper?\"true\":\"false\"},directives:[{name:\"show\",value:!this.disabled&&this.showPopper}],class:[\"el-tooltip__popper\",\"is-\"+this.effect,this.popperClass]},[this.$slots.content||this.content])]));var n=this.getFirstElement();if(!n)return null;var r=n.data=n.data||{};return r.staticClass=this.addTooltipClass(r.staticClass),n},mounted:function(){var e=this;this.referenceElm=this.$el,1===this.$el.nodeType&&(this.$el.setAttribute(\"aria-describedby\",this.tooltipId),this.$el.setAttribute(\"tabindex\",this.tabindex),Object(s.on)(this.referenceElm,\"mouseenter\",this.show),Object(s.on)(this.referenceElm,\"mouseleave\",this.hide),Object(s.on)(this.referenceElm,\"focus\",(function(){if(e.$slots.default&&e.$slots.default.length){var t=e.$slots.default[0].componentInstance;t&&t.focus?t.focus():e.handleFocus()}else e.handleFocus()})),Object(s.on)(this.referenceElm,\"blur\",this.handleBlur),Object(s.on)(this.referenceElm,\"click\",this.removeFocusing)),this.value&&this.popperVM&&this.popperVM.$nextTick((function(){e.value&&e.updatePopper()}))},watch:{focusing:function(e){e?Object(s.addClass)(this.referenceElm,\"focusing\"):Object(s.removeClass)(this.referenceElm,\"focusing\")}},methods:{show:function(){this.setExpectedState(!0),this.handleShowPopper()},hide:function(){this.setExpectedState(!1),this.debounceClose()},handleFocus:function(){this.focusing=!0,this.show()},handleBlur:function(){this.focusing=!1,this.hide()},removeFocusing:function(){this.focusing=!1},addTooltipClass:function(e){return e?\"el-tooltip \"+e.replace(\"el-tooltip\",\"\"):\"el-tooltip\"},handleShowPopper:function(){var e=this;this.expectedState&&!this.manual&&(clearTimeout(this.timeout),this.timeout=setTimeout((function(){e.showPopper=!0}),this.openDelay),this.hideAfter>0&&(this.timeoutPending=setTimeout((function(){e.showPopper=!1}),this.hideAfter)))},handleClosePopper:function(){this.enterable&&this.expectedState||this.manual||(clearTimeout(this.timeout),this.timeoutPending&&clearTimeout(this.timeoutPending),this.showPopper=!1,this.disabled&&this.doDestroy())},setExpectedState:function(e){!1===e&&clearTimeout(this.timeoutPending),this.expectedState=e},getFirstElement:function(){var e=this.$slots.default;if(!Array.isArray(e))return null;for(var t=null,n=0;n<e.length;n++)e[n]&&e[n].tag&&(t=e[n]);return t}},beforeDestroy:function(){this.popperVM&&this.popperVM.$destroy()},destroyed:function(){var e=this.referenceElm;1===e.nodeType&&(Object(s.off)(e,\"mouseenter\",this.show),Object(s.off)(e,\"mouseleave\",this.hide),Object(s.off)(e,\"focus\",this.handleFocus),Object(s.off)(e,\"blur\",this.handleBlur),Object(s.off)(e,\"click\",this.removeFocusing))},install:function(e){e.component(f.name,f)}};t.default=f}";
|