@worm-vue3-print/core 1.3.6 → 1.3.7
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 +34 -12
- package/dist/browser/index.d.cts +3 -3
- package/dist/browser/index.d.ts +3 -3
- package/dist/browser/index.js +7 -3
- package/dist/{chunk-JQUJ7AF3.js → chunk-TCI5XQKI.js} +29 -11
- package/dist/{chunk-GLNQXOMO.js → chunk-WLGEOVFK.js} +2 -2
- package/dist/client/index.cjs +1 -1
- package/dist/client/index.d.cts +1 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.js +1 -1
- package/dist/designer/index.cjs +54 -2
- package/dist/designer/index.d.cts +43 -5
- package/dist/designer/index.d.ts +43 -5
- package/dist/designer/index.js +54 -4
- package/dist/dom-executor.iife.global.js +6 -6
- package/dist/{driver-CFm0C_yX.d.cts → driver-Dzr2Aikx.d.cts} +19 -4
- package/dist/{driver-CFm0C_yX.d.ts → driver-Dzr2Aikx.d.ts} +19 -4
- package/dist/index.cjs +29 -11
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +3 -3
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.d.cts +2 -2
- package/dist/node/index.d.ts +2 -2
- package/dist/node/index.js +1 -1
- package/dist/{ports-Bdst9MWJ.d.ts → ports-B8MFq_Yo.d.ts} +2 -2
- package/dist/{ports-BXYcHExa.d.cts → ports-Bin4xmo0.d.cts} +2 -2
- package/package.json +1 -1
package/dist/browser/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @worm-vue3-print/core v1.3.
|
|
2
|
+
* @worm-vue3-print/core v1.3.7
|
|
3
3
|
* Copyright (c) 2026 worm <liu_long_qqcom@qq.com>
|
|
4
4
|
* SPDX-FileCopyrightText: 2026 worm <liu_long_qqcom@qq.com>
|
|
5
5
|
* SPDX-License-Identifier: MIT
|
|
@@ -292,6 +292,10 @@ function renderBarcodeSvg(value, opts) {
|
|
|
292
292
|
svg.setAttribute("shape-rendering", "crispEdges");
|
|
293
293
|
return svg.outerHTML;
|
|
294
294
|
}
|
|
295
|
+
var QR_DEFAULT_QUIET_MODULES = 0;
|
|
296
|
+
function qrQuietModules(value) {
|
|
297
|
+
return typeof value === "number" && Number.isFinite(value) ? Math.max(0, Math.floor(value)) : QR_DEFAULT_QUIET_MODULES;
|
|
298
|
+
}
|
|
295
299
|
function renderQrSvg(value, opts) {
|
|
296
300
|
const level = (opts.qrCodeLevel ?? "M").toUpperCase();
|
|
297
301
|
const qr = import_qrcode.default.create(value, {
|
|
@@ -300,7 +304,7 @@ function renderQrSvg(value, opts) {
|
|
|
300
304
|
const modules = qr.modules;
|
|
301
305
|
const size = modules.size;
|
|
302
306
|
const dot = 4;
|
|
303
|
-
const quiet =
|
|
307
|
+
const quiet = qrQuietModules(opts.qrQuietZone) * dot;
|
|
304
308
|
const dim = size * dot + quiet * 2;
|
|
305
309
|
let rects = "";
|
|
306
310
|
for (let y = 0; y < size; y++) {
|
|
@@ -1621,9 +1625,11 @@ function makeRenderRow(row, resolve, keepRaw = false) {
|
|
|
1621
1625
|
cellType: cell.cellType,
|
|
1622
1626
|
barcodeType: cell.barcodeType,
|
|
1623
1627
|
qrCodeLevel: cell.qrCodeLevel,
|
|
1628
|
+
qrQuietZone: cell.qrQuietZone,
|
|
1624
1629
|
showBarcodeText: cell.showBarcodeText,
|
|
1625
1630
|
printerDpi: cell.printerDpi,
|
|
1626
1631
|
fit: cell.fit,
|
|
1632
|
+
objectPosition: cell.objectPosition,
|
|
1627
1633
|
maxWidth: cell.maxWidth,
|
|
1628
1634
|
maxHeight: cell.maxHeight,
|
|
1629
1635
|
rowspan: cell.rowspan ?? 1,
|
|
@@ -2890,12 +2896,26 @@ function textStyle(opts) {
|
|
|
2890
2896
|
if (opts.lineHeight) parts.push(`line-height:${opts.lineHeight}pt`);
|
|
2891
2897
|
if (opts.letterSpacing) parts.push(`letter-spacing:${opts.letterSpacing}pt`);
|
|
2892
2898
|
if (opts.verticalAlign) {
|
|
2893
|
-
|
|
2894
|
-
|
|
2899
|
+
if (opts.textAlign === "justify") {
|
|
2900
|
+
parts.push(`display:flex;flex-direction:column;justify-content:${V_ALIGN_FLEX[opts.verticalAlign] ?? "flex-start"}`);
|
|
2901
|
+
} else {
|
|
2902
|
+
parts.push(`display:flex;align-items:${V_ALIGN_FLEX[opts.verticalAlign] ?? "flex-start"}`);
|
|
2903
|
+
parts.push(`justify-content:${H_ALIGN_FLEX[opts.textAlign ?? "left"] ?? "flex-start"}`);
|
|
2904
|
+
}
|
|
2895
2905
|
}
|
|
2896
2906
|
if (opts.textAlign) parts.push(`text-align:${opts.textAlign}`);
|
|
2907
|
+
if (opts.textAlign === "justify") parts.push("text-align-last:justify");
|
|
2897
2908
|
return parts.length ? parts.join(";") + ";" : "";
|
|
2898
2909
|
}
|
|
2910
|
+
function indentStyle(opts) {
|
|
2911
|
+
return opts.longTextIndent ? `text-indent:${opts.longTextIndent}em;` : "";
|
|
2912
|
+
}
|
|
2913
|
+
var OBJECT_POSITION_UNSAFE = /[;"'<>\\(){}\[\]@!#]/;
|
|
2914
|
+
function positionStyle(objectPosition) {
|
|
2915
|
+
const v = (objectPosition ?? "").trim();
|
|
2916
|
+
if (!v || v.length > 64 || OBJECT_POSITION_UNSAFE.test(v)) return "";
|
|
2917
|
+
return `object-position:${escapeInlineStyleValue(v)};`;
|
|
2918
|
+
}
|
|
2899
2919
|
function elementFitStyle(fit, opts) {
|
|
2900
2920
|
if (fit === "autoHeight") return "overflow:visible;";
|
|
2901
2921
|
if (opts.wordWrap === false) return "white-space:nowrap;text-overflow:ellipsis;";
|
|
@@ -2934,7 +2954,7 @@ function renderElement(el, isMeasure, containerStyle, overrideTop, ctx) {
|
|
|
2934
2954
|
return renderTableElement(el, isMeasure, measureAttr, ctx);
|
|
2935
2955
|
case "image":
|
|
2936
2956
|
return `<div class="print-element" style="${style}"${measureAttr}>
|
|
2937
|
-
<img src="${esc(opts.src ?? "")}" style="width:100%;height:100%;object-fit
|
|
2957
|
+
<img src="${esc(opts.src ?? "")}" style="width:100%;height:100%;object-fit:${opts.fit || "contain"};${positionStyle(opts.objectPosition)}" />
|
|
2938
2958
|
</div>`;
|
|
2939
2959
|
case "barcode":
|
|
2940
2960
|
case "qrcode": {
|
|
@@ -2961,7 +2981,7 @@ function renderElement(el, isMeasure, containerStyle, overrideTop, ctx) {
|
|
|
2961
2981
|
case "oval":
|
|
2962
2982
|
return `<div class="print-element" style="${style};border:${opts.borderWidth || 1}pt ${opts.borderStyle || "solid"} ${opts.borderColor || "#333"};border-radius:50%;"${measureAttr}></div>`;
|
|
2963
2983
|
case "longText":
|
|
2964
|
-
return `<div class="print-element" style="${style}${textStyle(opts)}${elementFitStyle(fit, opts)}"${measureAttr}${fitAttr}>${esc(opts.formatter ?? opts.testData ?? "")}</div>`;
|
|
2984
|
+
return `<div class="print-element" style="${style}${textStyle(opts)}${indentStyle(opts)}${elementFitStyle(fit, opts)}"${measureAttr}${fitAttr}>${esc(opts.formatter ?? opts.testData ?? "")}</div>`;
|
|
2965
2985
|
case "html":
|
|
2966
2986
|
return `<div class="print-element" style="${style}"${measureAttr}>${opts.testData ?? opts.title ?? ""}</div>`;
|
|
2967
2987
|
default:
|
|
@@ -2976,6 +2996,8 @@ function codeImgHtml(value, cellType, opts, io) {
|
|
|
2976
2996
|
const svg = codeRenderer.render(value, cellType, {
|
|
2977
2997
|
barcodeType: opts.barcodeType,
|
|
2978
2998
|
qrCodeLevel: opts.qrCodeLevel != null ? String(opts.qrCodeLevel) : void 0,
|
|
2999
|
+
// 0 是合法档(无白边),必须用 typeof 判定而非 or/?? 之类假值判断
|
|
3000
|
+
qrQuietZone: typeof opts.qrQuietZone === "number" ? opts.qrQuietZone : void 0,
|
|
2979
3001
|
showText: opts.hideTitle !== void 0 ? !opts.hideTitle : opts.showBarcodeText,
|
|
2980
3002
|
barWidth: typeof opts.barWidth === "number" ? opts.barWidth : void 0,
|
|
2981
3003
|
fontSize: typeof opts.fontSize === "number" ? opts.fontSize : void 0,
|
|
@@ -2986,10 +3008,8 @@ function codeImgHtml(value, cellType, opts, io) {
|
|
|
2986
3008
|
if (isBarcode && /^<svg[\s>]/i.test(svg)) return inlineCodeSvgHtml(svg);
|
|
2987
3009
|
const src = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svg)}`;
|
|
2988
3010
|
const styleParts = [];
|
|
2989
|
-
styleParts.push("max-width:100%", "max-height:100%", "display:block", "margin:auto");
|
|
2990
|
-
|
|
2991
|
-
styleParts.push(`object-fit:${fit}`);
|
|
2992
|
-
}
|
|
3011
|
+
styleParts.push("width:100%", "height:100%", "max-width:100%", "max-height:100%", "display:block", "margin:auto");
|
|
3012
|
+
styleParts.push(`object-fit:${fit || "contain"}`);
|
|
2993
3013
|
if (maxWidth) {
|
|
2994
3014
|
styleParts.push(`max-width:${maxWidth}mm`);
|
|
2995
3015
|
}
|
|
@@ -3017,6 +3037,7 @@ function matrixCellStyle(cell, opts) {
|
|
|
3017
3037
|
if (color) parts.push(`color:${color}`);
|
|
3018
3038
|
if (cell.backgroundColor) parts.push(`background-color:${cell.backgroundColor}`);
|
|
3019
3039
|
parts.push(`text-align:${cell.align ?? "left"}`);
|
|
3040
|
+
if (cell.align === "justify") parts.push("text-align-last:justify");
|
|
3020
3041
|
parts.push(`vertical-align:${cell.valign ?? "middle"}`);
|
|
3021
3042
|
parts.push(`padding:${padding}mm`);
|
|
3022
3043
|
parts.push(cell.wordWrap === false ? "white-space:nowrap;overflow:hidden" : "word-break:break-all");
|
|
@@ -3056,7 +3077,7 @@ function renderMatrixRows(renderRows, start, end, opts, withRowIndex, ctx, fitOw
|
|
|
3056
3077
|
const fit = cell.fit || "contain";
|
|
3057
3078
|
const maxWidth = cell.maxWidth ? `max-width:${cell.maxWidth}mm;` : "max-width:100%;";
|
|
3058
3079
|
const maxHeight = cell.maxHeight ? `max-height:${cell.maxHeight}mm;` : "max-height:100%;";
|
|
3059
|
-
inner = `<div style="width:100%;height:100%;display:flex;align-items:center;justify-content:center;overflow:hidden;"><img src="${esc(resolveCellContent(cell, ctx))}" style="object-fit:${fit};${maxWidth}${maxHeight}display:block;" /></div>`;
|
|
3080
|
+
inner = `<div style="width:100%;height:100%;display:flex;align-items:center;justify-content:center;overflow:hidden;"><img src="${esc(resolveCellContent(cell, ctx))}" style="object-fit:${fit};${positionStyle(cell.objectPosition)}${maxWidth}${maxHeight}display:block;" /></div>`;
|
|
3060
3081
|
} else {
|
|
3061
3082
|
inner = renderTextCellInner(renderRows, r, colIndex, cell, opts, fitOwner, defaultPadding, ctx);
|
|
3062
3083
|
}
|
|
@@ -3245,7 +3266,8 @@ function codeSpecKey(value, cellType, opts = {}) {
|
|
|
3245
3266
|
opts.qrCodeLevel ?? null,
|
|
3246
3267
|
opts.showText ?? null,
|
|
3247
3268
|
opts.barWidth ?? null,
|
|
3248
|
-
opts.fontSize ?? null
|
|
3269
|
+
opts.fontSize ?? null,
|
|
3270
|
+
opts.qrQuietZone ?? null
|
|
3249
3271
|
]);
|
|
3250
3272
|
}
|
|
3251
3273
|
function createMapCodeRenderer(map) {
|
package/dist/browser/index.d.cts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @worm-vue3-print/core v1.3.
|
|
2
|
+
* @worm-vue3-print/core v1.3.7
|
|
3
3
|
* Copyright (c) 2026 worm <liu_long_qqcom@qq.com>
|
|
4
4
|
* SPDX-FileCopyrightText: 2026 worm <liu_long_qqcom@qq.com>
|
|
5
5
|
* SPDX-License-Identifier: MIT
|
|
6
6
|
*/
|
|
7
|
-
import { P as PageLayout, T as TemplateData, M as MultiPageTemplateData, C as CodeRenderer, D as DriverFactory, R as RawMeasurement, a as CodeSpec } from '../driver-
|
|
8
|
-
import { P as PrintRuntime, F as FitFontSize } from '../ports-
|
|
7
|
+
import { P as PageLayout, T as TemplateData, M as MultiPageTemplateData, C as CodeRenderer, D as DriverFactory, R as RawMeasurement, a as CodeSpec } from '../driver-Dzr2Aikx.cjs';
|
|
8
|
+
import { P as PrintRuntime, F as FitFontSize } from '../ports-Bin4xmo0.cjs';
|
|
9
9
|
|
|
10
10
|
interface BrowserRenderResult {
|
|
11
11
|
/** 最终多页 HTML 字符串 */
|
package/dist/browser/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @worm-vue3-print/core v1.3.
|
|
2
|
+
* @worm-vue3-print/core v1.3.7
|
|
3
3
|
* Copyright (c) 2026 worm <liu_long_qqcom@qq.com>
|
|
4
4
|
* SPDX-FileCopyrightText: 2026 worm <liu_long_qqcom@qq.com>
|
|
5
5
|
* SPDX-License-Identifier: MIT
|
|
6
6
|
*/
|
|
7
|
-
import { P as PageLayout, T as TemplateData, M as MultiPageTemplateData, C as CodeRenderer, D as DriverFactory, R as RawMeasurement, a as CodeSpec } from '../driver-
|
|
8
|
-
import { P as PrintRuntime, F as FitFontSize } from '../ports-
|
|
7
|
+
import { P as PageLayout, T as TemplateData, M as MultiPageTemplateData, C as CodeRenderer, D as DriverFactory, R as RawMeasurement, a as CodeSpec } from '../driver-Dzr2Aikx.js';
|
|
8
|
+
import { P as PrintRuntime, F as FitFontSize } from '../ports-B8MFq_Yo.js';
|
|
9
9
|
|
|
10
10
|
interface BrowserRenderResult {
|
|
11
11
|
/** 最终多页 HTML 字符串 */
|
package/dist/browser/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @worm-vue3-print/core v1.3.
|
|
2
|
+
* @worm-vue3-print/core v1.3.7
|
|
3
3
|
* Copyright (c) 2026 worm <liu_long_qqcom@qq.com>
|
|
4
4
|
* SPDX-FileCopyrightText: 2026 worm <liu_long_qqcom@qq.com>
|
|
5
5
|
* SPDX-License-Identifier: MIT
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
prepareDocument,
|
|
18
18
|
resolveBarcodeSize,
|
|
19
19
|
resolveShrinkMinFontSize
|
|
20
|
-
} from "../chunk-
|
|
20
|
+
} from "../chunk-TCI5XQKI.js";
|
|
21
21
|
|
|
22
22
|
// src/browser/browser-code-renderer.ts
|
|
23
23
|
import JsBarcode from "jsbarcode";
|
|
@@ -62,6 +62,10 @@ function renderBarcodeSvg(value, opts) {
|
|
|
62
62
|
svg.setAttribute("shape-rendering", "crispEdges");
|
|
63
63
|
return svg.outerHTML;
|
|
64
64
|
}
|
|
65
|
+
var QR_DEFAULT_QUIET_MODULES = 0;
|
|
66
|
+
function qrQuietModules(value) {
|
|
67
|
+
return typeof value === "number" && Number.isFinite(value) ? Math.max(0, Math.floor(value)) : QR_DEFAULT_QUIET_MODULES;
|
|
68
|
+
}
|
|
65
69
|
function renderQrSvg(value, opts) {
|
|
66
70
|
const level = (opts.qrCodeLevel ?? "M").toUpperCase();
|
|
67
71
|
const qr = QRCode.create(value, {
|
|
@@ -70,7 +74,7 @@ function renderQrSvg(value, opts) {
|
|
|
70
74
|
const modules = qr.modules;
|
|
71
75
|
const size = modules.size;
|
|
72
76
|
const dot = 4;
|
|
73
|
-
const quiet =
|
|
77
|
+
const quiet = qrQuietModules(opts.qrQuietZone) * dot;
|
|
74
78
|
const dim = size * dot + quiet * 2;
|
|
75
79
|
let rects = "";
|
|
76
80
|
for (let y = 0; y < size; y++) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @worm-vue3-print/core v1.3.
|
|
2
|
+
* @worm-vue3-print/core v1.3.7
|
|
3
3
|
* Copyright (c) 2026 worm <liu_long_qqcom@qq.com>
|
|
4
4
|
* SPDX-FileCopyrightText: 2026 worm <liu_long_qqcom@qq.com>
|
|
5
5
|
* SPDX-License-Identifier: MIT
|
|
@@ -1047,9 +1047,11 @@ function makeRenderRow(row, resolve, keepRaw = false) {
|
|
|
1047
1047
|
cellType: cell.cellType,
|
|
1048
1048
|
barcodeType: cell.barcodeType,
|
|
1049
1049
|
qrCodeLevel: cell.qrCodeLevel,
|
|
1050
|
+
qrQuietZone: cell.qrQuietZone,
|
|
1050
1051
|
showBarcodeText: cell.showBarcodeText,
|
|
1051
1052
|
printerDpi: cell.printerDpi,
|
|
1052
1053
|
fit: cell.fit,
|
|
1054
|
+
objectPosition: cell.objectPosition,
|
|
1053
1055
|
maxWidth: cell.maxWidth,
|
|
1054
1056
|
maxHeight: cell.maxHeight,
|
|
1055
1057
|
rowspan: cell.rowspan ?? 1,
|
|
@@ -2451,12 +2453,26 @@ function textStyle(opts) {
|
|
|
2451
2453
|
if (opts.lineHeight) parts.push(`line-height:${opts.lineHeight}pt`);
|
|
2452
2454
|
if (opts.letterSpacing) parts.push(`letter-spacing:${opts.letterSpacing}pt`);
|
|
2453
2455
|
if (opts.verticalAlign) {
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
+
if (opts.textAlign === "justify") {
|
|
2457
|
+
parts.push(`display:flex;flex-direction:column;justify-content:${V_ALIGN_FLEX[opts.verticalAlign] ?? "flex-start"}`);
|
|
2458
|
+
} else {
|
|
2459
|
+
parts.push(`display:flex;align-items:${V_ALIGN_FLEX[opts.verticalAlign] ?? "flex-start"}`);
|
|
2460
|
+
parts.push(`justify-content:${H_ALIGN_FLEX[opts.textAlign ?? "left"] ?? "flex-start"}`);
|
|
2461
|
+
}
|
|
2456
2462
|
}
|
|
2457
2463
|
if (opts.textAlign) parts.push(`text-align:${opts.textAlign}`);
|
|
2464
|
+
if (opts.textAlign === "justify") parts.push("text-align-last:justify");
|
|
2458
2465
|
return parts.length ? parts.join(";") + ";" : "";
|
|
2459
2466
|
}
|
|
2467
|
+
function indentStyle(opts) {
|
|
2468
|
+
return opts.longTextIndent ? `text-indent:${opts.longTextIndent}em;` : "";
|
|
2469
|
+
}
|
|
2470
|
+
var OBJECT_POSITION_UNSAFE = /[;"'<>\\(){}\[\]@!#]/;
|
|
2471
|
+
function positionStyle(objectPosition) {
|
|
2472
|
+
const v = (objectPosition ?? "").trim();
|
|
2473
|
+
if (!v || v.length > 64 || OBJECT_POSITION_UNSAFE.test(v)) return "";
|
|
2474
|
+
return `object-position:${escapeInlineStyleValue(v)};`;
|
|
2475
|
+
}
|
|
2460
2476
|
function elementFitStyle(fit, opts) {
|
|
2461
2477
|
if (fit === "autoHeight") return "overflow:visible;";
|
|
2462
2478
|
if (opts.wordWrap === false) return "white-space:nowrap;text-overflow:ellipsis;";
|
|
@@ -2495,7 +2511,7 @@ function renderElement(el, isMeasure, containerStyle, overrideTop, ctx) {
|
|
|
2495
2511
|
return renderTableElement(el, isMeasure, measureAttr, ctx);
|
|
2496
2512
|
case "image":
|
|
2497
2513
|
return `<div class="print-element" style="${style}"${measureAttr}>
|
|
2498
|
-
<img src="${esc(opts.src ?? "")}" style="width:100%;height:100%;object-fit
|
|
2514
|
+
<img src="${esc(opts.src ?? "")}" style="width:100%;height:100%;object-fit:${opts.fit || "contain"};${positionStyle(opts.objectPosition)}" />
|
|
2499
2515
|
</div>`;
|
|
2500
2516
|
case "barcode":
|
|
2501
2517
|
case "qrcode": {
|
|
@@ -2522,7 +2538,7 @@ function renderElement(el, isMeasure, containerStyle, overrideTop, ctx) {
|
|
|
2522
2538
|
case "oval":
|
|
2523
2539
|
return `<div class="print-element" style="${style};border:${opts.borderWidth || 1}pt ${opts.borderStyle || "solid"} ${opts.borderColor || "#333"};border-radius:50%;"${measureAttr}></div>`;
|
|
2524
2540
|
case "longText":
|
|
2525
|
-
return `<div class="print-element" style="${style}${textStyle(opts)}${elementFitStyle(fit, opts)}"${measureAttr}${fitAttr}>${esc(opts.formatter ?? opts.testData ?? "")}</div>`;
|
|
2541
|
+
return `<div class="print-element" style="${style}${textStyle(opts)}${indentStyle(opts)}${elementFitStyle(fit, opts)}"${measureAttr}${fitAttr}>${esc(opts.formatter ?? opts.testData ?? "")}</div>`;
|
|
2526
2542
|
case "html":
|
|
2527
2543
|
return `<div class="print-element" style="${style}"${measureAttr}>${opts.testData ?? opts.title ?? ""}</div>`;
|
|
2528
2544
|
default:
|
|
@@ -2537,6 +2553,8 @@ function codeImgHtml(value, cellType, opts, io) {
|
|
|
2537
2553
|
const svg = codeRenderer.render(value, cellType, {
|
|
2538
2554
|
barcodeType: opts.barcodeType,
|
|
2539
2555
|
qrCodeLevel: opts.qrCodeLevel != null ? String(opts.qrCodeLevel) : void 0,
|
|
2556
|
+
// 0 是合法档(无白边),必须用 typeof 判定而非 or/?? 之类假值判断
|
|
2557
|
+
qrQuietZone: typeof opts.qrQuietZone === "number" ? opts.qrQuietZone : void 0,
|
|
2540
2558
|
showText: opts.hideTitle !== void 0 ? !opts.hideTitle : opts.showBarcodeText,
|
|
2541
2559
|
barWidth: typeof opts.barWidth === "number" ? opts.barWidth : void 0,
|
|
2542
2560
|
fontSize: typeof opts.fontSize === "number" ? opts.fontSize : void 0,
|
|
@@ -2547,10 +2565,8 @@ function codeImgHtml(value, cellType, opts, io) {
|
|
|
2547
2565
|
if (isBarcode && /^<svg[\s>]/i.test(svg)) return inlineCodeSvgHtml(svg);
|
|
2548
2566
|
const src = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svg)}`;
|
|
2549
2567
|
const styleParts = [];
|
|
2550
|
-
styleParts.push("max-width:100%", "max-height:100%", "display:block", "margin:auto");
|
|
2551
|
-
|
|
2552
|
-
styleParts.push(`object-fit:${fit}`);
|
|
2553
|
-
}
|
|
2568
|
+
styleParts.push("width:100%", "height:100%", "max-width:100%", "max-height:100%", "display:block", "margin:auto");
|
|
2569
|
+
styleParts.push(`object-fit:${fit || "contain"}`);
|
|
2554
2570
|
if (maxWidth) {
|
|
2555
2571
|
styleParts.push(`max-width:${maxWidth}mm`);
|
|
2556
2572
|
}
|
|
@@ -2578,6 +2594,7 @@ function matrixCellStyle(cell, opts) {
|
|
|
2578
2594
|
if (color) parts.push(`color:${color}`);
|
|
2579
2595
|
if (cell.backgroundColor) parts.push(`background-color:${cell.backgroundColor}`);
|
|
2580
2596
|
parts.push(`text-align:${cell.align ?? "left"}`);
|
|
2597
|
+
if (cell.align === "justify") parts.push("text-align-last:justify");
|
|
2581
2598
|
parts.push(`vertical-align:${cell.valign ?? "middle"}`);
|
|
2582
2599
|
parts.push(`padding:${padding}mm`);
|
|
2583
2600
|
parts.push(cell.wordWrap === false ? "white-space:nowrap;overflow:hidden" : "word-break:break-all");
|
|
@@ -2617,7 +2634,7 @@ function renderMatrixRows(renderRows, start, end, opts, withRowIndex, ctx, fitOw
|
|
|
2617
2634
|
const fit = cell.fit || "contain";
|
|
2618
2635
|
const maxWidth = cell.maxWidth ? `max-width:${cell.maxWidth}mm;` : "max-width:100%;";
|
|
2619
2636
|
const maxHeight = cell.maxHeight ? `max-height:${cell.maxHeight}mm;` : "max-height:100%;";
|
|
2620
|
-
inner = `<div style="width:100%;height:100%;display:flex;align-items:center;justify-content:center;overflow:hidden;"><img src="${esc(resolveCellContent(cell, ctx))}" style="object-fit:${fit};${maxWidth}${maxHeight}display:block;" /></div>`;
|
|
2637
|
+
inner = `<div style="width:100%;height:100%;display:flex;align-items:center;justify-content:center;overflow:hidden;"><img src="${esc(resolveCellContent(cell, ctx))}" style="object-fit:${fit};${positionStyle(cell.objectPosition)}${maxWidth}${maxHeight}display:block;" /></div>`;
|
|
2621
2638
|
} else {
|
|
2622
2639
|
inner = renderTextCellInner(renderRows, r, colIndex, cell, opts, fitOwner, defaultPadding, ctx);
|
|
2623
2640
|
}
|
|
@@ -2960,7 +2977,8 @@ function codeSpecKey(value, cellType, opts = {}) {
|
|
|
2960
2977
|
opts.qrCodeLevel ?? null,
|
|
2961
2978
|
opts.showText ?? null,
|
|
2962
2979
|
opts.barWidth ?? null,
|
|
2963
|
-
opts.fontSize ?? null
|
|
2980
|
+
opts.fontSize ?? null,
|
|
2981
|
+
opts.qrQuietZone ?? null
|
|
2964
2982
|
]);
|
|
2965
2983
|
}
|
|
2966
2984
|
function createMapCodeRenderer(map) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @worm-vue3-print/core v1.3.
|
|
2
|
+
* @worm-vue3-print/core v1.3.7
|
|
3
3
|
* Copyright (c) 2026 worm <liu_long_qqcom@qq.com>
|
|
4
4
|
* SPDX-FileCopyrightText: 2026 worm <liu_long_qqcom@qq.com>
|
|
5
5
|
* SPDX-License-Identifier: MIT
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
evaluate,
|
|
10
10
|
parse,
|
|
11
11
|
tokenize
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-TCI5XQKI.js";
|
|
13
13
|
|
|
14
14
|
// src/index.ts
|
|
15
15
|
var TemplateEngine = class {
|
package/dist/client/index.cjs
CHANGED
package/dist/client/index.d.cts
CHANGED
package/dist/client/index.d.ts
CHANGED
package/dist/client/index.js
CHANGED
package/dist/designer/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @worm-vue3-print/core v1.3.
|
|
2
|
+
* @worm-vue3-print/core v1.3.7
|
|
3
3
|
* Copyright (c) 2026 worm <liu_long_qqcom@qq.com>
|
|
4
4
|
* SPDX-FileCopyrightText: 2026 worm <liu_long_qqcom@qq.com>
|
|
5
5
|
* SPDX-License-Identifier: MIT
|
|
@@ -102,6 +102,7 @@ __export(designer_exports, {
|
|
|
102
102
|
normalizeSelection: () => normalizeSelection,
|
|
103
103
|
normalizeTemplateUnits: () => normalizeTemplateUnits,
|
|
104
104
|
parseCellFitKey: () => parseCellFitKey,
|
|
105
|
+
propertyTip: () => propertyTip,
|
|
105
106
|
ptToMm: () => ptToMm,
|
|
106
107
|
pxToMm: () => pxToMm,
|
|
107
108
|
resolveBarcodeDesignValue: () => resolveBarcodeDesignValue,
|
|
@@ -112,6 +113,7 @@ __export(designer_exports, {
|
|
|
112
113
|
resolveElementTextFit: () => resolveElementTextFit,
|
|
113
114
|
resolveShrinkMinFontSize: () => resolveShrinkMinFontSize,
|
|
114
115
|
resolveTextBinding: () => resolveTextBinding,
|
|
116
|
+
resolveToolbarOverflow: () => resolveToolbarOverflow,
|
|
115
117
|
roundFontSize: () => roundFontSize,
|
|
116
118
|
safeEval: () => safeEval2,
|
|
117
119
|
searchProperties: () => searchProperties,
|
|
@@ -304,6 +306,27 @@ function computeFitScale(containerW, containerH, paperW, paperH, ratio = 0.9) {
|
|
|
304
306
|
return Math.max(FIT_SCALE_MIN_PERCENT, pct);
|
|
305
307
|
}
|
|
306
308
|
|
|
309
|
+
// src/designer/utils/toolbar-overflow.ts
|
|
310
|
+
var DEFAULT_GAP = 2;
|
|
311
|
+
function resolveToolbarOverflow(input) {
|
|
312
|
+
const gap = input.gap ?? DEFAULT_GAP;
|
|
313
|
+
const chain = [...input.units].sort((a, b) => a.order - b.order);
|
|
314
|
+
if (input.available <= 0) return { movedIds: [], overflowRemains: false };
|
|
315
|
+
if (chain.some((u) => u.width <= 0)) return { movedIds: [], overflowRemains: false };
|
|
316
|
+
const fits = (moved2) => {
|
|
317
|
+
const inline = chain.filter((u) => !moved2.has(u.id));
|
|
318
|
+
const used = input.pinned + inline.reduce((sum2, u) => sum2 + u.width + gap, 0) + (moved2.size > 0 ? input.moreTriggerWidth + gap : 0);
|
|
319
|
+
return used <= input.available;
|
|
320
|
+
};
|
|
321
|
+
if (fits(/* @__PURE__ */ new Set())) return { movedIds: [], overflowRemains: false };
|
|
322
|
+
const moved = /* @__PURE__ */ new Set();
|
|
323
|
+
for (const unit of chain) {
|
|
324
|
+
moved.add(unit.id);
|
|
325
|
+
if (fits(moved)) return { movedIds: [...moved], overflowRemains: false };
|
|
326
|
+
}
|
|
327
|
+
return { movedIds: [...moved], overflowRemains: true };
|
|
328
|
+
}
|
|
329
|
+
|
|
307
330
|
// src/designer/utils/migrate.ts
|
|
308
331
|
var PT_KEYS = ["left", "top", "width", "height"];
|
|
309
332
|
function convertElement(el) {
|
|
@@ -1010,7 +1033,22 @@ var PROPERTY_REGISTRY = [
|
|
|
1010
1033
|
{ key: "ap-letter-spacing", keywords: ["\u5B57\u95F4\u8DDD", "letterspacing"] },
|
|
1011
1034
|
{ key: "ap-text-fit", keywords: ["\u6EA2\u51FA", "\u6EA2\u51FA\u663E\u793A", "\u622A\u65AD", "\u81EA\u52A8\u7F29\u5C0F", "\u81EA\u9002\u5E94\u884C\u9AD8", "textfit", "overflow"] },
|
|
1012
1035
|
{ key: "ap-shrink-min", keywords: ["\u6700\u5C0F\u5B57\u53F7", "\u7F29\u653E\u4E0B\u9650", "shrinkminfontsize"] },
|
|
1013
|
-
{ key: "ap-word-wrap", keywords: ["\u81EA\u52A8\u6362\u884C", "\u4E0D\u6362\u884C", "wordwrap"] }
|
|
1036
|
+
{ key: "ap-word-wrap", keywords: ["\u81EA\u52A8\u6362\u884C", "\u4E0D\u6362\u884C", "wordwrap"] },
|
|
1037
|
+
{
|
|
1038
|
+
key: "ap-long-text-indent",
|
|
1039
|
+
keywords: ["\u9996\u884C\u7F29\u8FDB", "\u7F29\u8FDB", "indent", "longtextindent", "\u4E24\u5B57\u7B26", "\u6BB5\u9996"],
|
|
1040
|
+
tip: "\u957F\u6587\u672C\u6BCF\u6BB5\u9996\u884C\u7A7A\u51FA\u7684\u5BBD\u5EA6\uFF0C\u5355\u4F4D\u300C\u5B57\u7B26\u300D\uFF1A\u586B 2 \u5373\u7F29\u8FDB\u4E24\u4E2A\u6C49\u5B57\u5BBD\uFF08\u4E2D\u6587\u6392\u7248\u60EF\u4F8B\uFF09\uFF0C\u6309 em \u843D\u7EB8\u2014\u2014\u5B57\u53F7\u88AB\u300C\u81EA\u52A8\u7F29\u5C0F\u300D\u538B\u5C0F\u65F6\u7F29\u8FDB\u540C\u6B65\u53D8\u7A84\u3002\u4EC5\u957F\u6587\u672C\u5143\u7D20\u751F\u6548\uFF0C\u5199\u5728\u666E\u901A\u6587\u672C\u4E0A\u4E0D\u751F\u6548"
|
|
1041
|
+
},
|
|
1042
|
+
{
|
|
1043
|
+
key: "ap-img-fit",
|
|
1044
|
+
keywords: ["\u7F29\u653E\u6A21\u5F0F", "\u62C9\u4F38", "\u7B49\u6BD4", "fit", "contain", "cover", "\u586B\u5145", "\u88C1\u526A"],
|
|
1045
|
+
tip: "\u56FE\u7247\u5728\u5143\u7D20\u6846\u5185\u7684\u7F29\u653E\u65B9\u5F0F\uFF1A\u5305\u542B\uFF1D\u5B8C\u6574\u663E\u793A\u53EF\u80FD\u7559\u767D\uFF1B\u8986\u76D6\uFF1D\u94FA\u6EE1\u6846\u53EF\u80FD\u88C1\u8FB9\uFF1B\u62C9\u4F38\uFF1D\u586B\u6EE1\u6846\u4F1A\u53D8\u5F62\uFF1B\u539F\u59CB\u5C3A\u5BF8/\u7F29\u5C0F\u4E0D\u653E\u5927\u3002\u753B\u5E03\u4E0E\u4E09\u6761\u51FA\u7EB8\u94FE\u8DEF\u540C\u4E00\u53E3\u5F84\uFF08\u7F3A\u7701\u5305\u542B\uFF09"
|
|
1046
|
+
},
|
|
1047
|
+
{
|
|
1048
|
+
key: "ap-img-object-position",
|
|
1049
|
+
keywords: ["\u88C1\u526A\u951A\u70B9", "\u951A\u70B9", "objectposition", "object-position", "\u5BF9\u9F50\u70B9", "\u4E0A\u79FB", "\u5934\u9876"],
|
|
1050
|
+
tip: "\u88C1\u526A\u65F6\u4FDD\u7559\u6846\u5185\u7684\u54EA\u4E00\u90E8\u5206\uFF0CCSS object-position \u503C\u539F\u6837\u751F\u6548\uFF08\u5982 center 20% \u8BA9\u753B\u9762\u4E0A\u79FB\u3001\u4FDD\u4F4F\u8BC1\u4EF6\u7167\u5934\u9876\uFF09\uFF1B\u53EA\u5728\u53D1\u751F\u88C1\u5207\u65F6\u53EF\u89C1\uFF0C\u7F3A\u7701\u6309 50% 50% \u5C45\u4E2D\u3002\u542B\u5206\u53F7\u3001\u5F15\u53F7\u3001url() \u7684\u503C\u4F1A\u88AB\u6574\u6761\u4E22\u5F03"
|
|
1051
|
+
}
|
|
1014
1052
|
]
|
|
1015
1053
|
},
|
|
1016
1054
|
{
|
|
@@ -1023,6 +1061,11 @@ var PROPERTY_REGISTRY = [
|
|
|
1023
1061
|
{ key: "cd-show-text", keywords: ["\u663E\u793A\u6587\u672C", "\u6761\u7801\u6587\u672C", "\u663E\u793A\u6570\u5B57"] },
|
|
1024
1062
|
{ key: "cd-font-size", keywords: ["\u6761\u7801\u5B57\u53F7", "\u6587\u672C\u5B57\u53F7"] },
|
|
1025
1063
|
{ key: "cd-ec-level", keywords: ["\u7EA0\u9519\u7EA7\u522B", "\u5BB9\u9519", "qrcodelevel"] },
|
|
1064
|
+
{
|
|
1065
|
+
key: "cd-quiet-zone",
|
|
1066
|
+
keywords: ["\u9759\u533A", "\u9759\u533A\u5BBD\u5EA6", "\u767D\u8FB9", "\u7A7A\u767D\u8FB9", "\u7559\u767D", "\u94FA\u6EE1", "quietzone"],
|
|
1067
|
+
tip: "\u4E8C\u7EF4\u7801\u56DB\u5468\u7559\u51FA\u7684\u7A7A\u767D\u683C\u6570\uFF1A0 \u5373\u4E0D\u7559\u767D\u8FB9\u3001\u7801\u9762\u7B49\u6BD4\u94FA\u6EE1\u5143\u7D20\u6846\uFF08\u6B64\u65F6\u9760\u6846\u5916\u7684\u767D\u7EB8\u5145\u5F53\u9759\u533A\uFF09\uFF1B\u6570\u503C\u8D8A\u5927\u767D\u8FB9\u8D8A\u5BBD\u3001\u7801\u9762\u5728\u6846\u5185\u8D8A\u5C0F\uFF08\u7F3A\u7701 0\uFF0C\u9700 ISO/IEC 18004 \u63A8\u8350\u9759\u533A\u65F6\u586B 4\uFF09"
|
|
1068
|
+
},
|
|
1026
1069
|
{ key: "cd-fit", keywords: ["\u7F29\u653E\u6A21\u5F0F", "\u62C9\u4F38", "\u7B49\u6BD4", "fit", "contain", "cover"] },
|
|
1027
1070
|
{ key: "cd-max-width", keywords: ["\u6700\u5927\u5BBD\u5EA6", "\u6700\u5927\u5BBD", "maxwidth"] },
|
|
1028
1071
|
{ key: "cd-max-height", keywords: ["\u6700\u5927\u9AD8\u5EA6", "\u6700\u5927\u9AD8", "maxheight"] }
|
|
@@ -1077,6 +1120,13 @@ var PROPERTY_REGISTRY = [
|
|
|
1077
1120
|
]
|
|
1078
1121
|
}
|
|
1079
1122
|
];
|
|
1123
|
+
function propertyTip(key) {
|
|
1124
|
+
for (const group of PROPERTY_REGISTRY) {
|
|
1125
|
+
const hit = group.items.find((item) => item.key === key);
|
|
1126
|
+
if (hit) return hit.tip ?? "";
|
|
1127
|
+
}
|
|
1128
|
+
return "";
|
|
1129
|
+
}
|
|
1080
1130
|
function matchKeywords(search, keywords) {
|
|
1081
1131
|
const s = search.trim().toLowerCase();
|
|
1082
1132
|
if (!s) {
|
|
@@ -2846,6 +2896,7 @@ function useBindingDisplay() {
|
|
|
2846
2896
|
normalizeSelection,
|
|
2847
2897
|
normalizeTemplateUnits,
|
|
2848
2898
|
parseCellFitKey,
|
|
2899
|
+
propertyTip,
|
|
2849
2900
|
ptToMm,
|
|
2850
2901
|
pxToMm,
|
|
2851
2902
|
resolveBarcodeDesignValue,
|
|
@@ -2856,6 +2907,7 @@ function useBindingDisplay() {
|
|
|
2856
2907
|
resolveElementTextFit,
|
|
2857
2908
|
resolveShrinkMinFontSize,
|
|
2858
2909
|
resolveTextBinding,
|
|
2910
|
+
resolveToolbarOverflow,
|
|
2859
2911
|
roundFontSize,
|
|
2860
2912
|
safeEval,
|
|
2861
2913
|
searchProperties,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @worm-vue3-print/core v1.3.
|
|
2
|
+
* @worm-vue3-print/core v1.3.7
|
|
3
3
|
* Copyright (c) 2026 worm <liu_long_qqcom@qq.com>
|
|
4
4
|
* SPDX-FileCopyrightText: 2026 worm <liu_long_qqcom@qq.com>
|
|
5
5
|
* SPDX-License-Identifier: MIT
|
|
6
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-
|
|
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-
|
|
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-
|
|
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-Dzr2Aikx.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-Dzr2Aikx.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-Bin4xmo0.cjs';
|
|
10
10
|
import { TemplateEngine, formatMoney, ifFn, addNumbers, subtractNumbers, multiplyNumbers, divideNumbers, round, roundUp, roundDown, roundHalfEven, formatDate, toUpperCaseAmount } from '../index.cjs';
|
|
11
11
|
|
|
12
12
|
/** 1 英寸 = 25.4mm */
|
|
@@ -111,6 +111,40 @@ declare function nextWheelScale(percent: number, direction: 1 | -1, factor?: num
|
|
|
111
111
|
/** 计算适应窗口的缩放百分比,允许小于交互缩放下限,保证整版纸张可见 */
|
|
112
112
|
declare function computeFitScale(containerW: number, containerH: number, paperW: number, paperH: number, ratio?: number): number;
|
|
113
113
|
|
|
114
|
+
/**
|
|
115
|
+
* 顶部工具栏自适应收纳的纯计算部分:给定可用宽与各收纳单元的自然宽度,
|
|
116
|
+
* 按收纳优先级链得出哪些单元应移入「更多」下拉。
|
|
117
|
+
*
|
|
118
|
+
* 放在框架无关内核而非某个 UI 包:canvas 与 common 两套设计器宿主必须同链同序,
|
|
119
|
+
* 复制两份会出现「同一宽度下收起的分组不同」。
|
|
120
|
+
*/
|
|
121
|
+
interface OverflowUnitInput {
|
|
122
|
+
/** 单元标识,同时作为「更多」面板内落位容器的 key */
|
|
123
|
+
id: string;
|
|
124
|
+
/** 收纳优先级:数值小者先被收进「更多」 */
|
|
125
|
+
order: number;
|
|
126
|
+
/** 实测自然宽度(px);<=0 表示尚未上报 */
|
|
127
|
+
width: number;
|
|
128
|
+
}
|
|
129
|
+
interface ToolbarOverflowInput {
|
|
130
|
+
/** 工具栏可用内容宽(px) */
|
|
131
|
+
available: number;
|
|
132
|
+
/** 常驻不外收单元的合计宽(含其分隔) */
|
|
133
|
+
pinned: number;
|
|
134
|
+
/** 「更多」触发钮宽度,仅在确有收纳时计入 */
|
|
135
|
+
moreTriggerWidth: number;
|
|
136
|
+
/** flex 子项间距,与工具栏的 gap 同源 */
|
|
137
|
+
gap?: number;
|
|
138
|
+
units: OverflowUnitInput[];
|
|
139
|
+
}
|
|
140
|
+
interface ToolbarOverflowResult {
|
|
141
|
+
/** 收纳顺序(优先级链从先到后) */
|
|
142
|
+
movedIds: string[];
|
|
143
|
+
/** 收纳用尽仍放不下,需由样式兜底 */
|
|
144
|
+
overflowRemains: boolean;
|
|
145
|
+
}
|
|
146
|
+
declare function resolveToolbarOverflow(input: ToolbarOverflowInput): ToolbarOverflowResult;
|
|
147
|
+
|
|
114
148
|
declare function normalizeTemplateUnits(data: TemplateData): TemplateData;
|
|
115
149
|
|
|
116
150
|
/** 标签纸分组名(PAPER_PRESETS.group):该组纸型默认取消页眉、页脚与页边距 */
|
|
@@ -290,6 +324,8 @@ declare const PRESET_COLORS: readonly ["#000000", "#333333", "#666666", "#999999
|
|
|
290
324
|
interface PropertyItem {
|
|
291
325
|
key: string;
|
|
292
326
|
keywords: string[];
|
|
327
|
+
/** 字段说明文案:挂在标签后的帮助图标上(悬浮/点击显示),元素台与单元格台、canvas 与 common 共用同一份 */
|
|
328
|
+
tip?: string;
|
|
293
329
|
}
|
|
294
330
|
interface PropertyGroupDef {
|
|
295
331
|
group: string;
|
|
@@ -298,6 +334,8 @@ interface PropertyGroupDef {
|
|
|
298
334
|
}
|
|
299
335
|
declare const PROPERTY_REGISTRY: PropertyGroupDef[];
|
|
300
336
|
/** 正向包含匹配:任一关键词包含搜索词即命中;空搜索恒命中 */
|
|
337
|
+
/** 按表单项 key 取说明文案(帮助图标 tip 的内容);未登记说明时返回空串 */
|
|
338
|
+
declare function propertyTip(key: string): string;
|
|
301
339
|
declare function matchKeywords(search: string, keywords: string[]): boolean;
|
|
302
340
|
/** 计算命中的分组与表单项 key 集合 */
|
|
303
341
|
declare function searchProperties(search: string): {
|
|
@@ -484,4 +522,4 @@ declare function useBindingDisplay(): {
|
|
|
484
522
|
getBindingDisplayState: (element: any) => BindingDisplayState;
|
|
485
523
|
};
|
|
486
524
|
|
|
487
|
-
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 };
|
|
525
|
+
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, type OverflowUnitInput, 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, type ToolbarOverflowInput, type ToolbarOverflowResult, 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, propertyTip, ptToMm, pxToMm, resolveBarcodeDesignValue, resolveBarcodeSize, resolveCellBorderCss, resolveElementBorder, resolveTextBinding, resolveToolbarOverflow, safeEval, searchProperties, setHeaderRepeat, setRowType, splitCells, syncTableElementSize, useAlign, useBindingDisplay, useGroup, useKeyboard, useResize, zoneFromPaperPoint };
|