template-designer 0.9.8 → 0.9.9
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-7d5af896.mjs → index-176d09e7.mjs} +4 -4
- package/dist/{index.es-94c71da2.mjs → index.es-ffc79e9d.mjs} +1 -1
- package/dist/{lodop-0a52e3b8.mjs → lodop-d3689150.mjs} +1 -1
- package/dist/{rfid-df5c71a2.mjs → rfid-87f400cf.mjs} +1 -1
- package/dist/template-designer.es.js +1 -1
- package/dist/template-designer.umd.js +1 -1
- package/package.json +1 -1
|
@@ -92,7 +92,7 @@ const Fm = {
|
|
|
92
92
|
const C = (L = t.modelValue) == null ? void 0 : L.FieldName;
|
|
93
93
|
C && (a.value.has(C) ? B = a.value.get(C) : (B = ((b = (W = (P = (H = t.modelValue) == null ? void 0 : H.options) == null ? void 0 : P.fields) == null ? void 0 : W.find((V) => V.value == C)) == null ? void 0 : b.label) || "", a.value.set(C, B)));
|
|
94
94
|
}
|
|
95
|
-
let T = (t.modelValue.TemplateDisplay || "text") === "fieldName" ? B : t.modelValue.Text
|
|
95
|
+
let T = (t.modelValue.TemplateDisplay || "text") === "fieldName" ? B : t.modelValue.Text;
|
|
96
96
|
return t.modelValue.Title && (T = `${t.modelValue.Title}${T}`), t.modelValue.EndMark && (T = `${T}${t.modelValue.EndMark}`), T;
|
|
97
97
|
}), u = jA({});
|
|
98
98
|
GA(() => t.modelValue.__selected || !1);
|
|
@@ -7090,9 +7090,9 @@ const gb = /* @__PURE__ */ Mt(hb, [["render", pb]]), Xg = [
|
|
|
7090
7090
|
], qg = Xg.flatMap((e) => e.components);
|
|
7091
7091
|
async function Bb(e) {
|
|
7092
7092
|
try {
|
|
7093
|
-
return (await ym(/* @__PURE__ */ Object.assign({ "./props/lodop.js": () => import("./lodop-
|
|
7093
|
+
return (await ym(/* @__PURE__ */ Object.assign({ "./props/lodop.js": () => import("./lodop-d3689150.mjs"), "./props/rfid.js": () => import("./rfid-87f400cf.mjs") }), `./props/${e}.js`)).default;
|
|
7094
7094
|
} catch {
|
|
7095
|
-
return console.warn(`配置文件 ./props/${e}.js 不存在,使用默认配置`), (await import("./lodop-
|
|
7095
|
+
return console.warn(`配置文件 ./props/${e}.js 不存在,使用默认配置`), (await import("./lodop-d3689150.mjs")).default;
|
|
7096
7096
|
}
|
|
7097
7097
|
}
|
|
7098
7098
|
function mb(e = {}, A = {}) {
|
|
@@ -22807,7 +22807,7 @@ function(e) {
|
|
|
22807
22807
|
*/
|
|
22808
22808
|
function(e) {
|
|
22809
22809
|
function A() {
|
|
22810
|
-
return (de.canvg ? Promise.resolve(de.canvg) : import("./index.es-
|
|
22810
|
+
return (de.canvg ? Promise.resolve(de.canvg) : import("./index.es-ffc79e9d.mjs")).catch(function(t) {
|
|
22811
22811
|
return Promise.reject(new Error("Could not load canvg: " + t));
|
|
22812
22812
|
}).then(function(t) {
|
|
22813
22813
|
return t.default ? t.default : t;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(mr,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],h):(mr=typeof globalThis<"u"?globalThis:mr||self,h(mr.TemplateDesigner={},mr.Vue))})(this,function(mr,h){"use strict";const BF=(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 Ss(t,e,A){const r=(i,o,s,l,u=0)=>{let d=i,g=o;if(u&&u!==0){const f=i+s/2,w=o+l/2,v=-s/2,C=-l/2,B=u*Math.PI/180,y=Math.cos(B),U=Math.sin(B),Q=v*y-C*U,I=v*U+C*y;d=f+Q,g=w+I}return{x1:Math.round(d*100)/100,y1:Math.round(g*100)/100}};return{calculateTopLeftCoordinates:r,watchCoordinates:()=>{h.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)&&h.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 xq="",wF={__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}=Ss(A,r),i=h.ref(new Map),o=h.ref(""),s=h.computed(()=>{var I,V,R,L,D,P,S;const C=JSON.stringify(((V=(I=A.modelValue)==null?void 0:I.options)==null?void 0:V.fields)||[]);C!==o.value&&(i.value.clear(),o.value=C);let B="";if(Array.isArray(A.modelValue.FieldName)){const F=A.modelValue.FieldName.map(O=>{var j,z,q,Y;if(i.value.has(O))return i.value.get(O);const W=((Y=(q=(z=(j=A.modelValue)==null?void 0:j.options)==null?void 0:z.fields)==null?void 0:q.find(Ae=>Ae.value==O))==null?void 0:Y.label)||O;return i.value.set(O,W),W}).filter(O=>O);if(F.length>0){const O=A.modelValue.FieldConnector||" ";B=F.join(O)}}else{const F=(R=A.modelValue)==null?void 0:R.FieldName;F&&(i.value.has(F)?B=i.value.get(F):(B=((S=(P=(D=(L=A.modelValue)==null?void 0:L.options)==null?void 0:D.fields)==null?void 0:P.find(O=>O.value==F))==null?void 0:S.label)||"",i.value.set(F,B)))}let Q=(A.modelValue.TemplateDisplay||"text")==="fieldName"?B:A.modelValue.Text
|
|
1
|
+
(function(mr,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],h):(mr=typeof globalThis<"u"?globalThis:mr||self,h(mr.TemplateDesigner={},mr.Vue))})(this,function(mr,h){"use strict";const BF=(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 Ss(t,e,A){const r=(i,o,s,l,u=0)=>{let d=i,g=o;if(u&&u!==0){const f=i+s/2,w=o+l/2,v=-s/2,C=-l/2,B=u*Math.PI/180,y=Math.cos(B),U=Math.sin(B),Q=v*y-C*U,I=v*U+C*y;d=f+Q,g=w+I}return{x1:Math.round(d*100)/100,y1:Math.round(g*100)/100}};return{calculateTopLeftCoordinates:r,watchCoordinates:()=>{h.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)&&h.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 xq="",wF={__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}=Ss(A,r),i=h.ref(new Map),o=h.ref(""),s=h.computed(()=>{var I,V,R,L,D,P,S;const C=JSON.stringify(((V=(I=A.modelValue)==null?void 0:I.options)==null?void 0:V.fields)||[]);C!==o.value&&(i.value.clear(),o.value=C);let B="";if(Array.isArray(A.modelValue.FieldName)){const F=A.modelValue.FieldName.map(O=>{var j,z,q,Y;if(i.value.has(O))return i.value.get(O);const W=((Y=(q=(z=(j=A.modelValue)==null?void 0:j.options)==null?void 0:z.fields)==null?void 0:q.find(Ae=>Ae.value==O))==null?void 0:Y.label)||O;return i.value.set(O,W),W}).filter(O=>O);if(F.length>0){const O=A.modelValue.FieldConnector||" ";B=F.join(O)}}else{const F=(R=A.modelValue)==null?void 0:R.FieldName;F&&(i.value.has(F)?B=i.value.get(F):(B=((S=(P=(D=(L=A.modelValue)==null?void 0:L.options)==null?void 0:D.fields)==null?void 0:P.find(O=>O.value==F))==null?void 0:S.label)||"",i.value.set(F,B)))}let Q=(A.modelValue.TemplateDisplay||"text")==="fieldName"?B:A.modelValue.Text;return A.modelValue.Title&&(Q=`${A.modelValue.Title}${Q}`),A.modelValue.EndMark&&(Q=`${Q}${A.modelValue.EndMark}`),Q}),l=h.ref({});h.computed(()=>A.modelValue.__selected||!1);const u=h.computed(()=>({width:"100%",height:"100%",position:"relative",display:"flex",alignItems:"center",overflow:"hidden",boxSizing:"border-box"})),d=h.ref(new Map),g=C=>{var y,U,Q,I,V,R;if(d.value.has(C))return d.value.get(C);const B=((R=(V=(I=(Q=(U=(y=A.propsConfig)==null?void 0:y.text)==null?void 0:U.propertyPanel)==null?void 0:Q.find(L=>L.prop=="FontName"))==null?void 0:I.options)==null?void 0:V.find(L=>L.value==C))==null?void 0:R.cssValue)||C;return d.value.set(C,B),B},f={1:"left",2:"center",3:"right"},w=h.computed(()=>{const C=A.modelValue.TextWrap??l.value.TextWrap??2,B=A.modelValue.FontSize??l.value.FontSize,y=A.modelValue.FontName||l.value.FontName,U=A.modelValue.Bold||l.value.Bold,Q=A.modelValue.Italic||l.value.Italic,I=A.modelValue.FontColor||l.value.FontColor,V=A.modelValue.Alignment||l.value.Alignment||2,R={fontSize:B+"px",fontFamily:g(y),fontWeight:U?"bold":"normal",fontStyle:Q?"italic":"normal",color:I,width:"100%",minWidth:0,boxSizing:"border-box",textAlign:f[V]};switch(C){case 1:R.whiteSpace="pre-wrap",R.overflow="visible",R.textOverflow="unset";break;case 2:R.whiteSpace="nowrap",R.overflow="hidden",R.textOverflow="ellipsis";break;case 3:R.whiteSpace="nowrap",R.overflow="hidden",R.textOverflow="clip";break}return R}),v=()=>{var B,y;const C=di((y=(B=A.propsConfig)==null?void 0:B.text)==null?void 0:y.propertyPanel)||{};l.value=C,d.value.clear()};return a(),n(),h.watch(()=>A.propsConfig,()=>v(),{deep:!0,immediate:!0}),(C,B)=>(h.openBlock(),h.createElementBlock("div",{class:"td-text-component",style:h.normalizeStyle(u.value)},[h.createElementVNode("div",{class:"td-text-content",style:h.normalizeStyle(w.value)},h.toDisplayString(s.value),5)],4))}},q2=Symbol(),yc="el",yF="is-",ri=(t,e,A,r,n)=>{let a=`${t}-${e}`;return A&&(a+=`-${A}`),r&&(a+=`__${r}`),n&&(a+=`--${n}`),a},$2=Symbol("namespaceContextKey"),bF=t=>{const e=t||(h.getCurrentInstance()?h.inject($2,h.ref(yc)):h.ref(yc));return h.computed(()=>h.unref(e)||yc)},Yh=(t,e)=>{const A=bF(e);return{namespace:A,b:(v="")=>ri(A.value,t,v,"",""),e:v=>v?ri(A.value,t,"",v,""):"",m:v=>v?ri(A.value,t,"","",v):"",be:(v,C)=>v&&C?ri(A.value,t,v,C,""):"",em:(v,C)=>v&&C?ri(A.value,t,"",v,C):"",bm:(v,C)=>v&&C?ri(A.value,t,v,"",C):"",bem:(v,C,B)=>v&&C&&B?ri(A.value,t,v,C,B):"",is:(v,...C)=>{const B=C.length>=1?C[0]:!0;return v&&B?`${yF}${v}`:""},cssVar:v=>{const C={};for(const B in v)v[B]&&(C[`--${A.value}-${B}`]=v[B]);return C},cssVarName:v=>`--${A.value}-${v}`,cssVarBlock:v=>{const C={};for(const B in v)v[B]&&(C[`--${A.value}-${t}-${B}`]=v[B]);return C},cssVarBlockName:v=>`--${A.value}-${t}-${v}`}};/**
|
|
2
2
|
* @vue/shared v3.5.20
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|