@worm-vue3-print/core 1.3.3 → 1.3.5

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.
@@ -1,3 +1,9 @@
1
+ /*!
2
+ * @worm-vue3-print/core v1.3.5
3
+ * Copyright (c) 2026 Worm Base AI
4
+ * SPDX-FileCopyrightText: 2026 Worm Base AI
5
+ * SPDX-License-Identifier: MIT
6
+ */
1
7
  "use strict";
2
8
  var __defProp = Object.defineProperty;
3
9
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -259,7 +265,7 @@ var VALID_STYLES = /* @__PURE__ */ new Set(["solid", "dashed", "dotted", "double
259
265
  function parseBorder(width, style, color) {
260
266
  if (typeof width !== "number" || !Number.isFinite(width) || width <= 0) return null;
261
267
  return {
262
- borderWidth: `${width}px`,
268
+ borderWidth: `${width}pt`,
263
269
  borderStyle: typeof style === "string" && VALID_STYLES.has(style) ? style : "solid",
264
270
  borderColor: color || "#000"
265
271
  };
@@ -315,15 +321,17 @@ function round2(n) {
315
321
  return Math.round(n * 100) / 100;
316
322
  }
317
323
  function normalizeTemplateUnits(data) {
318
- if (data.unit === "mm") return data;
324
+ const rest = { ...data };
325
+ delete rest.firstPageOverlay;
326
+ if (rest.unit === "mm") return rest;
327
+ const src = rest;
319
328
  const convert = (els) => els?.map(convertElement) ?? [];
320
329
  return {
321
- ...data,
330
+ ...src,
322
331
  unit: "mm",
323
- elements: convert(data.elements),
324
- header: data.header ? { ...data.header, elements: convert(data.header.elements) } : data.header,
325
- footer: data.footer ? { ...data.footer, elements: convert(data.footer.elements) } : data.footer,
326
- firstPageOverlay: data.firstPageOverlay ? { ...data.firstPageOverlay, elements: convert(data.firstPageOverlay.elements) } : data.firstPageOverlay
332
+ elements: convert(src.elements),
333
+ header: src.header ? { ...src.header, elements: convert(src.header.elements) } : src.header,
334
+ footer: src.footer ? { ...src.footer, elements: convert(src.footer.elements) } : src.footer
327
335
  };
328
336
  }
329
337
 
@@ -1,6 +1,12 @@
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-CNJVZK_L.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-CNJVZK_L.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-DeEgE2SL.cjs';
1
+ /*!
2
+ * @worm-vue3-print/core v1.3.5
3
+ * Copyright (c) 2026 Worm Base AI
4
+ * SPDX-FileCopyrightText: 2026 Worm Base AI
5
+ * SPDX-License-Identifier: MIT
6
+ */
7
+ 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-CFm0C_yX.cjs';
8
+ 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 TableCellBorders, x as TableCellType, y as TablePaginationConfig, z as TableSelection, F as TemplateElement, G as TextAlign, H as TextFit, U as UploadDesignBackgroundFn, I as UploadImageFn, V as VerticalAlign, W as WatermarkOptions } from '../driver-CFm0C_yX.cjs';
9
+ 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-BXYcHExa.cjs';
4
10
  import { TemplateEngine, formatMoney, ifFn, addNumbers, subtractNumbers, multiplyNumbers, divideNumbers, round, roundUp, roundDown, roundHalfEven, formatDate, toUpperCaseAmount } from '../index.cjs';
5
11
 
6
12
  /** 1 英寸 = 25.4mm */
@@ -65,7 +71,7 @@ declare function barcodeAvailableBoxMm(boxMm: number | undefined, maxMm: number
65
71
  declare function resolveBarcodeSize(input: BarcodeSizeInput): BarcodeSize;
66
72
 
67
73
  interface ElementBorderCss {
68
- /** CSS 长度,px 口径(与 rect/oval 现有一致) */
74
+ /** CSS 长度,pt 口径(与 rect/oval、单元格边框一致) */
69
75
  borderWidth: string;
70
76
  borderStyle: string;
71
77
  borderColor: string;
@@ -1,6 +1,12 @@
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-CNJVZK_L.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-CNJVZK_L.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-DSfECjvT.js';
1
+ /*!
2
+ * @worm-vue3-print/core v1.3.5
3
+ * Copyright (c) 2026 Worm Base AI
4
+ * SPDX-FileCopyrightText: 2026 Worm Base AI
5
+ * SPDX-License-Identifier: MIT
6
+ */
7
+ 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-CFm0C_yX.js';
8
+ 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 TableCellBorders, x as TableCellType, y as TablePaginationConfig, z as TableSelection, F as TemplateElement, G as TextAlign, H as TextFit, U as UploadDesignBackgroundFn, I as UploadImageFn, V as VerticalAlign, W as WatermarkOptions } from '../driver-CFm0C_yX.js';
9
+ 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-Bdst9MWJ.js';
4
10
  import { TemplateEngine, formatMoney, ifFn, addNumbers, subtractNumbers, multiplyNumbers, divideNumbers, round, roundUp, roundDown, roundHalfEven, formatDate, toUpperCaseAmount } from '../index.js';
5
11
 
6
12
  /** 1 英寸 = 25.4mm */
@@ -65,7 +71,7 @@ declare function barcodeAvailableBoxMm(boxMm: number | undefined, maxMm: number
65
71
  declare function resolveBarcodeSize(input: BarcodeSizeInput): BarcodeSize;
66
72
 
67
73
  interface ElementBorderCss {
68
- /** CSS 长度,px 口径(与 rect/oval 现有一致) */
74
+ /** CSS 长度,pt 口径(与 rect/oval、单元格边框一致) */
69
75
  borderWidth: string;
70
76
  borderStyle: string;
71
77
  borderColor: string;
@@ -1,6 +1,12 @@
1
+ /*!
2
+ * @worm-vue3-print/core v1.3.5
3
+ * Copyright (c) 2026 Worm Base AI
4
+ * SPDX-FileCopyrightText: 2026 Worm Base AI
5
+ * SPDX-License-Identifier: MIT
6
+ */
1
7
  import {
2
8
  TemplateEngine
3
- } from "../chunk-RXSLSQFO.js";
9
+ } from "../chunk-GHASCGL6.js";
4
10
  import {
5
11
  BARCODE_BAR_HEIGHT_MODULES,
6
12
  BARCODE_MARGIN_BOTTOM_MODULES,
@@ -46,7 +52,7 @@ import {
46
52
  subtractNumbers,
47
53
  sum,
48
54
  toUpperCaseAmount
49
- } from "../chunk-DCQGN54P.js";
55
+ } from "../chunk-ZCA33XA6.js";
50
56
 
51
57
  // src/designer/utils/scale.ts
52
58
  var MIN_SCALE_PERCENT = 25;
@@ -82,15 +88,17 @@ function round2(n) {
82
88
  return Math.round(n * 100) / 100;
83
89
  }
84
90
  function normalizeTemplateUnits(data) {
85
- if (data.unit === "mm") return data;
91
+ const rest = { ...data };
92
+ delete rest.firstPageOverlay;
93
+ if (rest.unit === "mm") return rest;
94
+ const src = rest;
86
95
  const convert = (els) => els?.map(convertElement) ?? [];
87
96
  return {
88
- ...data,
97
+ ...src,
89
98
  unit: "mm",
90
- elements: convert(data.elements),
91
- header: data.header ? { ...data.header, elements: convert(data.header.elements) } : data.header,
92
- footer: data.footer ? { ...data.footer, elements: convert(data.footer.elements) } : data.footer,
93
- firstPageOverlay: data.firstPageOverlay ? { ...data.firstPageOverlay, elements: convert(data.firstPageOverlay.elements) } : data.firstPageOverlay
99
+ elements: convert(src.elements),
100
+ header: src.header ? { ...src.header, elements: convert(src.header.elements) } : src.header,
101
+ footer: src.footer ? { ...src.footer, elements: convert(src.footer.elements) } : src.footer
94
102
  };
95
103
  }
96
104