@worm-vue3-print/core 1.3.6 → 1.3.8

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,5 +1,5 @@
1
1
  /*!
2
- * @worm-vue3-print/core v1.3.6
2
+ * @worm-vue3-print/core v1.3.8
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
@@ -242,7 +242,7 @@ type TemplateElement$1 = PrintElementData;
242
242
  /** 元素类型 */
243
243
  type ElementType = 'text' | 'image' | 'longText' | 'table' | 'hline' | 'vline' | 'rect' | 'oval' | 'barcode' | 'qrcode' | 'html' | 'pageNumber';
244
244
  /** 对齐方式 */
245
- type TextAlign = 'left' | 'center' | 'right';
245
+ type TextAlign = 'left' | 'center' | 'right' | 'justify';
246
246
  /**
247
247
  * 文字超出可用空间时的显示形式(文本类元素与表格单元格共用):
248
248
  * - `clip`:截断,超出部分不显示;不换行(`wordWrap=false`)时以省略号收尾
@@ -310,6 +310,7 @@ interface TableCell {
310
310
  cellType?: TableCellType;
311
311
  barcodeType?: string;
312
312
  qrCodeLevel?: string;
313
+ qrQuietZone?: number;
313
314
  showBarcodeText?: boolean;
314
315
  /**
315
316
  * 打印机分辨率(点/英寸,常见 203/300/600),仅 cellType='barcode' 时生效:
@@ -340,6 +341,8 @@ interface TableCell {
340
341
  /** 自动缩小(textFit='shrink')的下限字号(pt);缺省 6pt */
341
342
  shrinkMinFontSize?: number;
342
343
  fit?: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down';
344
+ objectPosition?: string;
345
+ fitScale?: number;
343
346
  maxWidth?: number;
344
347
  maxHeight?: number;
345
348
  }
@@ -421,9 +424,20 @@ interface ElementOptions {
421
424
  */
422
425
  printerDpi?: number;
423
426
  qrCodeLevel?: string;
427
+ /**
428
+ * 二维码静区(白边)宽度,单位「模块」:图形四周留出的空白格数,缺省 0。
429
+ * 0 表示不留白边,码面即整张图、等比铺满元素框——此时扫码所需的静区由元素框外的白纸充当;
430
+ * 要合规静区(ISO/IEC 18004 推荐 4 模块)请显式写 4。
431
+ * 值越大码面在框内占比越小(21 模块时:0→100%、2→84%、4→72.4%)。
432
+ */
433
+ qrQuietZone?: number;
424
434
  src?: string;
425
435
  /** 内容缩放模式(image/qrcode):contain | cover | fill | none | scale-down。条形码不接受拉伸——尺寸已由结算确定 */
426
436
  fit?: string;
437
+ /** 裁剪锚点(image):CSS object-position 值透传,如 'center 20%';含 ; 引号 url() 等非法字符则整条丢弃;缺省不输出,按 50% 50% 居中 */
438
+ objectPosition?: string;
439
+ /** 剪裁放大比例(image,100~400,单位 %):仅 fit='cover' 消费——铺满后把画面再推大这么多,两轴同时溢出才真裁得动;100/缺省不落声明 */
440
+ fitScale?: number;
427
441
  /** 内容最大宽度(mm,image/barcode/qrcode);缺省不限制 */
428
442
  maxWidth?: number;
429
443
  /** 内容最大高度(mm,image/barcode/qrcode);缺省不限制 */
@@ -451,8 +465,6 @@ interface ElementOptions {
451
465
  styler?: string;
452
466
  rowStyler?: string;
453
467
  longTextIndent?: number;
454
- leftSpaceRemoved?: boolean;
455
- lHeight?: number;
456
468
  }
457
469
  /** 元素类型元数据 */
458
470
  interface PrintElementTypeMeta {
@@ -656,12 +668,18 @@ interface RenderCell {
656
668
  barcodeType?: string;
657
669
  /** 二维码纠错级别 L/M/Q/H,仅 cellType='qrcode' 时生效 */
658
670
  qrCodeLevel?: string;
671
+ /** 二维码静区(白边)宽度(模块),仅 cellType='qrcode' 时生效;缺省 0 = 码面铺满单元格 */
672
+ qrQuietZone?: number;
659
673
  /** 条形码下方是否显示文本,仅 cellType='barcode' 时生效 */
660
674
  showBarcodeText?: boolean;
661
675
  /** 打印机分辨率(点/英寸),仅 cellType='barcode' 时生效:给出后条码尺寸优先适配打印机点阵 */
662
676
  printerDpi?: number;
663
677
  /** 图片缩放模式,仅 cellType='image' 时生效 */
664
678
  fit?: string;
679
+ /** 裁剪锚点(CSS object-position 值),仅 cellType=image 生效;含非法字符则整条不输出 */
680
+ objectPosition?: string;
681
+ /** 剪裁放大比例(%,100~400),仅 cellType=image 且 fit=cover 生效;100/缺省不输出 */
682
+ fitScale?: number;
665
683
  /** 图片最大宽度(mm),仅 cellType='image' 时生效 */
666
684
  maxWidth?: number;
667
685
  /** 图片最大高度(mm),仅 cellType='image' 时生效 */
@@ -698,6 +716,8 @@ interface CodeRenderOptions {
698
716
  barcodeType?: string;
699
717
  /** 二维码纠错级别 L/M/Q/H,仅 qrcode 类型使用 */
700
718
  qrCodeLevel?: string;
719
+ /** 二维码静区(白边)宽度,单位「模块」,仅 qrcode 类型使用;缺省 0 = 无白边,码面即整张图 */
720
+ qrQuietZone?: number;
701
721
  /** 条形码下方是否显示文本 */
702
722
  showText?: boolean;
703
723
  /** 条码模块宽度倍率;决定每模块的首选物理宽度(倍率/2 × 0.25mm),给 dpi 后吸附到最近整数点 */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @worm-vue3-print/core v1.3.6
2
+ * @worm-vue3-print/core v1.3.8
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
@@ -242,7 +242,7 @@ type TemplateElement$1 = PrintElementData;
242
242
  /** 元素类型 */
243
243
  type ElementType = 'text' | 'image' | 'longText' | 'table' | 'hline' | 'vline' | 'rect' | 'oval' | 'barcode' | 'qrcode' | 'html' | 'pageNumber';
244
244
  /** 对齐方式 */
245
- type TextAlign = 'left' | 'center' | 'right';
245
+ type TextAlign = 'left' | 'center' | 'right' | 'justify';
246
246
  /**
247
247
  * 文字超出可用空间时的显示形式(文本类元素与表格单元格共用):
248
248
  * - `clip`:截断,超出部分不显示;不换行(`wordWrap=false`)时以省略号收尾
@@ -310,6 +310,7 @@ interface TableCell {
310
310
  cellType?: TableCellType;
311
311
  barcodeType?: string;
312
312
  qrCodeLevel?: string;
313
+ qrQuietZone?: number;
313
314
  showBarcodeText?: boolean;
314
315
  /**
315
316
  * 打印机分辨率(点/英寸,常见 203/300/600),仅 cellType='barcode' 时生效:
@@ -340,6 +341,8 @@ interface TableCell {
340
341
  /** 自动缩小(textFit='shrink')的下限字号(pt);缺省 6pt */
341
342
  shrinkMinFontSize?: number;
342
343
  fit?: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down';
344
+ objectPosition?: string;
345
+ fitScale?: number;
343
346
  maxWidth?: number;
344
347
  maxHeight?: number;
345
348
  }
@@ -421,9 +424,20 @@ interface ElementOptions {
421
424
  */
422
425
  printerDpi?: number;
423
426
  qrCodeLevel?: string;
427
+ /**
428
+ * 二维码静区(白边)宽度,单位「模块」:图形四周留出的空白格数,缺省 0。
429
+ * 0 表示不留白边,码面即整张图、等比铺满元素框——此时扫码所需的静区由元素框外的白纸充当;
430
+ * 要合规静区(ISO/IEC 18004 推荐 4 模块)请显式写 4。
431
+ * 值越大码面在框内占比越小(21 模块时:0→100%、2→84%、4→72.4%)。
432
+ */
433
+ qrQuietZone?: number;
424
434
  src?: string;
425
435
  /** 内容缩放模式(image/qrcode):contain | cover | fill | none | scale-down。条形码不接受拉伸——尺寸已由结算确定 */
426
436
  fit?: string;
437
+ /** 裁剪锚点(image):CSS object-position 值透传,如 'center 20%';含 ; 引号 url() 等非法字符则整条丢弃;缺省不输出,按 50% 50% 居中 */
438
+ objectPosition?: string;
439
+ /** 剪裁放大比例(image,100~400,单位 %):仅 fit='cover' 消费——铺满后把画面再推大这么多,两轴同时溢出才真裁得动;100/缺省不落声明 */
440
+ fitScale?: number;
427
441
  /** 内容最大宽度(mm,image/barcode/qrcode);缺省不限制 */
428
442
  maxWidth?: number;
429
443
  /** 内容最大高度(mm,image/barcode/qrcode);缺省不限制 */
@@ -451,8 +465,6 @@ interface ElementOptions {
451
465
  styler?: string;
452
466
  rowStyler?: string;
453
467
  longTextIndent?: number;
454
- leftSpaceRemoved?: boolean;
455
- lHeight?: number;
456
468
  }
457
469
  /** 元素类型元数据 */
458
470
  interface PrintElementTypeMeta {
@@ -656,12 +668,18 @@ interface RenderCell {
656
668
  barcodeType?: string;
657
669
  /** 二维码纠错级别 L/M/Q/H,仅 cellType='qrcode' 时生效 */
658
670
  qrCodeLevel?: string;
671
+ /** 二维码静区(白边)宽度(模块),仅 cellType='qrcode' 时生效;缺省 0 = 码面铺满单元格 */
672
+ qrQuietZone?: number;
659
673
  /** 条形码下方是否显示文本,仅 cellType='barcode' 时生效 */
660
674
  showBarcodeText?: boolean;
661
675
  /** 打印机分辨率(点/英寸),仅 cellType='barcode' 时生效:给出后条码尺寸优先适配打印机点阵 */
662
676
  printerDpi?: number;
663
677
  /** 图片缩放模式,仅 cellType='image' 时生效 */
664
678
  fit?: string;
679
+ /** 裁剪锚点(CSS object-position 值),仅 cellType=image 生效;含非法字符则整条不输出 */
680
+ objectPosition?: string;
681
+ /** 剪裁放大比例(%,100~400),仅 cellType=image 且 fit=cover 生效;100/缺省不输出 */
682
+ fitScale?: number;
665
683
  /** 图片最大宽度(mm),仅 cellType='image' 时生效 */
666
684
  maxWidth?: number;
667
685
  /** 图片最大高度(mm),仅 cellType='image' 时生效 */
@@ -698,6 +716,8 @@ interface CodeRenderOptions {
698
716
  barcodeType?: string;
699
717
  /** 二维码纠错级别 L/M/Q/H,仅 qrcode 类型使用 */
700
718
  qrCodeLevel?: string;
719
+ /** 二维码静区(白边)宽度,单位「模块」,仅 qrcode 类型使用;缺省 0 = 无白边,码面即整张图 */
720
+ qrQuietZone?: number;
701
721
  /** 条形码下方是否显示文本 */
702
722
  showText?: boolean;
703
723
  /** 条码模块宽度倍率;决定每模块的首选物理宽度(倍率/2 × 0.25mm),给 dpi 后吸附到最近整数点 */