@gct-paas/word 0.2.7-beta.0 → 0.2.7-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 (26) hide show
  1. package/dist/base/dropdown/src/dropdown-basic-select.vue.d.ts +2 -0
  2. package/dist/base/utils/image-size-util.d.ts +1 -1
  3. package/dist/core/command/commands/DeleteCol.d.ts +1 -1
  4. package/dist/core/command/commands/InsertTable.d.ts +0 -1
  5. package/dist/core/command/types.d.ts +2 -0
  6. package/dist/core/data/formula/business-functions.d.ts +8 -2
  7. package/dist/core/data/formula/formula-params-cache.d.ts +15 -0
  8. package/dist/core/model/logic/subtable/shared/dataGroupSlotCount.d.ts +37 -1
  9. package/dist/domain/field/form-value.d.ts +6 -0
  10. package/dist/domain/table/business/device/maintenance/profile/field-keys.d.ts +2 -2
  11. package/dist/domain/table/business/material/material-substitution/profile/field-keys.d.ts +2 -0
  12. package/dist/domain/table/business/material/material-substitution/runtime/row-change-handlers.d.ts +1 -0
  13. package/dist/domain/table/design/validate-nested-table-insert.d.ts +3 -0
  14. package/dist/domain/table/index.d.ts +1 -0
  15. package/dist/domain/table/runtime/option-fill-updates.d.ts +6 -0
  16. package/dist/domain/table/runtime/table-runtime.d.ts +2 -0
  17. package/dist/domain/table/types.d.ts +2 -0
  18. package/dist/index.es.js +4219 -6189
  19. package/dist/runtime/canvas/__common__/context-menu/resolve-table-context.d.ts +10 -0
  20. package/dist/runtime/interface/sterilization-date.d.ts +9 -0
  21. package/dist/runtime/renderer/dropdowns/factories/dropdown-factory.d.ts +1 -5
  22. package/dist/sdk/doc-runtime/factories/document-initializer.d.ts +1 -0
  23. package/dist/sdk/setup.d.ts +4 -0
  24. package/dist/utils/adapters/ServiceUtil.d.ts +9 -0
  25. package/dist/word.css +122 -656
  26. package/package.json +2 -2
@@ -27,6 +27,8 @@ type __VLS_Props = {
27
27
  /** 选项列表最大高度 */
28
28
  listMaxHeight?: number | string;
29
29
  dropdownExtraProps?: Record<string, any>;
30
+ /** 下拉入口点击前校验;返回 false 时不展开菜单 */
31
+ beforeOpen?: () => boolean;
30
32
  };
31
33
  declare function __VLS_template(): {
32
34
  attrs: Partial<{}>;
@@ -43,7 +43,7 @@ export declare function computeContainDisplaySize(natural: ImageSize, box: Image
43
43
  export declare function getCachedSignatureImage(name: string, _width?: number, _height?: number, time?: number | string, fallbackSignType?: string, signatureImageDirection?: string): HTMLImageElement | null;
44
44
  /**
45
45
  * 创建无图签名兜底图
46
- * 默认用户名 + 电子签名 + 验证日期;仅用户名时只绘制姓名
46
+ * 默认仅绘制用户名;显式配置用户名 + 签署日期时绘制完整兜底签名
47
47
  */
48
48
  export declare function createSignatureImageDataUrl(name: string, _width?: number, _height?: number, time?: number | string, fallbackSignType?: string, signatureImageDirection?: string): string;
49
49
  export declare function createSignatureImage(name: string, width?: number, height?: number, time?: number | string, fallbackSignType?: string, signatureImageDirection?: string): Promise<HTMLImageElement>;
@@ -4,7 +4,7 @@ import { CommandBase, PostCommandContext } from '../base/CommandBase';
4
4
  /**
5
5
  * 表格列删除命令
6
6
  *
7
- * 删除指定索引处的列
7
+ * 删除指定列,或当前选区中同一表格的连续多列
8
8
  */
9
9
  export declare class DeleteCol extends CommandBase<'deleteCol'> {
10
10
  constructor(doc: Doc, payload?: CommandPayloadMap['deleteCol']);
@@ -5,7 +5,6 @@ import { Wtbl } from '../../model/document';
5
5
  export declare class InsertTable extends CommandBase<'insertTable'> {
6
6
  constructor(doc: Doc, payload?: CommandPayloadMap['insertTable']);
7
7
  protected createTable(width: number, rowCount?: number, colCount?: number): Wtbl;
8
- private resolveBlockedTableLabel;
9
8
  protected execute(): Promise<PostCommandContext>;
10
9
  private insertAtCursor;
11
10
  private insertIntoBody;
@@ -1,4 +1,5 @@
1
1
  import { VOrientationType } from '../../domain/constants/enum';
2
+ import { FIELD_TYPE } from '../../domain/field/field-type';
2
3
  import { Doc } from '../view/Doc';
3
4
  import { WidgetMeta } from '../widget/widget-meta';
4
5
  import { WordHighlight } from '../model/types';
@@ -91,6 +92,7 @@ export type CommandPayloadMap = {
91
92
  };
92
93
  commitValidateNumber: CommandPayload & {
93
94
  valuePath?: string;
95
+ fieldType?: FIELD_TYPE;
94
96
  type?: 'fw:number' | 'fw:double';
95
97
  digits?: number;
96
98
  roundingMode?: 1 | 4 | 6;
@@ -1,4 +1,10 @@
1
+ export { setFormulaParamsConfig } from './formula-params-cache';
1
2
  export type FormulaRegister = (name: string, executor: (...args: any[]) => any) => void;
2
- /** 更新当前表单的参数配置;未传入配置时清空上次的数据。 */
3
- export declare function setFormulaParamsConfig(paramsConfig?: Record<string, any> | null): void;
3
+ interface DeviceParamConfig {
4
+ customFieldKey: string;
5
+ lowerLimit?: number | string | null;
6
+ upperLimit?: number | string | null;
7
+ }
8
+ type FetchDeviceParamLimits = (id: any) => Promise<DeviceParamConfig[] | null>;
9
+ export declare function configureDeviceParamCheck(fetcher: FetchDeviceParamLimits): void;
4
10
  export declare function registerFormulaFuncs(register?: FormulaRegister): void;
@@ -0,0 +1,15 @@
1
+ interface FormulaParam {
2
+ customFieldKey: string;
3
+ lowerLimit?: number | string | null;
4
+ upperLimit?: number | string | null;
5
+ }
6
+ export declare const currentParamsConfig: {
7
+ readonly routingParamList: FormulaParam[];
8
+ readonly inspectionParamList: FormulaParam[];
9
+ readonly deviceParamList: FormulaParam[];
10
+ };
11
+ /** Excel、Word 共用参数;空配置也要覆盖旧值。 */
12
+ export declare function setFormulaParamsConfig(paramsConfig?: Record<string, any> | null): void;
13
+ /** 随应用绑定一次失效通知,不包装或替换宿主计算函数。 */
14
+ export declare function bindFormulaCacheInvalidation(value: unknown): void;
15
+ export {};
@@ -1,3 +1,4 @@
1
+ import { Wtbl } from '../../../document/Wtbl';
1
2
  /** 表格矩形范围(含起止行列,均为闭区间) */
2
3
  export type TableRange = {
3
4
  start: {
@@ -9,10 +10,45 @@ export type TableRange = {
9
10
  col: number;
10
11
  };
11
12
  };
13
+ type AxisRange = {
14
+ start: number;
15
+ end: number;
16
+ };
17
+ export type MergeAwareDataGroupSlot = {
18
+ range: TableRange;
19
+ /** 目标可见行带与模板行带的对应关系。 */
20
+ rowBands: Array<{
21
+ source: AxisRange;
22
+ target: AxisRange;
23
+ }>;
24
+ /** 目标可见列带与模板列带的对应关系。 */
25
+ colBands: Array<{
26
+ source: AxisRange;
27
+ target: AxisRange;
28
+ }>;
29
+ };
30
+ export type MergeAwareDataGroupCellMapping = {
31
+ row: number;
32
+ col: number;
33
+ sourceRow: number;
34
+ sourceCol: number;
35
+ dataIndex: number;
36
+ };
37
+ /**
38
+ * 按可见合并单元格枚举铺砖槽位。
39
+ *
40
+ * Word 底层的 gridCol/gridRow 数量不一定等于用户看到的单元格数量。这里先把父区域
41
+ * 转换为逻辑行列带,再按原有的先横后纵/先纵后横顺序铺砖。返回 undefined 表示合并
42
+ * 结构不规则,应回退到传统的底层网格矩形算法。
43
+ */
44
+ export declare function getMergeAwareDataGroupSlots(table: Wtbl, range: TableRange, itemRange: TableRange, fillDirection?: 'x' | 'y'): MergeAwareDataGroupSlot[] | undefined;
45
+ /** 将可见槽位展开为每个底层网格单元格的数据索引和模板坐标。 */
46
+ export declare function getMergeAwareDataGroupCellMappings(slots: MergeAwareDataGroupSlot[]): MergeAwareDataGroupCellMapping[];
12
47
  /**
13
48
  * 计算数据分组 / 动态关联在版面中可铺砖的数据槽位数(含模板块 dataIndex 0)。
14
49
  * 逻辑与 TableExpander.computeDataIndexMap 中铺砖循环一致。
15
50
  */
16
- export declare function countDataGroupSlots(range: TableRange, itemRange: TableRange, fillDirection?: 'x' | 'y'): number;
51
+ export declare function countDataGroupSlots(range: TableRange, itemRange: TableRange, fillDirection?: 'x' | 'y', table?: Wtbl): number;
17
52
  /** 检验表 / 二维表动态关联:itemRegion 行范围可能超出子表主体 */
18
53
  export declare function expandDataGroupRowRange(parent: TableRange, itemRange: TableRange): TableRange;
54
+ export {};
@@ -80,6 +80,12 @@ type NormalizeNumberTextResult = {
80
80
  * - fw:number 根据 digits 执行整数化或小数截断
81
81
  */
82
82
  export declare function normalizeNumberTextOnCommit(rawText: string, options: NormalizeNumberTextOptions): NormalizeNumberTextResult;
83
+ /** 配置检查:返回错误说明,不抛异常。 */
84
+ export declare function getNumberInputConfigError(fieldType: FIELD_TYPE | undefined, digits: unknown): string | null;
85
+ /** 填报失焦时处理数字长度和整数上限。 */
86
+ export declare function normalizeNumberInputOnBlur(rawText: string, options: NormalizeNumberTextOptions, fieldType?: FIELD_TYPE): NormalizeNumberTextResult & {
87
+ configError?: string;
88
+ };
83
89
  export declare function buildNumberFormats(props: any, type: NumberFieldType): {
84
90
  type: NumberFieldType;
85
91
  digits: number | undefined;
@@ -1,8 +1,8 @@
1
1
  /** 设备保养表内置字段 key */
2
2
  export declare const F: {
3
- /** 点检日期 */
3
+ /** 保养日期 */
4
4
  readonly inspectionDate: "inspection_date_";
5
- /** 点检人 */
5
+ /** 保养人 */
6
6
  readonly inspector: "inspector_";
7
7
  /** 复核人 */
8
8
  readonly reviewer: "reviewer_";
@@ -37,3 +37,5 @@ export declare const DISABLED_INPUT_FIELDS: readonly ["source_material_no_", "so
37
37
  export declare const CLEAR_ON_SOURCE_PRODUCT_EMPTY: readonly ["source_material_no_", "source_product_id_name_", "source_product_id_code_", "source_product_id_spec_", "source_qty_consumed_"];
38
38
  /** 替换物料批号清空 / 手输时需清空的物料字段 */
39
39
  export declare const CLEAR_ON_TARGET_MATERIAL_NO_EMPTY: readonly ["target_product_id_name_", "target_product_id_code_", "target_product_id_spec_"];
40
+ /** 替换料清空时同步清除批次、数量和物料信息。 */
41
+ export declare const CLEAR_ON_TARGET_PRODUCT_EMPTY: readonly ["target_material_no_", "target_product_id_name_", "target_product_id_code_", "target_product_id_spec_", "target_qty_consumed_"];
@@ -1,3 +1,4 @@
1
1
  import { Doc } from '../../../../../../core';
2
2
  export declare function handleTargetMaterialNoChange(doc: Doc, subFieldKey: string, rowIndex: number): void;
3
3
  export declare function handleSourceProductChange(doc: Doc, subFieldKey: string, rowIndex: number): void;
4
+ export declare function handleTargetProductChange(doc: Doc, subFieldKey: string, rowIndex: number): void;
@@ -0,0 +1,3 @@
1
+ import { Wtc } from '../../../core/model/document';
2
+ /** 返回普通表格插入被当前单元格阻止时的原有提示。 */
3
+ export declare function getNestedTableInsertWarning(hostCell: Wtc): string | undefined;
@@ -16,4 +16,5 @@ export * from './design/hooks/on-repeating-default-props';
16
16
  export * from './design/hooks/on-bounded-default-props';
17
17
  export * from './design/validate-table-selection';
18
18
  export * from './design/validate-nested-table-region';
19
+ export * from './design/validate-nested-table-insert';
19
20
  export * from './business/device/signature-lock';
@@ -0,0 +1,6 @@
1
+ interface OptionFillWriter {
2
+ setMultiple(updates: Record<string, unknown>, source: 'user' | 'enrichment'): unknown;
3
+ }
4
+ /** 选中值保留用户事件;同行回填使用 enrichment,避免触发被填字段的手工变更副作用。 */
5
+ export declare function applyOptionFillUpdates(writer: OptionFillWriter, nextValues: Record<string, unknown>, optionFill: Record<string, unknown>, inputValues: Record<string, unknown>, optionFillSource?: 'user' | 'enrichment'): void;
6
+ export {};
@@ -61,6 +61,8 @@ export declare class TableRuntime {
61
61
  * 解析业务表字段的下拉数据源 / 列覆盖(selectSource)。
62
62
  */
63
63
  resolveSelectSource(options: ResolveSelectSourceOptions): SelectSourceDef | null;
64
+ /** 默认保留原来的 user 写入,仅显式配置的业务字段改变回填事件来源。 */
65
+ resolveOptionFillSource(options: ResolveSelectSourceOptions): 'user' | 'enrichment';
64
66
  /**
65
67
  * 下拉选中后从选项反向回填同行字段,供 onChange 使用。
66
68
  */
@@ -371,6 +371,8 @@ export interface BusinessFieldProfile {
371
371
  select?: SelectBehaviorDef;
372
372
  /** 选中下拉项后,从 option 数据同步填充同行多个字段 */
373
373
  fillFromOption?: FieldOptionFillDef[];
374
+ /** 同行回填的事件来源;默认沿用 user,仅显式配置的字段使用 enrichment。 */
375
+ optionFillSource?: 'user' | 'enrichment';
374
376
  /**
375
377
  * 按表实例 props 动态解析回填规则;返回值优先于 fillFromOption。
376
378
  * 返回 null/undefined 时回退 fillFromOption。