@bpui/popover
Advanced tools
Comparing version 1.1.19 to 1.1.20
/*! | ||
* bpui popover v1.1.19 | ||
* bpui popover v1.1.20 | ||
* Copyright (c) 2021 Copyright bpoint.lee@live.com All Rights Reserved. | ||
@@ -962,22 +962,17 @@ * Released under the MIT License. | ||
_onTriggerHide: function _onTriggerHide(e) { | ||
var _this4 = this; | ||
var main = $(this.$refs.main); | ||
var ev = e; | ||
this.$timer.setTimeout(function () { | ||
_newArrowCheck(this, _this4); | ||
var ev = e; // this.$timer.setTimeout(()=>{ | ||
var mainOffset = bpLibs.dom.getElementOffset(main[0]); // in popover. | ||
var mainOffset = bpLibs.dom.getElementOffset(main[0]); // in popover. | ||
if (ev && ev.clientX + ev.offsetX >= mainOffset.left - 24 && ev.clientX + ev.offsetX <= mainOffset.left + main[0].offsetWidth + 24 && ev.clientY + ev.offsetY >= mainOffset.top - 24 && ev.clientY + ev.offsetY <= mainOffset.top + main[0].offsetHeight + 24) { | ||
$(this.$refs.main).on('mouseleave', this._hideVisible); | ||
} else { | ||
this.visibleReal = false; | ||
} | ||
if (ev && ev.clientX >= mainOffset.left - 24 && ev.clientX <= mainOffset.left + main[0].offsetWidth + 24 && ev.clientY >= mainOffset.top - 24 && ev.clientY <= mainOffset.top + main[0].offsetHeight + 24) { | ||
$(this.$refs.main).on('mouseleave', this._hideVisible); | ||
} else { | ||
this.visibleReal = false; | ||
} | ||
$('body').off('click', this._hide); | ||
}.bind(this), 50); | ||
$('body').off('click', this._hide); // }, 50); | ||
}, | ||
_show: function _show(directionData) { | ||
var _this5 = this; | ||
var _this4 = this; | ||
@@ -1044,7 +1039,7 @@ var bind = this.bind; | ||
bpLibs.dom.probeDom(400, function () { | ||
_newArrowCheck(this, _this5); | ||
_newArrowCheck(this, _this4); | ||
return main.clientWidth > 0; | ||
}.bind(this), function () { | ||
_newArrowCheck(this, _this5); | ||
_newArrowCheck(this, _this4); | ||
@@ -1116,12 +1111,36 @@ if (directionData == 'left' || directionData == 'right') { | ||
_hide: function _hide() { | ||
var _this6 = this; | ||
var _this5 = this; | ||
$('body').off('click', this._hide); | ||
this.hide().then(function (res) { | ||
_newArrowCheck(this, _this6); | ||
_newArrowCheck(this, _this5); | ||
}.bind(this)); | ||
}, | ||
_hideVisible: function _hideVisible() { | ||
_hideVisible: function _hideVisible(ev) { | ||
$(this.$refs.main).off('mouseleave', this._hideVisible); | ||
if (ev) { | ||
var el; | ||
if (bpLibs.dom.isVueObject(this.bind)) { | ||
el = this.bind.$el; | ||
} else { | ||
el = this.bind; | ||
if (typeof el === 'string') { | ||
el = $(el)[0]; | ||
} | ||
} | ||
var mainOffset = bpLibs.dom.getElementOffset(el); // in popover. | ||
if (ev.clientX >= mainOffset.left - 24 && ev.clientX <= mainOffset.left + el.offsetWidth + 24 && ev.clientY >= mainOffset.top - 24 && ev.clientY <= mainOffset.top + el.offsetHeight + 24) { | ||
return; | ||
} // if (ev.toElement.isSameNode(el)) { | ||
// return; | ||
// } | ||
} | ||
this.visibleReal = false; | ||
$(this.$refs.main).off('mouseleave', this._hideVisible); | ||
} | ||
@@ -1128,0 +1147,0 @@ } |
/*! | ||
* bpui popover v1.1.19 | ||
* bpui popover v1.1.20 | ||
* Copyright (c) 2021 Copyright bpoint.lee@live.com All Rights Reserved. | ||
* Released under the MIT License. | ||
*/ | ||
"use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}var e=t(require("@bpui/libs")),o=t(require("@bpui/dialog"));function i(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),o.push.apply(o,i)}return o}function r(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function n(t,e){if(t!==e)throw new TypeError("Cannot instantiate an arrow function")}var s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function f(t,e){return t(e={exports:{}},e.exports),e.exports}var c=function(t){return t&&t.Math==Math&&t},a=c("object"==typeof globalThis&&globalThis)||c("object"==typeof window&&window)||c("object"==typeof self&&self)||c("object"==typeof s&&s)||function(){return this}()||Function("return this")(),u=function(t){try{return!!t()}catch(t){return!0}},l=!u((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),h={}.propertyIsEnumerable,p=Object.getOwnPropertyDescriptor,d={f:p&&!h.call({1:2},1)?function(t){var e=p(this,t);return!!e&&e.enumerable}:h},g=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},v={}.toString,b=function(t){return v.call(t).slice(8,-1)},y="".split,w=u((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==b(t)?y.call(t,""):Object(t)}:Object,m=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},_=function(t){return w(m(t))},T=function(t){return"object"==typeof t?null!==t:"function"==typeof t},S=function(t,e){if(!T(t))return t;var o,i;if(e&&"function"==typeof(o=t.toString)&&!T(i=o.call(t)))return i;if("function"==typeof(o=t.valueOf)&&!T(i=o.call(t)))return i;if(!e&&"function"==typeof(o=t.toString)&&!T(i=o.call(t)))return i;throw TypeError("Can't convert object to primitive value")},O=function(t){return Object(m(t))},j={}.hasOwnProperty,A=Object.hasOwn||function(t,e){return j.call(O(t),e)},E=a.document,L=T(E)&&T(E.createElement),P=!l&&!u((function(){return 7!=Object.defineProperty((t="div",L?E.createElement(t):{}),"a",{get:function(){return 7}}).a;var t})),x=Object.getOwnPropertyDescriptor,k={f:l?x:function(t,e){if(t=_(t),e=S(e,!0),P)try{return x(t,e)}catch(t){}if(A(t,e))return g(!d.f.call(t,e),t[e])}},R=function(t){if(!T(t))throw TypeError(String(t)+" is not an object");return t},C=Object.defineProperty,I={f:l?C:function(t,e,o){if(R(t),e=S(e,!0),R(o),P)try{return C(t,e,o)}catch(t){}if("get"in o||"set"in o)throw TypeError("Accessors not supported");return"value"in o&&(t[e]=o.value),t}},D=l?function(t,e,o){return I.f(t,e,g(1,o))}:function(t,e,o){return t[e]=o,t},M=function(t,e){try{D(a,t,e)}catch(o){a[t]=e}return e},H=a["__core-js_shared__"]||M("__core-js_shared__",{}),B=Function.toString;"function"!=typeof H.inspectSource&&(H.inspectSource=function(t){return B.call(t)});var V,F,W,N,z=H.inspectSource,X=a.WeakMap,Y="function"==typeof X&&/native code/.test(z(X)),q=f((function(t){(t.exports=function(t,e){return H[t]||(H[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.15.2",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})})),G=0,U=Math.random(),K=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++G+U).toString(36)},J=q("keys"),Q={},Z=a.WeakMap;if(Y||H.state){var tt=H.state||(H.state=new Z),et=tt.get,ot=tt.has,it=tt.set;V=function(t,e){if(ot.call(tt,t))throw new TypeError("Object already initialized");return e.facade=t,it.call(tt,t,e),e},F=function(t){return et.call(tt,t)||{}},W=function(t){return ot.call(tt,t)}}else{var rt=J[N="state"]||(J[N]=K(N));Q[rt]=!0,V=function(t,e){if(A(t,rt))throw new TypeError("Object already initialized");return e.facade=t,D(t,rt,e),e},F=function(t){return A(t,rt)?t[rt]:{}},W=function(t){return A(t,rt)}}var nt,st,ft={set:V,get:F,has:W,enforce:function(t){return W(t)?F(t):V(t,{})},getterFor:function(t){return function(e){var o;if(!T(e)||(o=F(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return o}}},ct=f((function(t){var e=ft.get,o=ft.enforce,i=String(String).split("String");(t.exports=function(t,e,r,n){var s,f=!!n&&!!n.unsafe,c=!!n&&!!n.enumerable,u=!!n&&!!n.noTargetGet;"function"==typeof r&&("string"!=typeof e||A(r,"name")||D(r,"name",e),(s=o(r)).source||(s.source=i.join("string"==typeof e?e:""))),t!==a?(f?!u&&t[e]&&(c=!0):delete t[e],c?t[e]=r:D(t,e,r)):c?t[e]=r:M(e,r)})(Function.prototype,"toString",(function(){return"function"==typeof this&&e(this).source||z(this)}))})),at=a,ut=function(t){return"function"==typeof t?t:void 0},lt=function(t,e){return arguments.length<2?ut(at[t])||ut(a[t]):at[t]&&at[t][e]||a[t]&&a[t][e]},ht=Math.ceil,pt=Math.floor,dt=function(t){return isNaN(t=+t)?0:(t>0?pt:ht)(t)},gt=Math.min,vt=function(t){return t>0?gt(dt(t),9007199254740991):0},bt=Math.max,yt=Math.min,wt=function(t){return function(e,o,i){var r,n=_(e),s=vt(n.length),f=function(t,e){var o=dt(t);return o<0?bt(o+e,0):yt(o,e)}(i,s);if(t&&o!=o){for(;s>f;)if((r=n[f++])!=r)return!0}else for(;s>f;f++)if((t||f in n)&&n[f]===o)return t||f||0;return!t&&-1}},mt={includes:wt(!0),indexOf:wt(!1)}.indexOf,_t=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"].concat("length","prototype"),Tt={f:Object.getOwnPropertyNames||function(t){return function(t,e){var o,i=_(t),r=0,n=[];for(o in i)!A(Q,o)&&A(i,o)&&n.push(o);for(;e.length>r;)A(i,o=e[r++])&&(~mt(n,o)||n.push(o));return n}(t,_t)}},St={f:Object.getOwnPropertySymbols},Ot=lt("Reflect","ownKeys")||function(t){var e=Tt.f(R(t)),o=St.f;return o?e.concat(o(t)):e},jt=function(t,e){for(var o=Ot(e),i=I.f,r=k.f,n=0;n<o.length;n++){var s=o[n];A(t,s)||i(t,s,r(e,s))}},At=/#|\.prototype\./,$t=function(t,e){var o=Lt[Et(t)];return o==xt||o!=Pt&&("function"==typeof e?u(e):!!e)},Et=$t.normalize=function(t){return String(t).replace(At,".").toLowerCase()},Lt=$t.data={},Pt=$t.NATIVE="N",xt=$t.POLYFILL="P",kt=$t,Rt=k.f,Ct=Array.isArray||function(t){return"Array"==b(t)},It=function(t,e,o){var i=S(e);i in t?I.f(t,i,g(0,o)):t[i]=o},Dt=lt("navigator","userAgent")||"",Mt=a.process,Ht=Mt&&Mt.versions,Bt=Ht&&Ht.v8;Bt?st=(nt=Bt.split("."))[0]<4?1:nt[0]+nt[1]:Dt&&(!(nt=Dt.match(/Edge\/(\d+)/))||nt[1]>=74)&&(nt=Dt.match(/Chrome\/(\d+)/))&&(st=nt[1]);var Vt,Ft=st&&+st,Wt=!!Object.getOwnPropertySymbols&&!u((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&Ft&&Ft<41})),Nt=Wt&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,zt=q("wks"),Xt=a.Symbol,Yt=Nt?Xt:Xt&&Xt.withoutSetter||K,qt=function(t){return A(zt,t)&&(Wt||"string"==typeof zt[t])||(Wt&&A(Xt,t)?zt[t]=Xt[t]:zt[t]=Yt("Symbol."+t)),zt[t]},Gt=qt("species"),Ut=function(t,e){var o;return Ct(t)&&("function"!=typeof(o=t.constructor)||o!==Array&&!Ct(o.prototype)?T(o)&&null===(o=o[Gt])&&(o=void 0):o=void 0),new(void 0===o?Array:o)(0===e?0:e)},Kt=qt("species"),Jt=qt("isConcatSpreadable"),Qt=Ft>=51||!u((function(){var t=[];return t[Jt]=!1,t.concat()[0]!==t})),Zt=(Vt="concat",Ft>=51||!u((function(){var t=[];return(t.constructor={})[Kt]=function(){return{foo:1}},1!==t[Vt](Boolean).foo}))),te=function(t){if(!T(t))return!1;var e=t[Jt];return void 0!==e?!!e:Ct(t)};function ee(t,e,o,i,r,n,s,f,c,a){"boolean"!=typeof s&&(c=f,f=s,s=!1);var u,l="function"==typeof o?o.options:o;if(t&&t.render&&(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,r&&(l.functional=!0)),i&&(l._scopeId=i),n?(u=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,c(t)),t&&t._registeredComponents&&t._registeredComponents.add(n)},l._ssrRegister=u):e&&(u=s?function(t){e.call(this,a(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,f(t))}),u)if(l.functional){var h=l.render;l.render=function(t,e){return u.call(e),h(t,e)}}else{var p=l.beforeCreate;l.beforeCreate=p?[].concat(p,u):[u]}return o}!function(t,e){var o,i,r,n,s,f=t.target,c=t.global,u=t.stat;if(o=c?a:u?a[f]||M(f,{}):(a[f]||{}).prototype)for(i in e){if(n=e[i],r=t.noTargetGet?(s=Rt(o,i))&&s.value:o[i],!kt(c?i:f+(u?".":"#")+i,t.forced)&&void 0!==r){if(typeof n==typeof r)continue;jt(n,r)}(t.sham||r&&r.sham)&&D(n,"sham",!0),ct(o,i,n,t)}}({target:"Array",proto:!0,forced:!Qt||!Zt},{concat:function(t){var e,o,i,r,n,s=O(this),f=Ut(s,0),c=0;for(e=-1,i=arguments.length;e<i;e++)if(te(n=-1===e?s:arguments[e])){if(c+(r=vt(n.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(o=0;o<r;o++,c++)o in n&&It(f,c,n[o])}else{if(c>=9007199254740991)throw TypeError("Maximum allowed index exceeded");It(f,c++,n)}return f.length=c,f}});var oe={components:{widget:o.bpWidget},props:{visible:Boolean,mask:{default:!1,type:Boolean},maskClose:{default:!0,type:Boolean},pageClass:String|Array,pageStyle:String|Array|Object,direction:{default:"auto",type:String},trigger:{type:String},bind:{}},computed:{pStyle:function(){return this.pageStyle?"string"==typeof this.pageStyle?"left:".concat(this.offsetLeft,";top:").concat(this.offsetTop,";")+this.pageStyle:function(t){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?i(Object(o),!0).forEach((function(e){r(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):i(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}({left:this.offsetLeft,top:this.offsetTop},this.pageStyle):{left:this.offsetLeft,top:this.offsetTop}}},data:function(){return{visibleReal:!1,directionData:"auto",offsetTop:0,offsetLeft:0,offsetArrowLeft:null,offsetArrowTop:null,offsetArrowBottom:null,offsetArrowRight:null}},watch:{visible:function(t,e){this.visibleReal!=t&&(this.visibleReal=t,t!=e&&(t?this._onTriggerShow(null):this._onTriggerHide(null)))},visibleReal:function(t){this.$emit("update:visible",t)},bind:function(t,e){this._removeEvent(e),this._bindEvent(t)}},beforeMount:function(){this.visibleReal=this.visible},beforeDestroy:function(){this._removeEvent(this.bind),$("body").off("click",this._hide)},mounted:function(){var t=this;this.$nextTick(function(){n(this,t),this.$parent.$forceUpdate()}.bind(this))},methods:{show:function(){return this.$refs.widget.show()},hide:function(){return this.$refs.widget.hide()},_removeEvent:function(t){var o;t&&(o=e.dom.isVueObject(t)?t.$el:t,$(o).off("mouseover",this._onTriggerShow),$(o).off("mouseleave",this._onTriggerHide),$(o).off("click",this._onTriggerShow),this.ges&&(this.ges.dispose(),this.ges=null))},_bindEvent:function(t){var o,i=this;if(this._removeEvent(t),t)if(o=e.dom.isVueObject(t)?t.$el:t,"hover"==this.trigger)e.device.browserIsMobile()?$(o).on("click",this._onTriggerShow):($(o).on("mouseover",this._onTriggerShow),$(o).on("mouseleave",this._onTriggerHide));else if("click"==this.trigger){var r=(e.device.browserIsMobile(),"click");$(o).off(r,this._onTriggerShow).on(r,this._onTriggerShow)}else"long-press"==this.trigger&&(this.ges=new e.Gesture(o),this.ges.enablePressRecognizer({duration:600}),this.ges.on("press",function(t){n(this,i),e.device.vibrate(10),this._onTriggerShow(t)}.bind(this)))},_onTriggerShow:function(t){var e=this;this.visibleReal=!0,setTimeout(function(){n(this,e),$("body").off("click",this._hide).on("click",this._hide)}.bind(this),10),this._show(this.direction)},_onTriggerHide:function(t){var o=this,i=$(this.$refs.main),r=t;this.$timer.setTimeout(function(){n(this,o);var t=e.dom.getElementOffset(i[0]);r&&r.clientX+r.offsetX>=t.left-24&&r.clientX+r.offsetX<=t.left+i[0].offsetWidth+24&&r.clientY+r.offsetY>=t.top-24&&r.clientY+r.offsetY<=t.top+i[0].offsetHeight+24?$(this.$refs.main).on("mouseleave",this._hideVisible):this.visibleReal=!1,$("body").off("click",this._hide)}.bind(this),50)},_show:function(t){var o=this,i=this.bind;if(this.bind){var r;r=e.dom.isVueObject(i)?i.$el:i;var s=e.dom.getElementOffset(r),f={};f.height=r.clientHeight,f.width=r.clientWidth;var c,a=e.dom.getViewPort(),u=e.dom.getDocumentOffset();this.offsetTop=s.top+u.top,"top"==t?(this.directionData="top",this.offsetTop-=8):"bottom"==t?(this.directionData="bottom",this.offsetTop+=f.height):"left"==t?(this.directionData="left",this.offsetLeft=s.left+f.width):"right"==t?(this.directionData="right",this.offsetLeft=s.left+f.width):s.top+f.height/2>a.height/2?(t="top",this.directionData="top",this.offsetTop-=8):(t="bottom",this.directionData="bottom",this.offsetTop+=f.height),this.offsetTop=parseInt(this.offsetTop),c="left"==t||"right"==t?parseInt(s.top+f.height/2):parseInt(s.left+f.width/2);var l=this.$refs.main;e.dom.probeDom(400,function(){return n(this,o),l.clientWidth>0}.bind(this),function(){if(n(this,o),"left"==t||"right"==t){var e=parseInt(c-l.clientHeight/2);e<10&&(e=10),e+l.clientHeight>a.height-10&&(e=a.height-10-l.clientHeight),this.offsetTop=parseInt(e+u.top)+"px",this.offsetLeft="right"==t?s.left+f.width+6:s.left-l.clientWidth-6-6,this.offsetLeft+=u.left,this.offsetLeft=parseInt(this.offsetLeft),this.offsetLeft+="px",this.offsetArrowLeft=null,this.offsetArrowBottom=null,this.offsetArrowTop=parseInt(c-e-6),this.offsetArrowTop<10?this.offsetArrowTop=10:this.offsetArrowTop>l.clientHeight-22&&(this.offsetArrowTop=parseInt(l.clientHeight-22)),this.offsetArrowTop+="px",this.offsetArrowRight=null}else{var i=parseInt(l.clientWidth||50),r=parseInt(l.clientHeight||50);"top"==t&&(this.offsetTop-=r+6),this.offsetTop+="px";var h=parseInt(c-i/2);h<10&&(h=10),h+i>a.width-10&&(h=a.width-10-i),this.offsetLeft=parseInt(h)+"px",this.offsetArrowLeft=parseInt(c-h)-6,this.offsetArrowLeft<10?this.offsetArrowLeft=10:this.offsetArrowLeft>i-22&&(this.offsetArrowLeft=i-22),this.offsetArrowLeft+="px",this.offsetArrowBottom=null,this.offsetArrowTop=null,this.offsetArrowRight=null}}.bind(this))}},_hide:function(){var t=this;$("body").off("click",this._hide),this.hide().then(function(e){n(this,t)}.bind(this))},_hideVisible:function(){this.visibleReal=!1,$(this.$refs.main).off("mouseleave",this._hideVisible)}}},ie=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("widget",{ref:"widget",staticClass:"bp-popover",attrs:{visible:t.visibleReal,maskClose:t.maskClose,mask:t.mask,preventEvent:!1,hideBodyScroll:!1,appendToBody:!0},on:{"update:visible":function(e){t.visibleReal=e}}},[o("div",{ref:"main",staticClass:"bp-popover__main",class:t.pageClass,style:t.pStyle,attrs:{direction:t.directionData}},[t._t("default"),t._v(" "),o("div",{staticClass:"bp-popover__arrow",style:{left:t.offsetArrowLeft,top:t.offsetArrowTop,right:t.offsetArrowRight,bottom:t.offsetArrowBottom}})],2)])};ie._withStripped=!0;var re={bpPopover:ee({render:ie,staticRenderFns:[]},void 0,oe,void 0,!1,void 0,!1,void 0,void 0,void 0)};module.exports=re; | ||
"use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}var e=t(require("@bpui/libs")),i=t(require("@bpui/dialog"));function o(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,o)}return i}function r(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function n(t,e){if(t!==e)throw new TypeError("Cannot instantiate an arrow function")}var s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function f(t,e){return t(e={exports:{}},e.exports),e.exports}var c=function(t){return t&&t.Math==Math&&t},a=c("object"==typeof globalThis&&globalThis)||c("object"==typeof window&&window)||c("object"==typeof self&&self)||c("object"==typeof s&&s)||function(){return this}()||Function("return this")(),u=function(t){try{return!!t()}catch(t){return!0}},l=!u((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),h={}.propertyIsEnumerable,p=Object.getOwnPropertyDescriptor,d={f:p&&!h.call({1:2},1)?function(t){var e=p(this,t);return!!e&&e.enumerable}:h},g=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},b={}.toString,v=function(t){return b.call(t).slice(8,-1)},y="".split,m=u((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==v(t)?y.call(t,""):Object(t)}:Object,w=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},_=function(t){return m(w(t))},T=function(t){return"object"==typeof t?null!==t:"function"==typeof t},O=function(t,e){if(!T(t))return t;var i,o;if(e&&"function"==typeof(i=t.toString)&&!T(o=i.call(t)))return o;if("function"==typeof(i=t.valueOf)&&!T(o=i.call(t)))return o;if(!e&&"function"==typeof(i=t.toString)&&!T(o=i.call(t)))return o;throw TypeError("Can't convert object to primitive value")},S=function(t){return Object(w(t))},j={}.hasOwnProperty,A=Object.hasOwn||function(t,e){return j.call(S(t),e)},E=a.document,L=T(E)&&T(E.createElement),P=!l&&!u((function(){return 7!=Object.defineProperty((t="div",L?E.createElement(t):{}),"a",{get:function(){return 7}}).a;var t})),x=Object.getOwnPropertyDescriptor,k={f:l?x:function(t,e){if(t=_(t),e=O(e,!0),P)try{return x(t,e)}catch(t){}if(A(t,e))return g(!d.f.call(t,e),t[e])}},R=function(t){if(!T(t))throw TypeError(String(t)+" is not an object");return t},C=Object.defineProperty,I={f:l?C:function(t,e,i){if(R(t),e=O(e,!0),R(i),P)try{return C(t,e,i)}catch(t){}if("get"in i||"set"in i)throw TypeError("Accessors not supported");return"value"in i&&(t[e]=i.value),t}},D=l?function(t,e,i){return I.f(t,e,g(1,i))}:function(t,e,i){return t[e]=i,t},M=function(t,e){try{D(a,t,e)}catch(i){a[t]=e}return e},H=a["__core-js_shared__"]||M("__core-js_shared__",{}),V=Function.toString;"function"!=typeof H.inspectSource&&(H.inspectSource=function(t){return V.call(t)});var B,W,F,N,z=H.inspectSource,X=a.WeakMap,Y="function"==typeof X&&/native code/.test(z(X)),q=f((function(t){(t.exports=function(t,e){return H[t]||(H[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.15.2",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})})),G=0,U=Math.random(),K=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++G+U).toString(36)},J=q("keys"),Q={},Z=a.WeakMap;if(Y||H.state){var tt=H.state||(H.state=new Z),et=tt.get,it=tt.has,ot=tt.set;B=function(t,e){if(it.call(tt,t))throw new TypeError("Object already initialized");return e.facade=t,ot.call(tt,t,e),e},W=function(t){return et.call(tt,t)||{}},F=function(t){return it.call(tt,t)}}else{var rt=J[N="state"]||(J[N]=K(N));Q[rt]=!0,B=function(t,e){if(A(t,rt))throw new TypeError("Object already initialized");return e.facade=t,D(t,rt,e),e},W=function(t){return A(t,rt)?t[rt]:{}},F=function(t){return A(t,rt)}}var nt,st,ft={set:B,get:W,has:F,enforce:function(t){return F(t)?W(t):B(t,{})},getterFor:function(t){return function(e){var i;if(!T(e)||(i=W(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return i}}},ct=f((function(t){var e=ft.get,i=ft.enforce,o=String(String).split("String");(t.exports=function(t,e,r,n){var s,f=!!n&&!!n.unsafe,c=!!n&&!!n.enumerable,u=!!n&&!!n.noTargetGet;"function"==typeof r&&("string"!=typeof e||A(r,"name")||D(r,"name",e),(s=i(r)).source||(s.source=o.join("string"==typeof e?e:""))),t!==a?(f?!u&&t[e]&&(c=!0):delete t[e],c?t[e]=r:D(t,e,r)):c?t[e]=r:M(e,r)})(Function.prototype,"toString",(function(){return"function"==typeof this&&e(this).source||z(this)}))})),at=a,ut=function(t){return"function"==typeof t?t:void 0},lt=function(t,e){return arguments.length<2?ut(at[t])||ut(a[t]):at[t]&&at[t][e]||a[t]&&a[t][e]},ht=Math.ceil,pt=Math.floor,dt=function(t){return isNaN(t=+t)?0:(t>0?pt:ht)(t)},gt=Math.min,bt=function(t){return t>0?gt(dt(t),9007199254740991):0},vt=Math.max,yt=Math.min,mt=function(t){return function(e,i,o){var r,n=_(e),s=bt(n.length),f=function(t,e){var i=dt(t);return i<0?vt(i+e,0):yt(i,e)}(o,s);if(t&&i!=i){for(;s>f;)if((r=n[f++])!=r)return!0}else for(;s>f;f++)if((t||f in n)&&n[f]===i)return t||f||0;return!t&&-1}},wt={includes:mt(!0),indexOf:mt(!1)}.indexOf,_t=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"].concat("length","prototype"),Tt={f:Object.getOwnPropertyNames||function(t){return function(t,e){var i,o=_(t),r=0,n=[];for(i in o)!A(Q,i)&&A(o,i)&&n.push(i);for(;e.length>r;)A(o,i=e[r++])&&(~wt(n,i)||n.push(i));return n}(t,_t)}},Ot={f:Object.getOwnPropertySymbols},St=lt("Reflect","ownKeys")||function(t){var e=Tt.f(R(t)),i=Ot.f;return i?e.concat(i(t)):e},jt=function(t,e){for(var i=St(e),o=I.f,r=k.f,n=0;n<i.length;n++){var s=i[n];A(t,s)||o(t,s,r(e,s))}},At=/#|\.prototype\./,$t=function(t,e){var i=Lt[Et(t)];return i==xt||i!=Pt&&("function"==typeof e?u(e):!!e)},Et=$t.normalize=function(t){return String(t).replace(At,".").toLowerCase()},Lt=$t.data={},Pt=$t.NATIVE="N",xt=$t.POLYFILL="P",kt=$t,Rt=k.f,Ct=Array.isArray||function(t){return"Array"==v(t)},It=function(t,e,i){var o=O(e);o in t?I.f(t,o,g(0,i)):t[o]=i},Dt=lt("navigator","userAgent")||"",Mt=a.process,Ht=Mt&&Mt.versions,Vt=Ht&&Ht.v8;Vt?st=(nt=Vt.split("."))[0]<4?1:nt[0]+nt[1]:Dt&&(!(nt=Dt.match(/Edge\/(\d+)/))||nt[1]>=74)&&(nt=Dt.match(/Chrome\/(\d+)/))&&(st=nt[1]);var Bt,Wt=st&&+st,Ft=!!Object.getOwnPropertySymbols&&!u((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&Wt&&Wt<41})),Nt=Ft&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,zt=q("wks"),Xt=a.Symbol,Yt=Nt?Xt:Xt&&Xt.withoutSetter||K,qt=function(t){return A(zt,t)&&(Ft||"string"==typeof zt[t])||(Ft&&A(Xt,t)?zt[t]=Xt[t]:zt[t]=Yt("Symbol."+t)),zt[t]},Gt=qt("species"),Ut=function(t,e){var i;return Ct(t)&&("function"!=typeof(i=t.constructor)||i!==Array&&!Ct(i.prototype)?T(i)&&null===(i=i[Gt])&&(i=void 0):i=void 0),new(void 0===i?Array:i)(0===e?0:e)},Kt=qt("species"),Jt=qt("isConcatSpreadable"),Qt=Wt>=51||!u((function(){var t=[];return t[Jt]=!1,t.concat()[0]!==t})),Zt=(Bt="concat",Wt>=51||!u((function(){var t=[];return(t.constructor={})[Kt]=function(){return{foo:1}},1!==t[Bt](Boolean).foo}))),te=function(t){if(!T(t))return!1;var e=t[Jt];return void 0!==e?!!e:Ct(t)};function ee(t,e,i,o,r,n,s,f,c,a){"boolean"!=typeof s&&(c=f,f=s,s=!1);var u,l="function"==typeof i?i.options:i;if(t&&t.render&&(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,r&&(l.functional=!0)),o&&(l._scopeId=o),n?(u=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,c(t)),t&&t._registeredComponents&&t._registeredComponents.add(n)},l._ssrRegister=u):e&&(u=s?function(t){e.call(this,a(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,f(t))}),u)if(l.functional){var h=l.render;l.render=function(t,e){return u.call(e),h(t,e)}}else{var p=l.beforeCreate;l.beforeCreate=p?[].concat(p,u):[u]}return i}!function(t,e){var i,o,r,n,s,f=t.target,c=t.global,u=t.stat;if(i=c?a:u?a[f]||M(f,{}):(a[f]||{}).prototype)for(o in e){if(n=e[o],r=t.noTargetGet?(s=Rt(i,o))&&s.value:i[o],!kt(c?o:f+(u?".":"#")+o,t.forced)&&void 0!==r){if(typeof n==typeof r)continue;jt(n,r)}(t.sham||r&&r.sham)&&D(n,"sham",!0),ct(i,o,n,t)}}({target:"Array",proto:!0,forced:!Qt||!Zt},{concat:function(t){var e,i,o,r,n,s=S(this),f=Ut(s,0),c=0;for(e=-1,o=arguments.length;e<o;e++)if(te(n=-1===e?s:arguments[e])){if(c+(r=bt(n.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(i=0;i<r;i++,c++)i in n&&It(f,c,n[i])}else{if(c>=9007199254740991)throw TypeError("Maximum allowed index exceeded");It(f,c++,n)}return f.length=c,f}});var ie={components:{widget:i.bpWidget},props:{visible:Boolean,mask:{default:!1,type:Boolean},maskClose:{default:!0,type:Boolean},pageClass:String|Array,pageStyle:String|Array|Object,direction:{default:"auto",type:String},trigger:{type:String},bind:{}},computed:{pStyle:function(){return this.pageStyle?"string"==typeof this.pageStyle?"left:".concat(this.offsetLeft,";top:").concat(this.offsetTop,";")+this.pageStyle:function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?o(Object(i),!0).forEach((function(e){r(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):o(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}({left:this.offsetLeft,top:this.offsetTop},this.pageStyle):{left:this.offsetLeft,top:this.offsetTop}}},data:function(){return{visibleReal:!1,directionData:"auto",offsetTop:0,offsetLeft:0,offsetArrowLeft:null,offsetArrowTop:null,offsetArrowBottom:null,offsetArrowRight:null}},watch:{visible:function(t,e){this.visibleReal!=t&&(this.visibleReal=t,t!=e&&(t?this._onTriggerShow(null):this._onTriggerHide(null)))},visibleReal:function(t){this.$emit("update:visible",t)},bind:function(t,e){this._removeEvent(e),this._bindEvent(t)}},beforeMount:function(){this.visibleReal=this.visible},beforeDestroy:function(){this._removeEvent(this.bind),$("body").off("click",this._hide)},mounted:function(){var t=this;this.$nextTick(function(){n(this,t),this.$parent.$forceUpdate()}.bind(this))},methods:{show:function(){return this.$refs.widget.show()},hide:function(){return this.$refs.widget.hide()},_removeEvent:function(t){var i;t&&(i=e.dom.isVueObject(t)?t.$el:t,$(i).off("mouseover",this._onTriggerShow),$(i).off("mouseleave",this._onTriggerHide),$(i).off("click",this._onTriggerShow),this.ges&&(this.ges.dispose(),this.ges=null))},_bindEvent:function(t){var i,o=this;if(this._removeEvent(t),t)if(i=e.dom.isVueObject(t)?t.$el:t,"hover"==this.trigger)e.device.browserIsMobile()?$(i).on("click",this._onTriggerShow):($(i).on("mouseover",this._onTriggerShow),$(i).on("mouseleave",this._onTriggerHide));else if("click"==this.trigger){var r=(e.device.browserIsMobile(),"click");$(i).off(r,this._onTriggerShow).on(r,this._onTriggerShow)}else"long-press"==this.trigger&&(this.ges=new e.Gesture(i),this.ges.enablePressRecognizer({duration:600}),this.ges.on("press",function(t){n(this,o),e.device.vibrate(10),this._onTriggerShow(t)}.bind(this)))},_onTriggerShow:function(t){var e=this;this.visibleReal=!0,setTimeout(function(){n(this,e),$("body").off("click",this._hide).on("click",this._hide)}.bind(this),10),this._show(this.direction)},_onTriggerHide:function(t){var i=$(this.$refs.main),o=t,r=e.dom.getElementOffset(i[0]);o&&o.clientX>=r.left-24&&o.clientX<=r.left+i[0].offsetWidth+24&&o.clientY>=r.top-24&&o.clientY<=r.top+i[0].offsetHeight+24?$(this.$refs.main).on("mouseleave",this._hideVisible):this.visibleReal=!1,$("body").off("click",this._hide)},_show:function(t){var i=this,o=this.bind;if(this.bind){var r;r=e.dom.isVueObject(o)?o.$el:o;var s=e.dom.getElementOffset(r),f={};f.height=r.clientHeight,f.width=r.clientWidth;var c,a=e.dom.getViewPort(),u=e.dom.getDocumentOffset();this.offsetTop=s.top+u.top,"top"==t?(this.directionData="top",this.offsetTop-=8):"bottom"==t?(this.directionData="bottom",this.offsetTop+=f.height):"left"==t?(this.directionData="left",this.offsetLeft=s.left+f.width):"right"==t?(this.directionData="right",this.offsetLeft=s.left+f.width):s.top+f.height/2>a.height/2?(t="top",this.directionData="top",this.offsetTop-=8):(t="bottom",this.directionData="bottom",this.offsetTop+=f.height),this.offsetTop=parseInt(this.offsetTop),c="left"==t||"right"==t?parseInt(s.top+f.height/2):parseInt(s.left+f.width/2);var l=this.$refs.main;e.dom.probeDom(400,function(){return n(this,i),l.clientWidth>0}.bind(this),function(){if(n(this,i),"left"==t||"right"==t){var e=parseInt(c-l.clientHeight/2);e<10&&(e=10),e+l.clientHeight>a.height-10&&(e=a.height-10-l.clientHeight),this.offsetTop=parseInt(e+u.top)+"px",this.offsetLeft="right"==t?s.left+f.width+6:s.left-l.clientWidth-6-6,this.offsetLeft+=u.left,this.offsetLeft=parseInt(this.offsetLeft),this.offsetLeft+="px",this.offsetArrowLeft=null,this.offsetArrowBottom=null,this.offsetArrowTop=parseInt(c-e-6),this.offsetArrowTop<10?this.offsetArrowTop=10:this.offsetArrowTop>l.clientHeight-22&&(this.offsetArrowTop=parseInt(l.clientHeight-22)),this.offsetArrowTop+="px",this.offsetArrowRight=null}else{var o=parseInt(l.clientWidth||50),r=parseInt(l.clientHeight||50);"top"==t&&(this.offsetTop-=r+6),this.offsetTop+="px";var h=parseInt(c-o/2);h<10&&(h=10),h+o>a.width-10&&(h=a.width-10-o),this.offsetLeft=parseInt(h)+"px",this.offsetArrowLeft=parseInt(c-h)-6,this.offsetArrowLeft<10?this.offsetArrowLeft=10:this.offsetArrowLeft>o-22&&(this.offsetArrowLeft=o-22),this.offsetArrowLeft+="px",this.offsetArrowBottom=null,this.offsetArrowTop=null,this.offsetArrowRight=null}}.bind(this))}},_hide:function(){var t=this;$("body").off("click",this._hide),this.hide().then(function(e){n(this,t)}.bind(this))},_hideVisible:function(t){if($(this.$refs.main).off("mouseleave",this._hideVisible),t){var i;e.dom.isVueObject(this.bind)?i=this.bind.$el:"string"==typeof(i=this.bind)&&(i=$(i)[0]);var o=e.dom.getElementOffset(i);if(t.clientX>=o.left-24&&t.clientX<=o.left+i.offsetWidth+24&&t.clientY>=o.top-24&&t.clientY<=o.top+i.offsetHeight+24)return}this.visibleReal=!1}}},oe=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("widget",{ref:"widget",staticClass:"bp-popover",attrs:{visible:t.visibleReal,maskClose:t.maskClose,mask:t.mask,preventEvent:!1,hideBodyScroll:!1,appendToBody:!0},on:{"update:visible":function(e){t.visibleReal=e}}},[i("div",{ref:"main",staticClass:"bp-popover__main",class:t.pageClass,style:t.pStyle,attrs:{direction:t.directionData}},[t._t("default"),t._v(" "),i("div",{staticClass:"bp-popover__arrow",style:{left:t.offsetArrowLeft,top:t.offsetArrowTop,right:t.offsetArrowRight,bottom:t.offsetArrowBottom}})],2)])};oe._withStripped=!0;var re={bpPopover:ee({render:oe,staticRenderFns:[]},void 0,ie,void 0,!1,void 0,!1,void 0,void 0,void 0)};module.exports=re; |
/*! | ||
* bpui popover v1.1.19 | ||
* bpui popover v1.1.20 | ||
* Copyright (c) 2021 Copyright bpoint.lee@live.com All Rights Reserved. | ||
@@ -958,22 +958,17 @@ * Released under the MIT License. | ||
_onTriggerHide: function _onTriggerHide(e) { | ||
var _this4 = this; | ||
var main = $(this.$refs.main); | ||
var ev = e; | ||
this.$timer.setTimeout(function () { | ||
_newArrowCheck(this, _this4); | ||
var ev = e; // this.$timer.setTimeout(()=>{ | ||
var mainOffset = bpLibs.dom.getElementOffset(main[0]); // in popover. | ||
var mainOffset = bpLibs.dom.getElementOffset(main[0]); // in popover. | ||
if (ev && ev.clientX + ev.offsetX >= mainOffset.left - 24 && ev.clientX + ev.offsetX <= mainOffset.left + main[0].offsetWidth + 24 && ev.clientY + ev.offsetY >= mainOffset.top - 24 && ev.clientY + ev.offsetY <= mainOffset.top + main[0].offsetHeight + 24) { | ||
$(this.$refs.main).on('mouseleave', this._hideVisible); | ||
} else { | ||
this.visibleReal = false; | ||
} | ||
if (ev && ev.clientX >= mainOffset.left - 24 && ev.clientX <= mainOffset.left + main[0].offsetWidth + 24 && ev.clientY >= mainOffset.top - 24 && ev.clientY <= mainOffset.top + main[0].offsetHeight + 24) { | ||
$(this.$refs.main).on('mouseleave', this._hideVisible); | ||
} else { | ||
this.visibleReal = false; | ||
} | ||
$('body').off('click', this._hide); | ||
}.bind(this), 50); | ||
$('body').off('click', this._hide); // }, 50); | ||
}, | ||
_show: function _show(directionData) { | ||
var _this5 = this; | ||
var _this4 = this; | ||
@@ -1040,7 +1035,7 @@ var bind = this.bind; | ||
bpLibs.dom.probeDom(400, function () { | ||
_newArrowCheck(this, _this5); | ||
_newArrowCheck(this, _this4); | ||
return main.clientWidth > 0; | ||
}.bind(this), function () { | ||
_newArrowCheck(this, _this5); | ||
_newArrowCheck(this, _this4); | ||
@@ -1112,12 +1107,36 @@ if (directionData == 'left' || directionData == 'right') { | ||
_hide: function _hide() { | ||
var _this6 = this; | ||
var _this5 = this; | ||
$('body').off('click', this._hide); | ||
this.hide().then(function (res) { | ||
_newArrowCheck(this, _this6); | ||
_newArrowCheck(this, _this5); | ||
}.bind(this)); | ||
}, | ||
_hideVisible: function _hideVisible() { | ||
_hideVisible: function _hideVisible(ev) { | ||
$(this.$refs.main).off('mouseleave', this._hideVisible); | ||
if (ev) { | ||
var el; | ||
if (bpLibs.dom.isVueObject(this.bind)) { | ||
el = this.bind.$el; | ||
} else { | ||
el = this.bind; | ||
if (typeof el === 'string') { | ||
el = $(el)[0]; | ||
} | ||
} | ||
var mainOffset = bpLibs.dom.getElementOffset(el); // in popover. | ||
if (ev.clientX >= mainOffset.left - 24 && ev.clientX <= mainOffset.left + el.offsetWidth + 24 && ev.clientY >= mainOffset.top - 24 && ev.clientY <= mainOffset.top + el.offsetHeight + 24) { | ||
return; | ||
} // if (ev.toElement.isSameNode(el)) { | ||
// return; | ||
// } | ||
} | ||
this.visibleReal = false; | ||
$(this.$refs.main).off('mouseleave', this._hideVisible); | ||
} | ||
@@ -1124,0 +1143,0 @@ } |
/*! | ||
* bpui popover v1.1.19 | ||
* bpui popover v1.1.20 | ||
* Copyright (c) 2021 Copyright bpoint.lee@live.com All Rights Reserved. | ||
* Released under the MIT License. | ||
*/ | ||
import t from"@bpui/libs";import e from"@bpui/dialog";function o(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),o.push.apply(o,i)}return o}function i(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function r(t,e){if(t!==e)throw new TypeError("Cannot instantiate an arrow function")}var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function s(t,e){return t(e={exports:{}},e.exports),e.exports}var f=function(t){return t&&t.Math==Math&&t},c=f("object"==typeof globalThis&&globalThis)||f("object"==typeof window&&window)||f("object"==typeof self&&self)||f("object"==typeof n&&n)||function(){return this}()||Function("return this")(),a=function(t){try{return!!t()}catch(t){return!0}},u=!a((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),l={}.propertyIsEnumerable,h=Object.getOwnPropertyDescriptor,p={f:h&&!l.call({1:2},1)?function(t){var e=h(this,t);return!!e&&e.enumerable}:l},d=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},g={}.toString,v=function(t){return g.call(t).slice(8,-1)},b="".split,y=a((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==v(t)?b.call(t,""):Object(t)}:Object,m=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},w=function(t){return y(m(t))},_=function(t){return"object"==typeof t?null!==t:"function"==typeof t},T=function(t,e){if(!_(t))return t;var o,i;if(e&&"function"==typeof(o=t.toString)&&!_(i=o.call(t)))return i;if("function"==typeof(o=t.valueOf)&&!_(i=o.call(t)))return i;if(!e&&"function"==typeof(o=t.toString)&&!_(i=o.call(t)))return i;throw TypeError("Can't convert object to primitive value")},S=function(t){return Object(m(t))},O={}.hasOwnProperty,j=Object.hasOwn||function(t,e){return O.call(S(t),e)},A=c.document,E=_(A)&&_(A.createElement),L=!u&&!a((function(){return 7!=Object.defineProperty((t="div",E?A.createElement(t):{}),"a",{get:function(){return 7}}).a;var t})),P=Object.getOwnPropertyDescriptor,x={f:u?P:function(t,e){if(t=w(t),e=T(e,!0),L)try{return P(t,e)}catch(t){}if(j(t,e))return d(!p.f.call(t,e),t[e])}},k=function(t){if(!_(t))throw TypeError(String(t)+" is not an object");return t},R=Object.defineProperty,C={f:u?R:function(t,e,o){if(k(t),e=T(e,!0),k(o),L)try{return R(t,e,o)}catch(t){}if("get"in o||"set"in o)throw TypeError("Accessors not supported");return"value"in o&&(t[e]=o.value),t}},I=u?function(t,e,o){return C.f(t,e,d(1,o))}:function(t,e,o){return t[e]=o,t},D=function(t,e){try{I(c,t,e)}catch(o){c[t]=e}return e},M=c["__core-js_shared__"]||D("__core-js_shared__",{}),H=Function.toString;"function"!=typeof M.inspectSource&&(M.inspectSource=function(t){return H.call(t)});var B,V,F,W,N=M.inspectSource,z=c.WeakMap,X="function"==typeof z&&/native code/.test(N(z)),Y=s((function(t){(t.exports=function(t,e){return M[t]||(M[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.15.2",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})})),G=0,U=Math.random(),q=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++G+U).toString(36)},K=Y("keys"),J={},Q=c.WeakMap;if(X||M.state){var Z=M.state||(M.state=new Q),tt=Z.get,et=Z.has,ot=Z.set;B=function(t,e){if(et.call(Z,t))throw new TypeError("Object already initialized");return e.facade=t,ot.call(Z,t,e),e},V=function(t){return tt.call(Z,t)||{}},F=function(t){return et.call(Z,t)}}else{var it=K[W="state"]||(K[W]=q(W));J[it]=!0,B=function(t,e){if(j(t,it))throw new TypeError("Object already initialized");return e.facade=t,I(t,it,e),e},V=function(t){return j(t,it)?t[it]:{}},F=function(t){return j(t,it)}}var rt,nt,st={set:B,get:V,has:F,enforce:function(t){return F(t)?V(t):B(t,{})},getterFor:function(t){return function(e){var o;if(!_(e)||(o=V(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return o}}},ft=s((function(t){var e=st.get,o=st.enforce,i=String(String).split("String");(t.exports=function(t,e,r,n){var s,f=!!n&&!!n.unsafe,a=!!n&&!!n.enumerable,u=!!n&&!!n.noTargetGet;"function"==typeof r&&("string"!=typeof e||j(r,"name")||I(r,"name",e),(s=o(r)).source||(s.source=i.join("string"==typeof e?e:""))),t!==c?(f?!u&&t[e]&&(a=!0):delete t[e],a?t[e]=r:I(t,e,r)):a?t[e]=r:D(e,r)})(Function.prototype,"toString",(function(){return"function"==typeof this&&e(this).source||N(this)}))})),ct=c,at=function(t){return"function"==typeof t?t:void 0},ut=function(t,e){return arguments.length<2?at(ct[t])||at(c[t]):ct[t]&&ct[t][e]||c[t]&&c[t][e]},lt=Math.ceil,ht=Math.floor,pt=function(t){return isNaN(t=+t)?0:(t>0?ht:lt)(t)},dt=Math.min,gt=function(t){return t>0?dt(pt(t),9007199254740991):0},vt=Math.max,bt=Math.min,yt=function(t){return function(e,o,i){var r,n=w(e),s=gt(n.length),f=function(t,e){var o=pt(t);return o<0?vt(o+e,0):bt(o,e)}(i,s);if(t&&o!=o){for(;s>f;)if((r=n[f++])!=r)return!0}else for(;s>f;f++)if((t||f in n)&&n[f]===o)return t||f||0;return!t&&-1}},mt={includes:yt(!0),indexOf:yt(!1)}.indexOf,wt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"].concat("length","prototype"),_t={f:Object.getOwnPropertyNames||function(t){return function(t,e){var o,i=w(t),r=0,n=[];for(o in i)!j(J,o)&&j(i,o)&&n.push(o);for(;e.length>r;)j(i,o=e[r++])&&(~mt(n,o)||n.push(o));return n}(t,wt)}},Tt={f:Object.getOwnPropertySymbols},St=ut("Reflect","ownKeys")||function(t){var e=_t.f(k(t)),o=Tt.f;return o?e.concat(o(t)):e},Ot=function(t,e){for(var o=St(e),i=C.f,r=x.f,n=0;n<o.length;n++){var s=o[n];j(t,s)||i(t,s,r(e,s))}},jt=/#|\.prototype\./,At=function(t,e){var o=Et[$t(t)];return o==Pt||o!=Lt&&("function"==typeof e?a(e):!!e)},$t=At.normalize=function(t){return String(t).replace(jt,".").toLowerCase()},Et=At.data={},Lt=At.NATIVE="N",Pt=At.POLYFILL="P",xt=At,kt=x.f,Rt=Array.isArray||function(t){return"Array"==v(t)},Ct=function(t,e,o){var i=T(e);i in t?C.f(t,i,d(0,o)):t[i]=o},It=ut("navigator","userAgent")||"",Dt=c.process,Mt=Dt&&Dt.versions,Ht=Mt&&Mt.v8;Ht?nt=(rt=Ht.split("."))[0]<4?1:rt[0]+rt[1]:It&&(!(rt=It.match(/Edge\/(\d+)/))||rt[1]>=74)&&(rt=It.match(/Chrome\/(\d+)/))&&(nt=rt[1]);var Bt,Vt=nt&&+nt,Ft=!!Object.getOwnPropertySymbols&&!a((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&Vt&&Vt<41})),Wt=Ft&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Nt=Y("wks"),zt=c.Symbol,Xt=Wt?zt:zt&&zt.withoutSetter||q,Yt=function(t){return j(Nt,t)&&(Ft||"string"==typeof Nt[t])||(Ft&&j(zt,t)?Nt[t]=zt[t]:Nt[t]=Xt("Symbol."+t)),Nt[t]},Gt=Yt("species"),Ut=function(t,e){var o;return Rt(t)&&("function"!=typeof(o=t.constructor)||o!==Array&&!Rt(o.prototype)?_(o)&&null===(o=o[Gt])&&(o=void 0):o=void 0),new(void 0===o?Array:o)(0===e?0:e)},qt=Yt("species"),Kt=Yt("isConcatSpreadable"),Jt=Vt>=51||!a((function(){var t=[];return t[Kt]=!1,t.concat()[0]!==t})),Qt=(Bt="concat",Vt>=51||!a((function(){var t=[];return(t.constructor={})[qt]=function(){return{foo:1}},1!==t[Bt](Boolean).foo}))),Zt=function(t){if(!_(t))return!1;var e=t[Kt];return void 0!==e?!!e:Rt(t)};function te(t,e,o,i,r,n,s,f,c,a){"boolean"!=typeof s&&(c=f,f=s,s=!1);var u,l="function"==typeof o?o.options:o;if(t&&t.render&&(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,r&&(l.functional=!0)),i&&(l._scopeId=i),n?(u=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,c(t)),t&&t._registeredComponents&&t._registeredComponents.add(n)},l._ssrRegister=u):e&&(u=s?function(t){e.call(this,a(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,f(t))}),u)if(l.functional){var h=l.render;l.render=function(t,e){return u.call(e),h(t,e)}}else{var p=l.beforeCreate;l.beforeCreate=p?[].concat(p,u):[u]}return o}!function(t,e){var o,i,r,n,s,f=t.target,a=t.global,u=t.stat;if(o=a?c:u?c[f]||D(f,{}):(c[f]||{}).prototype)for(i in e){if(n=e[i],r=t.noTargetGet?(s=kt(o,i))&&s.value:o[i],!xt(a?i:f+(u?".":"#")+i,t.forced)&&void 0!==r){if(typeof n==typeof r)continue;Ot(n,r)}(t.sham||r&&r.sham)&&I(n,"sham",!0),ft(o,i,n,t)}}({target:"Array",proto:!0,forced:!Jt||!Qt},{concat:function(t){var e,o,i,r,n,s=S(this),f=Ut(s,0),c=0;for(e=-1,i=arguments.length;e<i;e++)if(Zt(n=-1===e?s:arguments[e])){if(c+(r=gt(n.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(o=0;o<r;o++,c++)o in n&&Ct(f,c,n[o])}else{if(c>=9007199254740991)throw TypeError("Maximum allowed index exceeded");Ct(f,c++,n)}return f.length=c,f}});var ee={components:{widget:e.bpWidget},props:{visible:Boolean,mask:{default:!1,type:Boolean},maskClose:{default:!0,type:Boolean},pageClass:String|Array,pageStyle:String|Array|Object,direction:{default:"auto",type:String},trigger:{type:String},bind:{}},computed:{pStyle:function(){return this.pageStyle?"string"==typeof this.pageStyle?"left:".concat(this.offsetLeft,";top:").concat(this.offsetTop,";")+this.pageStyle:function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach((function(e){i(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({left:this.offsetLeft,top:this.offsetTop},this.pageStyle):{left:this.offsetLeft,top:this.offsetTop}}},data:function(){return{visibleReal:!1,directionData:"auto",offsetTop:0,offsetLeft:0,offsetArrowLeft:null,offsetArrowTop:null,offsetArrowBottom:null,offsetArrowRight:null}},watch:{visible:function(t,e){this.visibleReal!=t&&(this.visibleReal=t,t!=e&&(t?this._onTriggerShow(null):this._onTriggerHide(null)))},visibleReal:function(t){this.$emit("update:visible",t)},bind:function(t,e){this._removeEvent(e),this._bindEvent(t)}},beforeMount:function(){this.visibleReal=this.visible},beforeDestroy:function(){this._removeEvent(this.bind),$("body").off("click",this._hide)},mounted:function(){var t=this;this.$nextTick(function(){r(this,t),this.$parent.$forceUpdate()}.bind(this))},methods:{show:function(){return this.$refs.widget.show()},hide:function(){return this.$refs.widget.hide()},_removeEvent:function(e){var o;e&&(o=t.dom.isVueObject(e)?e.$el:e,$(o).off("mouseover",this._onTriggerShow),$(o).off("mouseleave",this._onTriggerHide),$(o).off("click",this._onTriggerShow),this.ges&&(this.ges.dispose(),this.ges=null))},_bindEvent:function(e){var o,i=this;if(this._removeEvent(e),e)if(o=t.dom.isVueObject(e)?e.$el:e,"hover"==this.trigger)t.device.browserIsMobile()?$(o).on("click",this._onTriggerShow):($(o).on("mouseover",this._onTriggerShow),$(o).on("mouseleave",this._onTriggerHide));else if("click"==this.trigger){var n=(t.device.browserIsMobile(),"click");$(o).off(n,this._onTriggerShow).on(n,this._onTriggerShow)}else"long-press"==this.trigger&&(this.ges=new t.Gesture(o),this.ges.enablePressRecognizer({duration:600}),this.ges.on("press",function(e){r(this,i),t.device.vibrate(10),this._onTriggerShow(e)}.bind(this)))},_onTriggerShow:function(t){var e=this;this.visibleReal=!0,setTimeout(function(){r(this,e),$("body").off("click",this._hide).on("click",this._hide)}.bind(this),10),this._show(this.direction)},_onTriggerHide:function(e){var o=this,i=$(this.$refs.main),n=e;this.$timer.setTimeout(function(){r(this,o);var e=t.dom.getElementOffset(i[0]);n&&n.clientX+n.offsetX>=e.left-24&&n.clientX+n.offsetX<=e.left+i[0].offsetWidth+24&&n.clientY+n.offsetY>=e.top-24&&n.clientY+n.offsetY<=e.top+i[0].offsetHeight+24?$(this.$refs.main).on("mouseleave",this._hideVisible):this.visibleReal=!1,$("body").off("click",this._hide)}.bind(this),50)},_show:function(e){var o=this,i=this.bind;if(this.bind){var n;n=t.dom.isVueObject(i)?i.$el:i;var s=t.dom.getElementOffset(n),f={};f.height=n.clientHeight,f.width=n.clientWidth;var c,a=t.dom.getViewPort(),u=t.dom.getDocumentOffset();this.offsetTop=s.top+u.top,"top"==e?(this.directionData="top",this.offsetTop-=8):"bottom"==e?(this.directionData="bottom",this.offsetTop+=f.height):"left"==e?(this.directionData="left",this.offsetLeft=s.left+f.width):"right"==e?(this.directionData="right",this.offsetLeft=s.left+f.width):s.top+f.height/2>a.height/2?(e="top",this.directionData="top",this.offsetTop-=8):(e="bottom",this.directionData="bottom",this.offsetTop+=f.height),this.offsetTop=parseInt(this.offsetTop),c="left"==e||"right"==e?parseInt(s.top+f.height/2):parseInt(s.left+f.width/2);var l=this.$refs.main;t.dom.probeDom(400,function(){return r(this,o),l.clientWidth>0}.bind(this),function(){if(r(this,o),"left"==e||"right"==e){var t=parseInt(c-l.clientHeight/2);t<10&&(t=10),t+l.clientHeight>a.height-10&&(t=a.height-10-l.clientHeight),this.offsetTop=parseInt(t+u.top)+"px",this.offsetLeft="right"==e?s.left+f.width+6:s.left-l.clientWidth-6-6,this.offsetLeft+=u.left,this.offsetLeft=parseInt(this.offsetLeft),this.offsetLeft+="px",this.offsetArrowLeft=null,this.offsetArrowBottom=null,this.offsetArrowTop=parseInt(c-t-6),this.offsetArrowTop<10?this.offsetArrowTop=10:this.offsetArrowTop>l.clientHeight-22&&(this.offsetArrowTop=parseInt(l.clientHeight-22)),this.offsetArrowTop+="px",this.offsetArrowRight=null}else{var i=parseInt(l.clientWidth||50),n=parseInt(l.clientHeight||50);"top"==e&&(this.offsetTop-=n+6),this.offsetTop+="px";var h=parseInt(c-i/2);h<10&&(h=10),h+i>a.width-10&&(h=a.width-10-i),this.offsetLeft=parseInt(h)+"px",this.offsetArrowLeft=parseInt(c-h)-6,this.offsetArrowLeft<10?this.offsetArrowLeft=10:this.offsetArrowLeft>i-22&&(this.offsetArrowLeft=i-22),this.offsetArrowLeft+="px",this.offsetArrowBottom=null,this.offsetArrowTop=null,this.offsetArrowRight=null}}.bind(this))}},_hide:function(){var t=this;$("body").off("click",this._hide),this.hide().then(function(e){r(this,t)}.bind(this))},_hideVisible:function(){this.visibleReal=!1,$(this.$refs.main).off("mouseleave",this._hideVisible)}}},oe=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("widget",{ref:"widget",staticClass:"bp-popover",attrs:{visible:t.visibleReal,maskClose:t.maskClose,mask:t.mask,preventEvent:!1,hideBodyScroll:!1,appendToBody:!0},on:{"update:visible":function(e){t.visibleReal=e}}},[o("div",{ref:"main",staticClass:"bp-popover__main",class:t.pageClass,style:t.pStyle,attrs:{direction:t.directionData}},[t._t("default"),t._v(" "),o("div",{staticClass:"bp-popover__arrow",style:{left:t.offsetArrowLeft,top:t.offsetArrowTop,right:t.offsetArrowRight,bottom:t.offsetArrowBottom}})],2)])};oe._withStripped=!0;var ie={bpPopover:te({render:oe,staticRenderFns:[]},void 0,ee,void 0,!1,void 0,!1,void 0,void 0,void 0)};export default ie; | ||
import t from"@bpui/libs";import e from"@bpui/dialog";function i(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,o)}return i}function o(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function r(t,e){if(t!==e)throw new TypeError("Cannot instantiate an arrow function")}var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function s(t,e){return t(e={exports:{}},e.exports),e.exports}var f=function(t){return t&&t.Math==Math&&t},c=f("object"==typeof globalThis&&globalThis)||f("object"==typeof window&&window)||f("object"==typeof self&&self)||f("object"==typeof n&&n)||function(){return this}()||Function("return this")(),a=function(t){try{return!!t()}catch(t){return!0}},u=!a((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),l={}.propertyIsEnumerable,h=Object.getOwnPropertyDescriptor,p={f:h&&!l.call({1:2},1)?function(t){var e=h(this,t);return!!e&&e.enumerable}:l},d=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},g={}.toString,b=function(t){return g.call(t).slice(8,-1)},v="".split,y=a((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==b(t)?v.call(t,""):Object(t)}:Object,m=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},w=function(t){return y(m(t))},_=function(t){return"object"==typeof t?null!==t:"function"==typeof t},T=function(t,e){if(!_(t))return t;var i,o;if(e&&"function"==typeof(i=t.toString)&&!_(o=i.call(t)))return o;if("function"==typeof(i=t.valueOf)&&!_(o=i.call(t)))return o;if(!e&&"function"==typeof(i=t.toString)&&!_(o=i.call(t)))return o;throw TypeError("Can't convert object to primitive value")},O=function(t){return Object(m(t))},S={}.hasOwnProperty,j=Object.hasOwn||function(t,e){return S.call(O(t),e)},A=c.document,E=_(A)&&_(A.createElement),L=!u&&!a((function(){return 7!=Object.defineProperty((t="div",E?A.createElement(t):{}),"a",{get:function(){return 7}}).a;var t})),P=Object.getOwnPropertyDescriptor,x={f:u?P:function(t,e){if(t=w(t),e=T(e,!0),L)try{return P(t,e)}catch(t){}if(j(t,e))return d(!p.f.call(t,e),t[e])}},k=function(t){if(!_(t))throw TypeError(String(t)+" is not an object");return t},R=Object.defineProperty,C={f:u?R:function(t,e,i){if(k(t),e=T(e,!0),k(i),L)try{return R(t,e,i)}catch(t){}if("get"in i||"set"in i)throw TypeError("Accessors not supported");return"value"in i&&(t[e]=i.value),t}},I=u?function(t,e,i){return C.f(t,e,d(1,i))}:function(t,e,i){return t[e]=i,t},D=function(t,e){try{I(c,t,e)}catch(i){c[t]=e}return e},M=c["__core-js_shared__"]||D("__core-js_shared__",{}),H=Function.toString;"function"!=typeof M.inspectSource&&(M.inspectSource=function(t){return H.call(t)});var V,B,W,F,N=M.inspectSource,z=c.WeakMap,X="function"==typeof z&&/native code/.test(N(z)),Y=s((function(t){(t.exports=function(t,e){return M[t]||(M[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.15.2",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})})),G=0,U=Math.random(),q=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++G+U).toString(36)},K=Y("keys"),J={},Q=c.WeakMap;if(X||M.state){var Z=M.state||(M.state=new Q),tt=Z.get,et=Z.has,it=Z.set;V=function(t,e){if(et.call(Z,t))throw new TypeError("Object already initialized");return e.facade=t,it.call(Z,t,e),e},B=function(t){return tt.call(Z,t)||{}},W=function(t){return et.call(Z,t)}}else{var ot=K[F="state"]||(K[F]=q(F));J[ot]=!0,V=function(t,e){if(j(t,ot))throw new TypeError("Object already initialized");return e.facade=t,I(t,ot,e),e},B=function(t){return j(t,ot)?t[ot]:{}},W=function(t){return j(t,ot)}}var rt,nt,st={set:V,get:B,has:W,enforce:function(t){return W(t)?B(t):V(t,{})},getterFor:function(t){return function(e){var i;if(!_(e)||(i=B(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return i}}},ft=s((function(t){var e=st.get,i=st.enforce,o=String(String).split("String");(t.exports=function(t,e,r,n){var s,f=!!n&&!!n.unsafe,a=!!n&&!!n.enumerable,u=!!n&&!!n.noTargetGet;"function"==typeof r&&("string"!=typeof e||j(r,"name")||I(r,"name",e),(s=i(r)).source||(s.source=o.join("string"==typeof e?e:""))),t!==c?(f?!u&&t[e]&&(a=!0):delete t[e],a?t[e]=r:I(t,e,r)):a?t[e]=r:D(e,r)})(Function.prototype,"toString",(function(){return"function"==typeof this&&e(this).source||N(this)}))})),ct=c,at=function(t){return"function"==typeof t?t:void 0},ut=function(t,e){return arguments.length<2?at(ct[t])||at(c[t]):ct[t]&&ct[t][e]||c[t]&&c[t][e]},lt=Math.ceil,ht=Math.floor,pt=function(t){return isNaN(t=+t)?0:(t>0?ht:lt)(t)},dt=Math.min,gt=function(t){return t>0?dt(pt(t),9007199254740991):0},bt=Math.max,vt=Math.min,yt=function(t){return function(e,i,o){var r,n=w(e),s=gt(n.length),f=function(t,e){var i=pt(t);return i<0?bt(i+e,0):vt(i,e)}(o,s);if(t&&i!=i){for(;s>f;)if((r=n[f++])!=r)return!0}else for(;s>f;f++)if((t||f in n)&&n[f]===i)return t||f||0;return!t&&-1}},mt={includes:yt(!0),indexOf:yt(!1)}.indexOf,wt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"].concat("length","prototype"),_t={f:Object.getOwnPropertyNames||function(t){return function(t,e){var i,o=w(t),r=0,n=[];for(i in o)!j(J,i)&&j(o,i)&&n.push(i);for(;e.length>r;)j(o,i=e[r++])&&(~mt(n,i)||n.push(i));return n}(t,wt)}},Tt={f:Object.getOwnPropertySymbols},Ot=ut("Reflect","ownKeys")||function(t){var e=_t.f(k(t)),i=Tt.f;return i?e.concat(i(t)):e},St=function(t,e){for(var i=Ot(e),o=C.f,r=x.f,n=0;n<i.length;n++){var s=i[n];j(t,s)||o(t,s,r(e,s))}},jt=/#|\.prototype\./,At=function(t,e){var i=Et[$t(t)];return i==Pt||i!=Lt&&("function"==typeof e?a(e):!!e)},$t=At.normalize=function(t){return String(t).replace(jt,".").toLowerCase()},Et=At.data={},Lt=At.NATIVE="N",Pt=At.POLYFILL="P",xt=At,kt=x.f,Rt=Array.isArray||function(t){return"Array"==b(t)},Ct=function(t,e,i){var o=T(e);o in t?C.f(t,o,d(0,i)):t[o]=i},It=ut("navigator","userAgent")||"",Dt=c.process,Mt=Dt&&Dt.versions,Ht=Mt&&Mt.v8;Ht?nt=(rt=Ht.split("."))[0]<4?1:rt[0]+rt[1]:It&&(!(rt=It.match(/Edge\/(\d+)/))||rt[1]>=74)&&(rt=It.match(/Chrome\/(\d+)/))&&(nt=rt[1]);var Vt,Bt=nt&&+nt,Wt=!!Object.getOwnPropertySymbols&&!a((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&Bt&&Bt<41})),Ft=Wt&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Nt=Y("wks"),zt=c.Symbol,Xt=Ft?zt:zt&&zt.withoutSetter||q,Yt=function(t){return j(Nt,t)&&(Wt||"string"==typeof Nt[t])||(Wt&&j(zt,t)?Nt[t]=zt[t]:Nt[t]=Xt("Symbol."+t)),Nt[t]},Gt=Yt("species"),Ut=function(t,e){var i;return Rt(t)&&("function"!=typeof(i=t.constructor)||i!==Array&&!Rt(i.prototype)?_(i)&&null===(i=i[Gt])&&(i=void 0):i=void 0),new(void 0===i?Array:i)(0===e?0:e)},qt=Yt("species"),Kt=Yt("isConcatSpreadable"),Jt=Bt>=51||!a((function(){var t=[];return t[Kt]=!1,t.concat()[0]!==t})),Qt=(Vt="concat",Bt>=51||!a((function(){var t=[];return(t.constructor={})[qt]=function(){return{foo:1}},1!==t[Vt](Boolean).foo}))),Zt=function(t){if(!_(t))return!1;var e=t[Kt];return void 0!==e?!!e:Rt(t)};function te(t,e,i,o,r,n,s,f,c,a){"boolean"!=typeof s&&(c=f,f=s,s=!1);var u,l="function"==typeof i?i.options:i;if(t&&t.render&&(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,r&&(l.functional=!0)),o&&(l._scopeId=o),n?(u=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,c(t)),t&&t._registeredComponents&&t._registeredComponents.add(n)},l._ssrRegister=u):e&&(u=s?function(t){e.call(this,a(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,f(t))}),u)if(l.functional){var h=l.render;l.render=function(t,e){return u.call(e),h(t,e)}}else{var p=l.beforeCreate;l.beforeCreate=p?[].concat(p,u):[u]}return i}!function(t,e){var i,o,r,n,s,f=t.target,a=t.global,u=t.stat;if(i=a?c:u?c[f]||D(f,{}):(c[f]||{}).prototype)for(o in e){if(n=e[o],r=t.noTargetGet?(s=kt(i,o))&&s.value:i[o],!xt(a?o:f+(u?".":"#")+o,t.forced)&&void 0!==r){if(typeof n==typeof r)continue;St(n,r)}(t.sham||r&&r.sham)&&I(n,"sham",!0),ft(i,o,n,t)}}({target:"Array",proto:!0,forced:!Jt||!Qt},{concat:function(t){var e,i,o,r,n,s=O(this),f=Ut(s,0),c=0;for(e=-1,o=arguments.length;e<o;e++)if(Zt(n=-1===e?s:arguments[e])){if(c+(r=gt(n.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(i=0;i<r;i++,c++)i in n&&Ct(f,c,n[i])}else{if(c>=9007199254740991)throw TypeError("Maximum allowed index exceeded");Ct(f,c++,n)}return f.length=c,f}});var ee={components:{widget:e.bpWidget},props:{visible:Boolean,mask:{default:!1,type:Boolean},maskClose:{default:!0,type:Boolean},pageClass:String|Array,pageStyle:String|Array|Object,direction:{default:"auto",type:String},trigger:{type:String},bind:{}},computed:{pStyle:function(){return this.pageStyle?"string"==typeof this.pageStyle?"left:".concat(this.offsetLeft,";top:").concat(this.offsetTop,";")+this.pageStyle:function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?i(Object(r),!0).forEach((function(e){o(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({left:this.offsetLeft,top:this.offsetTop},this.pageStyle):{left:this.offsetLeft,top:this.offsetTop}}},data:function(){return{visibleReal:!1,directionData:"auto",offsetTop:0,offsetLeft:0,offsetArrowLeft:null,offsetArrowTop:null,offsetArrowBottom:null,offsetArrowRight:null}},watch:{visible:function(t,e){this.visibleReal!=t&&(this.visibleReal=t,t!=e&&(t?this._onTriggerShow(null):this._onTriggerHide(null)))},visibleReal:function(t){this.$emit("update:visible",t)},bind:function(t,e){this._removeEvent(e),this._bindEvent(t)}},beforeMount:function(){this.visibleReal=this.visible},beforeDestroy:function(){this._removeEvent(this.bind),$("body").off("click",this._hide)},mounted:function(){var t=this;this.$nextTick(function(){r(this,t),this.$parent.$forceUpdate()}.bind(this))},methods:{show:function(){return this.$refs.widget.show()},hide:function(){return this.$refs.widget.hide()},_removeEvent:function(e){var i;e&&(i=t.dom.isVueObject(e)?e.$el:e,$(i).off("mouseover",this._onTriggerShow),$(i).off("mouseleave",this._onTriggerHide),$(i).off("click",this._onTriggerShow),this.ges&&(this.ges.dispose(),this.ges=null))},_bindEvent:function(e){var i,o=this;if(this._removeEvent(e),e)if(i=t.dom.isVueObject(e)?e.$el:e,"hover"==this.trigger)t.device.browserIsMobile()?$(i).on("click",this._onTriggerShow):($(i).on("mouseover",this._onTriggerShow),$(i).on("mouseleave",this._onTriggerHide));else if("click"==this.trigger){var n=(t.device.browserIsMobile(),"click");$(i).off(n,this._onTriggerShow).on(n,this._onTriggerShow)}else"long-press"==this.trigger&&(this.ges=new t.Gesture(i),this.ges.enablePressRecognizer({duration:600}),this.ges.on("press",function(e){r(this,o),t.device.vibrate(10),this._onTriggerShow(e)}.bind(this)))},_onTriggerShow:function(t){var e=this;this.visibleReal=!0,setTimeout(function(){r(this,e),$("body").off("click",this._hide).on("click",this._hide)}.bind(this),10),this._show(this.direction)},_onTriggerHide:function(e){var i=$(this.$refs.main),o=e,r=t.dom.getElementOffset(i[0]);o&&o.clientX>=r.left-24&&o.clientX<=r.left+i[0].offsetWidth+24&&o.clientY>=r.top-24&&o.clientY<=r.top+i[0].offsetHeight+24?$(this.$refs.main).on("mouseleave",this._hideVisible):this.visibleReal=!1,$("body").off("click",this._hide)},_show:function(e){var i=this,o=this.bind;if(this.bind){var n;n=t.dom.isVueObject(o)?o.$el:o;var s=t.dom.getElementOffset(n),f={};f.height=n.clientHeight,f.width=n.clientWidth;var c,a=t.dom.getViewPort(),u=t.dom.getDocumentOffset();this.offsetTop=s.top+u.top,"top"==e?(this.directionData="top",this.offsetTop-=8):"bottom"==e?(this.directionData="bottom",this.offsetTop+=f.height):"left"==e?(this.directionData="left",this.offsetLeft=s.left+f.width):"right"==e?(this.directionData="right",this.offsetLeft=s.left+f.width):s.top+f.height/2>a.height/2?(e="top",this.directionData="top",this.offsetTop-=8):(e="bottom",this.directionData="bottom",this.offsetTop+=f.height),this.offsetTop=parseInt(this.offsetTop),c="left"==e||"right"==e?parseInt(s.top+f.height/2):parseInt(s.left+f.width/2);var l=this.$refs.main;t.dom.probeDom(400,function(){return r(this,i),l.clientWidth>0}.bind(this),function(){if(r(this,i),"left"==e||"right"==e){var t=parseInt(c-l.clientHeight/2);t<10&&(t=10),t+l.clientHeight>a.height-10&&(t=a.height-10-l.clientHeight),this.offsetTop=parseInt(t+u.top)+"px",this.offsetLeft="right"==e?s.left+f.width+6:s.left-l.clientWidth-6-6,this.offsetLeft+=u.left,this.offsetLeft=parseInt(this.offsetLeft),this.offsetLeft+="px",this.offsetArrowLeft=null,this.offsetArrowBottom=null,this.offsetArrowTop=parseInt(c-t-6),this.offsetArrowTop<10?this.offsetArrowTop=10:this.offsetArrowTop>l.clientHeight-22&&(this.offsetArrowTop=parseInt(l.clientHeight-22)),this.offsetArrowTop+="px",this.offsetArrowRight=null}else{var o=parseInt(l.clientWidth||50),n=parseInt(l.clientHeight||50);"top"==e&&(this.offsetTop-=n+6),this.offsetTop+="px";var h=parseInt(c-o/2);h<10&&(h=10),h+o>a.width-10&&(h=a.width-10-o),this.offsetLeft=parseInt(h)+"px",this.offsetArrowLeft=parseInt(c-h)-6,this.offsetArrowLeft<10?this.offsetArrowLeft=10:this.offsetArrowLeft>o-22&&(this.offsetArrowLeft=o-22),this.offsetArrowLeft+="px",this.offsetArrowBottom=null,this.offsetArrowTop=null,this.offsetArrowRight=null}}.bind(this))}},_hide:function(){var t=this;$("body").off("click",this._hide),this.hide().then(function(e){r(this,t)}.bind(this))},_hideVisible:function(e){if($(this.$refs.main).off("mouseleave",this._hideVisible),e){var i;t.dom.isVueObject(this.bind)?i=this.bind.$el:"string"==typeof(i=this.bind)&&(i=$(i)[0]);var o=t.dom.getElementOffset(i);if(e.clientX>=o.left-24&&e.clientX<=o.left+i.offsetWidth+24&&e.clientY>=o.top-24&&e.clientY<=o.top+i.offsetHeight+24)return}this.visibleReal=!1}}},ie=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("widget",{ref:"widget",staticClass:"bp-popover",attrs:{visible:t.visibleReal,maskClose:t.maskClose,mask:t.mask,preventEvent:!1,hideBodyScroll:!1,appendToBody:!0},on:{"update:visible":function(e){t.visibleReal=e}}},[i("div",{ref:"main",staticClass:"bp-popover__main",class:t.pageClass,style:t.pStyle,attrs:{direction:t.directionData}},[t._t("default"),t._v(" "),i("div",{staticClass:"bp-popover__arrow",style:{left:t.offsetArrowLeft,top:t.offsetArrowTop,right:t.offsetArrowRight,bottom:t.offsetArrowBottom}})],2)])};ie._withStripped=!0;var oe={bpPopover:te({render:ie,staticRenderFns:[]},void 0,ee,void 0,!1,void 0,!1,void 0,void 0,void 0)};export default oe; |
/*! | ||
* bpui popover v1.1.19 | ||
* bpui popover v1.1.20 | ||
* Copyright (c) 2021 Copyright bpoint.lee@live.com All Rights Reserved. | ||
@@ -964,22 +964,17 @@ * Released under the MIT License. | ||
_onTriggerHide: function _onTriggerHide(e) { | ||
var _this4 = this; | ||
var main = $(this.$refs.main); | ||
var ev = e; | ||
this.$timer.setTimeout(function () { | ||
_newArrowCheck(this, _this4); | ||
var ev = e; // this.$timer.setTimeout(()=>{ | ||
var mainOffset = bpLibs.dom.getElementOffset(main[0]); // in popover. | ||
var mainOffset = bpLibs.dom.getElementOffset(main[0]); // in popover. | ||
if (ev && ev.clientX + ev.offsetX >= mainOffset.left - 24 && ev.clientX + ev.offsetX <= mainOffset.left + main[0].offsetWidth + 24 && ev.clientY + ev.offsetY >= mainOffset.top - 24 && ev.clientY + ev.offsetY <= mainOffset.top + main[0].offsetHeight + 24) { | ||
$(this.$refs.main).on('mouseleave', this._hideVisible); | ||
} else { | ||
this.visibleReal = false; | ||
} | ||
if (ev && ev.clientX >= mainOffset.left - 24 && ev.clientX <= mainOffset.left + main[0].offsetWidth + 24 && ev.clientY >= mainOffset.top - 24 && ev.clientY <= mainOffset.top + main[0].offsetHeight + 24) { | ||
$(this.$refs.main).on('mouseleave', this._hideVisible); | ||
} else { | ||
this.visibleReal = false; | ||
} | ||
$('body').off('click', this._hide); | ||
}.bind(this), 50); | ||
$('body').off('click', this._hide); // }, 50); | ||
}, | ||
_show: function _show(directionData) { | ||
var _this5 = this; | ||
var _this4 = this; | ||
@@ -1046,7 +1041,7 @@ var bind = this.bind; | ||
bpLibs.dom.probeDom(400, function () { | ||
_newArrowCheck(this, _this5); | ||
_newArrowCheck(this, _this4); | ||
return main.clientWidth > 0; | ||
}.bind(this), function () { | ||
_newArrowCheck(this, _this5); | ||
_newArrowCheck(this, _this4); | ||
@@ -1118,12 +1113,36 @@ if (directionData == 'left' || directionData == 'right') { | ||
_hide: function _hide() { | ||
var _this6 = this; | ||
var _this5 = this; | ||
$('body').off('click', this._hide); | ||
this.hide().then(function (res) { | ||
_newArrowCheck(this, _this6); | ||
_newArrowCheck(this, _this5); | ||
}.bind(this)); | ||
}, | ||
_hideVisible: function _hideVisible() { | ||
_hideVisible: function _hideVisible(ev) { | ||
$(this.$refs.main).off('mouseleave', this._hideVisible); | ||
if (ev) { | ||
var el; | ||
if (bpLibs.dom.isVueObject(this.bind)) { | ||
el = this.bind.$el; | ||
} else { | ||
el = this.bind; | ||
if (typeof el === 'string') { | ||
el = $(el)[0]; | ||
} | ||
} | ||
var mainOffset = bpLibs.dom.getElementOffset(el); // in popover. | ||
if (ev.clientX >= mainOffset.left - 24 && ev.clientX <= mainOffset.left + el.offsetWidth + 24 && ev.clientY >= mainOffset.top - 24 && ev.clientY <= mainOffset.top + el.offsetHeight + 24) { | ||
return; | ||
} // if (ev.toElement.isSameNode(el)) { | ||
// return; | ||
// } | ||
} | ||
this.visibleReal = false; | ||
$(this.$refs.main).off('mouseleave', this._hideVisible); | ||
} | ||
@@ -1130,0 +1149,0 @@ } |
/*! | ||
* bpui popover v1.1.19 | ||
* bpui popover v1.1.20 | ||
* Copyright (c) 2021 Copyright bpoint.lee@live.com All Rights Reserved. | ||
* Released under the MIT License. | ||
*/ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("@bpui/libs"),require("@bpui/dialog")):"function"==typeof define&&define.amd?define(["@bpui/libs","@bpui/dialog"],e):(t=t||self).bpPopover=e(t.bpLibs,t.bpDialog)}(this,(function(t,e){"use strict";function o(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),o.push.apply(o,i)}return o}function i(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function r(t,e){if(t!==e)throw new TypeError("Cannot instantiate an arrow function")}t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t,e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function s(t,e){return t(e={exports:{}},e.exports),e.exports}var f=function(t){return t&&t.Math==Math&&t},c=f("object"==typeof globalThis&&globalThis)||f("object"==typeof window&&window)||f("object"==typeof self&&self)||f("object"==typeof n&&n)||function(){return this}()||Function("return this")(),a=function(t){try{return!!t()}catch(t){return!0}},u=!a((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),l={}.propertyIsEnumerable,h=Object.getOwnPropertyDescriptor,p={f:h&&!l.call({1:2},1)?function(t){var e=h(this,t);return!!e&&e.enumerable}:l},d=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},g={}.toString,b=function(t){return g.call(t).slice(8,-1)},v="".split,y=a((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==b(t)?v.call(t,""):Object(t)}:Object,w=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},m=function(t){return y(w(t))},_=function(t){return"object"==typeof t?null!==t:"function"==typeof t},O=function(t,e){if(!_(t))return t;var o,i;if(e&&"function"==typeof(o=t.toString)&&!_(i=o.call(t)))return i;if("function"==typeof(o=t.valueOf)&&!_(i=o.call(t)))return i;if(!e&&"function"==typeof(o=t.toString)&&!_(i=o.call(t)))return i;throw TypeError("Can't convert object to primitive value")},T=function(t){return Object(w(t))},S={}.hasOwnProperty,j=Object.hasOwn||function(t,e){return S.call(T(t),e)},A=c.document,E=_(A)&&_(A.createElement),P=!u&&!a((function(){return 7!=Object.defineProperty((t="div",E?A.createElement(t):{}),"a",{get:function(){return 7}}).a;var t})),L=Object.getOwnPropertyDescriptor,x={f:u?L:function(t,e){if(t=m(t),e=O(e,!0),P)try{return L(t,e)}catch(t){}if(j(t,e))return d(!p.f.call(t,e),t[e])}},k=function(t){if(!_(t))throw TypeError(String(t)+" is not an object");return t},R=Object.defineProperty,C={f:u?R:function(t,e,o){if(k(t),e=O(e,!0),k(o),P)try{return R(t,e,o)}catch(t){}if("get"in o||"set"in o)throw TypeError("Accessors not supported");return"value"in o&&(t[e]=o.value),t}},I=u?function(t,e,o){return C.f(t,e,d(1,o))}:function(t,e,o){return t[e]=o,t},D=function(t,e){try{I(c,t,e)}catch(o){c[t]=e}return e},M=c["__core-js_shared__"]||D("__core-js_shared__",{}),H=Function.toString;"function"!=typeof M.inspectSource&&(M.inspectSource=function(t){return H.call(t)});var B,V,F,W,N=M.inspectSource,z=c.WeakMap,X="function"==typeof z&&/native code/.test(N(z)),Y=s((function(t){(t.exports=function(t,e){return M[t]||(M[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.15.2",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})})),q=0,G=Math.random(),U=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++q+G).toString(36)},K=Y("keys"),J={},Q=c.WeakMap;if(X||M.state){var Z=M.state||(M.state=new Q),tt=Z.get,et=Z.has,ot=Z.set;B=function(t,e){if(et.call(Z,t))throw new TypeError("Object already initialized");return e.facade=t,ot.call(Z,t,e),e},V=function(t){return tt.call(Z,t)||{}},F=function(t){return et.call(Z,t)}}else{var it=K[W="state"]||(K[W]=U(W));J[it]=!0,B=function(t,e){if(j(t,it))throw new TypeError("Object already initialized");return e.facade=t,I(t,it,e),e},V=function(t){return j(t,it)?t[it]:{}},F=function(t){return j(t,it)}}var rt,nt,st={set:B,get:V,has:F,enforce:function(t){return F(t)?V(t):B(t,{})},getterFor:function(t){return function(e){var o;if(!_(e)||(o=V(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return o}}},ft=s((function(t){var e=st.get,o=st.enforce,i=String(String).split("String");(t.exports=function(t,e,r,n){var s,f=!!n&&!!n.unsafe,a=!!n&&!!n.enumerable,u=!!n&&!!n.noTargetGet;"function"==typeof r&&("string"!=typeof e||j(r,"name")||I(r,"name",e),(s=o(r)).source||(s.source=i.join("string"==typeof e?e:""))),t!==c?(f?!u&&t[e]&&(a=!0):delete t[e],a?t[e]=r:I(t,e,r)):a?t[e]=r:D(e,r)})(Function.prototype,"toString",(function(){return"function"==typeof this&&e(this).source||N(this)}))})),ct=c,at=function(t){return"function"==typeof t?t:void 0},ut=function(t,e){return arguments.length<2?at(ct[t])||at(c[t]):ct[t]&&ct[t][e]||c[t]&&c[t][e]},lt=Math.ceil,ht=Math.floor,pt=function(t){return isNaN(t=+t)?0:(t>0?ht:lt)(t)},dt=Math.min,gt=function(t){return t>0?dt(pt(t),9007199254740991):0},bt=Math.max,vt=Math.min,yt=function(t){return function(e,o,i){var r,n=m(e),s=gt(n.length),f=function(t,e){var o=pt(t);return o<0?bt(o+e,0):vt(o,e)}(i,s);if(t&&o!=o){for(;s>f;)if((r=n[f++])!=r)return!0}else for(;s>f;f++)if((t||f in n)&&n[f]===o)return t||f||0;return!t&&-1}},wt={includes:yt(!0),indexOf:yt(!1)}.indexOf,mt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"].concat("length","prototype"),_t={f:Object.getOwnPropertyNames||function(t){return function(t,e){var o,i=m(t),r=0,n=[];for(o in i)!j(J,o)&&j(i,o)&&n.push(o);for(;e.length>r;)j(i,o=e[r++])&&(~wt(n,o)||n.push(o));return n}(t,mt)}},Ot={f:Object.getOwnPropertySymbols},Tt=ut("Reflect","ownKeys")||function(t){var e=_t.f(k(t)),o=Ot.f;return o?e.concat(o(t)):e},St=function(t,e){for(var o=Tt(e),i=C.f,r=x.f,n=0;n<o.length;n++){var s=o[n];j(t,s)||i(t,s,r(e,s))}},jt=/#|\.prototype\./,At=function(t,e){var o=Et[$t(t)];return o==Lt||o!=Pt&&("function"==typeof e?a(e):!!e)},$t=At.normalize=function(t){return String(t).replace(jt,".").toLowerCase()},Et=At.data={},Pt=At.NATIVE="N",Lt=At.POLYFILL="P",xt=At,kt=x.f,Rt=Array.isArray||function(t){return"Array"==b(t)},Ct=function(t,e,o){var i=O(e);i in t?C.f(t,i,d(0,o)):t[i]=o},It=ut("navigator","userAgent")||"",Dt=c.process,Mt=Dt&&Dt.versions,Ht=Mt&&Mt.v8;Ht?nt=(rt=Ht.split("."))[0]<4?1:rt[0]+rt[1]:It&&(!(rt=It.match(/Edge\/(\d+)/))||rt[1]>=74)&&(rt=It.match(/Chrome\/(\d+)/))&&(nt=rt[1]);var Bt,Vt=nt&&+nt,Ft=!!Object.getOwnPropertySymbols&&!a((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&Vt&&Vt<41})),Wt=Ft&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Nt=Y("wks"),zt=c.Symbol,Xt=Wt?zt:zt&&zt.withoutSetter||U,Yt=function(t){return j(Nt,t)&&(Ft||"string"==typeof Nt[t])||(Ft&&j(zt,t)?Nt[t]=zt[t]:Nt[t]=Xt("Symbol."+t)),Nt[t]},qt=Yt("species"),Gt=function(t,e){var o;return Rt(t)&&("function"!=typeof(o=t.constructor)||o!==Array&&!Rt(o.prototype)?_(o)&&null===(o=o[qt])&&(o=void 0):o=void 0),new(void 0===o?Array:o)(0===e?0:e)},Ut=Yt("species"),Kt=Yt("isConcatSpreadable"),Jt=Vt>=51||!a((function(){var t=[];return t[Kt]=!1,t.concat()[0]!==t})),Qt=(Bt="concat",Vt>=51||!a((function(){var t=[];return(t.constructor={})[Ut]=function(){return{foo:1}},1!==t[Bt](Boolean).foo}))),Zt=function(t){if(!_(t))return!1;var e=t[Kt];return void 0!==e?!!e:Rt(t)};function te(t,e,o,i,r,n,s,f,c,a){"boolean"!=typeof s&&(c=f,f=s,s=!1);var u,l="function"==typeof o?o.options:o;if(t&&t.render&&(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,r&&(l.functional=!0)),i&&(l._scopeId=i),n?(u=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,c(t)),t&&t._registeredComponents&&t._registeredComponents.add(n)},l._ssrRegister=u):e&&(u=s?function(t){e.call(this,a(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,f(t))}),u)if(l.functional){var h=l.render;l.render=function(t,e){return u.call(e),h(t,e)}}else{var p=l.beforeCreate;l.beforeCreate=p?[].concat(p,u):[u]}return o}!function(t,e){var o,i,r,n,s,f=t.target,a=t.global,u=t.stat;if(o=a?c:u?c[f]||D(f,{}):(c[f]||{}).prototype)for(i in e){if(n=e[i],r=t.noTargetGet?(s=kt(o,i))&&s.value:o[i],!xt(a?i:f+(u?".":"#")+i,t.forced)&&void 0!==r){if(typeof n==typeof r)continue;St(n,r)}(t.sham||r&&r.sham)&&I(n,"sham",!0),ft(o,i,n,t)}}({target:"Array",proto:!0,forced:!Jt||!Qt},{concat:function(t){var e,o,i,r,n,s=T(this),f=Gt(s,0),c=0;for(e=-1,i=arguments.length;e<i;e++)if(Zt(n=-1===e?s:arguments[e])){if(c+(r=gt(n.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(o=0;o<r;o++,c++)o in n&&Ct(f,c,n[o])}else{if(c>=9007199254740991)throw TypeError("Maximum allowed index exceeded");Ct(f,c++,n)}return f.length=c,f}});var ee={components:{widget:e.bpWidget},props:{visible:Boolean,mask:{default:!1,type:Boolean},maskClose:{default:!0,type:Boolean},pageClass:String|Array,pageStyle:String|Array|Object,direction:{default:"auto",type:String},trigger:{type:String},bind:{}},computed:{pStyle:function(){return this.pageStyle?"string"==typeof this.pageStyle?"left:".concat(this.offsetLeft,";top:").concat(this.offsetTop,";")+this.pageStyle:function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach((function(e){i(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({left:this.offsetLeft,top:this.offsetTop},this.pageStyle):{left:this.offsetLeft,top:this.offsetTop}}},data:function(){return{visibleReal:!1,directionData:"auto",offsetTop:0,offsetLeft:0,offsetArrowLeft:null,offsetArrowTop:null,offsetArrowBottom:null,offsetArrowRight:null}},watch:{visible:function(t,e){this.visibleReal!=t&&(this.visibleReal=t,t!=e&&(t?this._onTriggerShow(null):this._onTriggerHide(null)))},visibleReal:function(t){this.$emit("update:visible",t)},bind:function(t,e){this._removeEvent(e),this._bindEvent(t)}},beforeMount:function(){this.visibleReal=this.visible},beforeDestroy:function(){this._removeEvent(this.bind),$("body").off("click",this._hide)},mounted:function(){var t=this;this.$nextTick(function(){r(this,t),this.$parent.$forceUpdate()}.bind(this))},methods:{show:function(){return this.$refs.widget.show()},hide:function(){return this.$refs.widget.hide()},_removeEvent:function(e){var o;e&&(o=t.dom.isVueObject(e)?e.$el:e,$(o).off("mouseover",this._onTriggerShow),$(o).off("mouseleave",this._onTriggerHide),$(o).off("click",this._onTriggerShow),this.ges&&(this.ges.dispose(),this.ges=null))},_bindEvent:function(e){var o,i=this;if(this._removeEvent(e),e)if(o=t.dom.isVueObject(e)?e.$el:e,"hover"==this.trigger)t.device.browserIsMobile()?$(o).on("click",this._onTriggerShow):($(o).on("mouseover",this._onTriggerShow),$(o).on("mouseleave",this._onTriggerHide));else if("click"==this.trigger){var n=(t.device.browserIsMobile(),"click");$(o).off(n,this._onTriggerShow).on(n,this._onTriggerShow)}else"long-press"==this.trigger&&(this.ges=new t.Gesture(o),this.ges.enablePressRecognizer({duration:600}),this.ges.on("press",function(e){r(this,i),t.device.vibrate(10),this._onTriggerShow(e)}.bind(this)))},_onTriggerShow:function(t){var e=this;this.visibleReal=!0,setTimeout(function(){r(this,e),$("body").off("click",this._hide).on("click",this._hide)}.bind(this),10),this._show(this.direction)},_onTriggerHide:function(e){var o=this,i=$(this.$refs.main),n=e;this.$timer.setTimeout(function(){r(this,o);var e=t.dom.getElementOffset(i[0]);n&&n.clientX+n.offsetX>=e.left-24&&n.clientX+n.offsetX<=e.left+i[0].offsetWidth+24&&n.clientY+n.offsetY>=e.top-24&&n.clientY+n.offsetY<=e.top+i[0].offsetHeight+24?$(this.$refs.main).on("mouseleave",this._hideVisible):this.visibleReal=!1,$("body").off("click",this._hide)}.bind(this),50)},_show:function(e){var o=this,i=this.bind;if(this.bind){var n;n=t.dom.isVueObject(i)?i.$el:i;var s=t.dom.getElementOffset(n),f={};f.height=n.clientHeight,f.width=n.clientWidth;var c,a=t.dom.getViewPort(),u=t.dom.getDocumentOffset();this.offsetTop=s.top+u.top,"top"==e?(this.directionData="top",this.offsetTop-=8):"bottom"==e?(this.directionData="bottom",this.offsetTop+=f.height):"left"==e?(this.directionData="left",this.offsetLeft=s.left+f.width):"right"==e?(this.directionData="right",this.offsetLeft=s.left+f.width):s.top+f.height/2>a.height/2?(e="top",this.directionData="top",this.offsetTop-=8):(e="bottom",this.directionData="bottom",this.offsetTop+=f.height),this.offsetTop=parseInt(this.offsetTop),c="left"==e||"right"==e?parseInt(s.top+f.height/2):parseInt(s.left+f.width/2);var l=this.$refs.main;t.dom.probeDom(400,function(){return r(this,o),l.clientWidth>0}.bind(this),function(){if(r(this,o),"left"==e||"right"==e){var t=parseInt(c-l.clientHeight/2);t<10&&(t=10),t+l.clientHeight>a.height-10&&(t=a.height-10-l.clientHeight),this.offsetTop=parseInt(t+u.top)+"px",this.offsetLeft="right"==e?s.left+f.width+6:s.left-l.clientWidth-6-6,this.offsetLeft+=u.left,this.offsetLeft=parseInt(this.offsetLeft),this.offsetLeft+="px",this.offsetArrowLeft=null,this.offsetArrowBottom=null,this.offsetArrowTop=parseInt(c-t-6),this.offsetArrowTop<10?this.offsetArrowTop=10:this.offsetArrowTop>l.clientHeight-22&&(this.offsetArrowTop=parseInt(l.clientHeight-22)),this.offsetArrowTop+="px",this.offsetArrowRight=null}else{var i=parseInt(l.clientWidth||50),n=parseInt(l.clientHeight||50);"top"==e&&(this.offsetTop-=n+6),this.offsetTop+="px";var h=parseInt(c-i/2);h<10&&(h=10),h+i>a.width-10&&(h=a.width-10-i),this.offsetLeft=parseInt(h)+"px",this.offsetArrowLeft=parseInt(c-h)-6,this.offsetArrowLeft<10?this.offsetArrowLeft=10:this.offsetArrowLeft>i-22&&(this.offsetArrowLeft=i-22),this.offsetArrowLeft+="px",this.offsetArrowBottom=null,this.offsetArrowTop=null,this.offsetArrowRight=null}}.bind(this))}},_hide:function(){var t=this;$("body").off("click",this._hide),this.hide().then(function(e){r(this,t)}.bind(this))},_hideVisible:function(){this.visibleReal=!1,$(this.$refs.main).off("mouseleave",this._hideVisible)}}},oe=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("widget",{ref:"widget",staticClass:"bp-popover",attrs:{visible:t.visibleReal,maskClose:t.maskClose,mask:t.mask,preventEvent:!1,hideBodyScroll:!1,appendToBody:!0},on:{"update:visible":function(e){t.visibleReal=e}}},[o("div",{ref:"main",staticClass:"bp-popover__main",class:t.pageClass,style:t.pStyle,attrs:{direction:t.directionData}},[t._t("default"),t._v(" "),o("div",{staticClass:"bp-popover__arrow",style:{left:t.offsetArrowLeft,top:t.offsetArrowTop,right:t.offsetArrowRight,bottom:t.offsetArrowBottom}})],2)])};oe._withStripped=!0;return{bpPopover:te({render:oe,staticRenderFns:[]},void 0,ee,void 0,!1,void 0,!1,void 0,void 0,void 0)}})); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("@bpui/libs"),require("@bpui/dialog")):"function"==typeof define&&define.amd?define(["@bpui/libs","@bpui/dialog"],e):(t=t||self).bpPopover=e(t.bpLibs,t.bpDialog)}(this,(function(t,e){"use strict";function o(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),o.push.apply(o,i)}return o}function i(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function r(t,e){if(t!==e)throw new TypeError("Cannot instantiate an arrow function")}t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t,e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function s(t,e){return t(e={exports:{}},e.exports),e.exports}var f=function(t){return t&&t.Math==Math&&t},c=f("object"==typeof globalThis&&globalThis)||f("object"==typeof window&&window)||f("object"==typeof self&&self)||f("object"==typeof n&&n)||function(){return this}()||Function("return this")(),a=function(t){try{return!!t()}catch(t){return!0}},u=!a((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),l={}.propertyIsEnumerable,h=Object.getOwnPropertyDescriptor,p={f:h&&!l.call({1:2},1)?function(t){var e=h(this,t);return!!e&&e.enumerable}:l},d=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},g={}.toString,b=function(t){return g.call(t).slice(8,-1)},v="".split,y=a((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==b(t)?v.call(t,""):Object(t)}:Object,m=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},w=function(t){return y(m(t))},_=function(t){return"object"==typeof t?null!==t:"function"==typeof t},O=function(t,e){if(!_(t))return t;var o,i;if(e&&"function"==typeof(o=t.toString)&&!_(i=o.call(t)))return i;if("function"==typeof(o=t.valueOf)&&!_(i=o.call(t)))return i;if(!e&&"function"==typeof(o=t.toString)&&!_(i=o.call(t)))return i;throw TypeError("Can't convert object to primitive value")},T=function(t){return Object(m(t))},S={}.hasOwnProperty,j=Object.hasOwn||function(t,e){return S.call(T(t),e)},A=c.document,E=_(A)&&_(A.createElement),P=!u&&!a((function(){return 7!=Object.defineProperty((t="div",E?A.createElement(t):{}),"a",{get:function(){return 7}}).a;var t})),L=Object.getOwnPropertyDescriptor,x={f:u?L:function(t,e){if(t=w(t),e=O(e,!0),P)try{return L(t,e)}catch(t){}if(j(t,e))return d(!p.f.call(t,e),t[e])}},k=function(t){if(!_(t))throw TypeError(String(t)+" is not an object");return t},R=Object.defineProperty,C={f:u?R:function(t,e,o){if(k(t),e=O(e,!0),k(o),P)try{return R(t,e,o)}catch(t){}if("get"in o||"set"in o)throw TypeError("Accessors not supported");return"value"in o&&(t[e]=o.value),t}},I=u?function(t,e,o){return C.f(t,e,d(1,o))}:function(t,e,o){return t[e]=o,t},D=function(t,e){try{I(c,t,e)}catch(o){c[t]=e}return e},M=c["__core-js_shared__"]||D("__core-js_shared__",{}),H=Function.toString;"function"!=typeof M.inspectSource&&(M.inspectSource=function(t){return H.call(t)});var V,B,W,F,N=M.inspectSource,z=c.WeakMap,X="function"==typeof z&&/native code/.test(N(z)),Y=s((function(t){(t.exports=function(t,e){return M[t]||(M[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.15.2",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})})),q=0,G=Math.random(),U=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++q+G).toString(36)},K=Y("keys"),J={},Q=c.WeakMap;if(X||M.state){var Z=M.state||(M.state=new Q),tt=Z.get,et=Z.has,ot=Z.set;V=function(t,e){if(et.call(Z,t))throw new TypeError("Object already initialized");return e.facade=t,ot.call(Z,t,e),e},B=function(t){return tt.call(Z,t)||{}},W=function(t){return et.call(Z,t)}}else{var it=K[F="state"]||(K[F]=U(F));J[it]=!0,V=function(t,e){if(j(t,it))throw new TypeError("Object already initialized");return e.facade=t,I(t,it,e),e},B=function(t){return j(t,it)?t[it]:{}},W=function(t){return j(t,it)}}var rt,nt,st={set:V,get:B,has:W,enforce:function(t){return W(t)?B(t):V(t,{})},getterFor:function(t){return function(e){var o;if(!_(e)||(o=B(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return o}}},ft=s((function(t){var e=st.get,o=st.enforce,i=String(String).split("String");(t.exports=function(t,e,r,n){var s,f=!!n&&!!n.unsafe,a=!!n&&!!n.enumerable,u=!!n&&!!n.noTargetGet;"function"==typeof r&&("string"!=typeof e||j(r,"name")||I(r,"name",e),(s=o(r)).source||(s.source=i.join("string"==typeof e?e:""))),t!==c?(f?!u&&t[e]&&(a=!0):delete t[e],a?t[e]=r:I(t,e,r)):a?t[e]=r:D(e,r)})(Function.prototype,"toString",(function(){return"function"==typeof this&&e(this).source||N(this)}))})),ct=c,at=function(t){return"function"==typeof t?t:void 0},ut=function(t,e){return arguments.length<2?at(ct[t])||at(c[t]):ct[t]&&ct[t][e]||c[t]&&c[t][e]},lt=Math.ceil,ht=Math.floor,pt=function(t){return isNaN(t=+t)?0:(t>0?ht:lt)(t)},dt=Math.min,gt=function(t){return t>0?dt(pt(t),9007199254740991):0},bt=Math.max,vt=Math.min,yt=function(t){return function(e,o,i){var r,n=w(e),s=gt(n.length),f=function(t,e){var o=pt(t);return o<0?bt(o+e,0):vt(o,e)}(i,s);if(t&&o!=o){for(;s>f;)if((r=n[f++])!=r)return!0}else for(;s>f;f++)if((t||f in n)&&n[f]===o)return t||f||0;return!t&&-1}},mt={includes:yt(!0),indexOf:yt(!1)}.indexOf,wt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"].concat("length","prototype"),_t={f:Object.getOwnPropertyNames||function(t){return function(t,e){var o,i=w(t),r=0,n=[];for(o in i)!j(J,o)&&j(i,o)&&n.push(o);for(;e.length>r;)j(i,o=e[r++])&&(~mt(n,o)||n.push(o));return n}(t,wt)}},Ot={f:Object.getOwnPropertySymbols},Tt=ut("Reflect","ownKeys")||function(t){var e=_t.f(k(t)),o=Ot.f;return o?e.concat(o(t)):e},St=function(t,e){for(var o=Tt(e),i=C.f,r=x.f,n=0;n<o.length;n++){var s=o[n];j(t,s)||i(t,s,r(e,s))}},jt=/#|\.prototype\./,At=function(t,e){var o=Et[$t(t)];return o==Lt||o!=Pt&&("function"==typeof e?a(e):!!e)},$t=At.normalize=function(t){return String(t).replace(jt,".").toLowerCase()},Et=At.data={},Pt=At.NATIVE="N",Lt=At.POLYFILL="P",xt=At,kt=x.f,Rt=Array.isArray||function(t){return"Array"==b(t)},Ct=function(t,e,o){var i=O(e);i in t?C.f(t,i,d(0,o)):t[i]=o},It=ut("navigator","userAgent")||"",Dt=c.process,Mt=Dt&&Dt.versions,Ht=Mt&&Mt.v8;Ht?nt=(rt=Ht.split("."))[0]<4?1:rt[0]+rt[1]:It&&(!(rt=It.match(/Edge\/(\d+)/))||rt[1]>=74)&&(rt=It.match(/Chrome\/(\d+)/))&&(nt=rt[1]);var Vt,Bt=nt&&+nt,Wt=!!Object.getOwnPropertySymbols&&!a((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&Bt&&Bt<41})),Ft=Wt&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Nt=Y("wks"),zt=c.Symbol,Xt=Ft?zt:zt&&zt.withoutSetter||U,Yt=function(t){return j(Nt,t)&&(Wt||"string"==typeof Nt[t])||(Wt&&j(zt,t)?Nt[t]=zt[t]:Nt[t]=Xt("Symbol."+t)),Nt[t]},qt=Yt("species"),Gt=function(t,e){var o;return Rt(t)&&("function"!=typeof(o=t.constructor)||o!==Array&&!Rt(o.prototype)?_(o)&&null===(o=o[qt])&&(o=void 0):o=void 0),new(void 0===o?Array:o)(0===e?0:e)},Ut=Yt("species"),Kt=Yt("isConcatSpreadable"),Jt=Bt>=51||!a((function(){var t=[];return t[Kt]=!1,t.concat()[0]!==t})),Qt=(Vt="concat",Bt>=51||!a((function(){var t=[];return(t.constructor={})[Ut]=function(){return{foo:1}},1!==t[Vt](Boolean).foo}))),Zt=function(t){if(!_(t))return!1;var e=t[Kt];return void 0!==e?!!e:Rt(t)};function te(t,e,o,i,r,n,s,f,c,a){"boolean"!=typeof s&&(c=f,f=s,s=!1);var u,l="function"==typeof o?o.options:o;if(t&&t.render&&(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,r&&(l.functional=!0)),i&&(l._scopeId=i),n?(u=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,c(t)),t&&t._registeredComponents&&t._registeredComponents.add(n)},l._ssrRegister=u):e&&(u=s?function(t){e.call(this,a(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,f(t))}),u)if(l.functional){var h=l.render;l.render=function(t,e){return u.call(e),h(t,e)}}else{var p=l.beforeCreate;l.beforeCreate=p?[].concat(p,u):[u]}return o}!function(t,e){var o,i,r,n,s,f=t.target,a=t.global,u=t.stat;if(o=a?c:u?c[f]||D(f,{}):(c[f]||{}).prototype)for(i in e){if(n=e[i],r=t.noTargetGet?(s=kt(o,i))&&s.value:o[i],!xt(a?i:f+(u?".":"#")+i,t.forced)&&void 0!==r){if(typeof n==typeof r)continue;St(n,r)}(t.sham||r&&r.sham)&&I(n,"sham",!0),ft(o,i,n,t)}}({target:"Array",proto:!0,forced:!Jt||!Qt},{concat:function(t){var e,o,i,r,n,s=T(this),f=Gt(s,0),c=0;for(e=-1,i=arguments.length;e<i;e++)if(Zt(n=-1===e?s:arguments[e])){if(c+(r=gt(n.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(o=0;o<r;o++,c++)o in n&&Ct(f,c,n[o])}else{if(c>=9007199254740991)throw TypeError("Maximum allowed index exceeded");Ct(f,c++,n)}return f.length=c,f}});var ee={components:{widget:e.bpWidget},props:{visible:Boolean,mask:{default:!1,type:Boolean},maskClose:{default:!0,type:Boolean},pageClass:String|Array,pageStyle:String|Array|Object,direction:{default:"auto",type:String},trigger:{type:String},bind:{}},computed:{pStyle:function(){return this.pageStyle?"string"==typeof this.pageStyle?"left:".concat(this.offsetLeft,";top:").concat(this.offsetTop,";")+this.pageStyle:function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach((function(e){i(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({left:this.offsetLeft,top:this.offsetTop},this.pageStyle):{left:this.offsetLeft,top:this.offsetTop}}},data:function(){return{visibleReal:!1,directionData:"auto",offsetTop:0,offsetLeft:0,offsetArrowLeft:null,offsetArrowTop:null,offsetArrowBottom:null,offsetArrowRight:null}},watch:{visible:function(t,e){this.visibleReal!=t&&(this.visibleReal=t,t!=e&&(t?this._onTriggerShow(null):this._onTriggerHide(null)))},visibleReal:function(t){this.$emit("update:visible",t)},bind:function(t,e){this._removeEvent(e),this._bindEvent(t)}},beforeMount:function(){this.visibleReal=this.visible},beforeDestroy:function(){this._removeEvent(this.bind),$("body").off("click",this._hide)},mounted:function(){var t=this;this.$nextTick(function(){r(this,t),this.$parent.$forceUpdate()}.bind(this))},methods:{show:function(){return this.$refs.widget.show()},hide:function(){return this.$refs.widget.hide()},_removeEvent:function(e){var o;e&&(o=t.dom.isVueObject(e)?e.$el:e,$(o).off("mouseover",this._onTriggerShow),$(o).off("mouseleave",this._onTriggerHide),$(o).off("click",this._onTriggerShow),this.ges&&(this.ges.dispose(),this.ges=null))},_bindEvent:function(e){var o,i=this;if(this._removeEvent(e),e)if(o=t.dom.isVueObject(e)?e.$el:e,"hover"==this.trigger)t.device.browserIsMobile()?$(o).on("click",this._onTriggerShow):($(o).on("mouseover",this._onTriggerShow),$(o).on("mouseleave",this._onTriggerHide));else if("click"==this.trigger){var n=(t.device.browserIsMobile(),"click");$(o).off(n,this._onTriggerShow).on(n,this._onTriggerShow)}else"long-press"==this.trigger&&(this.ges=new t.Gesture(o),this.ges.enablePressRecognizer({duration:600}),this.ges.on("press",function(e){r(this,i),t.device.vibrate(10),this._onTriggerShow(e)}.bind(this)))},_onTriggerShow:function(t){var e=this;this.visibleReal=!0,setTimeout(function(){r(this,e),$("body").off("click",this._hide).on("click",this._hide)}.bind(this),10),this._show(this.direction)},_onTriggerHide:function(e){var o=$(this.$refs.main),i=e,r=t.dom.getElementOffset(o[0]);i&&i.clientX>=r.left-24&&i.clientX<=r.left+o[0].offsetWidth+24&&i.clientY>=r.top-24&&i.clientY<=r.top+o[0].offsetHeight+24?$(this.$refs.main).on("mouseleave",this._hideVisible):this.visibleReal=!1,$("body").off("click",this._hide)},_show:function(e){var o=this,i=this.bind;if(this.bind){var n;n=t.dom.isVueObject(i)?i.$el:i;var s=t.dom.getElementOffset(n),f={};f.height=n.clientHeight,f.width=n.clientWidth;var c,a=t.dom.getViewPort(),u=t.dom.getDocumentOffset();this.offsetTop=s.top+u.top,"top"==e?(this.directionData="top",this.offsetTop-=8):"bottom"==e?(this.directionData="bottom",this.offsetTop+=f.height):"left"==e?(this.directionData="left",this.offsetLeft=s.left+f.width):"right"==e?(this.directionData="right",this.offsetLeft=s.left+f.width):s.top+f.height/2>a.height/2?(e="top",this.directionData="top",this.offsetTop-=8):(e="bottom",this.directionData="bottom",this.offsetTop+=f.height),this.offsetTop=parseInt(this.offsetTop),c="left"==e||"right"==e?parseInt(s.top+f.height/2):parseInt(s.left+f.width/2);var l=this.$refs.main;t.dom.probeDom(400,function(){return r(this,o),l.clientWidth>0}.bind(this),function(){if(r(this,o),"left"==e||"right"==e){var t=parseInt(c-l.clientHeight/2);t<10&&(t=10),t+l.clientHeight>a.height-10&&(t=a.height-10-l.clientHeight),this.offsetTop=parseInt(t+u.top)+"px",this.offsetLeft="right"==e?s.left+f.width+6:s.left-l.clientWidth-6-6,this.offsetLeft+=u.left,this.offsetLeft=parseInt(this.offsetLeft),this.offsetLeft+="px",this.offsetArrowLeft=null,this.offsetArrowBottom=null,this.offsetArrowTop=parseInt(c-t-6),this.offsetArrowTop<10?this.offsetArrowTop=10:this.offsetArrowTop>l.clientHeight-22&&(this.offsetArrowTop=parseInt(l.clientHeight-22)),this.offsetArrowTop+="px",this.offsetArrowRight=null}else{var i=parseInt(l.clientWidth||50),n=parseInt(l.clientHeight||50);"top"==e&&(this.offsetTop-=n+6),this.offsetTop+="px";var h=parseInt(c-i/2);h<10&&(h=10),h+i>a.width-10&&(h=a.width-10-i),this.offsetLeft=parseInt(h)+"px",this.offsetArrowLeft=parseInt(c-h)-6,this.offsetArrowLeft<10?this.offsetArrowLeft=10:this.offsetArrowLeft>i-22&&(this.offsetArrowLeft=i-22),this.offsetArrowLeft+="px",this.offsetArrowBottom=null,this.offsetArrowTop=null,this.offsetArrowRight=null}}.bind(this))}},_hide:function(){var t=this;$("body").off("click",this._hide),this.hide().then(function(e){r(this,t)}.bind(this))},_hideVisible:function(e){if($(this.$refs.main).off("mouseleave",this._hideVisible),e){var o;t.dom.isVueObject(this.bind)?o=this.bind.$el:"string"==typeof(o=this.bind)&&(o=$(o)[0]);var i=t.dom.getElementOffset(o);if(e.clientX>=i.left-24&&e.clientX<=i.left+o.offsetWidth+24&&e.clientY>=i.top-24&&e.clientY<=i.top+o.offsetHeight+24)return}this.visibleReal=!1}}},oe=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("widget",{ref:"widget",staticClass:"bp-popover",attrs:{visible:t.visibleReal,maskClose:t.maskClose,mask:t.mask,preventEvent:!1,hideBodyScroll:!1,appendToBody:!0},on:{"update:visible":function(e){t.visibleReal=e}}},[o("div",{ref:"main",staticClass:"bp-popover__main",class:t.pageClass,style:t.pStyle,attrs:{direction:t.directionData}},[t._t("default"),t._v(" "),o("div",{staticClass:"bp-popover__arrow",style:{left:t.offsetArrowLeft,top:t.offsetArrowTop,right:t.offsetArrowRight,bottom:t.offsetArrowBottom}})],2)])};oe._withStripped=!0;return{bpPopover:te({render:oe,staticRenderFns:[]},void 0,ee,void 0,!1,void 0,!1,void 0,void 0,void 0)}})); |
@@ -37,3 +37,3 @@ { | ||
"name": "@bpui/popover", | ||
"version": "1.1.19" | ||
"version": "1.1.20" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
468491
4873