@worm-vue3-print/core 1.3.3 → 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 +8 -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-RXSLSQFO.js → chunk-M4ZERK33.js} +1 -1
- package/dist/{chunk-DCQGN54P.js → chunk-RZJ6AY6T.js} +8 -7
- package/dist/designer/index.cjs +1 -1
- package/dist/designer/index.d.cts +4 -4
- package/dist/designer/index.d.ts +4 -4
- package/dist/designer/index.js +2 -2
- package/dist/{driver-CNJVZK_L.d.cts → driver-BMqI4QV-.d.cts} +2 -2
- package/dist/{driver-CNJVZK_L.d.ts → driver-BMqI4QV-.d.ts} +2 -2
- package/dist/index.cjs +8 -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-DeEgE2SL.d.cts → ports-BL-PbuKG.d.cts} +1 -1
- package/dist/{ports-DSfECjvT.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 */
|
|
@@ -2115,7 +2116,7 @@ var VALID_STYLES = /* @__PURE__ */ new Set(["solid", "dashed", "dotted", "double
|
|
|
2115
2116
|
function parseBorder(width, style, color) {
|
|
2116
2117
|
if (typeof width !== "number" || !Number.isFinite(width) || width <= 0) return null;
|
|
2117
2118
|
return {
|
|
2118
|
-
borderWidth: `${width}
|
|
2119
|
+
borderWidth: `${width}pt`,
|
|
2119
2120
|
borderStyle: typeof style === "string" && VALID_STYLES.has(style) ? style : "solid",
|
|
2120
2121
|
borderColor: color || "#000"
|
|
2121
2122
|
};
|
|
@@ -2983,13 +2984,13 @@ function renderElement(el, isMeasure, containerStyle, overrideTop, ctx) {
|
|
|
2983
2984
|
</div>`;
|
|
2984
2985
|
}
|
|
2985
2986
|
case "hline":
|
|
2986
|
-
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>`;
|
|
2987
2988
|
case "vline":
|
|
2988
|
-
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>`;
|
|
2989
2990
|
case "rect":
|
|
2990
|
-
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>`;
|
|
2991
2992
|
case "oval":
|
|
2992
|
-
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>`;
|
|
2993
2994
|
case "longText":
|
|
2994
2995
|
return `<div class="print-element" style="${style}${textStyle(opts)}${elementFitStyle(fit, opts)}"${measureAttr}${fitAttr}>${esc(opts.formatter ?? opts.testData ?? "")}</div>`;
|
|
2995
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 */
|
|
@@ -1599,7 +1600,7 @@ var VALID_STYLES = /* @__PURE__ */ new Set(["solid", "dashed", "dotted", "double
|
|
|
1599
1600
|
function parseBorder(width, style, color) {
|
|
1600
1601
|
if (typeof width !== "number" || !Number.isFinite(width) || width <= 0) return null;
|
|
1601
1602
|
return {
|
|
1602
|
-
borderWidth: `${width}
|
|
1603
|
+
borderWidth: `${width}pt`,
|
|
1603
1604
|
borderStyle: typeof style === "string" && VALID_STYLES.has(style) ? style : "solid",
|
|
1604
1605
|
borderColor: color || "#000"
|
|
1605
1606
|
};
|
|
@@ -2526,13 +2527,13 @@ function renderElement(el, isMeasure, containerStyle, overrideTop, ctx) {
|
|
|
2526
2527
|
</div>`;
|
|
2527
2528
|
}
|
|
2528
2529
|
case "hline":
|
|
2529
|
-
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>`;
|
|
2530
2531
|
case "vline":
|
|
2531
|
-
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>`;
|
|
2532
2533
|
case "rect":
|
|
2533
|
-
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>`;
|
|
2534
2535
|
case "oval":
|
|
2535
|
-
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>`;
|
|
2536
2537
|
case "longText":
|
|
2537
2538
|
return `<div class="print-element" style="${style}${textStyle(opts)}${elementFitStyle(fit, opts)}"${measureAttr}${fitAttr}>${esc(opts.formatter ?? opts.testData ?? "")}</div>`;
|
|
2538
2539
|
case "html":
|
package/dist/designer/index.cjs
CHANGED
|
@@ -259,7 +259,7 @@ var VALID_STYLES = /* @__PURE__ */ new Set(["solid", "dashed", "dotted", "double
|
|
|
259
259
|
function parseBorder(width, style, color) {
|
|
260
260
|
if (typeof width !== "number" || !Number.isFinite(width) || width <= 0) return null;
|
|
261
261
|
return {
|
|
262
|
-
borderWidth: `${width}
|
|
262
|
+
borderWidth: `${width}pt`,
|
|
263
263
|
borderStyle: typeof style === "string" && VALID_STYLES.has(style) ? style : "solid",
|
|
264
264
|
borderColor: color || "#000"
|
|
265
265
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
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-
|
|
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-
|
|
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 */
|
|
@@ -65,7 +65,7 @@ declare function barcodeAvailableBoxMm(boxMm: number | undefined, maxMm: number
|
|
|
65
65
|
declare function resolveBarcodeSize(input: BarcodeSizeInput): BarcodeSize;
|
|
66
66
|
|
|
67
67
|
interface ElementBorderCss {
|
|
68
|
-
/** CSS 长度,
|
|
68
|
+
/** CSS 长度,pt 口径(与 rect/oval、单元格边框一致) */
|
|
69
69
|
borderWidth: string;
|
|
70
70
|
borderStyle: string;
|
|
71
71
|
borderColor: string;
|
package/dist/designer/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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-
|
|
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-
|
|
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 */
|
|
@@ -65,7 +65,7 @@ declare function barcodeAvailableBoxMm(boxMm: number | undefined, maxMm: number
|
|
|
65
65
|
declare function resolveBarcodeSize(input: BarcodeSizeInput): BarcodeSize;
|
|
66
66
|
|
|
67
67
|
interface ElementBorderCss {
|
|
68
|
-
/** CSS 长度,
|
|
68
|
+
/** CSS 长度,pt 口径(与 rect/oval、单元格边框一致) */
|
|
69
69
|
borderWidth: string;
|
|
70
70
|
borderStyle: string;
|
|
71
71
|
borderColor: string;
|
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,
|
|
@@ -46,7 +46,7 @@ import {
|
|
|
46
46
|
subtractNumbers,
|
|
47
47
|
sum,
|
|
48
48
|
toUpperCaseAmount
|
|
49
|
-
} from "../chunk-
|
|
49
|
+
} from "../chunk-RZJ6AY6T.js";
|
|
50
50
|
|
|
51
51
|
// src/designer/utils/scale.ts
|
|
52
52
|
var MIN_SCALE_PERCENT = 25;
|
|
@@ -364,7 +364,7 @@ interface ElementFieldBinding {
|
|
|
364
364
|
}
|
|
365
365
|
/** 元素分边边框的边位 */
|
|
366
366
|
type ElementBorderSide = 'top' | 'right' | 'bottom' | 'left';
|
|
367
|
-
/** 元素单边边框规格(
|
|
367
|
+
/** 元素单边边框规格(pt 口径,与整圈 borderWidth 及单元格边框统一) */
|
|
368
368
|
interface ElementBorderEdge {
|
|
369
369
|
width: number;
|
|
370
370
|
style?: string;
|
|
@@ -401,7 +401,7 @@ interface ElementOptions {
|
|
|
401
401
|
borderWidth?: number;
|
|
402
402
|
borderStyle?: string;
|
|
403
403
|
borderColor?: string;
|
|
404
|
-
/** 元素分边边框(
|
|
404
|
+
/** 元素分边边框(pt 口径):在整圈三字段之上逐边覆盖;未设整圈时仅这些边生效 */
|
|
405
405
|
borders?: Partial<Record<ElementBorderSide, ElementBorderEdge>>;
|
|
406
406
|
contentPaddingLeft?: number;
|
|
407
407
|
contentPaddingTop?: number;
|
|
@@ -364,7 +364,7 @@ interface ElementFieldBinding {
|
|
|
364
364
|
}
|
|
365
365
|
/** 元素分边边框的边位 */
|
|
366
366
|
type ElementBorderSide = 'top' | 'right' | 'bottom' | 'left';
|
|
367
|
-
/** 元素单边边框规格(
|
|
367
|
+
/** 元素单边边框规格(pt 口径,与整圈 borderWidth 及单元格边框统一) */
|
|
368
368
|
interface ElementBorderEdge {
|
|
369
369
|
width: number;
|
|
370
370
|
style?: string;
|
|
@@ -401,7 +401,7 @@ interface ElementOptions {
|
|
|
401
401
|
borderWidth?: number;
|
|
402
402
|
borderStyle?: string;
|
|
403
403
|
borderColor?: string;
|
|
404
|
-
/** 元素分边边框(
|
|
404
|
+
/** 元素分边边框(pt 口径):在整圈三字段之上逐边覆盖;未设整圈时仅这些边生效 */
|
|
405
405
|
borders?: Partial<Record<ElementBorderSide, ElementBorderEdge>>;
|
|
406
406
|
contentPaddingLeft?: number;
|
|
407
407
|
contentPaddingTop?: number;
|
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 */
|
|
@@ -1735,7 +1736,7 @@ var VALID_STYLES = /* @__PURE__ */ new Set(["solid", "dashed", "dotted", "double
|
|
|
1735
1736
|
function parseBorder(width, style, color) {
|
|
1736
1737
|
if (typeof width !== "number" || !Number.isFinite(width) || width <= 0) return null;
|
|
1737
1738
|
return {
|
|
1738
|
-
borderWidth: `${width}
|
|
1739
|
+
borderWidth: `${width}pt`,
|
|
1739
1740
|
borderStyle: typeof style === "string" && VALID_STYLES.has(style) ? style : "solid",
|
|
1740
1741
|
borderColor: color || "#000"
|
|
1741
1742
|
};
|
|
@@ -2615,13 +2616,13 @@ function renderElement(el, isMeasure, containerStyle, overrideTop, ctx) {
|
|
|
2615
2616
|
</div>`;
|
|
2616
2617
|
}
|
|
2617
2618
|
case "hline":
|
|
2618
|
-
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>`;
|
|
2619
2620
|
case "vline":
|
|
2620
|
-
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>`;
|
|
2621
2622
|
case "rect":
|
|
2622
|
-
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>`;
|
|
2623
2624
|
case "oval":
|
|
2624
|
-
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>`;
|
|
2625
2626
|
case "longText":
|
|
2626
2627
|
return `<div class="print-element" style="${style}${textStyle(opts)}${elementFitStyle(fit, opts)}"${measureAttr}${fitAttr}>${esc(opts.formatter ?? opts.testData ?? "")}</div>`;
|
|
2627
2628
|
case "html":
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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-
|
|
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-
|
|
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, 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-
|
|
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-
|
|
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 { I as TextFit, a as CodeSpec, O as ViewportPx, R as RawMeasurement, Y as PdfTargetSpec, Z as ScreenshotTargetSpec } from './driver-
|
|
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 { I as TextFit, a as CodeSpec, O as ViewportPx, R as RawMeasurement, Y as PdfTargetSpec, Z as ScreenshotTargetSpec } from './driver-
|
|
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;
|