component-library-for-vue 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/es/index/index.js +1 -0
- package/es/watermark/index.js +1 -0
- package/libs/index/index.js +1 -0
- package/libs/watermark/index.js +1 -0
- package/package.json +77 -0
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t={683(t,e,r){r.d(e,{A:()=>o});var n=function(){var t=this;return(0,t._self._c)("canvas",{ref:"canvas",attrs:{width:t.width,height:t.height}})};n._withStripped=!0;var a=function(t,e){var r,n=t;if(e&&(n.render=e,n.staticRenderFns=[],n._compiled=!0),r)if(n.functional){n._injectStyles=r;var a=n.render;n.render=function(t,e){return r.call(e),a(t,e)}}else{var i=n.beforeCreate;n.beforeCreate=i?[].concat(i,r):[r]}return{exports:t,options:n}}({name:"WaterMark",props:{width:{type:Number,default:300},height:{type:Number,default:150},src:{type:String,required:!0},text:{type:String,default:""},fontSize:{type:Number,default:16},color:{type:String,default:"#000"},deg:{type:Number,default:45,validator:function(t){return!(t<0||t>360)||(console.warn("[Watermark] deg must be between 0 and 360"),!1)}},gapY:{type:Number,default:20},gapX:{type:Number,default:20}},mounted:function(){this.init()},methods:{init:function(){var t=this,e=this.$refs.canvas.getContext("2d"),r=new Image;r.crossOrigin="anonymous",r.src=this.src,r.onload=function(){e.drawImage(r,0,0,t.width,t.height),e.font="".concat(t.fontSize,"px sans-serif"),e.fillStyle=t.color,e.textAlign="left",e.textBaseline="middle";var n=e.measureText(t.text).width;e.save(),e.translate(t.width/2,t.height/2),e.rotate(t.deg*Math.PI/180),e.translate(-t.width/2,-t.height/2);for(var a=t.fontSize+t.gapY,i=n+t.gapX,o=-t.height;o<2*t.height;o+=a)for(var s=-t.width;s<2*t.width;s+=i)e.fillText(t.text,s,o);e.restore()}}}},n);const i=a.exports;i.install=function(t){t.component(i.name,i)};const o=i}},e={};function r(n){var a=e[n];if(void 0!==a)return a.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.d=(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=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var n={};r.d(n,{A:()=>o,b:()=>a.A});var a=r(683),i=[a.A];const o={install:function(t){i.forEach(function(e){e.install(t)})}},s=n.b,d=n.A;export{s as WaterMark,d as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t=function(){var t=this;return(0,t._self._c)("canvas",{ref:"canvas",attrs:{width:t.width,height:t.height}})};t._withStripped=!0;var e=function(t,e){var r,n=t;if(e&&(n.render=e,n.staticRenderFns=[],n._compiled=!0),r)if(n.functional){n._injectStyles=r;var a=n.render;n.render=function(t,e){return r.call(e),a(t,e)}}else{var i=n.beforeCreate;n.beforeCreate=i?[].concat(i,r):[r]}return{exports:t,options:n}}({name:"WaterMark",props:{width:{type:Number,default:300},height:{type:Number,default:150},src:{type:String,required:!0},text:{type:String,default:""},fontSize:{type:Number,default:16},color:{type:String,default:"#000"},deg:{type:Number,default:45,validator:function(t){return!(t<0||t>360)||(console.warn("[Watermark] deg must be between 0 and 360"),!1)}},gapY:{type:Number,default:20},gapX:{type:Number,default:20}},mounted:function(){this.init()},methods:{init:function(){var t=this,e=this.$refs.canvas.getContext("2d"),r=new Image;r.crossOrigin="anonymous",r.src=this.src,r.onload=function(){e.drawImage(r,0,0,t.width,t.height),e.font="".concat(t.fontSize,"px sans-serif"),e.fillStyle=t.color,e.textAlign="left",e.textBaseline="middle";var n=e.measureText(t.text).width;e.save(),e.translate(t.width/2,t.height/2),e.rotate(t.deg*Math.PI/180),e.translate(-t.width/2,-t.height/2);for(var a=t.fontSize+t.gapY,i=n+t.gapX,o=-t.height;o<2*t.height;o+=a)for(var s=-t.width;s<2*t.width;s+=i)e.fillText(t.text,s,o);e.restore()}}}},t);const r=e.exports;r.install=function(t){t.component(r.name,r)};const n=r;export{n as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";var e={683(e,t,r){r.d(t,{default:()=>i});var n=function(){var e=this;return(0,e._self._c)("canvas",{ref:"canvas",attrs:{width:e.width,height:e.height}})};n._withStripped=!0;var a=function(e,t){var r,n=e;if(t&&(n.render=t,n.staticRenderFns=[],n._compiled=!0),r)if(n.functional){n._injectStyles=r;var a=n.render;n.render=function(e,t){return r.call(t),a(e,t)}}else{var o=n.beforeCreate;n.beforeCreate=o?[].concat(o,r):[r]}return{exports:e,options:n}}({name:"WaterMark",props:{width:{type:Number,default:300},height:{type:Number,default:150},src:{type:String,required:!0},text:{type:String,default:""},fontSize:{type:Number,default:16},color:{type:String,default:"#000"},deg:{type:Number,default:45,validator:function(e){return!(e<0||e>360)||(console.warn("[Watermark] deg must be between 0 and 360"),!1)}},gapY:{type:Number,default:20},gapX:{type:Number,default:20}},mounted:function(){this.init()},methods:{init:function(){var e=this,t=this.$refs.canvas.getContext("2d"),r=new Image;r.crossOrigin="anonymous",r.src=this.src,r.onload=function(){t.drawImage(r,0,0,e.width,e.height),t.font="".concat(e.fontSize,"px sans-serif"),t.fillStyle=e.color,t.textAlign="left",t.textBaseline="middle";var n=t.measureText(e.text).width;t.save(),t.translate(e.width/2,e.height/2),t.rotate(e.deg*Math.PI/180),t.translate(-e.width/2,-e.height/2);for(var a=e.fontSize+e.gapY,o=n+e.gapX,i=-e.height;i<2*e.height;i+=a)for(var d=-e.width;d<2*e.width;d+=o)t.fillText(e.text,d,i);t.restore()}}}},n);const o=a.exports;o.install=function(e){e.component(o.name,o)};const i=o}},t={};function r(n){var a=t[n];if(void 0!==a)return a.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,r),o.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};r.r(n),r.d(n,{WaterMark:()=>a.default,default:()=>i});var a=r(683),o=[a.default];const i={install:function(e){o.forEach(function(t){t.install(e)})}};module.exports=n})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";var e={d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{default:()=>i});var r=function(){var e=this;return(0,e._self._c)("canvas",{ref:"canvas",attrs:{width:e.width,height:e.height}})};r._withStripped=!0;var n=function(e,t){var r,n=e;if(t&&(n.render=t,n.staticRenderFns=[],n._compiled=!0),r)if(n.functional){n._injectStyles=r;var a=n.render;n.render=function(e,t){return r.call(t),a(e,t)}}else{var i=n.beforeCreate;n.beforeCreate=i?[].concat(i,r):[r]}return{exports:e,options:n}}({name:"WaterMark",props:{width:{type:Number,default:300},height:{type:Number,default:150},src:{type:String,required:!0},text:{type:String,default:""},fontSize:{type:Number,default:16},color:{type:String,default:"#000"},deg:{type:Number,default:45,validator:function(e){return!(e<0||e>360)||(console.warn("[Watermark] deg must be between 0 and 360"),!1)}},gapY:{type:Number,default:20},gapX:{type:Number,default:20}},mounted:function(){this.init()},methods:{init:function(){var e=this,t=this.$refs.canvas.getContext("2d"),r=new Image;r.crossOrigin="anonymous",r.src=this.src,r.onload=function(){t.drawImage(r,0,0,e.width,e.height),t.font="".concat(e.fontSize,"px sans-serif"),t.fillStyle=e.color,t.textAlign="left",t.textBaseline="middle";var n=t.measureText(e.text).width;t.save(),t.translate(e.width/2,e.height/2),t.rotate(e.deg*Math.PI/180),t.translate(-e.width/2,-e.height/2);for(var a=e.fontSize+e.gapY,i=n+e.gapX,o=-e.height;o<2*e.height;o+=a)for(var d=-e.width;d<2*e.width;d+=i)t.fillText(e.text,d,o);t.restore()}}}},r);const a=n.exports;a.install=function(e){e.component(a.name,a)};const i=a;module.exports=t})();
|
package/package.json
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "component-library-for-vue",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "自定义的ui组件库",
|
|
5
|
+
"main": "libs/index/index.js",
|
|
6
|
+
"module": "es/index/index.js",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
9
|
+
"lint": "eslint . --ext .js,.vue",
|
|
10
|
+
"format": "prettier --write .",
|
|
11
|
+
"prepare": "husky install",
|
|
12
|
+
"server": "webpack serve --config ./webpack/webpack.config.dev.js",
|
|
13
|
+
"build:cjs": "webpack --config ./webpack/webpack.cjs.config.js",
|
|
14
|
+
"build:esm": "webpack --config ./webpack/webpack.esm.config.js"
|
|
15
|
+
},
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/peichaojie/component-library.git"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [],
|
|
21
|
+
"author": "裴超杰",
|
|
22
|
+
"license": "ISC",
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/peichaojie/component-library/issues"
|
|
25
|
+
},
|
|
26
|
+
"homepage": "https://github.com/peichaojie/component-library#readme",
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@babel/core": "^7.29.0",
|
|
29
|
+
"@babel/plugin-transform-runtime": "^7.29.0",
|
|
30
|
+
"@babel/preset-env": "^7.29.0",
|
|
31
|
+
"@commitlint/cli": "^20.4.3",
|
|
32
|
+
"@commitlint/config-conventional": "^20.4.3",
|
|
33
|
+
"autoprefixer": "^10.4.27",
|
|
34
|
+
"babel-loader": "^10.0.0",
|
|
35
|
+
"eslint": "^8.57.1",
|
|
36
|
+
"eslint-config-prettier": "^10.1.8",
|
|
37
|
+
"eslint-plugin-vue": "^9.19.2",
|
|
38
|
+
"eslint-webpack-plugin": "^4.2.0",
|
|
39
|
+
"html-webpack-plugin": "^5.6.6",
|
|
40
|
+
"husky": "^9.1.7",
|
|
41
|
+
"less": "^4.5.1",
|
|
42
|
+
"less-loader": "^12.3.1",
|
|
43
|
+
"lint-staged": "^16.3.2",
|
|
44
|
+
"mini-css-extract-plugin": "^2.10.0",
|
|
45
|
+
"postcss": "^8.5.8",
|
|
46
|
+
"postcss-loader": "^8.2.1",
|
|
47
|
+
"prettier": "^3.8.1",
|
|
48
|
+
"terser-webpack-plugin": "^5.3.17",
|
|
49
|
+
"vue": "^2.7.16",
|
|
50
|
+
"vue-loader": "^15.11.1",
|
|
51
|
+
"vue-template-compiler": "^2.7.16",
|
|
52
|
+
"webpack": "^5.105.3",
|
|
53
|
+
"webpack-cli": "^6.0.1",
|
|
54
|
+
"webpack-dev-server": "^5.2.3",
|
|
55
|
+
"webpack-merge": "^6.0.1"
|
|
56
|
+
},
|
|
57
|
+
"dependencies": {
|
|
58
|
+
"@babel/runtime": "^7.28.6"
|
|
59
|
+
},
|
|
60
|
+
"peerDependencies": {
|
|
61
|
+
"vue": "^2.7.16"
|
|
62
|
+
},
|
|
63
|
+
"lint-staged": {
|
|
64
|
+
"*.{js,vue,less}": [
|
|
65
|
+
"eslint --fix",
|
|
66
|
+
"prettier --write"
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
"sideEffects": [
|
|
70
|
+
"*.css",
|
|
71
|
+
"*.less"
|
|
72
|
+
],
|
|
73
|
+
"files": [
|
|
74
|
+
"libs",
|
|
75
|
+
"es"
|
|
76
|
+
]
|
|
77
|
+
}
|