@persagy2/meri-design
Version:
fork from meri-design and extend it.
7 lines • 6.59 kB
JavaScript
/*!
* @@persagy2/meri-design v1.4.9-extend.2
* (c) 2019-2020 xiongshuang
* Released under the MIT License.
* 2022-12-07 10:33:25
*/
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("vue")):"function"==typeof define&&define.amd?define("Breadcrumb",["vue"],e):"object"==typeof exports?exports.Breadcrumb=e(require("vue")):t.Breadcrumb=e(t.Vue)}(this,(function(t){return function(){"use strict";var e={3454:function(t,e,n){n.d(e,{s:function(){return r},x:function(){return i}});var r=function(){var t=this._self._c;return t("svg",{attrs:{viewBox:"0 0 8 14",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"}},[t("g",{attrs:{transform:"translate(-5.000000, -1.000000)"}},[t("path",{staticClass:"svg-fill-grey-500",attrs:{d:"M3.12825877,4.99018758 L3.12825877,12.3235209 L1.79492544,12.3235209 L1.79492544,4.99018758 L1.79492544,3.65685425 L10.4615921,3.65685425 L10.4615921,4.99018758 L3.12825877,4.99018758 Z",transform:"translate(6.128259, 7.990188) scale(-1, 1) rotate(-405.000000) translate(-6.128259, -7.990188)"}})])])},i=[]},216:function(t,e,n){n.d(e,{default:function(){return v}});var r=n(2205),i=n.n(r),o={name:"Tooltip"},a=(0,n(1900).Z)(o,(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,i,o,a,u=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(u.push(r.value),u.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return u}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return l(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(t,e)}(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 c=0,s=0,d=null,f=null,p=null,m=function t(e,n){var r=/<\/?.+?\/?>/g,o=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,l=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;e.onmouseenter=function(t){var e=n.arg,m=t.target,v=m.clientWidth,h=m.scrollWidth,b="420";if(e){var y=e.split(","),g={};if(y.forEach((function(t){var e=u(t.split(":"),2),n=e[0],r=e[1];g[n]=r})),g.isText&&h<=v)return;g.width&&(b=g.width)}p=setTimeout((function(){var e=i().extend(a);f=new e,d=f.$mount().$el,document.body.appendChild(d);var u=t.target.getBoundingClientRect(),p=u.top,m=u.bottom,v=u.width,h=u.height;n.value?d.innerText=n.value:d.innerText=t.target.innerHTML.replace(r,"");var y=window.getComputedStyle(d),g=parseInt(y.width.replace("px","")),x=parseInt(y.height.replace("px","")),w=t.x,_=t.y,C=p>x-4,S=l-m>x-4;w<v/2&&_<h/2&&(c=C?p-(x-4):p+h-4),w>v/2&&_<h/2&&(c=C?p-(x-4):p+h-4),w<v/2&&_>h/2&&(c=S?p+h-4:p-(x-4)),w>v/2&&_>h/2&&(c=S?p+h-4:p-(x-4)),s=w;var T=o-w,j=g>b?Number(b):g;T<j&&(s-=j-T),d.style.left="".concat(s,"px"),d.style.top="".concat(c,"px"),d.style.maxWidth="".concat(b,"px"),d.style.zIndex=7e3,d.style.visibility="visible"}),300)};var m=function(){p&&(clearTimeout(p),p=null),t.remove()};e.onmouseleave=m,e.onmouseup=m};m.remove=function(){f&&(document.body.removeChild(d),f.$destroy(),d=null,f=null)};var v=m},4807:function(t,e,n){var r=n(3454),i=(0,n(1900).Z)({},r.s,r.x,!1,null,null,null);e.Z=i.exports},1900:function(t,e,n){function r(t,e,n,r,i,o,a,u){var l,c="function"==typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=n,c._compiled=!0),r&&(c.functional=!0),o&&(c._scopeId="data-v-"+o),a?(l=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__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},c._ssrRegister=l):i&&(l=u?function(){i.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:i),l)if(c.functional){c._injectStyles=l;var s=c.render;c.render=function(t,e){return l.call(e),s(t,e)}}else{var d=c.beforeCreate;c.beforeCreate=d?[].concat(d,l):[l]}return{exports:t,options:c}}n.d(e,{Z:function(){return r}})},2205:function(e){e.exports=t}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var o=n[t]={exports:{}};return e[t](o,o.exports,r),o.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 i={};return function(){r.r(i),r.d(i,{default:function(){return a}});var t=r(4807),e=r(216),n={name:"Breadcrumb",components:{ArrowRight:t.Z},directives:{ptitle:{inserted:e.default,unbind:e.default.remove}},props:{data:{type:Array,default:function(){return[]}},value:{type:String,default:""},ellipsis:{type:Boolean,default:!1}},data:function(){return{titleShow:!1}},methods:{breadcrumbClick:function(t){this.value&&this.$emit("input",t),this.$emit("change",t)}}},o=(0,r(1900).Z)(n,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"p-breadcrumb"},t._l(t.data,(function(n,r){return e("section",{key:r+"-"+n.id,staticClass:"p-breadcrumb-item"},[e("article",{directives:[{name:"ptitle",rawName:"v-ptitle:isText:true",value:n.name,expression:"item.name",arg:"isText:true"}],class:["p-breadcrumb-item-text",(t.value?t.value===n.id:r===t.data.length-1)&&"p-breadcrumb-item-active",r>0&&r<t.data.length-1&&"p-breadcrumb-item-width",(t.ellipsis||r===t.data.length-1)&&"p-breadcrumb-item-max-width"],on:{click:function(e){return t.breadcrumbClick(n.id)}}},[t._v(t._s(n.name))]),t._v(" "),r<t.data.length-1?e("article",{staticClass:"p-breadcrumb-arrow"},[e("ArrowRight")],1):t._e()])})),0)}),[],!1,null,null,null).exports;o.install=function(t){return t.component(o.name,o)};var a=o}(),i}()}));