@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.
- package/LICENSE +21 -0
- package/README.md +5 -5
- package/dist/browser/index.cjs +18 -49
- package/dist/browser/index.d.cts +9 -3
- package/dist/browser/index.d.ts +9 -3
- package/dist/browser/index.js +7 -1
- package/dist/{chunk-RXSLSQFO.js → chunk-GHASCGL6.js} +7 -1
- package/dist/{chunk-DCQGN54P.js → chunk-ZCA33XA6.js} +20 -82
- package/dist/client/index.cjs +6 -0
- package/dist/client/index.d.cts +6 -0
- package/dist/client/index.d.ts +6 -0
- package/dist/client/index.js +7 -0
- package/dist/designer/index.cjs +15 -7
- package/dist/designer/index.d.cts +10 -4
- package/dist/designer/index.d.ts +10 -4
- package/dist/designer/index.js +16 -8
- package/dist/dom-executor.iife.global.js +10 -4
- package/dist/{driver-CNJVZK_L.d.cts → driver-CFm0C_yX.d.cts} +10 -25
- package/dist/{driver-CNJVZK_L.d.ts → driver-CFm0C_yX.d.ts} +10 -25
- package/dist/index.cjs +18 -83
- package/dist/index.d.cts +14 -12
- package/dist/index.d.ts +14 -12
- package/dist/index.js +8 -6
- package/dist/node/index.cjs +6 -0
- package/dist/node/index.d.cts +7 -1
- package/dist/node/index.d.ts +7 -1
- package/dist/node/index.js +7 -0
- package/dist/{ports-DeEgE2SL.d.cts → ports-BXYcHExa.d.cts} +7 -2
- package/dist/{ports-DSfECjvT.d.ts → ports-Bdst9MWJ.d.ts} +7 -2
- package/package.json +10 -2
package/dist/designer/index.cjs
CHANGED
|
@@ -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}
|
|
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
|
-
|
|
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
|
-
...
|
|
330
|
+
...src,
|
|
322
331
|
unit: "mm",
|
|
323
|
-
elements: convert(
|
|
324
|
-
header:
|
|
325
|
-
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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 长度,
|
|
74
|
+
/** CSS 长度,pt 口径(与 rect/oval、单元格边框一致) */
|
|
69
75
|
borderWidth: string;
|
|
70
76
|
borderStyle: string;
|
|
71
77
|
borderColor: string;
|
package/dist/designer/index.d.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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 长度,
|
|
74
|
+
/** CSS 长度,pt 口径(与 rect/oval、单元格边框一致) */
|
|
69
75
|
borderWidth: string;
|
|
70
76
|
borderStyle: string;
|
|
71
77
|
borderColor: string;
|
package/dist/designer/index.js
CHANGED
|
@@ -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-
|
|
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-
|
|
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
|
-
|
|
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
|
-
...
|
|
97
|
+
...src,
|
|
89
98
|
unit: "mm",
|
|
90
|
-
elements: convert(
|
|
91
|
-
header:
|
|
92
|
-
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
|
|