@worm-vue3-print/core 1.3.2 → 1.3.4
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/browser/index.cjs +48 -7
- package/dist/browser/index.d.cts +2 -2
- package/dist/browser/index.d.ts +2 -2
- package/dist/browser/index.js +1 -1
- package/dist/{chunk-B2XJSF4V.js → chunk-M4ZERK33.js} +1 -1
- package/dist/{chunk-BBSFBAWT.js → chunk-RZJ6AY6T.js} +54 -7
- package/dist/designer/index.cjs +38 -0
- package/dist/designer/index.d.cts +22 -4
- package/dist/designer/index.d.ts +22 -4
- package/dist/designer/index.js +8 -2
- package/dist/{driver-Dn_YAzO5.d.cts → driver-BMqI4QV-.d.cts} +11 -1
- package/dist/{driver-Dn_YAzO5.d.ts → driver-BMqI4QV-.d.ts} +11 -1
- package/dist/index.cjs +48 -7
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -2
- package/dist/node/index.d.cts +1 -1
- package/dist/node/index.d.ts +1 -1
- package/dist/{ports-Cf5sjwls.d.cts → ports-BL-PbuKG.d.cts} +1 -1
- package/dist/{ports-BvwlA_km.d.ts → ports-DmJos9Ce.d.ts} +1 -1
- package/package.json +1 -1
package/dist/browser/index.cjs
CHANGED
|
@@ -1972,13 +1972,14 @@ ${desc}.page-header {
|
|
|
1972
1972
|
|
|
1973
1973
|
/* \u2500\u2500 \u9875\u811A\uFF1A\u7EDD\u5BF9\u5B9A\u4F4D\u56FA\u5B9A\u5728\u9875\u9762\u5E95\u90E8\uFF08\u5185\u5BB9\u4E0D\u8DB3\u65F6\u4E0D\u968F\u6587\u6863\u6D41\u4E0A\u6D6E\uFF09 \u2500\u2500
|
|
1974
1974
|
\u7528\u663E\u5F0F top \u5B9A\u4F4D\u5230\u300C\u7EB8\u9AD8 - \u4E0B\u8FB9\u8DDD - \u9875\u811A\u9AD8\u300D\uFF0C\u4FDD\u8BC1\u4E0B\u8FB9\u8DDD\u751F\u6548\u3001
|
|
1975
|
-
\u4E0E\u8BBE\u8BA1\u5668 CanvasPaper \u7684\u4E09\u533A\u51E0\u4F55\u4E00\u81F4\u3002
|
|
1975
|
+
\u4E0E\u8BBE\u8BA1\u5668 CanvasPaper \u7684\u4E09\u533A\u51E0\u4F55\u4E00\u81F4\u3002
|
|
1976
|
+
\u7EDD\u5BF9\u5B9A\u4F4D\u7684\u5305\u542B\u5757\u662F padding box \u5916\u7F18\uFF08= \u7EB8\u9762\uFF09\uFF0Cleft \u987B\u663E\u5F0F\u8865\u5DE6\u8FB9\u8DDD\u3002 */
|
|
1976
1977
|
${desc}.page-footer {
|
|
1977
1978
|
width: ${mm(contentWidth)};
|
|
1978
1979
|
height: ${mm(footerH)};
|
|
1979
1980
|
position: absolute;
|
|
1980
1981
|
top: ${mm(paper.height - mb - footerH)};
|
|
1981
|
-
left:
|
|
1982
|
+
left: ${mm(ml)};
|
|
1982
1983
|
}
|
|
1983
1984
|
|
|
1984
1985
|
/* \u2500\u2500 \u5185\u5BB9\u533A \u2500\u2500 */
|
|
@@ -2108,6 +2109,35 @@ function elementPositionStyle(left, top, width, height, zIndex) {
|
|
|
2108
2109
|
return parts.join(";") + ";";
|
|
2109
2110
|
}
|
|
2110
2111
|
|
|
2112
|
+
// src/render/element-border.ts
|
|
2113
|
+
var ELEMENT_BORDER_SIDES = ["top", "right", "bottom", "left"];
|
|
2114
|
+
var SELF_BORDER_TYPES = /* @__PURE__ */ new Set(["rect", "oval", "hline", "vline", "table"]);
|
|
2115
|
+
var VALID_STYLES = /* @__PURE__ */ new Set(["solid", "dashed", "dotted", "double"]);
|
|
2116
|
+
function parseBorder(width, style, color) {
|
|
2117
|
+
if (typeof width !== "number" || !Number.isFinite(width) || width <= 0) return null;
|
|
2118
|
+
return {
|
|
2119
|
+
borderWidth: `${width}pt`,
|
|
2120
|
+
borderStyle: typeof style === "string" && VALID_STYLES.has(style) ? style : "solid",
|
|
2121
|
+
borderColor: color || "#000"
|
|
2122
|
+
};
|
|
2123
|
+
}
|
|
2124
|
+
function resolveElementBorder(type, opts) {
|
|
2125
|
+
if (!type || SELF_BORDER_TYPES.has(type)) return null;
|
|
2126
|
+
const all = parseBorder(opts?.borderWidth, opts?.borderStyle, opts?.borderColor);
|
|
2127
|
+
const edges = {};
|
|
2128
|
+
const src = opts?.borders;
|
|
2129
|
+
if (src) {
|
|
2130
|
+
for (const side of ELEMENT_BORDER_SIDES) {
|
|
2131
|
+
const edge = src[side];
|
|
2132
|
+
if (!edge) continue;
|
|
2133
|
+
const css = parseBorder(edge.width, edge.style, edge.color);
|
|
2134
|
+
if (css) edges[side] = css;
|
|
2135
|
+
}
|
|
2136
|
+
}
|
|
2137
|
+
if (!all && Object.keys(edges).length === 0) return null;
|
|
2138
|
+
return { all, edges };
|
|
2139
|
+
}
|
|
2140
|
+
|
|
2111
2141
|
// src/render/watermark.ts
|
|
2112
2142
|
var PX_PER_MM = 96 / 25.4;
|
|
2113
2143
|
var MM_PER_PX = 25.4 / 96;
|
|
@@ -2916,7 +2946,18 @@ function renderElement(el, isMeasure, containerStyle, overrideTop, ctx) {
|
|
|
2916
2946
|
const type = el.type || el.printElementType?.type || "text";
|
|
2917
2947
|
const fit = resolveElementTextFit(type, opts);
|
|
2918
2948
|
const fitHeight = fit === "autoHeight" ? void 0 : height;
|
|
2919
|
-
const
|
|
2949
|
+
const baseStyle = containerStyle ?? elementPositionStyle(left, top, width, fitHeight, opts.zIndex);
|
|
2950
|
+
const elBorders = resolveElementBorder(type, opts);
|
|
2951
|
+
let style = baseStyle;
|
|
2952
|
+
if (elBorders?.all) {
|
|
2953
|
+
style += `border:${elBorders.all.borderWidth} ${elBorders.all.borderStyle} ${elBorders.all.borderColor};`;
|
|
2954
|
+
}
|
|
2955
|
+
if (elBorders) {
|
|
2956
|
+
for (const side of ELEMENT_BORDER_SIDES) {
|
|
2957
|
+
const e = elBorders.edges[side];
|
|
2958
|
+
if (e) style += `border-${side}:${e.borderWidth} ${e.borderStyle} ${e.borderColor};`;
|
|
2959
|
+
}
|
|
2960
|
+
}
|
|
2920
2961
|
const measureAttr = isMeasure ? ` data-measure-id="${el.id}"` : "";
|
|
2921
2962
|
const fitAttr = fitAttrs(fit, el.id, opts.fontSize ?? 12, opts);
|
|
2922
2963
|
switch (type) {
|
|
@@ -2943,13 +2984,13 @@ function renderElement(el, isMeasure, containerStyle, overrideTop, ctx) {
|
|
|
2943
2984
|
</div>`;
|
|
2944
2985
|
}
|
|
2945
2986
|
case "hline":
|
|
2946
|
-
return `<div class="print-element" style="${style};border-top
|
|
2987
|
+
return `<div class="print-element" style="${style};border-top:${opts.borderWidth || 0.75}pt ${opts.borderStyle || "solid"} ${opts.borderColor || "#333"};height:0;"${measureAttr}></div>`;
|
|
2947
2988
|
case "vline":
|
|
2948
|
-
return `<div class="print-element" style="${style};border-left
|
|
2989
|
+
return `<div class="print-element" style="${style};border-left:${opts.borderWidth || 0.75}pt ${opts.borderStyle || "solid"} ${opts.borderColor || "#333"};width:0;"${measureAttr}></div>`;
|
|
2949
2990
|
case "rect":
|
|
2950
|
-
return `<div class="print-element" style="${style};border:${opts.borderWidth
|
|
2991
|
+
return `<div class="print-element" style="${style};border:${opts.borderWidth || 1}pt ${opts.borderStyle || "solid"} ${opts.borderColor || "#333"};"${measureAttr}></div>`;
|
|
2951
2992
|
case "oval":
|
|
2952
|
-
return `<div class="print-element" style="${style};border:${opts.borderWidth
|
|
2993
|
+
return `<div class="print-element" style="${style};border:${opts.borderWidth || 1}pt ${opts.borderStyle || "solid"} ${opts.borderColor || "#333"};border-radius:50%;"${measureAttr}></div>`;
|
|
2953
2994
|
case "longText":
|
|
2954
2995
|
return `<div class="print-element" style="${style}${textStyle(opts)}${elementFitStyle(fit, opts)}"${measureAttr}${fitAttr}>${esc(opts.formatter ?? opts.testData ?? "")}</div>`;
|
|
2955
2996
|
case "html":
|
package/dist/browser/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as PageLayout, T as TemplateData, M as MultiPageTemplateData, C as CodeRenderer, D as DriverFactory, R as RawMeasurement, a as CodeSpec } from '../driver-
|
|
2
|
-
import { P as PrintRuntime, F as FitFontSize } from '../ports-
|
|
1
|
+
import { P as PageLayout, T as TemplateData, M as MultiPageTemplateData, C as CodeRenderer, D as DriverFactory, R as RawMeasurement, a as CodeSpec } from '../driver-BMqI4QV-.cjs';
|
|
2
|
+
import { P as PrintRuntime, F as FitFontSize } from '../ports-BL-PbuKG.cjs';
|
|
3
3
|
|
|
4
4
|
interface BrowserRenderResult {
|
|
5
5
|
/** 最终多页 HTML 字符串 */
|
package/dist/browser/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as PageLayout, T as TemplateData, M as MultiPageTemplateData, C as CodeRenderer, D as DriverFactory, R as RawMeasurement, a as CodeSpec } from '../driver-
|
|
2
|
-
import { P as PrintRuntime, F as FitFontSize } from '../ports-
|
|
1
|
+
import { P as PageLayout, T as TemplateData, M as MultiPageTemplateData, C as CodeRenderer, D as DriverFactory, R as RawMeasurement, a as CodeSpec } from '../driver-BMqI4QV-.js';
|
|
2
|
+
import { P as PrintRuntime, F as FitFontSize } from '../ports-DmJos9Ce.js';
|
|
3
3
|
|
|
4
4
|
interface BrowserRenderResult {
|
|
5
5
|
/** 最终多页 HTML 字符串 */
|
package/dist/browser/index.js
CHANGED
|
@@ -1380,13 +1380,14 @@ ${desc}.page-header {
|
|
|
1380
1380
|
|
|
1381
1381
|
/* \u2500\u2500 \u9875\u811A\uFF1A\u7EDD\u5BF9\u5B9A\u4F4D\u56FA\u5B9A\u5728\u9875\u9762\u5E95\u90E8\uFF08\u5185\u5BB9\u4E0D\u8DB3\u65F6\u4E0D\u968F\u6587\u6863\u6D41\u4E0A\u6D6E\uFF09 \u2500\u2500
|
|
1382
1382
|
\u7528\u663E\u5F0F top \u5B9A\u4F4D\u5230\u300C\u7EB8\u9AD8 - \u4E0B\u8FB9\u8DDD - \u9875\u811A\u9AD8\u300D\uFF0C\u4FDD\u8BC1\u4E0B\u8FB9\u8DDD\u751F\u6548\u3001
|
|
1383
|
-
\u4E0E\u8BBE\u8BA1\u5668 CanvasPaper \u7684\u4E09\u533A\u51E0\u4F55\u4E00\u81F4\u3002
|
|
1383
|
+
\u4E0E\u8BBE\u8BA1\u5668 CanvasPaper \u7684\u4E09\u533A\u51E0\u4F55\u4E00\u81F4\u3002
|
|
1384
|
+
\u7EDD\u5BF9\u5B9A\u4F4D\u7684\u5305\u542B\u5757\u662F padding box \u5916\u7F18\uFF08= \u7EB8\u9762\uFF09\uFF0Cleft \u987B\u663E\u5F0F\u8865\u5DE6\u8FB9\u8DDD\u3002 */
|
|
1384
1385
|
${desc}.page-footer {
|
|
1385
1386
|
width: ${mm(contentWidth)};
|
|
1386
1387
|
height: ${mm(footerH)};
|
|
1387
1388
|
position: absolute;
|
|
1388
1389
|
top: ${mm(paper.height - mb - footerH)};
|
|
1389
|
-
left:
|
|
1390
|
+
left: ${mm(ml)};
|
|
1390
1391
|
}
|
|
1391
1392
|
|
|
1392
1393
|
/* \u2500\u2500 \u5185\u5BB9\u533A \u2500\u2500 */
|
|
@@ -1589,6 +1590,38 @@ function cellFitCapMm(rows, rowIndex, cell, defaultPadding = 1) {
|
|
|
1589
1590
|
return Math.max(height - padding * 2 - borderMm, 0.5);
|
|
1590
1591
|
}
|
|
1591
1592
|
|
|
1593
|
+
// src/render/element-border.ts
|
|
1594
|
+
var ELEMENT_BORDER_SIDES = ["top", "right", "bottom", "left"];
|
|
1595
|
+
var SELF_BORDER_TYPES = /* @__PURE__ */ new Set(["rect", "oval", "hline", "vline", "table"]);
|
|
1596
|
+
function acceptsElementBorder(type) {
|
|
1597
|
+
return !!type && !SELF_BORDER_TYPES.has(type);
|
|
1598
|
+
}
|
|
1599
|
+
var VALID_STYLES = /* @__PURE__ */ new Set(["solid", "dashed", "dotted", "double"]);
|
|
1600
|
+
function parseBorder(width, style, color) {
|
|
1601
|
+
if (typeof width !== "number" || !Number.isFinite(width) || width <= 0) return null;
|
|
1602
|
+
return {
|
|
1603
|
+
borderWidth: `${width}pt`,
|
|
1604
|
+
borderStyle: typeof style === "string" && VALID_STYLES.has(style) ? style : "solid",
|
|
1605
|
+
borderColor: color || "#000"
|
|
1606
|
+
};
|
|
1607
|
+
}
|
|
1608
|
+
function resolveElementBorder(type, opts) {
|
|
1609
|
+
if (!type || SELF_BORDER_TYPES.has(type)) return null;
|
|
1610
|
+
const all = parseBorder(opts?.borderWidth, opts?.borderStyle, opts?.borderColor);
|
|
1611
|
+
const edges = {};
|
|
1612
|
+
const src = opts?.borders;
|
|
1613
|
+
if (src) {
|
|
1614
|
+
for (const side of ELEMENT_BORDER_SIDES) {
|
|
1615
|
+
const edge = src[side];
|
|
1616
|
+
if (!edge) continue;
|
|
1617
|
+
const css = parseBorder(edge.width, edge.style, edge.color);
|
|
1618
|
+
if (css) edges[side] = css;
|
|
1619
|
+
}
|
|
1620
|
+
}
|
|
1621
|
+
if (!all && Object.keys(edges).length === 0) return null;
|
|
1622
|
+
return { all, edges };
|
|
1623
|
+
}
|
|
1624
|
+
|
|
1592
1625
|
// src/render/watermark.ts
|
|
1593
1626
|
var PX_PER_MM = 96 / 25.4;
|
|
1594
1627
|
var MM_PER_PX = 25.4 / 96;
|
|
@@ -2456,7 +2489,18 @@ function renderElement(el, isMeasure, containerStyle, overrideTop, ctx) {
|
|
|
2456
2489
|
const type = el.type || el.printElementType?.type || "text";
|
|
2457
2490
|
const fit = resolveElementTextFit(type, opts);
|
|
2458
2491
|
const fitHeight = fit === "autoHeight" ? void 0 : height;
|
|
2459
|
-
const
|
|
2492
|
+
const baseStyle = containerStyle ?? elementPositionStyle(left, top, width, fitHeight, opts.zIndex);
|
|
2493
|
+
const elBorders = resolveElementBorder(type, opts);
|
|
2494
|
+
let style = baseStyle;
|
|
2495
|
+
if (elBorders?.all) {
|
|
2496
|
+
style += `border:${elBorders.all.borderWidth} ${elBorders.all.borderStyle} ${elBorders.all.borderColor};`;
|
|
2497
|
+
}
|
|
2498
|
+
if (elBorders) {
|
|
2499
|
+
for (const side of ELEMENT_BORDER_SIDES) {
|
|
2500
|
+
const e = elBorders.edges[side];
|
|
2501
|
+
if (e) style += `border-${side}:${e.borderWidth} ${e.borderStyle} ${e.borderColor};`;
|
|
2502
|
+
}
|
|
2503
|
+
}
|
|
2460
2504
|
const measureAttr = isMeasure ? ` data-measure-id="${el.id}"` : "";
|
|
2461
2505
|
const fitAttr = fitAttrs(fit, el.id, opts.fontSize ?? 12, opts);
|
|
2462
2506
|
switch (type) {
|
|
@@ -2483,13 +2527,13 @@ function renderElement(el, isMeasure, containerStyle, overrideTop, ctx) {
|
|
|
2483
2527
|
</div>`;
|
|
2484
2528
|
}
|
|
2485
2529
|
case "hline":
|
|
2486
|
-
return `<div class="print-element" style="${style};border-top
|
|
2530
|
+
return `<div class="print-element" style="${style};border-top:${opts.borderWidth || 0.75}pt ${opts.borderStyle || "solid"} ${opts.borderColor || "#333"};height:0;"${measureAttr}></div>`;
|
|
2487
2531
|
case "vline":
|
|
2488
|
-
return `<div class="print-element" style="${style};border-left
|
|
2532
|
+
return `<div class="print-element" style="${style};border-left:${opts.borderWidth || 0.75}pt ${opts.borderStyle || "solid"} ${opts.borderColor || "#333"};width:0;"${measureAttr}></div>`;
|
|
2489
2533
|
case "rect":
|
|
2490
|
-
return `<div class="print-element" style="${style};border:${opts.borderWidth
|
|
2534
|
+
return `<div class="print-element" style="${style};border:${opts.borderWidth || 1}pt ${opts.borderStyle || "solid"} ${opts.borderColor || "#333"};"${measureAttr}></div>`;
|
|
2491
2535
|
case "oval":
|
|
2492
|
-
return `<div class="print-element" style="${style};border:${opts.borderWidth
|
|
2536
|
+
return `<div class="print-element" style="${style};border:${opts.borderWidth || 1}pt ${opts.borderStyle || "solid"} ${opts.borderColor || "#333"};border-radius:50%;"${measureAttr}></div>`;
|
|
2493
2537
|
case "longText":
|
|
2494
2538
|
return `<div class="print-element" style="${style}${textStyle(opts)}${elementFitStyle(fit, opts)}"${measureAttr}${fitAttr}>${esc(opts.formatter ?? opts.testData ?? "")}</div>`;
|
|
2495
2539
|
case "html":
|
|
@@ -3748,6 +3792,9 @@ export {
|
|
|
3748
3792
|
parseCellFitKey,
|
|
3749
3793
|
cellFitWidthMm,
|
|
3750
3794
|
cellFitCapMm,
|
|
3795
|
+
ELEMENT_BORDER_SIDES,
|
|
3796
|
+
acceptsElementBorder,
|
|
3797
|
+
resolveElementBorder,
|
|
3751
3798
|
PX_PER_MM,
|
|
3752
3799
|
MM_PER_PX,
|
|
3753
3800
|
WATERMARK_DEFAULTS,
|
package/dist/designer/index.cjs
CHANGED
|
@@ -28,6 +28,7 @@ __export(designer_exports, {
|
|
|
28
28
|
DEFAULT_DEMO_DATA: () => DEFAULT_DEMO_DATA,
|
|
29
29
|
DEFAULT_SHRINK_MIN_FONT_SIZE_PT: () => DEFAULT_SHRINK_MIN_FONT_SIZE_PT,
|
|
30
30
|
ELEMENT_BINDING_REGISTRY: () => ELEMENT_BINDING_REGISTRY,
|
|
31
|
+
ELEMENT_BORDER_SIDES: () => ELEMENT_BORDER_SIDES,
|
|
31
32
|
EXTENDED_FUNCTIONS: () => EXTENDED_FUNCTIONS,
|
|
32
33
|
FIT_SCALE_MIN_PERCENT: () => FIT_SCALE_MIN_PERCENT,
|
|
33
34
|
GHOST_BORDER_CSS: () => GHOST_BORDER_CSS,
|
|
@@ -42,6 +43,7 @@ __export(designer_exports, {
|
|
|
42
43
|
RESIZE_POINTS: () => RESIZE_POINTS,
|
|
43
44
|
RULER_THICKNESS: () => RULER_THICKNESS,
|
|
44
45
|
ZONE_ALLOWED_TYPES: () => ZONE_ALLOWED_TYPES,
|
|
46
|
+
acceptsElementBorder: () => acceptsElementBorder,
|
|
45
47
|
applyBorderPreset: () => applyBorderPreset,
|
|
46
48
|
barcodeAvailableBoxMm: () => barcodeAvailableBoxMm,
|
|
47
49
|
barcodePreferredModuleWidthMm: () => barcodePreferredModuleWidthMm,
|
|
@@ -100,6 +102,7 @@ __export(designer_exports, {
|
|
|
100
102
|
resolveBarcodeSize: () => resolveBarcodeSize,
|
|
101
103
|
resolveCellBorderCss: () => resolveCellBorderCss,
|
|
102
104
|
resolveCellTextFit: () => resolveCellTextFit,
|
|
105
|
+
resolveElementBorder: () => resolveElementBorder,
|
|
103
106
|
resolveElementTextFit: () => resolveElementTextFit,
|
|
104
107
|
resolveShrinkMinFontSize: () => resolveShrinkMinFontSize,
|
|
105
108
|
resolveTextBinding: () => resolveTextBinding,
|
|
@@ -246,6 +249,38 @@ function resolveBarcodeSize(input) {
|
|
|
246
249
|
};
|
|
247
250
|
}
|
|
248
251
|
|
|
252
|
+
// src/render/element-border.ts
|
|
253
|
+
var ELEMENT_BORDER_SIDES = ["top", "right", "bottom", "left"];
|
|
254
|
+
var SELF_BORDER_TYPES = /* @__PURE__ */ new Set(["rect", "oval", "hline", "vline", "table"]);
|
|
255
|
+
function acceptsElementBorder(type) {
|
|
256
|
+
return !!type && !SELF_BORDER_TYPES.has(type);
|
|
257
|
+
}
|
|
258
|
+
var VALID_STYLES = /* @__PURE__ */ new Set(["solid", "dashed", "dotted", "double"]);
|
|
259
|
+
function parseBorder(width, style, color) {
|
|
260
|
+
if (typeof width !== "number" || !Number.isFinite(width) || width <= 0) return null;
|
|
261
|
+
return {
|
|
262
|
+
borderWidth: `${width}pt`,
|
|
263
|
+
borderStyle: typeof style === "string" && VALID_STYLES.has(style) ? style : "solid",
|
|
264
|
+
borderColor: color || "#000"
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
function resolveElementBorder(type, opts) {
|
|
268
|
+
if (!type || SELF_BORDER_TYPES.has(type)) return null;
|
|
269
|
+
const all = parseBorder(opts?.borderWidth, opts?.borderStyle, opts?.borderColor);
|
|
270
|
+
const edges = {};
|
|
271
|
+
const src = opts?.borders;
|
|
272
|
+
if (src) {
|
|
273
|
+
for (const side of ELEMENT_BORDER_SIDES) {
|
|
274
|
+
const edge = src[side];
|
|
275
|
+
if (!edge) continue;
|
|
276
|
+
const css = parseBorder(edge.width, edge.style, edge.color);
|
|
277
|
+
if (css) edges[side] = css;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
if (!all && Object.keys(edges).length === 0) return null;
|
|
281
|
+
return { all, edges };
|
|
282
|
+
}
|
|
283
|
+
|
|
249
284
|
// src/designer/utils/scale.ts
|
|
250
285
|
var MIN_SCALE_PERCENT = 25;
|
|
251
286
|
var FIT_SCALE_MIN_PERCENT = 5;
|
|
@@ -2735,6 +2770,7 @@ function useBindingDisplay() {
|
|
|
2735
2770
|
DEFAULT_DEMO_DATA,
|
|
2736
2771
|
DEFAULT_SHRINK_MIN_FONT_SIZE_PT,
|
|
2737
2772
|
ELEMENT_BINDING_REGISTRY,
|
|
2773
|
+
ELEMENT_BORDER_SIDES,
|
|
2738
2774
|
EXTENDED_FUNCTIONS,
|
|
2739
2775
|
FIT_SCALE_MIN_PERCENT,
|
|
2740
2776
|
GHOST_BORDER_CSS,
|
|
@@ -2749,6 +2785,7 @@ function useBindingDisplay() {
|
|
|
2749
2785
|
RESIZE_POINTS,
|
|
2750
2786
|
RULER_THICKNESS,
|
|
2751
2787
|
ZONE_ALLOWED_TYPES,
|
|
2788
|
+
acceptsElementBorder,
|
|
2752
2789
|
applyBorderPreset,
|
|
2753
2790
|
barcodeAvailableBoxMm,
|
|
2754
2791
|
barcodePreferredModuleWidthMm,
|
|
@@ -2807,6 +2844,7 @@ function useBindingDisplay() {
|
|
|
2807
2844
|
resolveBarcodeSize,
|
|
2808
2845
|
resolveCellBorderCss,
|
|
2809
2846
|
resolveCellTextFit,
|
|
2847
|
+
resolveElementBorder,
|
|
2810
2848
|
resolveElementTextFit,
|
|
2811
2849
|
resolveShrinkMinFontSize,
|
|
2812
2850
|
resolveTextBinding,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { b as
|
|
2
|
-
export {
|
|
3
|
-
export { C as CellFitRowKind, D as DEFAULT_SHRINK_MIN_FONT_SIZE_PT, F as FitFontSize, M as MIN_SHRINK_FONT_SIZE_PT, c as cellFitCapMm, a as cellFitKey, b as cellFitWidthMm, f as floorFontSize, p as parseCellFitKey, r as resolveCellTextFit, d as resolveElementTextFit, e as resolveShrinkMinFontSize, g as roundFontSize } from '../ports-
|
|
1
|
+
import { E as ElementBorderSide, b as ElementOptions, c as TemplateData, d as TableRow, e as TableCellBorder, f as TableCell, g as TableRowType, h as ElementType, i as RuntimeElement, j as ElementZone, k as PrintBusinessField, B as BindingDescriptor, l as ElementRect, A as AdsorbResult, m as ResizePoint } from '../driver-BMqI4QV-.cjs';
|
|
2
|
+
export { n as AlignLine, o as DesignBackground, p as ElementBorderEdge, q as ElementFieldBinding, r as MultiPageTemplateData, s as PaginationConfig, t as PaperSize, u as PrintElementData, v as PrintElementTypeMeta, w as RequestScreenshotFn, S as ScreenshotRequest, x as TableCellBorders, y as TableCellType, z as TablePaginationConfig, F as TableSelection, G as TemplateElement, H as TextAlign, I as TextFit, U as UploadDesignBackgroundFn, J as UploadImageFn, V as VerticalAlign, W as WatermarkOptions } from '../driver-BMqI4QV-.cjs';
|
|
3
|
+
export { C as CellFitRowKind, D as DEFAULT_SHRINK_MIN_FONT_SIZE_PT, F as FitFontSize, M as MIN_SHRINK_FONT_SIZE_PT, c as cellFitCapMm, a as cellFitKey, b as cellFitWidthMm, f as floorFontSize, p as parseCellFitKey, r as resolveCellTextFit, d as resolveElementTextFit, e as resolveShrinkMinFontSize, g as roundFontSize } from '../ports-BL-PbuKG.cjs';
|
|
4
4
|
import { TemplateEngine, formatMoney, ifFn, addNumbers, subtractNumbers, multiplyNumbers, divideNumbers, round, roundUp, roundDown, roundHalfEven, formatDate, toUpperCaseAmount } from '../index.cjs';
|
|
5
5
|
|
|
6
6
|
/** 1 英寸 = 25.4mm */
|
|
@@ -64,6 +64,24 @@ declare function barcodeAvailableBoxMm(boxMm: number | undefined, maxMm: number
|
|
|
64
64
|
*/
|
|
65
65
|
declare function resolveBarcodeSize(input: BarcodeSizeInput): BarcodeSize;
|
|
66
66
|
|
|
67
|
+
interface ElementBorderCss {
|
|
68
|
+
/** CSS 长度,pt 口径(与 rect/oval、单元格边框一致) */
|
|
69
|
+
borderWidth: string;
|
|
70
|
+
borderStyle: string;
|
|
71
|
+
borderColor: string;
|
|
72
|
+
}
|
|
73
|
+
/** 元素级边框解析结果:整圈 + 逐边覆盖(渲染时先写整圈、后写各边,CSS 后者覆盖前者) */
|
|
74
|
+
interface ElementBordersCss {
|
|
75
|
+
all: ElementBorderCss | null;
|
|
76
|
+
edges: Partial<Record<ElementBorderSide, ElementBorderCss>>;
|
|
77
|
+
}
|
|
78
|
+
declare const ELEMENT_BORDER_SIDES: readonly ElementBorderSide[];
|
|
79
|
+
/** 该元素类型是否可携带元素级边框(供设计器格式刷等按类型过滤写入目标) */
|
|
80
|
+
declare function acceptsElementBorder(type: string | undefined): boolean;
|
|
81
|
+
type BorderFields = Pick<ElementOptions, 'borderWidth' | 'borderStyle' | 'borderColor' | 'borders'>;
|
|
82
|
+
/** 解析元素级边框;返回 null 表示无任何生效边框 */
|
|
83
|
+
declare function resolveElementBorder(type: string | undefined, opts: BorderFields | undefined): ElementBordersCss | null;
|
|
84
|
+
|
|
67
85
|
/** pt 转 mm */
|
|
68
86
|
declare function ptToMm(pt: number): number;
|
|
69
87
|
/** px 转 mm(基于 96dpi 屏幕) */
|
|
@@ -460,4 +478,4 @@ declare function useBindingDisplay(): {
|
|
|
460
478
|
getBindingDisplayState: (element: any) => BindingDisplayState;
|
|
461
479
|
};
|
|
462
480
|
|
|
463
|
-
export { type AdsorbConfig, AdsorbResult, type AlignMode, BARCODE_BAR_HEIGHT_MODULES, BARCODE_MARGIN_BOTTOM_MODULES, BARCODE_MODULE_WIDTH_MM, BARCODE_QUIET_ZONE_MODULES, BARCODE_TEXT_FONT_SIZE_MODULES, type BarcodeSize, type BarcodeSizeInput, BindingDescriptor, type BorderPreset, type CellRect, DEFAULT_DEMO_DATA, ELEMENT_BINDING_REGISTRY, EXTENDED_FUNCTIONS, ElementOptions, ElementRect, ElementType, ElementZone, FIT_SCALE_MIN_PERCENT, type FieldGroup, GHOST_BORDER_CSS, type KeyboardHandlers, LABEL_PAPER_GROUP, MIN_COL_WIDTH_MM, MIN_SCALE_PERCENT, MM_PER_INCH, type ManualGuides, PAPER_PRESETS, PRESET_COLORS, PROPERTY_REGISTRY, type PaperPreset, PrintBusinessField, type PropertyGroupDef, type PropertyItem, RESIZE_POINTS, RULER_THICKNESS, type ResizeOptions, ResizePoint, type ResizeRect, type RulerTick, RuntimeElement, TableCell, TableCellBorder, TableRow, TableRowType, TemplateData, ZONE_ALLOWED_TYPES, type ZoneRectPt, applyBorderPreset, barcodeAvailableBoxMm, barcodePreferredModuleWidthMm, barcodeUnitsPerModule, buildRulerTicks, calcResizeRect, canMergeReason, chooseMajorStepMM, clampResizedColumnWidth, clampScalePercent, clampToZone, computeAdsorb, computeFitScale, createCell, createDefaultOptions, createDefaultTable, createFieldElement, createRuntimeElement, deleteCol, deleteRow, engine, evaluateTemplate, filterGroups, finalizeElementZone, findMainCell, generateGroupId, generateId, getDemoData, getElementBindings, getPaperDimensions, getPaperSizeMM, getSpanRect, getTableCellBindings, getZoneRects, groupFields, insertCol, insertRow, isContinuousPaperSize, isLabelPaperSize, labelPaperDefaults, matchKeywords, mergeCells, minorStepMM, mmToPx, nextWheelScale, normalizeSelection, normalizeTemplateUnits, ptToMm, pxToMm, resolveBarcodeDesignValue, resolveBarcodeSize, resolveCellBorderCss, resolveTextBinding, safeEval, searchProperties, setHeaderRepeat, setRowType, splitCells, syncTableElementSize, useAlign, useBindingDisplay, useGroup, useKeyboard, useResize, zoneFromPaperPoint };
|
|
481
|
+
export { type AdsorbConfig, AdsorbResult, type AlignMode, BARCODE_BAR_HEIGHT_MODULES, BARCODE_MARGIN_BOTTOM_MODULES, BARCODE_MODULE_WIDTH_MM, BARCODE_QUIET_ZONE_MODULES, BARCODE_TEXT_FONT_SIZE_MODULES, type BarcodeSize, type BarcodeSizeInput, BindingDescriptor, type BorderPreset, type CellRect, DEFAULT_DEMO_DATA, ELEMENT_BINDING_REGISTRY, ELEMENT_BORDER_SIDES, EXTENDED_FUNCTIONS, type ElementBorderCss, ElementBorderSide, type ElementBordersCss, ElementOptions, ElementRect, ElementType, ElementZone, FIT_SCALE_MIN_PERCENT, type FieldGroup, GHOST_BORDER_CSS, type KeyboardHandlers, LABEL_PAPER_GROUP, MIN_COL_WIDTH_MM, MIN_SCALE_PERCENT, MM_PER_INCH, type ManualGuides, PAPER_PRESETS, PRESET_COLORS, PROPERTY_REGISTRY, type PaperPreset, PrintBusinessField, type PropertyGroupDef, type PropertyItem, RESIZE_POINTS, RULER_THICKNESS, type ResizeOptions, ResizePoint, type ResizeRect, type RulerTick, RuntimeElement, TableCell, TableCellBorder, TableRow, TableRowType, TemplateData, ZONE_ALLOWED_TYPES, type ZoneRectPt, acceptsElementBorder, applyBorderPreset, barcodeAvailableBoxMm, barcodePreferredModuleWidthMm, barcodeUnitsPerModule, buildRulerTicks, calcResizeRect, canMergeReason, chooseMajorStepMM, clampResizedColumnWidth, clampScalePercent, clampToZone, computeAdsorb, computeFitScale, createCell, createDefaultOptions, createDefaultTable, createFieldElement, createRuntimeElement, deleteCol, deleteRow, engine, evaluateTemplate, filterGroups, finalizeElementZone, findMainCell, generateGroupId, generateId, getDemoData, getElementBindings, getPaperDimensions, getPaperSizeMM, getSpanRect, getTableCellBindings, getZoneRects, groupFields, insertCol, insertRow, isContinuousPaperSize, isLabelPaperSize, labelPaperDefaults, matchKeywords, mergeCells, minorStepMM, mmToPx, nextWheelScale, normalizeSelection, normalizeTemplateUnits, ptToMm, pxToMm, resolveBarcodeDesignValue, resolveBarcodeSize, resolveCellBorderCss, resolveElementBorder, resolveTextBinding, safeEval, searchProperties, setHeaderRepeat, setRowType, splitCells, syncTableElementSize, useAlign, useBindingDisplay, useGroup, useKeyboard, useResize, zoneFromPaperPoint };
|
package/dist/designer/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { b as
|
|
2
|
-
export {
|
|
3
|
-
export { C as CellFitRowKind, D as DEFAULT_SHRINK_MIN_FONT_SIZE_PT, F as FitFontSize, M as MIN_SHRINK_FONT_SIZE_PT, c as cellFitCapMm, a as cellFitKey, b as cellFitWidthMm, f as floorFontSize, p as parseCellFitKey, r as resolveCellTextFit, d as resolveElementTextFit, e as resolveShrinkMinFontSize, g as roundFontSize } from '../ports-
|
|
1
|
+
import { E as ElementBorderSide, b as ElementOptions, c as TemplateData, d as TableRow, e as TableCellBorder, f as TableCell, g as TableRowType, h as ElementType, i as RuntimeElement, j as ElementZone, k as PrintBusinessField, B as BindingDescriptor, l as ElementRect, A as AdsorbResult, m as ResizePoint } from '../driver-BMqI4QV-.js';
|
|
2
|
+
export { n as AlignLine, o as DesignBackground, p as ElementBorderEdge, q as ElementFieldBinding, r as MultiPageTemplateData, s as PaginationConfig, t as PaperSize, u as PrintElementData, v as PrintElementTypeMeta, w as RequestScreenshotFn, S as ScreenshotRequest, x as TableCellBorders, y as TableCellType, z as TablePaginationConfig, F as TableSelection, G as TemplateElement, H as TextAlign, I as TextFit, U as UploadDesignBackgroundFn, J as UploadImageFn, V as VerticalAlign, W as WatermarkOptions } from '../driver-BMqI4QV-.js';
|
|
3
|
+
export { C as CellFitRowKind, D as DEFAULT_SHRINK_MIN_FONT_SIZE_PT, F as FitFontSize, M as MIN_SHRINK_FONT_SIZE_PT, c as cellFitCapMm, a as cellFitKey, b as cellFitWidthMm, f as floorFontSize, p as parseCellFitKey, r as resolveCellTextFit, d as resolveElementTextFit, e as resolveShrinkMinFontSize, g as roundFontSize } from '../ports-DmJos9Ce.js';
|
|
4
4
|
import { TemplateEngine, formatMoney, ifFn, addNumbers, subtractNumbers, multiplyNumbers, divideNumbers, round, roundUp, roundDown, roundHalfEven, formatDate, toUpperCaseAmount } from '../index.js';
|
|
5
5
|
|
|
6
6
|
/** 1 英寸 = 25.4mm */
|
|
@@ -64,6 +64,24 @@ declare function barcodeAvailableBoxMm(boxMm: number | undefined, maxMm: number
|
|
|
64
64
|
*/
|
|
65
65
|
declare function resolveBarcodeSize(input: BarcodeSizeInput): BarcodeSize;
|
|
66
66
|
|
|
67
|
+
interface ElementBorderCss {
|
|
68
|
+
/** CSS 长度,pt 口径(与 rect/oval、单元格边框一致) */
|
|
69
|
+
borderWidth: string;
|
|
70
|
+
borderStyle: string;
|
|
71
|
+
borderColor: string;
|
|
72
|
+
}
|
|
73
|
+
/** 元素级边框解析结果:整圈 + 逐边覆盖(渲染时先写整圈、后写各边,CSS 后者覆盖前者) */
|
|
74
|
+
interface ElementBordersCss {
|
|
75
|
+
all: ElementBorderCss | null;
|
|
76
|
+
edges: Partial<Record<ElementBorderSide, ElementBorderCss>>;
|
|
77
|
+
}
|
|
78
|
+
declare const ELEMENT_BORDER_SIDES: readonly ElementBorderSide[];
|
|
79
|
+
/** 该元素类型是否可携带元素级边框(供设计器格式刷等按类型过滤写入目标) */
|
|
80
|
+
declare function acceptsElementBorder(type: string | undefined): boolean;
|
|
81
|
+
type BorderFields = Pick<ElementOptions, 'borderWidth' | 'borderStyle' | 'borderColor' | 'borders'>;
|
|
82
|
+
/** 解析元素级边框;返回 null 表示无任何生效边框 */
|
|
83
|
+
declare function resolveElementBorder(type: string | undefined, opts: BorderFields | undefined): ElementBordersCss | null;
|
|
84
|
+
|
|
67
85
|
/** pt 转 mm */
|
|
68
86
|
declare function ptToMm(pt: number): number;
|
|
69
87
|
/** px 转 mm(基于 96dpi 屏幕) */
|
|
@@ -460,4 +478,4 @@ declare function useBindingDisplay(): {
|
|
|
460
478
|
getBindingDisplayState: (element: any) => BindingDisplayState;
|
|
461
479
|
};
|
|
462
480
|
|
|
463
|
-
export { type AdsorbConfig, AdsorbResult, type AlignMode, BARCODE_BAR_HEIGHT_MODULES, BARCODE_MARGIN_BOTTOM_MODULES, BARCODE_MODULE_WIDTH_MM, BARCODE_QUIET_ZONE_MODULES, BARCODE_TEXT_FONT_SIZE_MODULES, type BarcodeSize, type BarcodeSizeInput, BindingDescriptor, type BorderPreset, type CellRect, DEFAULT_DEMO_DATA, ELEMENT_BINDING_REGISTRY, EXTENDED_FUNCTIONS, ElementOptions, ElementRect, ElementType, ElementZone, FIT_SCALE_MIN_PERCENT, type FieldGroup, GHOST_BORDER_CSS, type KeyboardHandlers, LABEL_PAPER_GROUP, MIN_COL_WIDTH_MM, MIN_SCALE_PERCENT, MM_PER_INCH, type ManualGuides, PAPER_PRESETS, PRESET_COLORS, PROPERTY_REGISTRY, type PaperPreset, PrintBusinessField, type PropertyGroupDef, type PropertyItem, RESIZE_POINTS, RULER_THICKNESS, type ResizeOptions, ResizePoint, type ResizeRect, type RulerTick, RuntimeElement, TableCell, TableCellBorder, TableRow, TableRowType, TemplateData, ZONE_ALLOWED_TYPES, type ZoneRectPt, applyBorderPreset, barcodeAvailableBoxMm, barcodePreferredModuleWidthMm, barcodeUnitsPerModule, buildRulerTicks, calcResizeRect, canMergeReason, chooseMajorStepMM, clampResizedColumnWidth, clampScalePercent, clampToZone, computeAdsorb, computeFitScale, createCell, createDefaultOptions, createDefaultTable, createFieldElement, createRuntimeElement, deleteCol, deleteRow, engine, evaluateTemplate, filterGroups, finalizeElementZone, findMainCell, generateGroupId, generateId, getDemoData, getElementBindings, getPaperDimensions, getPaperSizeMM, getSpanRect, getTableCellBindings, getZoneRects, groupFields, insertCol, insertRow, isContinuousPaperSize, isLabelPaperSize, labelPaperDefaults, matchKeywords, mergeCells, minorStepMM, mmToPx, nextWheelScale, normalizeSelection, normalizeTemplateUnits, ptToMm, pxToMm, resolveBarcodeDesignValue, resolveBarcodeSize, resolveCellBorderCss, resolveTextBinding, safeEval, searchProperties, setHeaderRepeat, setRowType, splitCells, syncTableElementSize, useAlign, useBindingDisplay, useGroup, useKeyboard, useResize, zoneFromPaperPoint };
|
|
481
|
+
export { type AdsorbConfig, AdsorbResult, type AlignMode, BARCODE_BAR_HEIGHT_MODULES, BARCODE_MARGIN_BOTTOM_MODULES, BARCODE_MODULE_WIDTH_MM, BARCODE_QUIET_ZONE_MODULES, BARCODE_TEXT_FONT_SIZE_MODULES, type BarcodeSize, type BarcodeSizeInput, BindingDescriptor, type BorderPreset, type CellRect, DEFAULT_DEMO_DATA, ELEMENT_BINDING_REGISTRY, ELEMENT_BORDER_SIDES, EXTENDED_FUNCTIONS, type ElementBorderCss, ElementBorderSide, type ElementBordersCss, ElementOptions, ElementRect, ElementType, ElementZone, FIT_SCALE_MIN_PERCENT, type FieldGroup, GHOST_BORDER_CSS, type KeyboardHandlers, LABEL_PAPER_GROUP, MIN_COL_WIDTH_MM, MIN_SCALE_PERCENT, MM_PER_INCH, type ManualGuides, PAPER_PRESETS, PRESET_COLORS, PROPERTY_REGISTRY, type PaperPreset, PrintBusinessField, type PropertyGroupDef, type PropertyItem, RESIZE_POINTS, RULER_THICKNESS, type ResizeOptions, ResizePoint, type ResizeRect, type RulerTick, RuntimeElement, TableCell, TableCellBorder, TableRow, TableRowType, TemplateData, ZONE_ALLOWED_TYPES, type ZoneRectPt, acceptsElementBorder, applyBorderPreset, barcodeAvailableBoxMm, barcodePreferredModuleWidthMm, barcodeUnitsPerModule, buildRulerTicks, calcResizeRect, canMergeReason, chooseMajorStepMM, clampResizedColumnWidth, clampScalePercent, clampToZone, computeAdsorb, computeFitScale, createCell, createDefaultOptions, createDefaultTable, createFieldElement, createRuntimeElement, deleteCol, deleteRow, engine, evaluateTemplate, filterGroups, finalizeElementZone, findMainCell, generateGroupId, generateId, getDemoData, getElementBindings, getPaperDimensions, getPaperSizeMM, getSpanRect, getTableCellBindings, getZoneRects, groupFields, insertCol, insertRow, isContinuousPaperSize, isLabelPaperSize, labelPaperDefaults, matchKeywords, mergeCells, minorStepMM, mmToPx, nextWheelScale, normalizeSelection, normalizeTemplateUnits, ptToMm, pxToMm, resolveBarcodeDesignValue, resolveBarcodeSize, resolveCellBorderCss, resolveElementBorder, resolveTextBinding, safeEval, searchProperties, setHeaderRepeat, setRowType, splitCells, syncTableElementSize, useAlign, useBindingDisplay, useGroup, useKeyboard, useResize, zoneFromPaperPoint };
|
package/dist/designer/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TemplateEngine
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-M4ZERK33.js";
|
|
4
4
|
import {
|
|
5
5
|
BARCODE_BAR_HEIGHT_MODULES,
|
|
6
6
|
BARCODE_MARGIN_BOTTOM_MODULES,
|
|
@@ -8,8 +8,10 @@ import {
|
|
|
8
8
|
BARCODE_QUIET_ZONE_MODULES,
|
|
9
9
|
BARCODE_TEXT_FONT_SIZE_MODULES,
|
|
10
10
|
DEFAULT_SHRINK_MIN_FONT_SIZE_PT,
|
|
11
|
+
ELEMENT_BORDER_SIDES,
|
|
11
12
|
MIN_SHRINK_FONT_SIZE_PT,
|
|
12
13
|
MM_PER_INCH,
|
|
14
|
+
acceptsElementBorder,
|
|
13
15
|
addNumbers,
|
|
14
16
|
avg,
|
|
15
17
|
barcodeAvailableBoxMm,
|
|
@@ -33,6 +35,7 @@ import {
|
|
|
33
35
|
pxToMm,
|
|
34
36
|
resolveBarcodeSize,
|
|
35
37
|
resolveCellTextFit,
|
|
38
|
+
resolveElementBorder,
|
|
36
39
|
resolveElementTextFit,
|
|
37
40
|
resolveShrinkMinFontSize,
|
|
38
41
|
round,
|
|
@@ -43,7 +46,7 @@ import {
|
|
|
43
46
|
subtractNumbers,
|
|
44
47
|
sum,
|
|
45
48
|
toUpperCaseAmount
|
|
46
|
-
} from "../chunk-
|
|
49
|
+
} from "../chunk-RZJ6AY6T.js";
|
|
47
50
|
|
|
48
51
|
// src/designer/utils/scale.ts
|
|
49
52
|
var MIN_SCALE_PERCENT = 25;
|
|
@@ -1650,6 +1653,7 @@ export {
|
|
|
1650
1653
|
DEFAULT_DEMO_DATA,
|
|
1651
1654
|
DEFAULT_SHRINK_MIN_FONT_SIZE_PT,
|
|
1652
1655
|
ELEMENT_BINDING_REGISTRY,
|
|
1656
|
+
ELEMENT_BORDER_SIDES,
|
|
1653
1657
|
EXTENDED_FUNCTIONS,
|
|
1654
1658
|
FIT_SCALE_MIN_PERCENT,
|
|
1655
1659
|
GHOST_BORDER_CSS,
|
|
@@ -1664,6 +1668,7 @@ export {
|
|
|
1664
1668
|
RESIZE_POINTS,
|
|
1665
1669
|
RULER_THICKNESS,
|
|
1666
1670
|
ZONE_ALLOWED_TYPES,
|
|
1671
|
+
acceptsElementBorder,
|
|
1667
1672
|
applyBorderPreset,
|
|
1668
1673
|
barcodeAvailableBoxMm,
|
|
1669
1674
|
barcodePreferredModuleWidthMm,
|
|
@@ -1722,6 +1727,7 @@ export {
|
|
|
1722
1727
|
resolveBarcodeSize,
|
|
1723
1728
|
resolveCellBorderCss,
|
|
1724
1729
|
resolveCellTextFit,
|
|
1730
|
+
resolveElementBorder,
|
|
1725
1731
|
resolveElementTextFit,
|
|
1726
1732
|
resolveShrinkMinFontSize,
|
|
1727
1733
|
resolveTextBinding,
|
|
@@ -362,6 +362,14 @@ interface ElementFieldBinding {
|
|
|
362
362
|
text?: string;
|
|
363
363
|
dataSource?: string;
|
|
364
364
|
}
|
|
365
|
+
/** 元素分边边框的边位 */
|
|
366
|
+
type ElementBorderSide = 'top' | 'right' | 'bottom' | 'left';
|
|
367
|
+
/** 元素单边边框规格(pt 口径,与整圈 borderWidth 及单元格边框统一) */
|
|
368
|
+
interface ElementBorderEdge {
|
|
369
|
+
width: number;
|
|
370
|
+
style?: string;
|
|
371
|
+
color?: string;
|
|
372
|
+
}
|
|
365
373
|
/** 元素选项(序列化到 JSON) */
|
|
366
374
|
interface ElementOptions {
|
|
367
375
|
left: number;
|
|
@@ -393,6 +401,8 @@ interface ElementOptions {
|
|
|
393
401
|
borderWidth?: number;
|
|
394
402
|
borderStyle?: string;
|
|
395
403
|
borderColor?: string;
|
|
404
|
+
/** 元素分边边框(pt 口径):在整圈三字段之上逐边覆盖;未设整圈时仅这些边生效 */
|
|
405
|
+
borders?: Partial<Record<ElementBorderSide, ElementBorderEdge>>;
|
|
396
406
|
contentPaddingLeft?: number;
|
|
397
407
|
contentPaddingTop?: number;
|
|
398
408
|
contentPaddingRight?: number;
|
|
@@ -932,4 +942,4 @@ interface DriverFactory {
|
|
|
932
942
|
createDriver(): Promise<PageDriver>;
|
|
933
943
|
}
|
|
934
944
|
|
|
935
|
-
export { type
|
|
945
|
+
export { type ExecutorBundle as $, type AdsorbResult as A, type BindingDescriptor as B, type CodeRenderer as C, type DriverFactory as D, type ElementBorderSide as E, type TableSelection as F, type TemplateElement$1 as G, type TextAlign as H, type TextFit as I, type UploadImageFn as J, type MeasuredElement as K, type TemplateElement as L, type MultiPageTemplateData as M, type PaperMm as N, type ViewportPx as O, type PageLayout as P, type HeightSource as Q, type RawMeasurement as R, type ScreenshotRequest as S, type TemplateData as T, type UploadDesignBackgroundFn as U, type VerticalAlign as V, type WatermarkOptions as W, type MarginsMm as X, type PdfTargetSpec as Y, type ScreenshotTargetSpec as Z, type CodeRenderOptions as _, type CodeSpec as a, type TileLayout as a0, type PrintJob as a1, type PreparedDocument as a2, type RenderPdfResult as a3, type PrintFontDeclaration as a4, type ContinuousPaperSize as a5, EXECUTOR_TARGETS as a6, type ExecutorMethod as a7, type ExecutorTargetKind as a8, FALLBACK_FONT_STACK as a9, normalizePrintData as aA, normalizeTilingOptions as aB, resolveSheetMm as aC, roundMm as aD, tilePosition as aE, toFontFamilyStack as aF, validateTiling as aG, MAX_BATCH_COPIES as aa, type NormalizedPrintData as ab, PAPER_DIMENSIONS as ac, type PageDriver as ad, type PageSection as ae, type PaperSize as af, type PrintDataInput as ag, type PrintFontFile as ah, type RenderCell as ai, type RenderRequest as aj, type RenderRow as ak, type SheetPaperSize as al, TILE_DEFAULTS as am, TilingError as an, type TilingIssue as ao, type TilingIssueCode as ap, type TilingOptions as aq, type TilingResolveOptions as ar, type TilingTemplateInput as as, buildFontFaceCss as at, computeMaxColumns as au, computeTileLayout as av, escapeInlineStyleValue as aw, getPaperDimensions as ax, isContinuousPaper as ay, isContinuousPaperSize as az, type ElementOptions as b, type TemplateData$1 as c, type TableRow as d, type TableCellBorder as e, type TableCell as f, type TableRowType as g, type ElementType as h, type RuntimeElement as i, type ElementZone as j, type PrintBusinessField as k, type ElementRect as l, type ResizePoint as m, type AlignLine as n, type DesignBackground as o, type ElementBorderEdge as p, type ElementFieldBinding as q, type MultiPageTemplateData$1 as r, type PaginationConfig$1 as s, type PaperSize$1 as t, type PrintElementData as u, type PrintElementTypeMeta as v, type RequestScreenshotFn as w, type TableCellBorders as x, type TableCellType as y, type TablePaginationConfig$1 as z };
|
|
@@ -362,6 +362,14 @@ interface ElementFieldBinding {
|
|
|
362
362
|
text?: string;
|
|
363
363
|
dataSource?: string;
|
|
364
364
|
}
|
|
365
|
+
/** 元素分边边框的边位 */
|
|
366
|
+
type ElementBorderSide = 'top' | 'right' | 'bottom' | 'left';
|
|
367
|
+
/** 元素单边边框规格(pt 口径,与整圈 borderWidth 及单元格边框统一) */
|
|
368
|
+
interface ElementBorderEdge {
|
|
369
|
+
width: number;
|
|
370
|
+
style?: string;
|
|
371
|
+
color?: string;
|
|
372
|
+
}
|
|
365
373
|
/** 元素选项(序列化到 JSON) */
|
|
366
374
|
interface ElementOptions {
|
|
367
375
|
left: number;
|
|
@@ -393,6 +401,8 @@ interface ElementOptions {
|
|
|
393
401
|
borderWidth?: number;
|
|
394
402
|
borderStyle?: string;
|
|
395
403
|
borderColor?: string;
|
|
404
|
+
/** 元素分边边框(pt 口径):在整圈三字段之上逐边覆盖;未设整圈时仅这些边生效 */
|
|
405
|
+
borders?: Partial<Record<ElementBorderSide, ElementBorderEdge>>;
|
|
396
406
|
contentPaddingLeft?: number;
|
|
397
407
|
contentPaddingTop?: number;
|
|
398
408
|
contentPaddingRight?: number;
|
|
@@ -932,4 +942,4 @@ interface DriverFactory {
|
|
|
932
942
|
createDriver(): Promise<PageDriver>;
|
|
933
943
|
}
|
|
934
944
|
|
|
935
|
-
export { type
|
|
945
|
+
export { type ExecutorBundle as $, type AdsorbResult as A, type BindingDescriptor as B, type CodeRenderer as C, type DriverFactory as D, type ElementBorderSide as E, type TableSelection as F, type TemplateElement$1 as G, type TextAlign as H, type TextFit as I, type UploadImageFn as J, type MeasuredElement as K, type TemplateElement as L, type MultiPageTemplateData as M, type PaperMm as N, type ViewportPx as O, type PageLayout as P, type HeightSource as Q, type RawMeasurement as R, type ScreenshotRequest as S, type TemplateData as T, type UploadDesignBackgroundFn as U, type VerticalAlign as V, type WatermarkOptions as W, type MarginsMm as X, type PdfTargetSpec as Y, type ScreenshotTargetSpec as Z, type CodeRenderOptions as _, type CodeSpec as a, type TileLayout as a0, type PrintJob as a1, type PreparedDocument as a2, type RenderPdfResult as a3, type PrintFontDeclaration as a4, type ContinuousPaperSize as a5, EXECUTOR_TARGETS as a6, type ExecutorMethod as a7, type ExecutorTargetKind as a8, FALLBACK_FONT_STACK as a9, normalizePrintData as aA, normalizeTilingOptions as aB, resolveSheetMm as aC, roundMm as aD, tilePosition as aE, toFontFamilyStack as aF, validateTiling as aG, MAX_BATCH_COPIES as aa, type NormalizedPrintData as ab, PAPER_DIMENSIONS as ac, type PageDriver as ad, type PageSection as ae, type PaperSize as af, type PrintDataInput as ag, type PrintFontFile as ah, type RenderCell as ai, type RenderRequest as aj, type RenderRow as ak, type SheetPaperSize as al, TILE_DEFAULTS as am, TilingError as an, type TilingIssue as ao, type TilingIssueCode as ap, type TilingOptions as aq, type TilingResolveOptions as ar, type TilingTemplateInput as as, buildFontFaceCss as at, computeMaxColumns as au, computeTileLayout as av, escapeInlineStyleValue as aw, getPaperDimensions as ax, isContinuousPaper as ay, isContinuousPaperSize as az, type ElementOptions as b, type TemplateData$1 as c, type TableRow as d, type TableCellBorder as e, type TableCell as f, type TableRowType as g, type ElementType as h, type RuntimeElement as i, type ElementZone as j, type PrintBusinessField as k, type ElementRect as l, type ResizePoint as m, type AlignLine as n, type DesignBackground as o, type ElementBorderEdge as p, type ElementFieldBinding as q, type MultiPageTemplateData$1 as r, type PaginationConfig$1 as s, type PaperSize$1 as t, type PrintElementData as u, type PrintElementTypeMeta as v, type RequestScreenshotFn as w, type TableCellBorders as x, type TableCellType as y, type TablePaginationConfig$1 as z };
|
package/dist/index.cjs
CHANGED
|
@@ -1525,13 +1525,14 @@ ${desc}.page-header {
|
|
|
1525
1525
|
|
|
1526
1526
|
/* \u2500\u2500 \u9875\u811A\uFF1A\u7EDD\u5BF9\u5B9A\u4F4D\u56FA\u5B9A\u5728\u9875\u9762\u5E95\u90E8\uFF08\u5185\u5BB9\u4E0D\u8DB3\u65F6\u4E0D\u968F\u6587\u6863\u6D41\u4E0A\u6D6E\uFF09 \u2500\u2500
|
|
1527
1527
|
\u7528\u663E\u5F0F top \u5B9A\u4F4D\u5230\u300C\u7EB8\u9AD8 - \u4E0B\u8FB9\u8DDD - \u9875\u811A\u9AD8\u300D\uFF0C\u4FDD\u8BC1\u4E0B\u8FB9\u8DDD\u751F\u6548\u3001
|
|
1528
|
-
\u4E0E\u8BBE\u8BA1\u5668 CanvasPaper \u7684\u4E09\u533A\u51E0\u4F55\u4E00\u81F4\u3002
|
|
1528
|
+
\u4E0E\u8BBE\u8BA1\u5668 CanvasPaper \u7684\u4E09\u533A\u51E0\u4F55\u4E00\u81F4\u3002
|
|
1529
|
+
\u7EDD\u5BF9\u5B9A\u4F4D\u7684\u5305\u542B\u5757\u662F padding box \u5916\u7F18\uFF08= \u7EB8\u9762\uFF09\uFF0Cleft \u987B\u663E\u5F0F\u8865\u5DE6\u8FB9\u8DDD\u3002 */
|
|
1529
1530
|
${desc}.page-footer {
|
|
1530
1531
|
width: ${mm(contentWidth)};
|
|
1531
1532
|
height: ${mm(footerH)};
|
|
1532
1533
|
position: absolute;
|
|
1533
1534
|
top: ${mm(paper.height - mb - footerH)};
|
|
1534
|
-
left:
|
|
1535
|
+
left: ${mm(ml)};
|
|
1535
1536
|
}
|
|
1536
1537
|
|
|
1537
1538
|
/* \u2500\u2500 \u5185\u5BB9\u533A \u2500\u2500 */
|
|
@@ -1728,6 +1729,35 @@ function cellFitCapMm(rows, rowIndex, cell, defaultPadding = 1) {
|
|
|
1728
1729
|
return Math.max(height - padding * 2 - borderMm, 0.5);
|
|
1729
1730
|
}
|
|
1730
1731
|
|
|
1732
|
+
// src/render/element-border.ts
|
|
1733
|
+
var ELEMENT_BORDER_SIDES = ["top", "right", "bottom", "left"];
|
|
1734
|
+
var SELF_BORDER_TYPES = /* @__PURE__ */ new Set(["rect", "oval", "hline", "vline", "table"]);
|
|
1735
|
+
var VALID_STYLES = /* @__PURE__ */ new Set(["solid", "dashed", "dotted", "double"]);
|
|
1736
|
+
function parseBorder(width, style, color) {
|
|
1737
|
+
if (typeof width !== "number" || !Number.isFinite(width) || width <= 0) return null;
|
|
1738
|
+
return {
|
|
1739
|
+
borderWidth: `${width}pt`,
|
|
1740
|
+
borderStyle: typeof style === "string" && VALID_STYLES.has(style) ? style : "solid",
|
|
1741
|
+
borderColor: color || "#000"
|
|
1742
|
+
};
|
|
1743
|
+
}
|
|
1744
|
+
function resolveElementBorder(type, opts) {
|
|
1745
|
+
if (!type || SELF_BORDER_TYPES.has(type)) return null;
|
|
1746
|
+
const all = parseBorder(opts?.borderWidth, opts?.borderStyle, opts?.borderColor);
|
|
1747
|
+
const edges = {};
|
|
1748
|
+
const src = opts?.borders;
|
|
1749
|
+
if (src) {
|
|
1750
|
+
for (const side of ELEMENT_BORDER_SIDES) {
|
|
1751
|
+
const edge = src[side];
|
|
1752
|
+
if (!edge) continue;
|
|
1753
|
+
const css = parseBorder(edge.width, edge.style, edge.color);
|
|
1754
|
+
if (css) edges[side] = css;
|
|
1755
|
+
}
|
|
1756
|
+
}
|
|
1757
|
+
if (!all && Object.keys(edges).length === 0) return null;
|
|
1758
|
+
return { all, edges };
|
|
1759
|
+
}
|
|
1760
|
+
|
|
1731
1761
|
// src/render/watermark.ts
|
|
1732
1762
|
var PX_PER_MM = 96 / 25.4;
|
|
1733
1763
|
var MM_PER_PX = 25.4 / 96;
|
|
@@ -2548,7 +2578,18 @@ function renderElement(el, isMeasure, containerStyle, overrideTop, ctx) {
|
|
|
2548
2578
|
const type = el.type || el.printElementType?.type || "text";
|
|
2549
2579
|
const fit = resolveElementTextFit(type, opts);
|
|
2550
2580
|
const fitHeight = fit === "autoHeight" ? void 0 : height;
|
|
2551
|
-
const
|
|
2581
|
+
const baseStyle = containerStyle ?? elementPositionStyle(left, top, width, fitHeight, opts.zIndex);
|
|
2582
|
+
const elBorders = resolveElementBorder(type, opts);
|
|
2583
|
+
let style = baseStyle;
|
|
2584
|
+
if (elBorders?.all) {
|
|
2585
|
+
style += `border:${elBorders.all.borderWidth} ${elBorders.all.borderStyle} ${elBorders.all.borderColor};`;
|
|
2586
|
+
}
|
|
2587
|
+
if (elBorders) {
|
|
2588
|
+
for (const side of ELEMENT_BORDER_SIDES) {
|
|
2589
|
+
const e = elBorders.edges[side];
|
|
2590
|
+
if (e) style += `border-${side}:${e.borderWidth} ${e.borderStyle} ${e.borderColor};`;
|
|
2591
|
+
}
|
|
2592
|
+
}
|
|
2552
2593
|
const measureAttr = isMeasure ? ` data-measure-id="${el.id}"` : "";
|
|
2553
2594
|
const fitAttr = fitAttrs(fit, el.id, opts.fontSize ?? 12, opts);
|
|
2554
2595
|
switch (type) {
|
|
@@ -2575,13 +2616,13 @@ function renderElement(el, isMeasure, containerStyle, overrideTop, ctx) {
|
|
|
2575
2616
|
</div>`;
|
|
2576
2617
|
}
|
|
2577
2618
|
case "hline":
|
|
2578
|
-
return `<div class="print-element" style="${style};border-top
|
|
2619
|
+
return `<div class="print-element" style="${style};border-top:${opts.borderWidth || 0.75}pt ${opts.borderStyle || "solid"} ${opts.borderColor || "#333"};height:0;"${measureAttr}></div>`;
|
|
2579
2620
|
case "vline":
|
|
2580
|
-
return `<div class="print-element" style="${style};border-left
|
|
2621
|
+
return `<div class="print-element" style="${style};border-left:${opts.borderWidth || 0.75}pt ${opts.borderStyle || "solid"} ${opts.borderColor || "#333"};width:0;"${measureAttr}></div>`;
|
|
2581
2622
|
case "rect":
|
|
2582
|
-
return `<div class="print-element" style="${style};border:${opts.borderWidth
|
|
2623
|
+
return `<div class="print-element" style="${style};border:${opts.borderWidth || 1}pt ${opts.borderStyle || "solid"} ${opts.borderColor || "#333"};"${measureAttr}></div>`;
|
|
2583
2624
|
case "oval":
|
|
2584
|
-
return `<div class="print-element" style="${style};border:${opts.borderWidth
|
|
2625
|
+
return `<div class="print-element" style="${style};border:${opts.borderWidth || 1}pt ${opts.borderStyle || "solid"} ${opts.borderColor || "#333"};border-radius:50%;"${measureAttr}></div>`;
|
|
2585
2626
|
case "longText":
|
|
2586
2627
|
return `<div class="print-element" style="${style}${textStyle(opts)}${elementFitStyle(fit, opts)}"${measureAttr}${fitAttr}>${esc(opts.formatter ?? opts.testData ?? "")}</div>`;
|
|
2587
2628
|
case "html":
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { T as TemplateData, C as CodeRenderer, P as PageLayout,
|
|
2
|
-
export {
|
|
3
|
-
import { F as FitFontSize, P as PrintRuntime } from './ports-
|
|
4
|
-
export { C as CellFitRowKind, h as DEFAULT_READINESS_MS, D as DEFAULT_SHRINK_MIN_FONT_SIZE_PT, i as DEFAULT_TIMEOUT_MS, M as MIN_SHRINK_FONT_SIZE_PT, j as MeasureResult, k as PrintSession, S as SessionBudget, c as cellFitCapMm, a as cellFitKey, f as floorFontSize, p as parseCellFitKey, r as resolveCellTextFit, d as resolveElementTextFit, e as resolveShrinkMinFontSize, g as roundFontSize } from './ports-
|
|
1
|
+
import { T as TemplateData, C as CodeRenderer, P as PageLayout, K as MeasuredElement, L as TemplateElement, W as WatermarkOptions, N as PaperMm, O as ViewportPx, Q as HeightSource, X as MarginsMm, Y as PdfTargetSpec, Z as ScreenshotTargetSpec, R as RawMeasurement, a as CodeSpec, _ as CodeRenderOptions, D as DriverFactory, $ as ExecutorBundle, a0 as TileLayout, a1 as PrintJob, a2 as PreparedDocument, a3 as RenderPdfResult, M as MultiPageTemplateData, a4 as PrintFontDeclaration } from './driver-BMqI4QV-.cjs';
|
|
2
|
+
export { a5 as ContinuousPaperSize, a6 as EXECUTOR_TARGETS, a7 as ExecutorMethod, a8 as ExecutorTargetKind, a9 as FALLBACK_FONT_STACK, aa as MAX_BATCH_COPIES, ab as NormalizedPrintData, ac as PAPER_DIMENSIONS, ad as PageDriver, ae as PageSection, af as PaperSize, ag as PrintDataInput, ah as PrintFontFile, ai as RenderCell, aj as RenderRequest, ak as RenderRow, al as SheetPaperSize, am as TILE_DEFAULTS, I as TextFit, an as TilingError, ao as TilingIssue, ap as TilingIssueCode, aq as TilingOptions, ar as TilingResolveOptions, as as TilingTemplateInput, at as buildFontFaceCss, au as computeMaxColumns, av as computeTileLayout, aw as escapeInlineStyleValue, ax as getPaperDimensions, ay as isContinuousPaper, az as isContinuousPaperSize, aA as normalizePrintData, aB as normalizeTilingOptions, aC as resolveSheetMm, aD as roundMm, aE as tilePosition, aF as toFontFamilyStack, aG as validateTiling } from './driver-BMqI4QV-.cjs';
|
|
3
|
+
import { F as FitFontSize, P as PrintRuntime } from './ports-BL-PbuKG.cjs';
|
|
4
|
+
export { C as CellFitRowKind, h as DEFAULT_READINESS_MS, D as DEFAULT_SHRINK_MIN_FONT_SIZE_PT, i as DEFAULT_TIMEOUT_MS, M as MIN_SHRINK_FONT_SIZE_PT, j as MeasureResult, k as PrintSession, S as SessionBudget, c as cellFitCapMm, a as cellFitKey, f as floorFontSize, p as parseCellFitKey, r as resolveCellTextFit, d as resolveElementTextFit, e as resolveShrinkMinFontSize, g as roundFontSize } from './ports-BL-PbuKG.cjs';
|
|
5
5
|
|
|
6
6
|
type TokenType = 'num' | 'str' | 'bool' | 'ident' | 'punc';
|
|
7
7
|
interface Token {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { T as TemplateData, C as CodeRenderer, P as PageLayout,
|
|
2
|
-
export {
|
|
3
|
-
import { F as FitFontSize, P as PrintRuntime } from './ports-
|
|
4
|
-
export { C as CellFitRowKind, h as DEFAULT_READINESS_MS, D as DEFAULT_SHRINK_MIN_FONT_SIZE_PT, i as DEFAULT_TIMEOUT_MS, M as MIN_SHRINK_FONT_SIZE_PT, j as MeasureResult, k as PrintSession, S as SessionBudget, c as cellFitCapMm, a as cellFitKey, f as floorFontSize, p as parseCellFitKey, r as resolveCellTextFit, d as resolveElementTextFit, e as resolveShrinkMinFontSize, g as roundFontSize } from './ports-
|
|
1
|
+
import { T as TemplateData, C as CodeRenderer, P as PageLayout, K as MeasuredElement, L as TemplateElement, W as WatermarkOptions, N as PaperMm, O as ViewportPx, Q as HeightSource, X as MarginsMm, Y as PdfTargetSpec, Z as ScreenshotTargetSpec, R as RawMeasurement, a as CodeSpec, _ as CodeRenderOptions, D as DriverFactory, $ as ExecutorBundle, a0 as TileLayout, a1 as PrintJob, a2 as PreparedDocument, a3 as RenderPdfResult, M as MultiPageTemplateData, a4 as PrintFontDeclaration } from './driver-BMqI4QV-.js';
|
|
2
|
+
export { a5 as ContinuousPaperSize, a6 as EXECUTOR_TARGETS, a7 as ExecutorMethod, a8 as ExecutorTargetKind, a9 as FALLBACK_FONT_STACK, aa as MAX_BATCH_COPIES, ab as NormalizedPrintData, ac as PAPER_DIMENSIONS, ad as PageDriver, ae as PageSection, af as PaperSize, ag as PrintDataInput, ah as PrintFontFile, ai as RenderCell, aj as RenderRequest, ak as RenderRow, al as SheetPaperSize, am as TILE_DEFAULTS, I as TextFit, an as TilingError, ao as TilingIssue, ap as TilingIssueCode, aq as TilingOptions, ar as TilingResolveOptions, as as TilingTemplateInput, at as buildFontFaceCss, au as computeMaxColumns, av as computeTileLayout, aw as escapeInlineStyleValue, ax as getPaperDimensions, ay as isContinuousPaper, az as isContinuousPaperSize, aA as normalizePrintData, aB as normalizeTilingOptions, aC as resolveSheetMm, aD as roundMm, aE as tilePosition, aF as toFontFamilyStack, aG as validateTiling } from './driver-BMqI4QV-.js';
|
|
3
|
+
import { F as FitFontSize, P as PrintRuntime } from './ports-DmJos9Ce.js';
|
|
4
|
+
export { C as CellFitRowKind, h as DEFAULT_READINESS_MS, D as DEFAULT_SHRINK_MIN_FONT_SIZE_PT, i as DEFAULT_TIMEOUT_MS, M as MIN_SHRINK_FONT_SIZE_PT, j as MeasureResult, k as PrintSession, S as SessionBudget, c as cellFitCapMm, a as cellFitKey, f as floorFontSize, p as parseCellFitKey, r as resolveCellTextFit, d as resolveElementTextFit, e as resolveShrinkMinFontSize, g as roundFontSize } from './ports-DmJos9Ce.js';
|
|
5
5
|
|
|
6
6
|
type TokenType = 'num' | 'str' | 'bool' | 'ident' | 'punc';
|
|
7
7
|
interface Token {
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TemplateEngine
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-M4ZERK33.js";
|
|
4
4
|
import {
|
|
5
5
|
DEFAULT_READINESS_MS,
|
|
6
6
|
DEFAULT_SHRINK_MIN_FONT_SIZE_PT,
|
|
@@ -121,7 +121,7 @@ import {
|
|
|
121
121
|
tokenize,
|
|
122
122
|
validateTiling,
|
|
123
123
|
withTimeout
|
|
124
|
-
} from "./chunk-
|
|
124
|
+
} from "./chunk-RZJ6AY6T.js";
|
|
125
125
|
export {
|
|
126
126
|
DEFAULT_READINESS_MS,
|
|
127
127
|
DEFAULT_SHRINK_MIN_FONT_SIZE_PT,
|
package/dist/node/index.d.cts
CHANGED
package/dist/node/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { I as TextFit, a as CodeSpec, O as ViewportPx, R as RawMeasurement, Y as PdfTargetSpec, Z as ScreenshotTargetSpec } from './driver-BMqI4QV-.cjs';
|
|
2
2
|
|
|
3
3
|
/** 自动缩小的默认下限字号(pt) */
|
|
4
4
|
declare const DEFAULT_SHRINK_MIN_FONT_SIZE_PT = 6;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { I as TextFit, a as CodeSpec, O as ViewportPx, R as RawMeasurement, Y as PdfTargetSpec, Z as ScreenshotTargetSpec } from './driver-BMqI4QV-.js';
|
|
2
2
|
|
|
3
3
|
/** 自动缩小的默认下限字号(pt) */
|
|
4
4
|
declare const DEFAULT_SHRINK_MIN_FONT_SIZE_PT = 6;
|