@agile-team/mach-report 2.25.1 → 2.26.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 +14 -8
- package/dist/ExcelBindingWizard-B418l44t.js +1578 -0
- package/dist/ExcelBindingWizard-C4FGVsY_.cjs +1 -0
- package/dist/{ParamEditor-CGfaweYX.cjs → ParamEditor-BemJE8n8.cjs} +1 -1
- package/dist/{ParamEditor-B7YVD28E.js → ParamEditor-XvMtf_XQ.js} +2 -2
- package/dist/{ReportBatchPanel-BRJt0TXp.cjs → ReportBatchPanel-CbY4fvXD.cjs} +1 -1
- package/dist/{ReportBatchPanel-BTKHtLTW.js → ReportBatchPanel-Ds0R_uXn.js} +37 -37
- package/dist/{ReportLabelStudio-BvK_WBke.cjs → ReportLabelStudio-DuTwN5er.cjs} +1 -1
- package/dist/{ReportLabelStudio-CZwqyO3t.js → ReportLabelStudio-ZFy79eRv.js} +26 -26
- package/dist/ReportParamPanel-Chxu4MTx.cjs +1 -0
- package/dist/{ReportParamPanel-DGXzBzl2.js → ReportParamPanel-Czm3OPo_.js} +216 -205
- package/dist/ReportPreview-C9c0Rp7Y.js +7380 -0
- package/dist/ReportPreview-CIMR4ERo.cjs +6 -0
- package/dist/{ReportTemplateLibrary-ClwxhnC0.cjs → ReportTemplateLibrary-C6lByc69.cjs} +1 -1
- package/dist/{ReportTemplateLibrary-C7sB0Jay.js → ReportTemplateLibrary-XJVoTDIz.js} +1 -1
- package/dist/{RuleEditor-CsDGFaWz.js → RuleEditor-CeNFPeOc.js} +5 -5
- package/dist/{RuleEditor-D-OdaGdR.cjs → RuleEditor-gggUkEwB.cjs} +1 -1
- package/dist/{TemplateOutlinePanel-DAqR9zQi.cjs → TemplateOutlinePanel-B0e-umq2.cjs} +1 -1
- package/dist/{TemplateOutlinePanel-CXOT7d1r.js → TemplateOutlinePanel-BWN4Y9iz.js} +2 -2
- package/dist/{TemplateReusePanel-Dcfx3Hba.js → TemplateReusePanel-CR-4OHoU.js} +2 -2
- package/dist/{TemplateReusePanel-ygIi-Ajz.cjs → TemplateReusePanel-Cthig1S1.cjs} +1 -1
- package/dist/{TemplateReviewPanel-COU8FqPq.js → TemplateReviewPanel-BkWzyNL4.js} +2 -2
- package/dist/{TemplateReviewPanel-DyGULVxr.cjs → TemplateReviewPanel-D8o2gDaK.cjs} +1 -1
- package/dist/analytics.cjs +1 -1
- package/dist/analytics.js +5 -5
- package/dist/artifact-integrity.json +106 -102
- package/dist/{assets-C4MIvzQ4.js → assets-BFTP-0WR.js} +2 -2
- package/dist/{assets-BYdpkTIt.cjs → assets-CZiZhTf2.cjs} +1 -1
- package/dist/{auto-D7x7QsWD.js → auto-C7udkeAa.js} +89 -88
- package/dist/auto-CXd2E2aZ.cjs +1 -0
- package/dist/capabilities-D8UU2clQ.cjs +1 -0
- package/dist/{capabilities-CN_kSVjO.js → capabilities-g0a2j9Yy.js} +50 -46
- package/dist/{charts-Cjw5AYkg.cjs → charts-D-Vg-ak9.cjs} +1 -1
- package/dist/{charts-CxJZ0XaY.js → charts-D48XCefN.js} +1 -1
- package/dist/computed-BQgBrma-.cjs +1 -0
- package/dist/{computed-f3pOqWLX.js → computed-CH3NYPOW.js} +198 -188
- package/dist/{data-bar-Bfh54sT4.js → data-bar-DjOgTLqu.js} +1 -1
- package/dist/{dataset-DL83majE.js → dataset-B8oTsC6o.js} +69 -66
- package/dist/dataset-D3OsyzG1.cjs +1 -0
- package/dist/designer-COuSUxZ1.cjs +2 -0
- package/dist/designer-CT4mlrr0.js +7997 -0
- package/dist/designer.cjs +1 -1
- package/dist/designer.d.cts +83 -4
- package/dist/designer.d.ts +83 -4
- package/dist/designer.js +4 -4
- package/dist/{diagnostic-collector-gB07PHy2.js → diagnostic-collector-C-JBA016.js} +2 -2
- package/dist/dom-DgWc-DY1.js +452 -0
- package/dist/dom-Fk4NF-gN.cjs +1 -0
- package/dist/{encoding-Amq3XrtU.js → encoding-D480EM2r.js} +2 -2
- package/dist/{encoding-DRVXs5xm.cjs → encoding-tWc2Wn89.cjs} +1 -1
- package/dist/execution-result-7sG_mdcD.cjs +1 -0
- package/dist/execution-result-Ba65gieT.js +39 -0
- package/dist/{font-loader-p_SyTvqt.cjs → font-loader-BIxme_9g.cjs} +1 -1
- package/dist/{font-loader-D4NLIKJL.js → font-loader-CHmEwkHl.js} +1 -1
- package/dist/{grid-strokes-DkZEZvcI.js → grid-strokes-DsoICRjZ.js} +1 -1
- package/dist/import-range-BwT86Z3j.cjs +1 -0
- package/dist/import-range-D9p_blcb.js +98 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +25 -25
- package/dist/{json-snapshot-CBVWZvyC.js → json-snapshot-BZ0CIQln.js} +1142 -951
- package/dist/json-snapshot-DGFeI30h.cjs +2 -0
- package/dist/{matrix-b6T291xo.js → matrix-CB9TqTEy.js} +1 -1
- package/dist/{matrix-DUYPRL7t.cjs → matrix-CcqYOuq_.cjs} +1 -1
- package/dist/{pdf-DU8HelKd.js → pdf-DTR7fAIr.js} +3596 -3517
- package/dist/{pdf-C060D5UY.cjs → pdf-d9oJ6V0P.cjs} +49 -49
- package/dist/pdf.cjs +1 -1
- package/dist/pdf.js +2 -2
- package/dist/{plugin-DHe8y5pD.cjs → plugin-B7Bi-1te.cjs} +1 -1
- package/dist/{plugin-BdCplNe1.js → plugin-OKDFQFS4.js} +1 -1
- package/dist/{prefill-Buy4NJ15.js → prefill-C8fF91JB.js} +3 -3
- package/dist/{prefill-Cw4ZYGXZ.cjs → prefill-C_Bf_AMo.cjs} +1 -1
- package/dist/{prepared-BlNeOjoO.cjs → prepared-BLhV7vdE.cjs} +1 -1
- package/dist/{prepared-CBJ7BkK0.js → prepared-DhgQ0d-h.js} +7 -7
- package/dist/protocol-CZ-BILne.cjs +1 -0
- package/dist/{protocol-CB19KXGr.js → protocol-DHO91-Jt.js} +3 -3
- package/dist/{record-bindings-Cv7lFiof.js → record-bindings-DBrCu6zO.js} +3 -3
- package/dist/{record-bindings-B7djSjNs.cjs → record-bindings-KEs-DKCS.cjs} +1 -1
- package/dist/region-binding-workflow-FSyIZge8.js +882 -0
- package/dist/region-binding-workflow-ikpY1Kbw.cjs +3 -0
- package/dist/report-encoding-worker.cjs +1 -1
- package/dist/report-encoding-worker.js +1 -1
- package/dist/rich-text-layout-BYbIc3eJ.cjs +3 -0
- package/dist/rich-text-layout-BtygMWZC.js +96 -0
- package/dist/runtime-B5HG8poy.cjs +1 -0
- package/dist/runtime-BsvAqz4a.js +204 -0
- package/dist/sbom.cdx.json +1 -1
- package/dist/server-node.cjs +5 -5
- package/dist/server-node.js +2323 -2120
- package/dist/server.cjs +1 -1
- package/dist/server.d.cts +35 -0
- package/dist/server.d.ts +35 -0
- package/dist/server.js +340 -328
- package/dist/style.css +1 -1
- package/dist/{template-catalog-CM6U_RlD.js → template-catalog-BbrN9dgu.js} +5 -5
- package/dist/{template-catalog-Cj66M84u.cjs → template-catalog-DDH-5J57.cjs} +1 -1
- package/dist/{template-fragments-BDxdCuMD.js → template-fragments-CUTE8-_I.js} +3 -3
- package/dist/{template-fragments-DbKdxI1z.cjs → template-fragments-cyAQu7aw.cjs} +1 -1
- package/dist/{template-registry-B-AK1oam.cjs → template-registry-D24Z8aQf.cjs} +1 -1
- package/dist/{template-registry-DeVgwEZj.js → template-registry-PSuLsnyq.js} +4 -4
- package/dist/{template-serialization-CqQY4zDg.cjs → template-serialization-BOUidUlh.cjs} +1 -1
- package/dist/{template-serialization-CWmHq7lX.js → template-serialization-BgGWYV_1.js} +1 -1
- package/dist/{textwrap-BywMBMXM.js → textwrap-Bt_tnI6V.js} +1 -1
- package/dist/vue/async.d.cts +46 -3
- package/dist/vue/async.d.ts +46 -3
- package/dist/vue/index.d.cts +217 -25
- package/dist/vue/index.d.ts +217 -25
- package/dist/vue-async.cjs +1 -1
- package/dist/vue-async.js +3 -3
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +434 -202
- package/dist/workbook-session-BJfZVp4q.cjs +29 -0
- package/dist/{workbook-session-B6hRjTyX.js → workbook-session-DRnMjIFK.js} +2377 -2350
- package/dist/worker.cjs +1 -1
- package/dist/worker.js +4 -4
- package/dist/xlsx.cjs +1 -1
- package/dist/xlsx.d.cts +27 -2
- package/dist/xlsx.d.ts +27 -2
- package/dist/xlsx.js +15 -15
- package/package.json +1 -1
- package/dist/ExcelBindingWizard-bs3F4dD8.js +0 -1486
- package/dist/ExcelBindingWizard-jSdjBtWw.cjs +0 -1
- package/dist/ReportParamPanel-B27IGJjk.cjs +0 -1
- package/dist/ReportPreview-CnxaDTCO.js +0 -7170
- package/dist/ReportPreview-DqFBcsJQ.cjs +0 -6
- package/dist/auto-mPK9W0y5.cjs +0 -1
- package/dist/capabilities-D4nfhcvB.cjs +0 -1
- package/dist/computed-DK6BruFz.cjs +0 -1
- package/dist/dataset-IrlXbUvh.cjs +0 -1
- package/dist/designer-B597ZdC0.js +0 -7595
- package/dist/designer-DFIdv_n7.cjs +0 -2
- package/dist/dom-CXWMmwh-.cjs +0 -1
- package/dist/dom-DxdCMLzs.js +0 -452
- package/dist/json-snapshot-DCFEtfFw.cjs +0 -2
- package/dist/protocol-BU_4sXP0.cjs +0 -1
- package/dist/region-binding-workflow-EYxvUYJ-.js +0 -977
- package/dist/region-binding-workflow-NdkMSFCh.cjs +0 -3
- package/dist/rich-text-layout-Ch_N0Ubu.js +0 -52
- package/dist/rich-text-layout-yJGuThtC.cjs +0 -3
- package/dist/runtime-B5d_lQNQ.js +0 -227
- package/dist/runtime-BRx8Agqr.cjs +0 -1
- package/dist/workbook-session-BclW7KKH.cjs +0 -29
package/dist/dom-CXWMmwh-.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const z=require("./template-serialization-CqQY4zDg.cjs"),V=require("./data-bar-DzceAVeR.cjs"),B=require("./dom-cell-address-DLD1mkTB.cjs"),f=require("./diagnostic-collector-wASg6Fzs.cjs"),D=require("./grid-strokes-RFMR91jn.cjs"),R=require("./capabilities-D4nfhcvB.cjs");function F(e){const t=/\.pages\[(\d+)\](?:\.components\[(\d+)\])?/.exec(e);return t?{pageIndex:Number(t[1]),...t[2]===void 0?{}:{componentIndex:Number(t[2])}}:{}}function q(e,t,r){return z.collectTemplateDatasetBindings(e).filter(n=>n.dataset===t).flatMap(n=>n.fields.filter(o=>o.field===r).map(o=>({...o,...F(o.path),dataset:t,kind:/\.computed\[/.test(o.path)?"calculation":/\.columns\[\d+\]\.field$/.test(o.path)?"display":"binding"})))}function j(e,t){const r=e.kind==="list"?e.title||e.dataset:e.binding?.field||e.text||e.nid;return`${e.kind} · ${(r||String(t+1)).replace(/\s+/g," ").slice(0,80)}`}function K(e){const t=z.collectTemplateDatasetBindings(e),r=new Map;for(const o of t)for(const l of o.fields){const a=/^\$\.template\.pages\[\d+\]\.components\[\d+\]/.exec(l.path)?.[0];if(!a)continue;const s=r.get(a)??[];s.push({...l,dataset:o.dataset}),r.set(a,s)}const n=[];return e.pages.forEach((o,l)=>{const a=`$.template.pages[${l}]`;n.push({path:a,pageIndex:l,kind:"page",depth:0,title:typeof o.meta?.title=="string"?o.meta.title:`${l+1} · ${o.widthMm} × ${o.heightMm} mm`}),o.components.forEach((s,i)=>{const d=`${a}.components[${i}]`,h={pageIndex:l,componentIndex:i};n.push({path:d,...h,depth:1,kind:"component",title:j(s,i)}),s.kind==="list"&&(s.columns.forEach((m,p)=>n.push({path:`${d}.columns[${p}].field`,...h,depth:2,kind:"field",title:`${m.header} · ${m.field}`,field:m.field,dataset:s.dataset})),s.computed?.forEach((m,p)=>n.push({path:`${d}.computed[${p}]`,...h,depth:2,kind:"calculation",title:m.field,field:m.field,dataset:s.dataset})));const c=new Set;for(const m of r.get(d)??[])/\.columns\[\d+\]\.field$/.test(m.path)||c.has(m.path)||(c.add(m.path),n.push({...m,...h,depth:2,kind:"binding",title:m.field}))})}),n}function M(e,t,r){let n=0,o=e.length;for(;n<o;){const l=n+o>>>1;r(e[l])<t?n=l+1:o=l}return n}function G(e){if(![e.leftMm,e.topMm,e.widthMm,e.heightMm].every(Number.isFinite)||e.widthMm<0||e.heightMm<0)throw new RangeError("Preview viewport must have finite coordinates and nonnegative dimensions.");return e}function U(e){const t=e.rows.map(()=>[]);for(const r of e.cells){const n=Math.min(t.length,r.ri+(r.cell.rowSpan??1));for(let o=r.ri;o<n;o++)t[o].push(r)}for(const r of t)r.sort((n,o)=>n.xMm-o.xMm);return{cells(r){G(r);const n=new Set,o=r.topMm+r.heightMm,l=r.leftMm+r.widthMm;let a=M(e.rows,r.topMm,s=>s.pos+s.size);for(;a<t.length&&e.rows[a].pos<=o;){const s=t[a++];let i=M(s,r.leftMm,d=>d.xMm+d.widthMm);for(;i<s.length&&s[i].xMm<=l;)n.add(s[i++])}return[...n].sort((s,i)=>s.ri-i.ri||s.ci-i.ci)}}}function _(e){const t=["h","v"].map(r=>e.filter(n=>n.kind===r).sort((n,o)=>n.pos-o.pos));return r=>{const n=[];return t.forEach((o,l)=>{const a=l===0?r.topMm:r.leftMm,s=a+(l===0?r.heightMm:r.widthMm),i=l===0?r.leftMm:r.topMm,d=i+(l===0?r.widthMm:r.heightMm);let h=M(o,a,c=>c.pos);for(;h<o.length&&o[h].pos<=s;){const c=o[h++];c.to>=i&&c.from<=d&&n.push(c)}}),n}}function W(){const e=[];return{mount(t){e.push(ee(t))},update(t,r,n,o){G(t);let l=!1;for(const a of e)l=a.update(t,a.component===r?n:void 0,o)||l;return l}}}function X(e,t){const r=Math.max(8,e.widthMm/4),n=Math.max(8,e.heightMm/4);return{leftMm:e.leftMm-t.leftMm-r,topMm:e.topMm-t.topMm-n,widthMm:e.widthMm+2*r,heightMm:e.heightMm+2*n}}function Y(e,t,r){let n=t.get(r);return n||(n=e.table.ownerDocument.createElement("tr"),n.className=e.rowClass,n.setAttribute("role","row"),n.setAttribute("aria-rowindex",String(r+1)),n.style.cssText="all:unset;display:contents;box-sizing:border-box",t.set(r,n)),n}function J(e,t,r,n){const o=new Set(t),l=new Set(t.map(i=>i.ri)),a=new Map;for(const[i,d]of r)if(!o.has(i)){d.remove(),r.delete(i);const h=e.reuseKey?.(i);if(h!==void 0){const c=a.get(h)??[];c.push(d),a.set(h,c)}}for(const[i,d]of n)l.has(i)||(d.remove(),n.delete(i));for(const i of t){let d=r.get(i);if(!d){const c=e.reuseKey?.(i),m=c===void 0?void 0:a.get(c)?.pop();d=m&&e.reuseCell?.(m,i)?m:e.drawCell(i),d.setAttribute("aria-colindex",String(i.ci+1)),r.set(i,d)}const h=Y(e,n,i.ri);d.parentElement!==h&&h.appendChild(d)}const s=new Map;for(const i of t){const d=s.get(i.ri)??[];d.push(r.get(i)),s.set(i.ri,d)}for(const[i,d]of s)A(n.get(i),d);A(e.body,[...l].sort((i,d)=>i-d).map(i=>n.get(i)))}function A(e,t){let r=e.firstElementChild;for(const n of t)n===r?r=r.nextElementSibling:e.insertBefore(n,r)}function Q(e,t){return e.table?.role==="header"?e.heightMm:t.rows[0]?.size??0}function Z(e,t,r,n){const o=[e],l=n.freezeHeaders&&(r.table?.role==="header"||!r.table),a=Q(r,t);l&&o.push({...e,topMm:0,heightMm:Math.max(0,a-1e-4)});const s=Math.max(0,Math.min(20,Math.floor(n.frozenColumns??0)))||0;if(!s||!t.columns.length)return o;const i=t.columns[Math.min(s,t.columns.length)-1],d={...e,leftMm:0,widthMm:Math.max(0,i.pos+i.size-1e-4)};return o.push(d),l&&o.push({...d,topMm:0,heightMm:Math.max(0,a-1e-4)}),o}function ee(e){const t=f.resolveGridLayout(e.grid,e.component.widthMm,e.component.heightMm),r=new Map(t.cells.map(h=>[`${h.ri}:${h.ci}`,h])),n=U(t),o=new Map,l=new Map,a=_(D.resolveGridStrokes(t,e.component));e.table.setAttribute("aria-rowcount",String(t.rows.length)),e.table.setAttribute("aria-colcount",String(t.columns.length));let s="",i="";function d(h,c){const m=new Set;for(const p of Z(h,t,e.component,c??{}))for(const w of n.cells(p))m.add(w);return[...m]}return{component:e.component,update(h,c,m){const p=X(h,e.component),w=d(p,m),y=c&&r.get(`${c.rowIndex}:${c.columnIndex}`);y&&!w.includes(y)&&w.push(y),w.sort((b,$)=>b.ri-$.ri||b.ci-$.ci);const C=w.map(b=>`${b.ri}:${b.ci}`).join(";"),S=a(p),v=S.map(b=>`${b.kind}:${b.pos}:${b.from}:${b.to}`).join(";"),E=C!==s,T=v!==i;return E&&(s=C,J(e,w,o,l)),T&&(i=v,e.edgeHost.replaceChildren(...e.drawEdges(S))),E||T}}}const L=new WeakMap,te={root:"mr-root",page:"mr-page",comp:"mr-comp",text:"mr-text",lines:"mr-lines",line:"mr-line",rich:"mr-rich",paragraph:"mr-paragraph",segment:"mr-segment",image:"mr-image",shape:"mr-shape",grid:"mr-grid",row:"mr-row",cell:"mr-cell",unknown:"mr-unknown"};function g(e,t){return t?.classNames?.[e]??te[e]}class ne{constructor(){this.props=[]}add(t,r){return r==null||r===!1||r===""?this:(this.props.push([t,String(r)]),this)}mm(t,r,n,o=2){return this.add(t,`${f.round(f.mmToPx(r,n),o)}px`)}toString(){let t="";for(const[r,n]of this.props)t+=`${r}:${n};`;return t}applyTo(t){const r=this.toString();r&&(t.style.cssText=r)}}function u(e,t="unset"){return new ne().add("all",t).add("display",e).add("box-sizing","border-box")}function H(e,t,r){e.add("color",t.color).add("font-family",t.fontFamily).add("font-weight",t.bold!=null?t.bold?"700":"400":void 0).add("font-style",t.italic!=null?t.italic?"italic":"normal":void 0).add("text-decoration",t.underline!=null?t.underline?"underline":"none":void 0).add("letter-spacing",t.letterSpacing!=null?`${t.letterSpacing}pt`:void 0).add("line-height",String(f.resolveLineHeight(t))).add("text-align",t.align);const n=f.resolveFontSize(t,r);e.add("font-size",`${f.round(n.fontSizePx,2)}px`)}function re(e,t,r){const n=t.style??{};H(e,n,r);const o=!t.grid&&(t.kind==="ellipse"||t.kind==="line");e.add("background-color",o?void 0:n.backgroundColor).add("opacity",n.opacity!=null?String(n.opacity):void 0).add("transform",n.rotateDeg?`rotate(${n.rotateDeg}deg)`:void 0)}function P(e,t,r,n,o,l){const a=e.cell,s=l.createElement("td");s.className=g("cell",o),B.setDomCellAddress(s,e.ri,e.ci),s.setAttribute("role",t.table?.role==="header"?"columnheader":"cell"),a.colSpan&&(s.colSpan=a.colSpan),a.rowSpan&&(s.rowSpan=a.rowSpan);const i=f.resolveGridCellStyle(t.style,a),d=u("block").add("position","absolute").mm("left",e.xMm,n).mm("top",e.yMm,n).mm("width",e.widthMm,n).mm("height",e.heightMm,n).add("background-color",i.backgroundColor).add("vertical-align",i.verticalAlign??"middle");H(d,i,n),d.applyTo(s);const h=V.dataBarBox(a.dataBar,e.widthMm,e.heightMm,r);if(h){const m=l.createElement("div");m.className="mr-cell-data-bar",m.setAttribute("aria-hidden","true"),u("block").add("position","absolute").mm("left",h.x,n).mm("top",h.y,n).mm("width",h.width,n).mm("height",h.height,n).add("background-color",h.color).add("opacity","0.35").add("pointer-events","none").applyTo(m),s.appendChild(m)}const c=l.createElement("div");c.className="mr-cell-content",u("flex").add("position","absolute").mm("left",r+(a.indentMm??0),n).mm("right",r,n).mm("top",r,n).mm("bottom",r,n).add("flex-direction","column").add("justify-content",i.verticalAlign==="top"?"flex-start":i.verticalAlign==="bottom"?"flex-end":"center").add("overflow-wrap","anywhere").add("overflow","hidden").applyTo(c),a.richParagraphs?.length?c.appendChild(I({...t,kind:"text",richParagraphs:a.richParagraphs},n,o,l)):a.text!=null&&c.append(a.text);for(const m of a.children??[])c.appendChild(x(m,n,o,l));return s.insertBefore(c,s.firstChild),s}function oe(e,t,r,n){return O(D.resolveGridStrokes(e,t),r,n)}function ie(e,t){const r=e.cell;if(!(r.children?.length||r.richParagraphs?.length||r.dataBar||(r.colSpan??1)!==1||(r.rowSpan??1)!==1))return JSON.stringify([r.style,r.indentMm,f.gridCellAlignment(t,r)])}function le(e,t,r){if(e.style.position!=="absolute"||e.style.zIndex||e.style.transform||e.children.length!==1)return!1;const n=e.firstElementChild;return!(n instanceof HTMLElement)||n.className!=="mr-cell-content"?!1:(B.setDomCellAddress(e,t.ri,t.ci),e.style.left=`${f.round(f.mmToPx(t.xMm,r),2)}px`,e.style.top=`${f.round(f.mmToPx(t.yMm,r),2)}px`,e.style.width=`${f.round(f.mmToPx(t.widthMm,r),2)}px`,e.style.height=`${f.round(f.mmToPx(t.heightMm,r),2)}px`,n.textContent=t.cell.text??"",!0)}function O(e,t,r){return e.map(n=>{const o=`${f.round(n.widthPt*t/72,2)}px solid ${n.color}`,l=r.createElement("div");l.className="mr-grid-edge",l.setAttribute("aria-hidden","true");const a=n.kind==="h";return u("block").add("position","absolute").add("pointer-events","none").mm("left",a?n.from:n.pos,t).mm("top",a?n.pos:n.from,t).mm("width",a?n.to-n.from:0,t).mm("height",a?0:n.to-n.from,t).add(a?"border-top":"border-left",o).applyTo(l),l})}function ae(e,t,r,n,o){const l=o.createElement("table");l.className=g("grid",n),l.setAttribute("role","table"),u("block").add("position","relative").add("width","100%").add("height","100%").applyTo(l);const a=o.createElement("tbody");u("contents").applyTo(a),l.appendChild(a);const s=t.style?.rotateDeg?void 0:L.get(n);if(s){const c=o.createElement("div");u("block").add("position","relative").add("width","100%").add("height","100%").applyTo(c);const m=o.createElement("div");return u("contents").applyTo(m),m.setAttribute("aria-hidden","true"),s.mount({grid:e,component:t,table:l,rowClass:g("row",n),body:a,edgeHost:m,drawCell:p=>P(p,t,e.paddingMm??.5,r,{...n},o),reuseKey:p=>ie(p,t.style),reuseCell:(p,w)=>le(p,w,r),drawEdges:p=>O(p,r,o)}),c.append(l,m),c}const i=f.resolveGridLayout(e,t.widthMm,t.heightMm),d=e.cells.map(()=>{const c=o.createElement("tr");return c.className=g("row",n),c.setAttribute("role","row"),u("contents").applyTo(c),a.appendChild(c),c});for(const c of i.cells)d[c.ri].appendChild(P(c,t,e.paddingMm??.5,r,n,o));const h=o.createElement("div");return u("block").add("position","relative").add("width","100%").add("height","100%").applyTo(h),h.append(l,...oe(i,t,r,o)),h}function se(e,t,r,n){const o=n.createElement("div");o.className=g("paragraph",r),u("block").add("text-align",e.align).add("line-height",e.lineHeight!=null?String(e.lineHeight):void 0).mm("margin-top",e.spaceBeforeMm??0,t).mm("margin-bottom",e.spaceAfterMm??0,t).mm("text-indent",e.indentMm??0,t).applyTo(o);for(const l of e.segments||[]){const a=n.createElement("span");a.className=g("segment",r),a.textContent=l.kind==="field"?l.field??"":l.text??"";const s=u("inline");if(l.style){const i=l.style;s.add("color",i.color).add("background-color",i.backgroundColor).add("font-family",i.fontFamily).add("line-height",i.lineHeight).add("letter-spacing",i.letterSpacing==null?void 0:`${i.letterSpacing*t/72}px`).add("font-weight",i.bold!=null?i.bold?"700":"400":void 0).add("font-style",i.italic!=null?i.italic?"italic":"normal":void 0).add("text-decoration",i.underline!=null?i.underline?"underline":"none":void 0),(i.fontSize!=null||i.fontSizePx!=null)&&s.add("font-size",`${f.round(f.resolveFontSize(i,t).fontSizePx,2)}px`)}s.applyTo(a),o.appendChild(a)}return o}function I(e,t,r,n){if(f.isRichText(e)){const o=n.createElement("div");o.className=g("rich",r),u("block").applyTo(o);for(const l of e.richParagraphs)o.appendChild(se(l,t,r,n));return o}if(Array.isArray(e.lines)&&e.lines.length>0){const o=n.createElement("div");o.className=g("lines",r),u("block").applyTo(o);for(const l of e.lines){const a=n.createElement("div");a.className=g("line",r),a.textContent=l,u("block").add("white-space","pre").add("min-height","1lh").applyTo(a),o.appendChild(a)}return o}return e.text??""}function de(e,t,r,n){const o=n.createElement("div");o.className=g("text",r);const l=e.style||{};return u("flex").add("width","100%").add("height","100%").add("flex-direction","column").add("justify-content",l.verticalAlign==="middle"?"center":l.verticalAlign==="bottom"?"flex-end":"flex-start").add("overflow-wrap","anywhere").add("overflow","hidden").applyTo(o),o.append(I(e,t,r,n)),o}function ce(e,t,r){const n=r.createElement("img");return n.className=g("image",t),n.src=e.imageData,u("block").add("width","100%").add("height","100%").add("object-fit","contain").applyTo(n),n.alt=e.kind,n}function N(e,t,r,n){const o=n.createElement("div");o.className=g("shape",r);const l=e.style||{},a=f.resolveStroke(l),s=f.resolveBoxBorders(l),i=`${f.round(a.widthPt*t/72,2)}px solid ${a.color}`,d=u("block");return e.grid?d.add("position","relative"):e.kind==="rect"?(s.top&&d.add("border-top",i),s.right&&d.add("border-right",i),s.bottom&&d.add("border-bottom",i),s.left&&d.add("border-left",i)):e.kind==="ellipse"?(d.add("border-radius","50%"),s.inner&&d.add("border",i),l.backgroundColor&&d.add("background-color",l.backgroundColor)):e.kind==="line"&&d.add("height","0").add("border-top",i),d.add("box-sizing","border-box").add("width","100%").add("height","100%"),d.applyTo(o),o}function he(e,t,r){const n=r.createElementNS("http://www.w3.org/2000/svg","svg"),o=f.mmToPx(e.widthMm,t),l=f.mmToPx(e.heightMm,t);n.setAttribute("width",String(Math.max(1,o))),n.setAttribute("height",String(Math.max(1,l))),n.setAttribute("aria-hidden","true"),n.style.overflow="visible",n.style.display="block";const a=r.createElementNS("http://www.w3.org/2000/svg","line");a.setAttribute("x1","0"),a.setAttribute("x2",String(o)),a.setAttribute("y1",e.lineDirection==="up"?String(l):"0"),a.setAttribute("y2",e.lineDirection==="up"?"0":String(l));const s=f.resolveStroke({...e.style,borderColor:e.style?.lineColor??e.style?.borderColor});return a.setAttribute("stroke",s.color),a.setAttribute("stroke-width",String(s.widthPt*t/72)),n.appendChild(a),n}function x(e,t,r,n){const o=n.createElement("div");o.className=`${g("comp",r)} mr-kind-${e.kind}`;const l=u("block").add("position","absolute").mm("left",e.leftMm,t).mm("top",e.topMm,t).mm("width",e.widthMm,t).mm("height",e.heightMm,t).add("box-sizing","border-box");if(re(l,e,t),l.applyTo(o),f.isImageBackedComponent(e))return o.appendChild(ce(e,r,n)),o;if(e.kind==="text")return o.appendChild(de(e,t,r,n)),o;if(e.grid){const s=N(e,t,r,n);return s.appendChild(ae(e.grid,e,t,r,n)),o.appendChild(s),o}if(e.kind==="line"&&e.lineDirection)return o.appendChild(he(e,t,n)),o;if(e.kind==="line"||e.kind==="rect"||e.kind==="ellipse")return o.appendChild(N(e,t,r,n)),o;const a=n.createElement("div");return a.className=g("unknown",r),u("block").applyTo(a),a.textContent=e.fallbackText??`[${e.kind}]`,a.dataset.mrUnsupported=e.kind,a.setAttribute("role","note"),o.appendChild(a),o}function k(e,t,r,n){const o=n.createElement("div");return o.className=g("page",r),u("block","initial").add("position","relative").add("font-family",f.DEFAULT_FONT_FAMILY).add("font-size",`${f.round(f.resolveFontSize(void 0,t).fontSizePx,2)}px`).add("line-height",String(f.resolveLineHeight(void 0))).add("white-space","pre-wrap").add("direction","ltr").mm("width",e.pageWidthMm,t).mm("height",e.pageHeightMm,t).add("background-color","#fff").add("color",f.DEFAULT_TEXT_COLOR).add("overflow","hidden").add("box-sizing","border-box").applyTo(o),e.components.forEach((l,a)=>{const s=x(l,t,r,n);s.dataset.mrComponentIndex=String(a),o.appendChild(s)}),o}function me(e,t,r={}){const n=r.dpi??96;R.reportOutputDiagnostics(e,"dom",r);const o=t.createElement("div");return o.className=g("root",r),u("block").applyTo(o),o.dataset.schemaVersion=e.schemaVersion,e.pages.forEach(l=>{o.appendChild(k(l,n,r,t))}),o}function fe(e,t,r,n){const o={...r},l=W();return L.set(o,l),{element:k(e,t,o,n),update(s,i,d){return l.update(s,i&&e.components[i.componentIndex],i,d)}}}exports.classOf=g;exports.collectTemplateOutline=K;exports.createPageViewportRenderer=fe;exports.inspectTemplateFieldUsage=q;exports.renderComponent=x;exports.renderPage=k;exports.renderPlan=me;exports.templatePathLocation=F;
|
package/dist/dom-DxdCMLzs.js
DELETED
|
@@ -1,452 +0,0 @@
|
|
|
1
|
-
import { b as P } from "./template-serialization-CWmHq7lX.js";
|
|
2
|
-
import { d as U } from "./data-bar-Bfh54sT4.js";
|
|
3
|
-
import { s as B } from "./dom-cell-address-Fn-8nk7D.js";
|
|
4
|
-
import { r as D, i as _, e as G, f as W, n as y, t as b, c as F, a as k, g as X, u as Y, b as J, D as q, h as Q } from "./diagnostic-collector-gB07PHy2.js";
|
|
5
|
-
import { r as H } from "./grid-strokes-DkZEZvcI.js";
|
|
6
|
-
import { r as Z } from "./capabilities-CN_kSVjO.js";
|
|
7
|
-
function ee(e) {
|
|
8
|
-
const t = /\.pages\[(\d+)\](?:\.components\[(\d+)\])?/.exec(e);
|
|
9
|
-
return t ? {
|
|
10
|
-
pageIndex: Number(t[1]),
|
|
11
|
-
...t[2] === void 0 ? {} : { componentIndex: Number(t[2]) }
|
|
12
|
-
} : {};
|
|
13
|
-
}
|
|
14
|
-
function Te(e, t, r) {
|
|
15
|
-
return P(e).filter((n) => n.dataset === t).flatMap(
|
|
16
|
-
(n) => n.fields.filter((i) => i.field === r).map((i) => ({
|
|
17
|
-
...i,
|
|
18
|
-
...ee(i.path),
|
|
19
|
-
dataset: t,
|
|
20
|
-
kind: /\.computed\[/.test(i.path) ? "calculation" : /\.columns\[\d+\]\.field$/.test(i.path) ? "display" : "binding"
|
|
21
|
-
}))
|
|
22
|
-
);
|
|
23
|
-
}
|
|
24
|
-
function te(e, t) {
|
|
25
|
-
const r = e.kind === "list" ? e.title || e.dataset : e.binding?.field || e.text || e.nid;
|
|
26
|
-
return `${e.kind} · ${(r || String(t + 1)).replace(/\s+/g, " ").slice(0, 80)}`;
|
|
27
|
-
}
|
|
28
|
-
function Ae(e) {
|
|
29
|
-
const t = P(e), r = /* @__PURE__ */ new Map();
|
|
30
|
-
for (const i of t)
|
|
31
|
-
for (const l of i.fields) {
|
|
32
|
-
const a = /^\$\.template\.pages\[\d+\]\.components\[\d+\]/.exec(
|
|
33
|
-
l.path
|
|
34
|
-
)?.[0];
|
|
35
|
-
if (!a) continue;
|
|
36
|
-
const s = r.get(a) ?? [];
|
|
37
|
-
s.push({ ...l, dataset: i.dataset }), r.set(a, s);
|
|
38
|
-
}
|
|
39
|
-
const n = [];
|
|
40
|
-
return e.pages.forEach((i, l) => {
|
|
41
|
-
const a = `$.template.pages[${l}]`;
|
|
42
|
-
n.push({
|
|
43
|
-
path: a,
|
|
44
|
-
pageIndex: l,
|
|
45
|
-
kind: "page",
|
|
46
|
-
depth: 0,
|
|
47
|
-
title: typeof i.meta?.title == "string" ? i.meta.title : `${l + 1} · ${i.widthMm} × ${i.heightMm} mm`
|
|
48
|
-
}), i.components.forEach((s, o) => {
|
|
49
|
-
const d = `${a}.components[${o}]`, h = { pageIndex: l, componentIndex: o };
|
|
50
|
-
n.push({
|
|
51
|
-
path: d,
|
|
52
|
-
...h,
|
|
53
|
-
depth: 1,
|
|
54
|
-
kind: "component",
|
|
55
|
-
title: te(s, o)
|
|
56
|
-
}), s.kind === "list" && (s.columns.forEach(
|
|
57
|
-
(m, u) => n.push({
|
|
58
|
-
path: `${d}.columns[${u}].field`,
|
|
59
|
-
...h,
|
|
60
|
-
depth: 2,
|
|
61
|
-
kind: "field",
|
|
62
|
-
title: `${m.header} · ${m.field}`,
|
|
63
|
-
field: m.field,
|
|
64
|
-
dataset: s.dataset
|
|
65
|
-
})
|
|
66
|
-
), s.computed?.forEach(
|
|
67
|
-
(m, u) => n.push({
|
|
68
|
-
path: `${d}.computed[${u}]`,
|
|
69
|
-
...h,
|
|
70
|
-
depth: 2,
|
|
71
|
-
kind: "calculation",
|
|
72
|
-
title: m.field,
|
|
73
|
-
field: m.field,
|
|
74
|
-
dataset: s.dataset
|
|
75
|
-
})
|
|
76
|
-
));
|
|
77
|
-
const c = /* @__PURE__ */ new Set();
|
|
78
|
-
for (const m of r.get(d) ?? [])
|
|
79
|
-
/\.columns\[\d+\]\.field$/.test(m.path) || c.has(m.path) || (c.add(m.path), n.push({
|
|
80
|
-
...m,
|
|
81
|
-
...h,
|
|
82
|
-
depth: 2,
|
|
83
|
-
kind: "binding",
|
|
84
|
-
title: m.field
|
|
85
|
-
}));
|
|
86
|
-
});
|
|
87
|
-
}), n;
|
|
88
|
-
}
|
|
89
|
-
function x(e, t, r) {
|
|
90
|
-
let n = 0, i = e.length;
|
|
91
|
-
for (; n < i; ) {
|
|
92
|
-
const l = n + i >>> 1;
|
|
93
|
-
r(e[l]) < t ? n = l + 1 : i = l;
|
|
94
|
-
}
|
|
95
|
-
return n;
|
|
96
|
-
}
|
|
97
|
-
function L(e) {
|
|
98
|
-
if (![e.leftMm, e.topMm, e.widthMm, e.heightMm].every(Number.isFinite) || e.widthMm < 0 || e.heightMm < 0) throw new RangeError("Preview viewport must have finite coordinates and nonnegative dimensions.");
|
|
99
|
-
return e;
|
|
100
|
-
}
|
|
101
|
-
function ne(e) {
|
|
102
|
-
const t = e.rows.map(() => []);
|
|
103
|
-
for (const r of e.cells) {
|
|
104
|
-
const n = Math.min(t.length, r.ri + (r.cell.rowSpan ?? 1));
|
|
105
|
-
for (let i = r.ri; i < n; i++) t[i].push(r);
|
|
106
|
-
}
|
|
107
|
-
for (const r of t) r.sort((n, i) => n.xMm - i.xMm);
|
|
108
|
-
return {
|
|
109
|
-
cells(r) {
|
|
110
|
-
L(r);
|
|
111
|
-
const n = /* @__PURE__ */ new Set(), i = r.topMm + r.heightMm, l = r.leftMm + r.widthMm;
|
|
112
|
-
let a = x(e.rows, r.topMm, (s) => s.pos + s.size);
|
|
113
|
-
for (; a < t.length && e.rows[a].pos <= i; ) {
|
|
114
|
-
const s = t[a++];
|
|
115
|
-
let o = x(s, r.leftMm, (d) => d.xMm + d.widthMm);
|
|
116
|
-
for (; o < s.length && s[o].xMm <= l; ) n.add(s[o++]);
|
|
117
|
-
}
|
|
118
|
-
return [...n].sort((s, o) => s.ri - o.ri || s.ci - o.ci);
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
function re(e) {
|
|
123
|
-
const t = ["h", "v"].map((r) => e.filter((n) => n.kind === r).sort((n, i) => n.pos - i.pos));
|
|
124
|
-
return (r) => {
|
|
125
|
-
const n = [];
|
|
126
|
-
return t.forEach((i, l) => {
|
|
127
|
-
const a = l === 0 ? r.topMm : r.leftMm, s = a + (l === 0 ? r.heightMm : r.widthMm), o = l === 0 ? r.leftMm : r.topMm, d = o + (l === 0 ? r.widthMm : r.heightMm);
|
|
128
|
-
let h = x(i, a, (c) => c.pos);
|
|
129
|
-
for (; h < i.length && i[h].pos <= s; ) {
|
|
130
|
-
const c = i[h++];
|
|
131
|
-
c.to >= o && c.from <= d && n.push(c);
|
|
132
|
-
}
|
|
133
|
-
}), n;
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
function ie() {
|
|
137
|
-
const e = [];
|
|
138
|
-
return {
|
|
139
|
-
mount(t) {
|
|
140
|
-
e.push(ce(t));
|
|
141
|
-
},
|
|
142
|
-
update(t, r, n, i) {
|
|
143
|
-
L(t);
|
|
144
|
-
let l = !1;
|
|
145
|
-
for (const a of e) l = a.update(t, a.component === r ? n : void 0, i) || l;
|
|
146
|
-
return l;
|
|
147
|
-
}
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
function oe(e, t) {
|
|
151
|
-
const r = Math.max(8, e.widthMm / 4), n = Math.max(8, e.heightMm / 4);
|
|
152
|
-
return {
|
|
153
|
-
leftMm: e.leftMm - t.leftMm - r,
|
|
154
|
-
topMm: e.topMm - t.topMm - n,
|
|
155
|
-
widthMm: e.widthMm + 2 * r,
|
|
156
|
-
heightMm: e.heightMm + 2 * n
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
function le(e, t, r) {
|
|
160
|
-
let n = t.get(r);
|
|
161
|
-
return n || (n = e.table.ownerDocument.createElement("tr"), n.className = e.rowClass, n.setAttribute("role", "row"), n.setAttribute("aria-rowindex", String(r + 1)), n.style.cssText = "all:unset;display:contents;box-sizing:border-box", t.set(r, n)), n;
|
|
162
|
-
}
|
|
163
|
-
function ae(e, t, r, n) {
|
|
164
|
-
const i = new Set(t), l = new Set(t.map((o) => o.ri)), a = /* @__PURE__ */ new Map();
|
|
165
|
-
for (const [o, d] of r) if (!i.has(o)) {
|
|
166
|
-
d.remove(), r.delete(o);
|
|
167
|
-
const h = e.reuseKey?.(o);
|
|
168
|
-
if (h !== void 0) {
|
|
169
|
-
const c = a.get(h) ?? [];
|
|
170
|
-
c.push(d), a.set(h, c);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
for (const [o, d] of n) l.has(o) || (d.remove(), n.delete(o));
|
|
174
|
-
for (const o of t) {
|
|
175
|
-
let d = r.get(o);
|
|
176
|
-
if (!d) {
|
|
177
|
-
const c = e.reuseKey?.(o), m = c === void 0 ? void 0 : a.get(c)?.pop();
|
|
178
|
-
d = m && e.reuseCell?.(m, o) ? m : e.drawCell(o), d.setAttribute("aria-colindex", String(o.ci + 1)), r.set(o, d);
|
|
179
|
-
}
|
|
180
|
-
const h = le(e, n, o.ri);
|
|
181
|
-
d.parentElement !== h && h.appendChild(d);
|
|
182
|
-
}
|
|
183
|
-
const s = /* @__PURE__ */ new Map();
|
|
184
|
-
for (const o of t) {
|
|
185
|
-
const d = s.get(o.ri) ?? [];
|
|
186
|
-
d.push(r.get(o)), s.set(o.ri, d);
|
|
187
|
-
}
|
|
188
|
-
for (const [o, d] of s) A(n.get(o), d);
|
|
189
|
-
A(e.body, [...l].sort((o, d) => o - d).map((o) => n.get(o)));
|
|
190
|
-
}
|
|
191
|
-
function A(e, t) {
|
|
192
|
-
let r = e.firstElementChild;
|
|
193
|
-
for (const n of t)
|
|
194
|
-
n === r ? r = r.nextElementSibling : e.insertBefore(n, r);
|
|
195
|
-
}
|
|
196
|
-
function se(e, t) {
|
|
197
|
-
return e.table?.role === "header" ? e.heightMm : t.rows[0]?.size ?? 0;
|
|
198
|
-
}
|
|
199
|
-
function de(e, t, r, n) {
|
|
200
|
-
const i = [e], l = n.freezeHeaders && (r.table?.role === "header" || !r.table), a = se(r, t);
|
|
201
|
-
l && i.push({ ...e, topMm: 0, heightMm: Math.max(0, a - 1e-4) });
|
|
202
|
-
const s = Math.max(0, Math.min(20, Math.floor(n.frozenColumns ?? 0))) || 0;
|
|
203
|
-
if (!s || !t.columns.length) return i;
|
|
204
|
-
const o = t.columns[Math.min(s, t.columns.length) - 1], d = { ...e, leftMm: 0, widthMm: Math.max(0, o.pos + o.size - 1e-4) };
|
|
205
|
-
return i.push(d), l && i.push({ ...d, topMm: 0, heightMm: Math.max(0, a - 1e-4) }), i;
|
|
206
|
-
}
|
|
207
|
-
function ce(e) {
|
|
208
|
-
const t = D(e.grid, e.component.widthMm, e.component.heightMm), r = new Map(t.cells.map((h) => [`${h.ri}:${h.ci}`, h])), n = ne(t), i = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), a = re(H(t, e.component));
|
|
209
|
-
e.table.setAttribute("aria-rowcount", String(t.rows.length)), e.table.setAttribute("aria-colcount", String(t.columns.length));
|
|
210
|
-
let s = "", o = "";
|
|
211
|
-
function d(h, c) {
|
|
212
|
-
const m = /* @__PURE__ */ new Set();
|
|
213
|
-
for (const u of de(h, t, e.component, c ?? {})) for (const w of n.cells(u)) m.add(w);
|
|
214
|
-
return [...m];
|
|
215
|
-
}
|
|
216
|
-
return { component: e.component, update(h, c, m) {
|
|
217
|
-
const u = oe(h, e.component), w = d(u, m), M = c && r.get(`${c.rowIndex}:${c.columnIndex}`);
|
|
218
|
-
M && !w.includes(M) && w.push(M), w.sort((p, T) => p.ri - T.ri || p.ci - T.ci);
|
|
219
|
-
const C = w.map((p) => `${p.ri}:${p.ci}`).join(";"), S = a(u), v = S.map((p) => `${p.kind}:${p.pos}:${p.from}:${p.to}`).join(";"), E = C !== s, $ = v !== o;
|
|
220
|
-
return E && (s = C, ae(e, w, i, l)), $ && (o = v, e.edgeHost.replaceChildren(...e.drawEdges(S))), E || $;
|
|
221
|
-
} };
|
|
222
|
-
}
|
|
223
|
-
const I = /* @__PURE__ */ new WeakMap(), he = {
|
|
224
|
-
root: "mr-root",
|
|
225
|
-
page: "mr-page",
|
|
226
|
-
comp: "mr-comp",
|
|
227
|
-
text: "mr-text",
|
|
228
|
-
lines: "mr-lines",
|
|
229
|
-
line: "mr-line",
|
|
230
|
-
rich: "mr-rich",
|
|
231
|
-
paragraph: "mr-paragraph",
|
|
232
|
-
segment: "mr-segment",
|
|
233
|
-
image: "mr-image",
|
|
234
|
-
shape: "mr-shape",
|
|
235
|
-
grid: "mr-grid",
|
|
236
|
-
row: "mr-row",
|
|
237
|
-
cell: "mr-cell",
|
|
238
|
-
unknown: "mr-unknown"
|
|
239
|
-
};
|
|
240
|
-
function g(e, t) {
|
|
241
|
-
return t?.classNames?.[e] ?? he[e];
|
|
242
|
-
}
|
|
243
|
-
class me {
|
|
244
|
-
constructor() {
|
|
245
|
-
this.props = [];
|
|
246
|
-
}
|
|
247
|
-
add(t, r) {
|
|
248
|
-
return r == null || r === !1 || r === "" ? this : (this.props.push([t, String(r)]), this);
|
|
249
|
-
}
|
|
250
|
-
mm(t, r, n, i = 2) {
|
|
251
|
-
return this.add(t, `${b(y(r, n), i)}px`);
|
|
252
|
-
}
|
|
253
|
-
toString() {
|
|
254
|
-
let t = "";
|
|
255
|
-
for (const [r, n] of this.props)
|
|
256
|
-
t += `${r}:${n};`;
|
|
257
|
-
return t;
|
|
258
|
-
}
|
|
259
|
-
applyTo(t) {
|
|
260
|
-
const r = this.toString();
|
|
261
|
-
r && (t.style.cssText = r);
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
function f(e, t = "unset") {
|
|
265
|
-
return new me().add("all", t).add("display", e).add("box-sizing", "border-box");
|
|
266
|
-
}
|
|
267
|
-
function O(e, t, r) {
|
|
268
|
-
e.add("color", t.color).add("font-family", t.fontFamily).add("font-weight", t.bold != null ? t.bold ? "700" : "400" : void 0).add("font-style", t.italic != null ? t.italic ? "italic" : "normal" : void 0).add("text-decoration", t.underline != null ? t.underline ? "underline" : "none" : void 0).add("letter-spacing", t.letterSpacing != null ? `${t.letterSpacing}pt` : void 0).add("line-height", String(F(t))).add("text-align", t.align);
|
|
269
|
-
const n = k(t, r);
|
|
270
|
-
e.add("font-size", `${b(n.fontSizePx, 2)}px`);
|
|
271
|
-
}
|
|
272
|
-
function fe(e, t, r) {
|
|
273
|
-
const n = t.style ?? {};
|
|
274
|
-
O(e, n, r);
|
|
275
|
-
const i = !t.grid && (t.kind === "ellipse" || t.kind === "line");
|
|
276
|
-
e.add("background-color", i ? void 0 : n.backgroundColor).add("opacity", n.opacity != null ? String(n.opacity) : void 0).add("transform", n.rotateDeg ? `rotate(${n.rotateDeg}deg)` : void 0);
|
|
277
|
-
}
|
|
278
|
-
function N(e, t, r, n, i, l) {
|
|
279
|
-
const a = e.cell, s = l.createElement("td");
|
|
280
|
-
s.className = g("cell", i), B(s, e.ri, e.ci), s.setAttribute("role", t.table?.role === "header" ? "columnheader" : "cell"), a.colSpan && (s.colSpan = a.colSpan), a.rowSpan && (s.rowSpan = a.rowSpan);
|
|
281
|
-
const o = J(t.style, a), d = f("block").add("position", "absolute").mm("left", e.xMm, n).mm("top", e.yMm, n).mm("width", e.widthMm, n).mm("height", e.heightMm, n).add("background-color", o.backgroundColor).add("vertical-align", o.verticalAlign ?? "middle");
|
|
282
|
-
O(d, o, n), d.applyTo(s);
|
|
283
|
-
const h = U(a.dataBar, e.widthMm, e.heightMm, r);
|
|
284
|
-
if (h) {
|
|
285
|
-
const m = l.createElement("div");
|
|
286
|
-
m.className = "mr-cell-data-bar", m.setAttribute("aria-hidden", "true"), f("block").add("position", "absolute").mm("left", h.x, n).mm("top", h.y, n).mm("width", h.width, n).mm("height", h.height, n).add("background-color", h.color).add("opacity", "0.35").add("pointer-events", "none").applyTo(m), s.appendChild(m);
|
|
287
|
-
}
|
|
288
|
-
const c = l.createElement("div");
|
|
289
|
-
c.className = "mr-cell-content", f("flex").add("position", "absolute").mm("left", r + (a.indentMm ?? 0), n).mm("right", r, n).mm("top", r, n).mm("bottom", r, n).add("flex-direction", "column").add("justify-content", o.verticalAlign === "top" ? "flex-start" : o.verticalAlign === "bottom" ? "flex-end" : "center").add("overflow-wrap", "anywhere").add("overflow", "hidden").applyTo(c), a.richParagraphs?.length ? c.appendChild(R({ ...t, kind: "text", richParagraphs: a.richParagraphs }, n, i, l)) : a.text != null && c.append(a.text);
|
|
290
|
-
for (const m of a.children ?? []) c.appendChild(j(m, n, i, l));
|
|
291
|
-
return s.insertBefore(c, s.firstChild), s;
|
|
292
|
-
}
|
|
293
|
-
function ue(e, t, r, n) {
|
|
294
|
-
return V(H(e, t), r, n);
|
|
295
|
-
}
|
|
296
|
-
function ge(e, t) {
|
|
297
|
-
const r = e.cell;
|
|
298
|
-
if (!(r.children?.length || r.richParagraphs?.length || r.dataBar || (r.colSpan ?? 1) !== 1 || (r.rowSpan ?? 1) !== 1))
|
|
299
|
-
return JSON.stringify([r.style, r.indentMm, Y(t, r)]);
|
|
300
|
-
}
|
|
301
|
-
function pe(e, t, r) {
|
|
302
|
-
if (e.style.position !== "absolute" || e.style.zIndex || e.style.transform || e.children.length !== 1) return !1;
|
|
303
|
-
const n = e.firstElementChild;
|
|
304
|
-
return !(n instanceof HTMLElement) || n.className !== "mr-cell-content" ? !1 : (B(e, t.ri, t.ci), e.style.left = `${b(y(t.xMm, r), 2)}px`, e.style.top = `${b(y(t.yMm, r), 2)}px`, e.style.width = `${b(y(t.widthMm, r), 2)}px`, e.style.height = `${b(y(t.heightMm, r), 2)}px`, n.textContent = t.cell.text ?? "", !0);
|
|
305
|
-
}
|
|
306
|
-
function V(e, t, r) {
|
|
307
|
-
return e.map((n) => {
|
|
308
|
-
const i = `${b(n.widthPt * t / 72, 2)}px solid ${n.color}`, l = r.createElement("div");
|
|
309
|
-
l.className = "mr-grid-edge", l.setAttribute("aria-hidden", "true");
|
|
310
|
-
const a = n.kind === "h";
|
|
311
|
-
return f("block").add("position", "absolute").add("pointer-events", "none").mm("left", a ? n.from : n.pos, t).mm("top", a ? n.pos : n.from, t).mm("width", a ? n.to - n.from : 0, t).mm("height", a ? 0 : n.to - n.from, t).add(a ? "border-top" : "border-left", i).applyTo(l), l;
|
|
312
|
-
});
|
|
313
|
-
}
|
|
314
|
-
function be(e, t, r, n, i) {
|
|
315
|
-
const l = i.createElement("table");
|
|
316
|
-
l.className = g("grid", n), l.setAttribute("role", "table"), f("block").add("position", "relative").add("width", "100%").add("height", "100%").applyTo(l);
|
|
317
|
-
const a = i.createElement("tbody");
|
|
318
|
-
f("contents").applyTo(a), l.appendChild(a);
|
|
319
|
-
const s = t.style?.rotateDeg ? void 0 : I.get(n);
|
|
320
|
-
if (s) {
|
|
321
|
-
const c = i.createElement("div");
|
|
322
|
-
f("block").add("position", "relative").add("width", "100%").add("height", "100%").applyTo(c);
|
|
323
|
-
const m = i.createElement("div");
|
|
324
|
-
return f("contents").applyTo(m), m.setAttribute("aria-hidden", "true"), s.mount({
|
|
325
|
-
grid: e,
|
|
326
|
-
component: t,
|
|
327
|
-
table: l,
|
|
328
|
-
rowClass: g("row", n),
|
|
329
|
-
body: a,
|
|
330
|
-
edgeHost: m,
|
|
331
|
-
drawCell: (u) => N(u, t, e.paddingMm ?? 0.5, r, { ...n }, i),
|
|
332
|
-
reuseKey: (u) => ge(u, t.style),
|
|
333
|
-
reuseCell: (u, w) => pe(u, w, r),
|
|
334
|
-
drawEdges: (u) => V(u, r, i)
|
|
335
|
-
}), c.append(l, m), c;
|
|
336
|
-
}
|
|
337
|
-
const o = D(e, t.widthMm, t.heightMm), d = e.cells.map(() => {
|
|
338
|
-
const c = i.createElement("tr");
|
|
339
|
-
return c.className = g("row", n), c.setAttribute("role", "row"), f("contents").applyTo(c), a.appendChild(c), c;
|
|
340
|
-
});
|
|
341
|
-
for (const c of o.cells)
|
|
342
|
-
d[c.ri].appendChild(N(c, t, e.paddingMm ?? 0.5, r, n, i));
|
|
343
|
-
const h = i.createElement("div");
|
|
344
|
-
return f("block").add("position", "relative").add("width", "100%").add("height", "100%").applyTo(h), h.append(l, ...ue(o, t, r, i)), h;
|
|
345
|
-
}
|
|
346
|
-
function we(e, t, r, n) {
|
|
347
|
-
const i = n.createElement("div");
|
|
348
|
-
i.className = g("paragraph", r), f("block").add("text-align", e.align).add("line-height", e.lineHeight != null ? String(e.lineHeight) : void 0).mm("margin-top", e.spaceBeforeMm ?? 0, t).mm("margin-bottom", e.spaceAfterMm ?? 0, t).mm("text-indent", e.indentMm ?? 0, t).applyTo(i);
|
|
349
|
-
for (const l of e.segments || []) {
|
|
350
|
-
const a = n.createElement("span");
|
|
351
|
-
a.className = g("segment", r), a.textContent = l.kind === "field" ? l.field ?? "" : l.text ?? "";
|
|
352
|
-
const s = f("inline");
|
|
353
|
-
if (l.style) {
|
|
354
|
-
const o = l.style;
|
|
355
|
-
s.add("color", o.color).add("background-color", o.backgroundColor).add("font-family", o.fontFamily).add("line-height", o.lineHeight).add("letter-spacing", o.letterSpacing == null ? void 0 : `${o.letterSpacing * t / 72}px`).add("font-weight", o.bold != null ? o.bold ? "700" : "400" : void 0).add("font-style", o.italic != null ? o.italic ? "italic" : "normal" : void 0).add("text-decoration", o.underline != null ? o.underline ? "underline" : "none" : void 0), (o.fontSize != null || o.fontSizePx != null) && s.add("font-size", `${b(k(o, t).fontSizePx, 2)}px`);
|
|
356
|
-
}
|
|
357
|
-
s.applyTo(a), i.appendChild(a);
|
|
358
|
-
}
|
|
359
|
-
return i;
|
|
360
|
-
}
|
|
361
|
-
function R(e, t, r, n) {
|
|
362
|
-
if (X(e)) {
|
|
363
|
-
const i = n.createElement("div");
|
|
364
|
-
i.className = g("rich", r), f("block").applyTo(i);
|
|
365
|
-
for (const l of e.richParagraphs) i.appendChild(we(l, t, r, n));
|
|
366
|
-
return i;
|
|
367
|
-
}
|
|
368
|
-
if (Array.isArray(e.lines) && e.lines.length > 0) {
|
|
369
|
-
const i = n.createElement("div");
|
|
370
|
-
i.className = g("lines", r), f("block").applyTo(i);
|
|
371
|
-
for (const l of e.lines) {
|
|
372
|
-
const a = n.createElement("div");
|
|
373
|
-
a.className = g("line", r), a.textContent = l, f("block").add("white-space", "pre").add("min-height", "1lh").applyTo(a), i.appendChild(a);
|
|
374
|
-
}
|
|
375
|
-
return i;
|
|
376
|
-
}
|
|
377
|
-
return e.text ?? "";
|
|
378
|
-
}
|
|
379
|
-
function ye(e, t, r, n) {
|
|
380
|
-
const i = n.createElement("div");
|
|
381
|
-
i.className = g("text", r);
|
|
382
|
-
const l = e.style || {};
|
|
383
|
-
return f("flex").add("width", "100%").add("height", "100%").add("flex-direction", "column").add("justify-content", l.verticalAlign === "middle" ? "center" : l.verticalAlign === "bottom" ? "flex-end" : "flex-start").add("overflow-wrap", "anywhere").add("overflow", "hidden").applyTo(i), i.append(R(e, t, r, n)), i;
|
|
384
|
-
}
|
|
385
|
-
function Me(e, t, r) {
|
|
386
|
-
const n = r.createElement("img");
|
|
387
|
-
return n.className = g("image", t), n.src = e.imageData, f("block").add("width", "100%").add("height", "100%").add("object-fit", "contain").applyTo(n), n.alt = e.kind, n;
|
|
388
|
-
}
|
|
389
|
-
function z(e, t, r, n) {
|
|
390
|
-
const i = n.createElement("div");
|
|
391
|
-
i.className = g("shape", r);
|
|
392
|
-
const l = e.style || {}, a = G(l), s = W(l), o = `${b(a.widthPt * t / 72, 2)}px solid ${a.color}`, d = f("block");
|
|
393
|
-
return e.grid ? d.add("position", "relative") : e.kind === "rect" ? (s.top && d.add("border-top", o), s.right && d.add("border-right", o), s.bottom && d.add("border-bottom", o), s.left && d.add("border-left", o)) : e.kind === "ellipse" ? (d.add("border-radius", "50%"), s.inner && d.add("border", o), l.backgroundColor && d.add("background-color", l.backgroundColor)) : e.kind === "line" && d.add("height", "0").add("border-top", o), d.add("box-sizing", "border-box").add("width", "100%").add("height", "100%"), d.applyTo(i), i;
|
|
394
|
-
}
|
|
395
|
-
function xe(e, t, r) {
|
|
396
|
-
const n = r.createElementNS("http://www.w3.org/2000/svg", "svg"), i = y(e.widthMm, t), l = y(e.heightMm, t);
|
|
397
|
-
n.setAttribute("width", String(Math.max(1, i))), n.setAttribute("height", String(Math.max(1, l))), n.setAttribute("aria-hidden", "true"), n.style.overflow = "visible", n.style.display = "block";
|
|
398
|
-
const a = r.createElementNS("http://www.w3.org/2000/svg", "line");
|
|
399
|
-
a.setAttribute("x1", "0"), a.setAttribute("x2", String(i)), a.setAttribute("y1", e.lineDirection === "up" ? String(l) : "0"), a.setAttribute("y2", e.lineDirection === "up" ? "0" : String(l));
|
|
400
|
-
const s = G({ ...e.style, borderColor: e.style?.lineColor ?? e.style?.borderColor });
|
|
401
|
-
return a.setAttribute("stroke", s.color), a.setAttribute("stroke-width", String(s.widthPt * t / 72)), n.appendChild(a), n;
|
|
402
|
-
}
|
|
403
|
-
function j(e, t, r, n) {
|
|
404
|
-
const i = n.createElement("div");
|
|
405
|
-
i.className = `${g("comp", r)} mr-kind-${e.kind}`;
|
|
406
|
-
const l = f("block").add("position", "absolute").mm("left", e.leftMm, t).mm("top", e.topMm, t).mm("width", e.widthMm, t).mm("height", e.heightMm, t).add("box-sizing", "border-box");
|
|
407
|
-
if (fe(l, e, t), l.applyTo(i), _(e))
|
|
408
|
-
return i.appendChild(Me(e, r, n)), i;
|
|
409
|
-
if (e.kind === "text")
|
|
410
|
-
return i.appendChild(ye(e, t, r, n)), i;
|
|
411
|
-
if (e.grid) {
|
|
412
|
-
const s = z(e, t, r, n);
|
|
413
|
-
return s.appendChild(be(e.grid, e, t, r, n)), i.appendChild(s), i;
|
|
414
|
-
}
|
|
415
|
-
if (e.kind === "line" && e.lineDirection)
|
|
416
|
-
return i.appendChild(xe(e, t, n)), i;
|
|
417
|
-
if (e.kind === "line" || e.kind === "rect" || e.kind === "ellipse")
|
|
418
|
-
return i.appendChild(z(e, t, r, n)), i;
|
|
419
|
-
const a = n.createElement("div");
|
|
420
|
-
return a.className = g("unknown", r), f("block").applyTo(a), a.textContent = e.fallbackText ?? `[${e.kind}]`, a.dataset.mrUnsupported = e.kind, a.setAttribute("role", "note"), i.appendChild(a), i;
|
|
421
|
-
}
|
|
422
|
-
function K(e, t, r, n) {
|
|
423
|
-
const i = n.createElement("div");
|
|
424
|
-
return i.className = g("page", r), f("block", "initial").add("position", "relative").add("font-family", q).add("font-size", `${b(k(void 0, t).fontSizePx, 2)}px`).add("line-height", String(F(void 0))).add("white-space", "pre-wrap").add("direction", "ltr").mm("width", e.pageWidthMm, t).mm("height", e.pageHeightMm, t).add("background-color", "#fff").add("color", Q).add("overflow", "hidden").add("box-sizing", "border-box").applyTo(i), e.components.forEach((l, a) => {
|
|
425
|
-
const s = j(l, t, r, n);
|
|
426
|
-
s.dataset.mrComponentIndex = String(a), i.appendChild(s);
|
|
427
|
-
}), i;
|
|
428
|
-
}
|
|
429
|
-
function Ne(e, t, r = {}) {
|
|
430
|
-
const n = r.dpi ?? 96;
|
|
431
|
-
Z(e, "dom", r);
|
|
432
|
-
const i = t.createElement("div");
|
|
433
|
-
return i.className = g("root", r), f("block").applyTo(i), i.dataset.schemaVersion = e.schemaVersion, e.pages.forEach((l) => {
|
|
434
|
-
i.appendChild(K(l, n, r, t));
|
|
435
|
-
}), i;
|
|
436
|
-
}
|
|
437
|
-
function ze(e, t, r, n) {
|
|
438
|
-
const i = { ...r }, l = ie();
|
|
439
|
-
return I.set(i, l), { element: K(e, t, i, n), update(s, o, d) {
|
|
440
|
-
return l.update(s, o && e.components[o.componentIndex], o, d);
|
|
441
|
-
} };
|
|
442
|
-
}
|
|
443
|
-
export {
|
|
444
|
-
Ae as a,
|
|
445
|
-
ze as b,
|
|
446
|
-
g as c,
|
|
447
|
-
K as d,
|
|
448
|
-
Ne as e,
|
|
449
|
-
Te as i,
|
|
450
|
-
j as r,
|
|
451
|
-
ee as t
|
|
452
|
-
};
|