template-designer 0.10.5 → 0.10.6
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-f80c51e3.mjs → index-fffa184f.mjs} +5 -5
- package/dist/{index.es-be84dba8.mjs → index.es-3161d85f.mjs} +1 -1
- package/dist/{lodop-21044abf.mjs → lodop-4527865f.mjs} +1 -1
- package/dist/{rfid-9be72f25.mjs → rfid-2da71a91.mjs} +1 -1
- package/dist/template-designer.es.js +1 -1
- package/dist/template-designer.umd.js +1 -1
- package/package.json +1 -1
|
@@ -131,10 +131,10 @@ const Cm = {
|
|
|
131
131
|
Z.whiteSpace = "pre-wrap", Z.overflow = "visible", Z.textOverflow = "unset";
|
|
132
132
|
break;
|
|
133
133
|
case 2:
|
|
134
|
-
Z.whiteSpace = "nowrap", Z.overflow = "hidden", Z.textOverflow = "
|
|
134
|
+
Z.whiteSpace = "nowrap", Z.overflow = "hidden", Z.textOverflow = "clip";
|
|
135
135
|
break;
|
|
136
136
|
case 3:
|
|
137
|
-
Z.whiteSpace = "nowrap", Z.overflow = "hidden", Z.textOverflow = "
|
|
137
|
+
Z.whiteSpace = "nowrap", Z.overflow = "hidden", Z.textOverflow = "ellipsis";
|
|
138
138
|
break;
|
|
139
139
|
}
|
|
140
140
|
return Z;
|
|
@@ -7362,9 +7362,9 @@ const BQ = /* @__PURE__ */ Mt(dQ, [["render", gQ]]), qg = [
|
|
|
7362
7362
|
], $g = qg.flatMap((e) => e.components);
|
|
7363
7363
|
async function mQ(e) {
|
|
7364
7364
|
try {
|
|
7365
|
-
return (await Fm(/* @__PURE__ */ Object.assign({ "./props/lodop.js": () => import("./lodop-
|
|
7365
|
+
return (await Fm(/* @__PURE__ */ Object.assign({ "./props/lodop.js": () => import("./lodop-4527865f.mjs"), "./props/rfid.js": () => import("./rfid-2da71a91.mjs") }), `./props/${e}.js`)).default;
|
|
7366
7366
|
} catch {
|
|
7367
|
-
return console.warn(`配置文件 ./props/${e}.js 不存在,使用默认配置`), (await import("./lodop-
|
|
7367
|
+
return console.warn(`配置文件 ./props/${e}.js 不存在,使用默认配置`), (await import("./lodop-4527865f.mjs")).default;
|
|
7368
7368
|
}
|
|
7369
7369
|
}
|
|
7370
7370
|
function wQ(e = {}, A = {}) {
|
|
@@ -23185,7 +23185,7 @@ function(e) {
|
|
|
23185
23185
|
*/
|
|
23186
23186
|
function(e) {
|
|
23187
23187
|
function A() {
|
|
23188
|
-
return (de.canvg ? Promise.resolve(de.canvg) : import("./index.es-
|
|
23188
|
+
return (de.canvg ? Promise.resolve(de.canvg) : import("./index.es-3161d85f.mjs")).catch(function(t) {
|
|
23189
23189
|
return Promise.reject(new Error("Could not load canvg: " + t));
|
|
23190
23190
|
}).then(function(t) {
|
|
23191
23191
|
return t.default ? t.default : t;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(vr,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],f):(vr=typeof globalThis<"u"?globalThis:vr||self,f(vr.TemplateDesigner={},vr.Vue))})(this,function(vr,f){"use strict";const wF=(t,e)=>{const A=t[e];return A?typeof A=="function"?A():Promise.resolve(A):new Promise((r,n)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(n.bind(null,new Error("Unknown variable dynamic import: "+e)))})};function Qs(t,e,A){const r=(i,o,s,l,u=0)=>{let d=i,g=o;if(u&&u!==0){const h=i+s/2,b=o+l/2,w=-s/2,C=-l/2,v=u*Math.PI/180,y=Math.cos(v),F=Math.sin(v),N=w*y-C*F,V=w*F+C*y;d=h+N,g=b+V}return{x1:Math.round(d*100)/100,y1:Math.round(g*100)/100}};return{calculateTopLeftCoordinates:r,watchCoordinates:()=>{f.watch(()=>{var i,o,s,l,u;return[(i=t.modelValue)==null?void 0:i.x,(o=t.modelValue)==null?void 0:o.y,(s=t.modelValue)==null?void 0:s.width,(l=t.modelValue)==null?void 0:l.height,(u=t.modelValue)==null?void 0:u.rotation]},([i,o,s,l,u])=>{if(t.modelValue&&i!==void 0&&o!==void 0&&s!==void 0&&l!==void 0){const d=r(i,o,s,l,u||0),g={x1:t.modelValue.x1,y1:t.modelValue.y1};(Math.abs(d.x1-g.x1)>.001||Math.abs(d.y1-g.y1)>.001)&&e("update:modelValue",{...t.modelValue,...d})}},{immediate:!0})},initCoordinates:()=>{t.modelValue&&(!t.modelValue.x1||!t.modelValue.y1)&&f.nextTick(()=>{const{x:i,y:o,width:s,height:l,rotation:u=0}=t.modelValue;if(i!==void 0&&o!==void 0&&s!==void 0&&l!==void 0){const d=r(i,o,s,l,u);e("update:modelValue",{...t.modelValue,...d})}})}}}const Iq="",yF={__name:"TextComponent",props:{modelValue:{type:Object,required:!0,default:()=>({})},propsConfig:{type:Object,required:!0}},emits:["update:modelValue"],setup(t,{emit:e}){const A=t,r=e,{watchCoordinates:n,initCoordinates:a}=Qs(A,r),i=f.ref(new Map),o=f.ref(""),s=f.computed(()=>{var V,L,M,k,D,x,S;const C=JSON.stringify(((L=(V=A.modelValue)==null?void 0:V.options)==null?void 0:L.fields)||[]);C!==o.value&&(i.value.clear(),o.value=C);let v="";if(Array.isArray(A.modelValue.FieldName)){const E=A.modelValue.FieldName.map(T=>{var j,G,Y,K;if(i.value.has(T))return i.value.get(T);const O=((K=(Y=(G=(j=A.modelValue)==null?void 0:j.options)==null?void 0:G.fields)==null?void 0:Y.find(ee=>ee.value==T))==null?void 0:K.label)||T;return i.value.set(T,O),O}).filter(T=>T);if(E.length>0){const T=A.modelValue.FieldConnector||" ";v=E.join(T)}}else{const E=(M=A.modelValue)==null?void 0:M.FieldName;E&&(i.value.has(E)?v=i.value.get(E):(v=((S=(x=(D=(k=A.modelValue)==null?void 0:k.options)==null?void 0:D.fields)==null?void 0:x.find(T=>T.value==E))==null?void 0:S.label)||"",i.value.set(E,v)))}let N=(A.modelValue.TemplateDisplay||"text")==="fieldName"?v:A.modelValue.Text;return A.modelValue.Title&&(N=`${A.modelValue.Title}${N}`),A.modelValue.EndMark&&(N=`${N}${A.modelValue.EndMark}`),N}),l=f.ref({});f.computed(()=>A.modelValue.__selected||!1);const u=f.computed(()=>({width:"100%",height:"100%",position:"relative",display:"flex",alignItems:"center",overflow:"hidden",boxSizing:"border-box"})),d=f.ref(new Map),g=C=>{var y,F,N,V,L,M;if(d.value.has(C))return d.value.get(C);const v=((M=(L=(V=(N=(F=(y=A.propsConfig)==null?void 0:y.text)==null?void 0:F.propertyPanel)==null?void 0:N.find(k=>k.prop=="FontName"))==null?void 0:V.options)==null?void 0:L.find(k=>k.value==C))==null?void 0:M.cssValue)||C;return d.value.set(C,v),v},h={1:"left",2:"center",3:"right"},b=f.computed(()=>{const C=A.modelValue.TextWrap??l.value.TextWrap??2,v=A.modelValue.FontSize??l.value.FontSize,y=A.modelValue.FontName||l.value.FontName,F=A.modelValue.Bold||l.value.Bold,N=A.modelValue.Italic||l.value.Italic,V=A.modelValue.FontColor||l.value.FontColor,L=A.modelValue.Alignment||l.value.Alignment||2,M={fontSize:v+"px",fontFamily:g(y),fontWeight:F?"bold":"normal",fontStyle:N?"italic":"normal",color:V,width:"100%",minWidth:0,boxSizing:"border-box",textAlign:h[L]};switch(C){case 1:M.whiteSpace="pre-wrap",M.overflow="visible",M.textOverflow="unset";break;case 2:M.whiteSpace="nowrap",M.overflow="hidden",M.textOverflow="
|
|
1
|
+
(function(vr,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],f):(vr=typeof globalThis<"u"?globalThis:vr||self,f(vr.TemplateDesigner={},vr.Vue))})(this,function(vr,f){"use strict";const wF=(t,e)=>{const A=t[e];return A?typeof A=="function"?A():Promise.resolve(A):new Promise((r,n)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(n.bind(null,new Error("Unknown variable dynamic import: "+e)))})};function Qs(t,e,A){const r=(i,o,s,l,u=0)=>{let d=i,g=o;if(u&&u!==0){const h=i+s/2,b=o+l/2,w=-s/2,C=-l/2,v=u*Math.PI/180,y=Math.cos(v),F=Math.sin(v),N=w*y-C*F,V=w*F+C*y;d=h+N,g=b+V}return{x1:Math.round(d*100)/100,y1:Math.round(g*100)/100}};return{calculateTopLeftCoordinates:r,watchCoordinates:()=>{f.watch(()=>{var i,o,s,l,u;return[(i=t.modelValue)==null?void 0:i.x,(o=t.modelValue)==null?void 0:o.y,(s=t.modelValue)==null?void 0:s.width,(l=t.modelValue)==null?void 0:l.height,(u=t.modelValue)==null?void 0:u.rotation]},([i,o,s,l,u])=>{if(t.modelValue&&i!==void 0&&o!==void 0&&s!==void 0&&l!==void 0){const d=r(i,o,s,l,u||0),g={x1:t.modelValue.x1,y1:t.modelValue.y1};(Math.abs(d.x1-g.x1)>.001||Math.abs(d.y1-g.y1)>.001)&&e("update:modelValue",{...t.modelValue,...d})}},{immediate:!0})},initCoordinates:()=>{t.modelValue&&(!t.modelValue.x1||!t.modelValue.y1)&&f.nextTick(()=>{const{x:i,y:o,width:s,height:l,rotation:u=0}=t.modelValue;if(i!==void 0&&o!==void 0&&s!==void 0&&l!==void 0){const d=r(i,o,s,l,u);e("update:modelValue",{...t.modelValue,...d})}})}}}const Iq="",yF={__name:"TextComponent",props:{modelValue:{type:Object,required:!0,default:()=>({})},propsConfig:{type:Object,required:!0}},emits:["update:modelValue"],setup(t,{emit:e}){const A=t,r=e,{watchCoordinates:n,initCoordinates:a}=Qs(A,r),i=f.ref(new Map),o=f.ref(""),s=f.computed(()=>{var V,L,M,k,D,x,S;const C=JSON.stringify(((L=(V=A.modelValue)==null?void 0:V.options)==null?void 0:L.fields)||[]);C!==o.value&&(i.value.clear(),o.value=C);let v="";if(Array.isArray(A.modelValue.FieldName)){const E=A.modelValue.FieldName.map(T=>{var j,G,Y,K;if(i.value.has(T))return i.value.get(T);const O=((K=(Y=(G=(j=A.modelValue)==null?void 0:j.options)==null?void 0:G.fields)==null?void 0:Y.find(ee=>ee.value==T))==null?void 0:K.label)||T;return i.value.set(T,O),O}).filter(T=>T);if(E.length>0){const T=A.modelValue.FieldConnector||" ";v=E.join(T)}}else{const E=(M=A.modelValue)==null?void 0:M.FieldName;E&&(i.value.has(E)?v=i.value.get(E):(v=((S=(x=(D=(k=A.modelValue)==null?void 0:k.options)==null?void 0:D.fields)==null?void 0:x.find(T=>T.value==E))==null?void 0:S.label)||"",i.value.set(E,v)))}let N=(A.modelValue.TemplateDisplay||"text")==="fieldName"?v:A.modelValue.Text;return A.modelValue.Title&&(N=`${A.modelValue.Title}${N}`),A.modelValue.EndMark&&(N=`${N}${A.modelValue.EndMark}`),N}),l=f.ref({});f.computed(()=>A.modelValue.__selected||!1);const u=f.computed(()=>({width:"100%",height:"100%",position:"relative",display:"flex",alignItems:"center",overflow:"hidden",boxSizing:"border-box"})),d=f.ref(new Map),g=C=>{var y,F,N,V,L,M;if(d.value.has(C))return d.value.get(C);const v=((M=(L=(V=(N=(F=(y=A.propsConfig)==null?void 0:y.text)==null?void 0:F.propertyPanel)==null?void 0:N.find(k=>k.prop=="FontName"))==null?void 0:V.options)==null?void 0:L.find(k=>k.value==C))==null?void 0:M.cssValue)||C;return d.value.set(C,v),v},h={1:"left",2:"center",3:"right"},b=f.computed(()=>{const C=A.modelValue.TextWrap??l.value.TextWrap??2,v=A.modelValue.FontSize??l.value.FontSize,y=A.modelValue.FontName||l.value.FontName,F=A.modelValue.Bold||l.value.Bold,N=A.modelValue.Italic||l.value.Italic,V=A.modelValue.FontColor||l.value.FontColor,L=A.modelValue.Alignment||l.value.Alignment||2,M={fontSize:v+"px",fontFamily:g(y),fontWeight:F?"bold":"normal",fontStyle:N?"italic":"normal",color:V,width:"100%",minWidth:0,boxSizing:"border-box",textAlign:h[L]};switch(C){case 1:M.whiteSpace="pre-wrap",M.overflow="visible",M.textOverflow="unset";break;case 2:M.whiteSpace="nowrap",M.overflow="hidden",M.textOverflow="clip";break;case 3:M.whiteSpace="nowrap",M.overflow="hidden",M.textOverflow="ellipsis";break}return M}),w=()=>{var v,y;const C=pi((y=(v=A.propsConfig)==null?void 0:v.text)==null?void 0:y.propertyPanel)||{};l.value=C,d.value.clear()};return a(),n(),f.watch(()=>A.propsConfig,()=>w(),{deep:!0,immediate:!0}),(C,v)=>(f.openBlock(),f.createElementBlock("div",{class:"td-text-component",style:f.normalizeStyle(u.value)},[f.createElementVNode("div",{class:"td-text-content",style:f.normalizeStyle(b.value)},f.toDisplayString(s.value),5)],4))}},$2=Symbol(),yc="el",bF="is-",ni=(t,e,A,r,n)=>{let a=`${t}-${e}`;return A&&(a+=`-${A}`),r&&(a+=`__${r}`),n&&(a+=`--${n}`),a},em=Symbol("namespaceContextKey"),CF=t=>{const e=t||(f.getCurrentInstance()?f.inject(em,f.ref(yc)):f.ref(yc));return f.computed(()=>f.unref(e)||yc)},Xh=(t,e)=>{const A=CF(e);return{namespace:A,b:(w="")=>ni(A.value,t,w,"",""),e:w=>w?ni(A.value,t,"",w,""):"",m:w=>w?ni(A.value,t,"","",w):"",be:(w,C)=>w&&C?ni(A.value,t,w,C,""):"",em:(w,C)=>w&&C?ni(A.value,t,"",w,C):"",bm:(w,C)=>w&&C?ni(A.value,t,w,"",C):"",bem:(w,C,v)=>w&&C&&v?ni(A.value,t,w,C,v):"",is:(w,...C)=>{const v=C.length>=1?C[0]:!0;return w&&v?`${bF}${w}`:""},cssVar:w=>{const C={};for(const v in w)w[v]&&(C[`--${A.value}-${v}`]=w[v]);return C},cssVarName:w=>`--${A.value}-${w}`,cssVarBlock:w=>{const C={};for(const v in w)w[v]&&(C[`--${A.value}-${t}-${v}`]=w[v]);return C},cssVarBlockName:w=>`--${A.value}-${t}-${w}`}};/**
|
|
2
2
|
* @vue/shared v3.5.20
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|