@pdfme/ui 3.2.1 → 3.2.2
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/dist/index.es.js +175886 -0
- package/dist/index.umd.js +1387 -0
- package/package.json +7 -9
- package/src/helper.ts +4 -3
- package/vite.config.ts +3 -13
- package/dist/__vite-browser-external-jWVCDlBL.js +0 -1
- package/dist/index.js +0 -1098
- package/dist/path2d-polyfill.esm-yIGK7UQJ.js +0 -1
@@ -1 +0,0 @@
|
|
1
|
-
function D(a,o,r){if(r||arguments.length===2)for(var n=0,s=o.length,c;n<s;n++)(c||!(n in o))&&(c||(c=Array.prototype.slice.call(o,0,n)),c[n]=o[n]);return a.concat(c||Array.prototype.slice.call(o))}var M={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},H=/([astvzqmhlc])([^astvzqmhlc]*)/gi,N=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function V(a){var o=a.match(N);return o?o.map(Number):[]}function j(a){var o=[],r=String(a).trim();return r[0]!=="M"&&r[0]!=="m"||r.replace(H,function(n,s,c){var e=V(c),h=s.toLowerCase(),u=s;if(h==="m"&&e.length>2&&(o.push(D([u],e.splice(0,2),!0)),h="l",u=u==="m"?"l":"L"),e.length<M[h])return"";for(o.push(D([u],e.splice(0,M[h]),!0));e.length>=M[h]&&e.length&&M[h];)o.push(D([u],e.splice(0,M[h]),!0));return""}),o}function F(a,o){var r=a.x*Math.cos(o)-a.y*Math.sin(o),n=a.y*Math.cos(o)+a.x*Math.sin(o);a.x=r,a.y=n}function G(a,o,r){a.x+=o,a.y+=r}function Z(a,o){a.x*=o,a.y*=o}var E=function(){function a(o){var r;this.commands=[],o&&o instanceof a?(r=this.commands).push.apply(r,o.commands):o&&(this.commands=j(o))}return a.prototype.addPath=function(o){var r;o&&o instanceof a&&(r=this.commands).push.apply(r,o.commands)},a.prototype.moveTo=function(o,r){this.commands.push(["M",o,r])},a.prototype.lineTo=function(o,r){this.commands.push(["L",o,r])},a.prototype.arc=function(o,r,n,s,c,e){this.commands.push(["AC",o,r,n,s,c,!!e])},a.prototype.arcTo=function(o,r,n,s,c){this.commands.push(["AT",o,r,n,s,c])},a.prototype.ellipse=function(o,r,n,s,c,e,h,u){this.commands.push(["E",o,r,n,s,c,e,h,!!u])},a.prototype.closePath=function(){this.commands.push(["Z"])},a.prototype.bezierCurveTo=function(o,r,n,s,c,e){this.commands.push(["C",o,r,n,s,c,e])},a.prototype.quadraticCurveTo=function(o,r,n,s){this.commands.push(["Q",o,r,n,s])},a.prototype.rect=function(o,r,n,s){this.commands.push(["R",o,r,n,s])},a.prototype.roundRect=function(o,r,n,s,c){typeof c>"u"?this.commands.push(["RR",o,r,n,s,0]):this.commands.push(["RR",o,r,n,s,c])},a}();function L(a,o){var r=0,n=0,s,c,e,h,u,i,g,b,A,R,I,Q,q,p,m,P,w,d,T,z,S,v=null,x=null,y=null,f=null,C=null,k=null;a.beginPath();for(var l=0;l<o.length;++l){d=o[l][0],d!=="S"&&d!=="s"&&d!=="C"&&d!=="c"&&(v=null,x=null),d!=="T"&&d!=="t"&&d!=="Q"&&d!=="q"&&(y=null,f=null);var t=void 0;switch(d){case"m":case"M":t=o[l],d==="m"?(r+=t[1],n+=t[2]):(r=t[1],n=t[2]),(d==="M"||!C)&&(C={x:r,y:n}),a.moveTo(r,n);break;case"l":t=o[l],r+=t[1],n+=t[2],a.lineTo(r,n);break;case"L":t=o[l],r=t[1],n=t[2],a.lineTo(r,n);break;case"H":t=o[l],r=t[1],a.lineTo(r,n);break;case"h":t=o[l],r+=t[1],a.lineTo(r,n);break;case"V":t=o[l],n=t[1],a.lineTo(r,n);break;case"v":t=o[l],n+=t[1],a.lineTo(r,n);break;case"a":case"A":if(t=o[l],k===null)throw new Error("This should never happen");d==="a"?(r+=t[6],n+=t[7]):(r=t[6],n=t[7]),p=t[1],m=t[2],g=t[3]*Math.PI/180,e=!!t[4],h=!!t[5],u={x:r,y:n},i={x:(k.x-u.x)/2,y:(k.y-u.y)/2},F(i,-g),b=i.x*i.x/(p*p)+i.y*i.y/(m*m),b>1&&(b=Math.sqrt(b),p*=b,m*=b),T={x:p*i.y/m,y:-(m*i.x)/p},A=p*p*m*m,R=p*p*i.y*i.y+m*m*i.x*i.x,h!==e?Z(T,Math.sqrt((A-R)/R)||0):Z(T,-Math.sqrt((A-R)/R)||0),c=Math.atan2((i.y-T.y)/m,(i.x-T.x)/p),s=Math.atan2(-(i.y+T.y)/m,-(i.x+T.x)/p),F(T,g),G(T,(u.x+k.x)/2,(u.y+k.y)/2),a.save(),a.translate(T.x,T.y),a.rotate(g),a.scale(p,m),a.arc(0,0,1,c,s,!h),a.restore();break;case"C":t=o[l],v=t[3],x=t[4],r=t[5],n=t[6],a.bezierCurveTo(t[1],t[2],v,x,r,n);break;case"c":t=o[l],a.bezierCurveTo(t[1]+r,t[2]+n,t[3]+r,t[4]+n,t[5]+r,t[6]+n),v=t[3]+r,x=t[4]+n,r+=t[5],n+=t[6];break;case"S":t=o[l],(v===null||x===null)&&(v=r,x=n),a.bezierCurveTo(2*r-v,2*n-x,t[1],t[2],t[3],t[4]),v=t[1],x=t[2],r=t[3],n=t[4];break;case"s":t=o[l],(v===null||x===null)&&(v=r,x=n),a.bezierCurveTo(2*r-v,2*n-x,t[1]+r,t[2]+n,t[3]+r,t[4]+n),v=t[1]+r,x=t[2]+n,r+=t[3],n+=t[4];break;case"Q":t=o[l],y=t[1],f=t[2],r=t[3],n=t[4],a.quadraticCurveTo(y,f,r,n);break;case"q":t=o[l],y=t[1]+r,f=t[2]+n,r+=t[3],n+=t[4],a.quadraticCurveTo(y,f,r,n);break;case"T":t=o[l],(y===null||f===null)&&(y=r,f=n),y=2*r-y,f=2*n-f,r=t[1],n=t[2],a.quadraticCurveTo(y,f,r,n);break;case"t":t=o[l],(y===null||f===null)&&(y=r,f=n),y=2*r-y,f=2*n-f,r+=t[1],n+=t[2],a.quadraticCurveTo(y,f,r,n);break;case"z":case"Z":C&&(r=C.x,n=C.y),C=null,a.closePath();break;case"AC":t=o[l],r=t[1],n=t[2],q=t[3],c=t[4],s=t[5],z=t[6],a.arc(r,n,q,c,s,z);break;case"AT":t=o[l],I=t[1],Q=t[2],r=t[3],n=t[4],q=t[5],a.arcTo(I,Q,r,n,q);break;case"E":t=o[l],r=t[1],n=t[2],p=t[3],m=t[4],g=t[5],c=t[6],s=t[7],z=t[8],a.save(),a.translate(r,n),a.rotate(g),a.scale(p,m),a.arc(0,0,1,c,s,z),a.restore();break;case"R":t=o[l],r=t[1],n=t[2],P=t[3],w=t[4],C={x:r,y:n},a.rect(r,n,P,w);break;case"RR":t=o[l],r=t[1],n=t[2],P=t[3],w=t[4],S=t[5],C={x:r,y:n},a.roundRect(r,n,P,w,S);break}k?(k.x=r,k.y=n):k={x:r,y:n}}}function J(a){if(!(!a||!a.CanvasRenderingContext2D||a.Path2D)){var o=a.CanvasRenderingContext2D,r=o.prototype.fill,n=o.prototype.stroke,s=o.prototype.isPointInPath;o.prototype.fill=function(){for(var c=[],e=0;e<arguments.length;e++)c[e]=arguments[e];if(c[0]instanceof E){var h=c[0],u=c[1]||"nonzero";L(this,h.commands),r.apply(this,[u])}else{var u=c[0]||"nonzero";return r.apply(this,[u])}},o.prototype.stroke=function(c){c&&L(this,c.commands),n.apply(this)},o.prototype.isPointInPath=function(){for(var c=[],e=0;e<arguments.length;e++)c[e]=arguments[e];if(c[0]instanceof E){var h=c[0],u=c[1],i=c[2],g=c[3]||"nonzero";return L(this,h.commands),s.apply(this,[u,i,g])}else return s.apply(this,c)},a.Path2D=E}}function B(a,o,r,n,s){var c=this;if(s===void 0&&(s=0),typeof s=="number"&&(s=[s]),Array.isArray(s)){if(s.length===0||s.length>4)throw new RangeError("Failed to execute 'roundRect' on '".concat(this.constructor.name,"': ").concat(s.length," radii provided. Between one and four radii are necessary."));s.forEach(function(b){if(b<0)throw new RangeError("Failed to execute 'roundRect' on '".concat(c.constructor.name,"': Radius value ").concat(b," is negative."))})}else return;if(s.length===1&&s[0]===0)return this.rect(a,o,r,n);var e=Math.min(r,n)/2,h,u,i,g=h=u=i=Math.min(e,s[0]);s.length===2&&(h=i=Math.min(e,s[1])),s.length===3&&(h=i=Math.min(e,s[1]),u=Math.min(e,s[2])),s.length===4&&(h=Math.min(e,s[1]),u=Math.min(e,s[2]),i=Math.min(e,s[3])),this.moveTo(a,o+n-i),this.arcTo(a,o,a+g,o,g),this.arcTo(a+r,o,a+r,o+h,h),this.arcTo(a+r,o+n,a+r-u,o+n,u),this.arcTo(a,o+n,a,o+n-i,i),this.moveTo(a,o)}function K(a){if(!(!a||!a.CanvasRenderingContext2D)){var o=a.CanvasRenderingContext2D,r=a.Path2D;o&&!o.prototype.roundRect&&(o.prototype.roundRect=B),r&&!r.prototype.roundRect&&(r.prototype.roundRect=B)}}J(window),K(window);
|