@gct-paas/word 0.1.74-beta.0 → 0.1.74-beta.2

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.
Files changed (27) hide show
  1. package/dist/base/input/src/input-number.vue.d.ts +2 -0
  2. package/dist/core/constants/paper.d.ts +2 -1
  3. package/dist/core/layout/LayoutContext.d.ts +1 -1
  4. package/dist/core/view/utils/TextUtil.d.ts +9 -4
  5. package/dist/domain/field/field-type.d.ts +0 -14
  6. package/dist/domain/field/option-spacing.d.ts +8 -0
  7. package/dist/domain/table/business/check/check-table/actions/fetch-check-items.d.ts +5 -3
  8. package/dist/domain/table/business/check/check-table/front-config.d.ts +21 -0
  9. package/dist/domain/table/business/check/check-table/index.d.ts +1 -0
  10. package/dist/domain/table/business/check/check-table/runtime/prepare-check-table-init.d.ts +13 -6
  11. package/dist/index.es.js +2490 -769
  12. package/dist/runtime/designer/ribbon/constant/font.d.ts +5 -4
  13. package/dist/sdk/types/index.d.ts +20 -1
  14. package/dist/utils/fonts/cjk-font-catalog.d.ts +32 -0
  15. package/dist/utils/fonts/cjk-optical-offset.d.ts +12 -0
  16. package/dist/utils/fonts/ensure-document-fonts.d.ts +12 -0
  17. package/dist/utils/pdf/collect-page-draw-ops.d.ts +5 -0
  18. package/dist/utils/pdf/collect-widget-draw-ops.d.ts +12 -0
  19. package/dist/utils/pdf/export-vector-pdf.d.ts +11 -0
  20. package/dist/utils/pdf/load-cjk-font.d.ts +2 -0
  21. package/dist/utils/pdf/pdf-page-painter.d.ts +3 -0
  22. package/dist/utils/pdf/resolve-field-text-style.d.ts +12 -0
  23. package/dist/utils/pdf/resolve-paper-widget-value.d.ts +4 -0
  24. package/dist/utils/pdf/resolve-pdf-text-baseline.d.ts +12 -0
  25. package/dist/utils/pdf/types.d.ts +80 -0
  26. package/dist/word.css +89 -73
  27. package/package.json +3 -1
@@ -17,6 +17,8 @@ type __VLS_Props = {
17
17
  returnString?: boolean;
18
18
  /** 控制是否实时 emit */
19
19
  emitOnInput?: boolean;
20
+ /** 清空并失焦后回填的值;未配置时保持原有空值行为 */
21
+ emptyValue?: string | number;
20
22
  /** 小数截取处理规则 */
21
23
  roundingMode?: 1 | 4 | 6;
22
24
  };
@@ -26,9 +26,10 @@ export declare const DEFAULT_PAGE_SIZE: {
26
26
  export declare const DEFAULT_PAGE_PADDING: [number, number, number, number];
27
27
  export declare const DEFAULT_CELL_PADDING: [number, number, number, number];
28
28
  export declare const DEFAULT_FONT_SIZE = 16;
29
+ /** 默认黑体 */
29
30
  export declare const DEFAULT_LINE_HEIGHT = 1.6;
30
31
  /** 图片 / 签名行高,略高于内容,避免贴行又不过松 */
31
32
  export declare const IMAGE_LINE_HEIGHT = 1.1;
32
- export declare const DEFAULT_FONT_FAMILY = "Roboto,RobotoDraft,Helvetica,Arial,sans-serif";
33
+ export declare const DEFAULT_FONT_FAMILY = "\"Noto Sans SC\", \"NotoSansSC\", \"\u9ED1\u4F53\", \"SimHei\", sans-serif";
33
34
  export declare const DEFAULT_TEXT_COLOR = "black";
34
35
  export declare const ZERO_WIDTH_SPACE = "\u200B";
@@ -40,7 +40,7 @@ export declare class LayoutContext {
40
40
  ensureCellParagraphSpace(itemWidth: number): void;
41
41
  ensurePageParagraphSpace(itemWidth: number, itemHeight: number): void;
42
42
  ensureParagraphSpace(itemWidth: number, itemHeight: number): void;
43
- insertLineBreak(): void;
43
+ insertLineBreak(blockGap?: number): void;
44
44
  /** 设置下一个 run 与当前 run 之间的行内 gap。 */
45
45
  setInlineGap(gap: number): void;
46
46
  createNewPage(payload?: Partial<PageOptions>): Page;
@@ -66,12 +66,17 @@ export declare class TextUtil {
66
66
  * @returns
67
67
  */
68
68
  private static getMeasureCacheKey;
69
+ /** 历史默认西文栈:仅黑体垂直定位参照,保持与旧版观感一致 */
70
+ private static readonly VERTICAL_METRICS_REF_FONT;
69
71
  /**
70
- * 计算字体度量
71
- * ascent / descent
72
+ * 是否为文档黑体(Noto Sans SC);宋体/楷体不走 Roboto 垂直参照
73
+ */
74
+ private static isHeitiDocumentFontFamily;
75
+ /**
76
+ * 计算字体度量 ascent / descent
72
77
  *
73
- * @param payload
74
- * @returns
78
+ * 黑体:用 Roboto 栈的 'Hg' + actualBoundingBox 做垂直定位(接近旧默认观感)。
79
+ * 宋体/楷体/其它:用自身字体度量。
75
80
  */
76
81
  static getFontMetrics(payload: Konva.TextConfig): {
77
82
  ascent: number;
@@ -390,20 +390,6 @@ export declare enum FIELD_TYPE {
390
390
  */
391
391
  STERILIZATION_CONTAINER = "sterilization_container"
392
392
  }
393
- export declare enum FIELD_TYPE_TRACE {
394
- MATERIAL_NO = "material_no",
395
- STERILIZE_LOT = "sterilization_container",
396
- MATERIAL_LOT = "material_container",
397
- RELATED_LOT_NO = "related_lot_no",
398
- PRODUCT = "product",
399
- SHOPFLOOR = "shopfloor",
400
- DEVICE = "device",
401
- MFG_ORDER = "mfg_order",
402
- RECORD_NO = "record_no",
403
- TRACE_DATE = "trace_date",
404
- ORDER_NO = "order_no",
405
- EXTERNAL_REF_NO = "external_reference_no"
406
- }
407
393
  export type FieldTypeSource = Pick<FieldMeta, 'type' | 'bizType'>;
408
394
  /** manifest / 面板 / 渲染 / icon 查找用的类型 */
409
395
  export declare function resolveFieldManifestType(field: FieldTypeSource): FIELD_TYPE;
@@ -0,0 +1,8 @@
1
+ export declare const DEFAULT_ICON_LABEL_SPACE = 8;
2
+ export declare const DEFAULT_OPTION_SPACING = 12;
3
+ /** 将清空或异常的间距恢复为设计默认值,避免配置与画布出现空值。 */
4
+ export declare function resolveSpacingValue(value: unknown, defaultValue: number): number;
5
+ /** 新配置使用 optionSpacing;缺失时继续兼容历史 controlEnumSpace。 */
6
+ export declare function resolveOptionSpacing(optionSpacing: unknown, legacyOptionSpacing?: unknown): number;
7
+ /** 纵向排列时仅在相邻选项行之间添加 gap,最后一项后不额外留白。 */
8
+ export declare function resolveVerticalOptionGap(optionIndex: number, optionCount: number, optionSpacing: unknown, legacyOptionSpacing?: unknown): number;
@@ -1,9 +1,11 @@
1
1
  import { CheckTableItemInfosPayload, CheckTableRegionRef } from '../types';
2
+ import { ICheckTableConfig } from '../front-config';
2
3
  /**
3
- * 按已扫描的检验表 region 并行拉取检验项详情。
4
- * @returns infosMap / countMap(count 至少为 1,用于占位行)
4
+ * 按已扫描的检验表 region 并行解析检验项(有快照用快照,否则请求)。
5
+ * @returns infosMap / countMap(count 至少为 1,用于占位行)/ 待落库 byTable 快照
5
6
  */
6
- export declare function fetchCheckItemsForRegions(instanceId: string, regions: CheckTableRegionRef[]): Promise<{
7
+ export declare function fetchCheckItemsForRegions(instanceId: string, regions: CheckTableRegionRef[], checkTableConfig?: ICheckTableConfig): Promise<{
7
8
  infosMap: Record<string, CheckTableItemInfosPayload>;
8
9
  countMap: Record<string, number>;
10
+ pendingCheckTableConfig?: ICheckTableConfig;
9
11
  }>;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * 表单实例 frontConfig
3
+ *
4
+ * Word 检验表按 regionId 写入 checkTableConfig.byTable;
5
+ * shared 预留给后续若接入 MedPro M08 整页共用源。
6
+ */
7
+ export interface ICheckTableConfig {
8
+ /** MedPro 整页共用原始检验项;字段存在即锁定(可空数组) */
9
+ shared?: Record<string, unknown>[];
10
+ /** 按检验表 regionId 分表快照;key 存在即锁定(可空数组) */
11
+ byTable?: Record<string, Record<string, unknown>[]>;
12
+ }
13
+ export interface IFrontConfig {
14
+ checkTableConfig?: ICheckTableConfig;
15
+ otherConfig?: Record<string, unknown>;
16
+ }
17
+ export declare function parseFrontConfig(frontConfig?: string | null): IFrontConfig;
18
+ export declare function hasByTableCheckTableSnapshot(config: ICheckTableConfig | undefined, regionId: string): boolean;
19
+ export declare function hasAnyCheckTableSnapshot(config?: ICheckTableConfig): boolean;
20
+ /** 从 frontConfig 字符串取出检验表快照 */
21
+ export declare function getCheckTableConfigFromFrontConfig(frontConfig?: string | null): ICheckTableConfig | undefined;
@@ -2,4 +2,5 @@ export { profile as checkTableProfile } from './profile';
2
2
  export { CHECK_TABLE_TYPE_TO_VALUE_FIELD } from './profile/field-keys';
3
3
  export * from './runtime';
4
4
  export * from './actions';
5
+ export * from './front-config';
5
6
  export * from './types';
@@ -1,13 +1,20 @@
1
1
  import { CheckTableItemInfosPayload, CheckTableRegionRef } from '../types';
2
- /**
3
- * 文档初始化前:一次扫描 → 并行拉检验项 → 原地扩 runtimeJson。
4
- * 须在 ModelConverter.toModel 之前调用;传入的 runtimeJson 须已是可写副本。
5
- */
6
- export declare function prepareCheckTableRuntimeJson<T extends Record<string, unknown>>(instanceId: string, runtimeJson: T): Promise<{
2
+ import { ICheckTableConfig } from '../front-config';
3
+ export type PrepareCheckTableRuntimeJsonResult<T extends Record<string, unknown>> = {
7
4
  runtimeJson: T;
8
5
  infosMap: Record<string, CheckTableItemInfosPayload>;
9
6
  regions: CheckTableRegionRef[];
10
- }>;
7
+ /** 本次打开解析/拉取到的检验表快照,保存时写入 frontConfig.checkTableConfig */
8
+ pendingCheckTableConfig?: ICheckTableConfig;
9
+ };
10
+ /**
11
+ * 文档初始化前:一次扫描 → 并行拉检验项(或读快照)→ 原地扩 runtimeJson。
12
+ * 须在 ModelConverter.toModel 之前调用;传入的 runtimeJson 须已是可写副本。
13
+ */
14
+ export declare function prepareCheckTableRuntimeJson<T extends Record<string, unknown>>(instanceId: string, runtimeJson: T, options?: {
15
+ /** 实例已落库的 frontConfig(JSON 字符串) */
16
+ frontConfig?: string | null;
17
+ }): Promise<PrepareCheckTableRuntimeJsonResult<T>>;
11
18
  /**
12
19
  * 文档初始化中:将检验项配置写入 defaultsMap(字段路径展开)。
13
20
  * 优先使用 prepare 返回的 regions,避免再次扫描 runtimeJson。