Comparing version 1.0.4 to 1.0.5
@@ -5,3 +5,3 @@ import Image from './src/image.vue'; | ||
readonly type: import("vue").PropType<string>; | ||
readonly default: "#fff"; | ||
readonly default: "transparent"; | ||
}; | ||
@@ -33,2 +33,6 @@ readonly width: { | ||
}; | ||
readonly title: { | ||
readonly type: import("vue").PropType<string>; | ||
readonly default: ""; | ||
}; | ||
readonly alt: { | ||
@@ -46,6 +50,10 @@ readonly type: import("vue").PropType<string>; | ||
}; | ||
readonly onerror: { | ||
readonly type: import("vue").PropType<() => void>; | ||
readonly default: () => void; | ||
}; | ||
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{ | ||
readonly bgc: { | ||
readonly type: import("vue").PropType<string>; | ||
readonly default: "#fff"; | ||
readonly default: "transparent"; | ||
}; | ||
@@ -77,2 +85,6 @@ readonly width: { | ||
}; | ||
readonly title: { | ||
readonly type: import("vue").PropType<string>; | ||
readonly default: ""; | ||
}; | ||
readonly alt: { | ||
@@ -90,2 +102,6 @@ readonly type: import("vue").PropType<string>; | ||
}; | ||
readonly onerror: { | ||
readonly type: import("vue").PropType<() => void>; | ||
readonly default: () => void; | ||
}; | ||
}>>, { | ||
@@ -99,5 +115,7 @@ readonly bgc: string; | ||
readonly src: string; | ||
readonly title: string; | ||
readonly alt: string; | ||
readonly fit: "fill" | "contain" | "cover" | "none" | "scale-down"; | ||
readonly onScale: (scale: number) => void; | ||
readonly onerror: () => void; | ||
}>>; | ||
@@ -104,0 +122,0 @@ export default GImage; |
@@ -6,3 +6,3 @@ import type { ExtractPropTypes, PropType } from 'vue'; | ||
readonly type: PropType<string>; | ||
readonly default: "#fff"; | ||
readonly default: "transparent"; | ||
}; | ||
@@ -34,2 +34,6 @@ readonly width: { | ||
}; | ||
readonly title: { | ||
readonly type: PropType<string>; | ||
readonly default: ""; | ||
}; | ||
readonly alt: { | ||
@@ -47,4 +51,8 @@ readonly type: PropType<string>; | ||
}; | ||
readonly onerror: { | ||
readonly type: PropType<() => void>; | ||
readonly default: () => void; | ||
}; | ||
}; | ||
export type ImageProps = ExtractPropTypes<typeof imageProps>; | ||
export type ImageInstance = InstanceType<typeof Image>; |
declare const _sfc_main: import("vue").DefineComponent<{ | ||
readonly bgc: { | ||
readonly type: import("vue").PropType<string>; | ||
readonly default: "#fff"; | ||
readonly default: "transparent"; | ||
}; | ||
@@ -31,2 +31,6 @@ readonly width: { | ||
}; | ||
readonly title: { | ||
readonly type: import("vue").PropType<string>; | ||
readonly default: ""; | ||
}; | ||
readonly alt: { | ||
@@ -44,6 +48,10 @@ readonly type: import("vue").PropType<string>; | ||
}; | ||
readonly onerror: { | ||
readonly type: import("vue").PropType<() => void>; | ||
readonly default: () => void; | ||
}; | ||
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{ | ||
readonly bgc: { | ||
readonly type: import("vue").PropType<string>; | ||
readonly default: "#fff"; | ||
readonly default: "transparent"; | ||
}; | ||
@@ -75,2 +83,6 @@ readonly width: { | ||
}; | ||
readonly title: { | ||
readonly type: import("vue").PropType<string>; | ||
readonly default: ""; | ||
}; | ||
readonly alt: { | ||
@@ -88,2 +100,6 @@ readonly type: import("vue").PropType<string>; | ||
}; | ||
readonly onerror: { | ||
readonly type: import("vue").PropType<() => void>; | ||
readonly default: () => void; | ||
}; | ||
}>>, { | ||
@@ -97,6 +113,8 @@ readonly bgc: string; | ||
readonly src: string; | ||
readonly title: string; | ||
readonly alt: string; | ||
readonly fit: "fill" | "contain" | "cover" | "none" | "scale-down"; | ||
readonly onScale: (scale: number) => void; | ||
readonly onerror: () => void; | ||
}>; | ||
export default _sfc_main; |
@@ -5,3 +5,3 @@ import Image from './src/image.vue'; | ||
readonly type: import("vue").PropType<string>; | ||
readonly default: "#fff"; | ||
readonly default: "transparent"; | ||
}; | ||
@@ -33,2 +33,6 @@ readonly width: { | ||
}; | ||
readonly title: { | ||
readonly type: import("vue").PropType<string>; | ||
readonly default: ""; | ||
}; | ||
readonly alt: { | ||
@@ -46,6 +50,10 @@ readonly type: import("vue").PropType<string>; | ||
}; | ||
readonly onerror: { | ||
readonly type: import("vue").PropType<() => void>; | ||
readonly default: () => void; | ||
}; | ||
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{ | ||
readonly bgc: { | ||
readonly type: import("vue").PropType<string>; | ||
readonly default: "#fff"; | ||
readonly default: "transparent"; | ||
}; | ||
@@ -77,2 +85,6 @@ readonly width: { | ||
}; | ||
readonly title: { | ||
readonly type: import("vue").PropType<string>; | ||
readonly default: ""; | ||
}; | ||
readonly alt: { | ||
@@ -90,2 +102,6 @@ readonly type: import("vue").PropType<string>; | ||
}; | ||
readonly onerror: { | ||
readonly type: import("vue").PropType<() => void>; | ||
readonly default: () => void; | ||
}; | ||
}>>, { | ||
@@ -99,5 +115,7 @@ readonly bgc: string; | ||
readonly src: string; | ||
readonly title: string; | ||
readonly alt: string; | ||
readonly fit: "fill" | "contain" | "cover" | "none" | "scale-down"; | ||
readonly onScale: (scale: number) => void; | ||
readonly onerror: () => void; | ||
}>>; | ||
@@ -104,0 +122,0 @@ export default GImage; |
@@ -6,3 +6,3 @@ import type { ExtractPropTypes, PropType } from 'vue'; | ||
readonly type: PropType<string>; | ||
readonly default: "#fff"; | ||
readonly default: "transparent"; | ||
}; | ||
@@ -34,2 +34,6 @@ readonly width: { | ||
}; | ||
readonly title: { | ||
readonly type: PropType<string>; | ||
readonly default: ""; | ||
}; | ||
readonly alt: { | ||
@@ -47,4 +51,8 @@ readonly type: PropType<string>; | ||
}; | ||
readonly onerror: { | ||
readonly type: PropType<() => void>; | ||
readonly default: () => void; | ||
}; | ||
}; | ||
export type ImageProps = ExtractPropTypes<typeof imageProps>; | ||
export type ImageInstance = InstanceType<typeof Image>; |
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={bgc:{type:String,default:"#fff"},width:{type:[Number,String],default:"100%"},height:{type:[Number,String],default:"100%"},scalable:{type:Boolean,default:!1},minScale:{type:Number,default:-8},maxScale:{type:Number,default:100},src:{type:String,default:"",required:!0},alt:{type:String,default:""},fit:{type:String,default:"contain"},onScale:{type:Function,default:()=>{}}};exports.imageProps=e; | ||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={bgc:{type:String,default:"transparent"},width:{type:[Number,String],default:"100%"},height:{type:[Number,String],default:"100%"},scalable:{type:Boolean,default:!1},minScale:{type:Number,default:-8},maxScale:{type:Number,default:100},src:{type:String,default:"",required:!0},title:{type:String,default:""},alt:{type:String,default:""},fit:{type:String,default:"contain"},onScale:{type:Function,default:()=>{}},onerror:{type:Function,default:()=>{}}};exports.imageProps=e; |
declare const _sfc_main: import("vue").DefineComponent<{ | ||
readonly bgc: { | ||
readonly type: import("vue").PropType<string>; | ||
readonly default: "#fff"; | ||
readonly default: "transparent"; | ||
}; | ||
@@ -31,2 +31,6 @@ readonly width: { | ||
}; | ||
readonly title: { | ||
readonly type: import("vue").PropType<string>; | ||
readonly default: ""; | ||
}; | ||
readonly alt: { | ||
@@ -44,6 +48,10 @@ readonly type: import("vue").PropType<string>; | ||
}; | ||
readonly onerror: { | ||
readonly type: import("vue").PropType<() => void>; | ||
readonly default: () => void; | ||
}; | ||
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{ | ||
readonly bgc: { | ||
readonly type: import("vue").PropType<string>; | ||
readonly default: "#fff"; | ||
readonly default: "transparent"; | ||
}; | ||
@@ -75,2 +83,6 @@ readonly width: { | ||
}; | ||
readonly title: { | ||
readonly type: import("vue").PropType<string>; | ||
readonly default: ""; | ||
}; | ||
readonly alt: { | ||
@@ -88,2 +100,6 @@ readonly type: import("vue").PropType<string>; | ||
}; | ||
readonly onerror: { | ||
readonly type: import("vue").PropType<() => void>; | ||
readonly default: () => void; | ||
}; | ||
}>>, { | ||
@@ -97,6 +113,8 @@ readonly bgc: string; | ||
readonly src: string; | ||
readonly title: string; | ||
readonly alt: string; | ||
readonly fit: "fill" | "contain" | "cover" | "none" | "scale-down"; | ||
readonly onScale: (scale: number) => void; | ||
readonly onerror: () => void; | ||
}>; | ||
export default _sfc_main; |
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./image.vue2.js");require("./image.vue3.js");const t=require("../../../_virtual/_plugin-vue_export-helper.js"),u=t.default(e.default,[["__scopeId","data-v-9a743c13"]]);exports.default=u; | ||
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./image.vue2.js");require("./image.vue3.js");const t=require("../../../_virtual/_plugin-vue_export-helper.js"),u=t.default(e.default,[["__scopeId","data-v-42ada2ba"]]);exports.default=u; |
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("vue"),Y=require("./image.js"),$={class:"g-image__container"},k=["src","alt"],C=["onMousewheel"],N=a.defineComponent({name:"GImage"}),D=a.defineComponent({...N,props:Y.imageProps,setup(M){const o=M;let g=!1,f=0,m=0,s=0,r=0,u=0,p=0,e=0,h=o.minScale<-10||o.minScale>0?-10:o.minScale;const S=t=>{const n=t.target;e<=0||(g=!0,f=t.pageX-n.offsetLeft,m=t.pageY-n.offsetTop)},x=t=>{var v;if(!g)return;t.preventDefault();const n=(v=t.currentTarget.parentNode)==null?void 0:v.firstElementChild,l=t.target,i=t.pageX-l.offsetLeft,w=t.pageY-l.offsetTop;u=i-f,p=w-m,s+=u,r+=p;const E=n.offsetWidth,T=n.offsetHeight,b=l.offsetWidth,X=l.offsetHeight,c=(E*(1+e*.1)-b)/2,d=(T*(1+e*.1)-X)/2;s=s>c?c:s,s=s<-c?-c:s,r=r>d?d:r,r=r<-d?-d:r,n.animate([{transform:`translate3d(${s+u}px, ${r+p}px, 0) scale3d(${1+e*.1}, ${1+e*.1}, 1)`}],{duration:500,fill:"forwards"}),f=i,m=w},_=()=>{g=!1};a.onMounted(()=>{window.addEventListener("mouseup",_)});const y=t=>{var i;t.preventDefault();const n=(i=t.currentTarget.parentNode)==null?void 0:i.firstElementChild,l=t.target;!n||!o.scalable||(e<=0?l.style.cursor="pointer":l.style.cursor="move",t.wheelDelta===120?e=e>=o.maxScale?o.maxScale:++e:e=e<=h?h:--e,o.onScale&&o.onScale(e),s=0,r=0,n.animate([{transform:`scale3d(${1+e*.1}, ${1+e*.1}, 1)`}],{duration:500,fill:"forwards"}))};return(t,n)=>(a.openBlock(),a.createElementBlock("div",{class:"g-image",style:a.normalizeStyle({backgroundColor:o.bgc,width:o.width,height:o.height})},[a.createElementVNode("div",$,[a.createElementVNode("img",{style:a.normalizeStyle({"object-fit":o.fit}),class:"g-image__container-img",src:o.src,alt:o.alt},null,12,k),a.createElementVNode("div",{class:"g-image__container-drag",onMousewheel:a.withModifiers(y,["prevent"]),onMousedown:S,onMousemove:x,onMouseup:_},null,40,C)])],4))}});exports.default=D; | ||
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("vue"),Y=require("./image.js"),k={class:"g-image__container"},C=["src","title","alt","onerror"],N=["onMousewheel"],D=a.defineComponent({name:"GImage"}),H=a.defineComponent({...D,props:Y.imageProps,setup(M){const e=M;let g=!1,f=0,m=0,r=0,s=0,u=0,p=0,o=0,h=e.minScale<-10||e.minScale>0?-10:e.minScale;const S=t=>{const n=t.target;o<=0||(g=!0,f=t.pageX-n.offsetLeft,m=t.pageY-n.offsetTop)},x=t=>{var v;if(!g)return;t.preventDefault();const n=(v=t.currentTarget.parentNode)==null?void 0:v.firstElementChild,l=t.target,i=t.pageX-l.offsetLeft,w=t.pageY-l.offsetTop;u=i-f,p=w-m,r+=u,s+=p;const E=n.offsetWidth,T=n.offsetHeight,$=l.offsetWidth,b=l.offsetHeight,c=(E*(1+o*.1)-$)/2,d=(T*(1+o*.1)-b)/2;r=r>c?c:r,r=r<-c?-c:r,s=s>d?d:s,s=s<-d?-d:s;const X=`translate3d(${r}px, ${s}px, 0) scale3d(${1+o*.1}, ${1+o*.1}, 1)`;n.animate([{transform:X}],{duration:500,fill:"forwards"}),f=i,m=w},_=()=>{g=!1};a.onMounted(()=>{window.addEventListener("mouseup",_)});const y=t=>{var i;t.preventDefault();const n=(i=t.currentTarget.parentNode)==null?void 0:i.firstElementChild,l=t.target;!n||!e.scalable||(t.wheelDelta===120?o=o>=e.maxScale?e.maxScale:++o:o=o<=h?h:--o,o<=0?l.style.cursor="pointer":l.style.cursor="move",e.onScale&&e.onScale(o),r=0,s=0,n.animate([{transform:`scale3d(${1+o*.1}, ${1+o*.1}, 1)`}],{duration:500,fill:"forwards"}))};return(t,n)=>(a.openBlock(),a.createElementBlock("div",{class:"g-image",style:a.normalizeStyle({backgroundColor:e.bgc,width:e.width,height:e.height})},[a.createElementVNode("div",k,[a.createElementVNode("img",a.mergeProps({style:{"object-fit":e.fit},class:"g-image__container-img",src:e.src,title:e.title,alt:e.alt,onerror:e.onerror},t.$attrs),null,16,C),a.createElementVNode("div",{class:"g-image__container-drag",onMousewheel:a.withModifiers(y,["prevent"]),onMousedown:S,onMousemove:x,onMouseup:_},null,40,N)])],4))}});exports.default=H; |
{ | ||
"name": "g6-ui", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "前端常用小组件", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
65345
1453