1 line
7.3 KiB
JavaScript
1 line
7.3 KiB
JavaScript
module.exports=function(e){function t(o){if(n[o])return n[o].exports;var i=n[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/",t(t.s=5)}([function(e,t){e.exports=function(e,t,n,o,i,a){var r,u=e=e||{},d=typeof e.default;"object"!==d&&"function"!==d||(r=e,u=e.default);var l="function"==typeof u?u.options:u;t&&(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0),n&&(l.functional=!0),i&&(l._scopeId=i);var s;if(a?(s=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},l._ssrRegister=s):o&&(s=o),s){var c=l.functional,f=c?l.render:l.beforeCreate;c?(l._injectStyles=s,l.render=function(e,t){return s.call(t),f(e,t)}):l.beforeCreate=f?[].concat(f,s):[s]}return{esModule:r,exports:u,options:l}}},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),a=o(i),r=n(8),u=o(r),d=n(9),l=o(d),s=n(3),c=o(s);t.default={props:u.default,components:{SvgPanZoomThumbnail:c.default},computed:{has_thumbnail:function(){return this.$slots.thumbnail},options:function(){var e=this,t={},n=function(t){return void 0!==e[t]};return Object.keys(u.default).filter(n).forEach(function(n){return t[n]=e[n]}),t}},mounted:function(){var e=this,t={};Object.keys(u.default).filter(function(t){return void 0!==e[t]}).forEach(function(n){return t[n]=e[n]});var n=void 0;this.has_thumbnail?(this.$slots.thumbnail[0].elm.id="thumbView",n=(0,l.default)({mainViewId:this.$slots.default[0].elm.id,thumbViewId:"thumbView"})):n=(0,a.default)(this.$slots.default[0].elm,t),this.$emit("svgpanzoom",n)}}},function(e,t){e.exports=require("svg-pan-zoom")},function(e,t,n){"use strict";function o(e){n(10)}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),a=n.n(i);for(var r in i)"default"!==r&&function(e){n.d(t,e,function(){return i[e]})}(r);var u=n(11),d=n(0),l=o,s=d(a.a,u.a,!1,l,null,null);t.default=s.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=t.SvgPanZoomThumbnail={};t.default=o},function(e,t,n){e.exports=n(6)},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.SvgPanZoom=void 0;var i=n(7),a=o(i),r=n(3);o(r);t.SvgPanZoom=a.default,t.default=a.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n.n(o);for(var a in o)"default"!==a&&function(e){n.d(t,e,function(){return o[e]})}(a);var r=n(12),u=n(0),d=u(i.a,r.a,!1,null,null,null);t.default=d.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={zoomEnabled:{type:Boolean,default:!0},controlIconsEnabled:{type:Boolean,default:!1},fit:{type:Boolean,default:!0},panEnabled:{type:Boolean,default:!0},dblClickZoomEnabled:{type:Boolean,default:!0},mouseWheelZoomEnabled:{type:Boolean,default:!0},preventMouseEventsDefault:{type:Boolean,default:!0},contain:{type:Boolean,default:!1},center:{type:Boolean,default:!0},viewportSelector:{default:".svg-pan-zoom_viewport"},zoomScaleSensitivity:{default:.2},minZoom:{default:.5},maxZoom:{default:10},refreshRate:{default:"auto"},beforeZoom:{},onZoom:{},beforePan:{},onPan:{},onUpdatedCTM:{},customEventsHandler:{},eventsListenerElement:{}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=function(e){var t=e.contentDocument;if(!t)try{t=e.getSVGDocument()}catch(n){t=e}return t},n=function(t,n){if(!window.main&&t&&(window.main=t),!window.thumb&&n&&(window.thumb=n),window.main&&window.thumb){var o;window.addEventListener("resize",function(e){!1!==o&&clearTimeout(o),o=setTimeout(function(){window.main.resize(),window.thumb.resize()},300)}),window.main.setOnZoom(function(t){window.thumb.updateThumbScope(),e.onZoom&&e.onZoom(window.main,window.thumb,t)}),window.main.setOnPan(function(t){window.thumb.updateThumbScope(),e.onPan&&e.onPan(window.main,window.thumb,t)});var i=function(e,t,n,o,i){var a=e.getPan().x,r=e.getPan().y,u=e.getSizes().width,d=e.getSizes().height,l=e.getSizes().realZoom,s=t.getPan().x,c=t.getPan().y,f=t.getSizes().realZoom,m=f/l,h=s-a*m,v=c-r*m,w=u*m,p=d*m;n.setAttribute("x",h+1),n.setAttribute("y",v+1),n.setAttribute("width",w-2),n.setAttribute("height",p-2)};window.thumb.updateThumbScope=function(){var e=document.getElementById("scope");document.getElementById("line1"),document.getElementById("line2");i(window.main,window.thumb,e)},window.thumb.updateThumbScope();var a=function(e,t,n,o,i){var a=n.getBoundingClientRect(),r=(o.getSizes().width,o.getSizes().height,o.getSizes().realZoom),u=i.getSizes().width,d=i.getSizes().height,l=i.getSizes().realZoom,s=e-a.left-u/2,c=t-a.top-d/2,f=-s*r/l,m=-c*r/l;o.pan({x:f,y:m})},r=function(e){if(0==e.which&&0==e.button)return!1;var t=document.getElementById("scopeContainer");a(e.clientX,e.clientY,t,window.main,window.thumb)},u=document.getElementById("scopeContainer");u.addEventListener("click",function(e){r(e)}),u.addEventListener("mousemove",function(e){r(e)})}},o=document.getElementById(e.mainViewId);console.log(o),o.addEventListener("load",function(){var a=t(o);e.onMainViewSVGLoaded&&e.onMainViewSVGLoaded(a);var r=function(e,t){var n=this.getSizes(),o=-(n.viewBox.x+n.viewBox.width)*n.realZoom+100,i=n.width-100-n.viewBox.x*n.realZoom,a=-(n.viewBox.y+n.viewBox.height)*n.realZoom+100,r=n.height-100-n.viewBox.y*n.realZoom,u={};return u.x=Math.max(o,Math.min(i,t.x)),u.y=Math.max(a,Math.min(r,t.y)),u},u=(0,i.default)("#"+e.mainViewId,{zoomEnabled:!0,controlIconsEnabled:!0,fit:!1,center:!0,beforePan:r});n(u,void 0),e.onMainViewShown&&e.onMainViewShown(a,u)},!1);var a=document.getElementById(e.thumbViewId);return a.addEventListener("load",function(){var o=t(a);e.onThumbnailSVGLoaded&&e.onThumbnailSVGLoaded(o);var r=(0,i.default)("#"+e.thumbViewId,{zoomEnabled:!1,panEnabled:!1,controlIconsEnabled:!1,dblClickZoomEnabled:!1,preventMouseEventsDefault:!0});n(void 0,r),e.onThumbnailShown&&e.onThumbnailShown(o,r)},!1),main};var o=n(2),i=function(e){return e&&e.__esModule?e:{default:e}}(o)},function(e,t){},function(e,t,n){"use strict";var o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"thumbViewContainer"}},[n("svg",{staticClass:"thumbViewClass",attrs:{id:"scopeContainer"}},[n("g",[n("rect",{attrs:{id:"scope",fill:"red","fill-opacity":"0.1",stroke:"red","stroke-width":"2px",x:"0",y:"0",width:"0",height:"0"}}),e._v(" "),n("line",{attrs:{id:"line1",stroke:"red","stroke-width":"2px",x1:"0",y1:"0",x2:"0",y2:"0"}}),e._v(" "),n("line",{attrs:{id:"line2",stroke:"red","stroke-width":"2px",x1:"0",y1:"0",x2:"0",y2:"0"}})])]),e._v(" "),e._t("default")],2)},i=[],a={render:o,staticRenderFns:i};t.a=a},function(e,t,n){"use strict";var o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[e._t("default"),e._v(" "),e.has_thumbnail?n("SvgPanZoomThumbnail",[e._t("thumbnail")],2):e._e()],2)},i=[],a={render:o,staticRenderFns:i};t.a=a}]); |