UNPKG

@persagy2/meri-design

Version:

fork from meri-design and extend it.

7 lines 4.51 kB
/*! * @@persagy2/meri-design v1.4.9-extend.2 * (c) 2019-2020 xiongshuang * Released under the MIT License. * 2022-12-07 10:32:51 */ var t,e;t=this,e=function(t){return function(){"use strict";var e={1900:function(t,e,n){function r(t,e,n,r,o,i,u,l){var a,c="function"==typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=n,c._compiled=!0),r&&(c.functional=!0),i&&(c._scopeId="data-v-"+i),u?(a=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__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(u)},c._ssrRegister=a):o&&(a=l?function(){o.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:o),a)if(c.functional){c._injectStyles=a;var d=c.render;c.render=function(t,e){return a.call(e),d(t,e)}}else{var s=c.beforeCreate;c.beforeCreate=s?[].concat(s,a):[a]}return{exports:t,options:c}}n.d(e,{Z:function(){return r}})},2205:function(e){e.exports=t}},n={};function r(t){var o=n[t];if(void 0!==o)return o.exports;var i=n[t]={exports:{}};return e[t](i,i.exports,r),i.exports}r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,{a:e}),e},r.d=function(t,e){for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};return function(){r.r(o),r.d(o,{default:function(){return v}});var t=r(2205),e=r.n(t),n={name:"Tooltip"},i=(0,r(1900).Z)(n,(function(){return(0,this._self._c)("div",{staticClass:"p-tooltip-box"})}),[],!1,null,null,null).exports;function u(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,u,l=[],a=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;a=!1}else for(;!(a=(r=i.call(n)).done)&&(l.push(r.value),l.length!==e);a=!0);}catch(d){c=!0,o=d}finally{try{if(!a&&null!=n.return&&(u=n.return(),Object(u)!==u))return}finally{if(c)throw o}}return l}}(t,e)||function(t,e){if(t){if("string"==typeof t)return l(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var a=0,c=0,d=null,s=null,f=null,p=function t(n,r){var o=/<\/?.+?\/?>/g,l=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,p=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;n.onmouseenter=function(t){var n=r.arg,v=t.target,y=v.clientWidth,m=v.scrollWidth,h="420";if(n){var b=n.split(","),g={};if(b.forEach((function(t){var e=u(t.split(":"),2),n=e[0],r=e[1];g[n]=r})),g.isText&&m<=y)return;g.width&&(h=g.width)}f=setTimeout((function(){var n=e().extend(i);s=new n,d=s.$mount().$el,document.body.appendChild(d);var u=t.target.getBoundingClientRect(),f=u.top,v=u.bottom,y=u.width,m=u.height;r.value?d.innerText=r.value:d.innerText=t.target.innerHTML.replace(o,"");var b=window.getComputedStyle(d),g=parseInt(b.width.replace("px","")),x=parseInt(b.height.replace("px","")),_=t.x,w=t.y,T=f>x-4,S=p-v>x-4;_<y/2&&w<m/2&&(a=T?f-(x-4):f+m-4),_>y/2&&w<m/2&&(a=T?f-(x-4):f+m-4),_<y/2&&w>m/2&&(a=S?f+m-4:f-(x-4)),_>y/2&&w>m/2&&(a=S?f+m-4:f-(x-4)),c=_;var C=l-_,j=g>h?Number(h):g;C<j&&(c-=j-C),d.style.left="".concat(c,"px"),d.style.top="".concat(a,"px"),d.style.maxWidth="".concat(h,"px"),d.style.zIndex=7e3,d.style.visibility="visible"}),300)};var v=function(){f&&(clearTimeout(f),f=null),t.remove()};n.onmouseleave=v,n.onmouseup=v};p.remove=function(){s&&(document.body.removeChild(d),s.$destroy(),d=null,s=null)};var v=p}(),o}()},"object"==typeof exports&&"object"==typeof module?module.exports=e(require("vue")):"function"==typeof define&&define.amd?define("Tooltip",["vue"],e):"object"==typeof exports?exports.Tooltip=e(require("vue")):t.Tooltip=e(t.Vue);