@gct-paas/word 0.1.30 → 0.1.32

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.
@@ -3,7 +3,6 @@ import { Doc } from '../view/Doc';
3
3
  import { WidgetMeta } from '../widget/widget-meta';
4
4
  import { WordHighlight } from '../model/types';
5
5
  import { PointerHitResult } from '../cursor/hit/types';
6
- import { FieldMeta } from '@gct-paas/api/apaas';
7
6
  export interface CursorMeta {
8
7
  nodeId: string;
9
8
  offset: number;
@@ -103,7 +102,6 @@ export type CommandPayloadMap = {
103
102
  insertField: CommandPayload & {
104
103
  widgetMeta: WidgetMeta;
105
104
  valuePath: string;
106
- mainModelFields: FieldMeta[];
107
105
  };
108
106
  insertPaperWidget: CommandPayload & {
109
107
  pageWidgetMeta: WidgetMeta;
@@ -122,8 +122,22 @@ export declare class DataManager {
122
122
  /**
123
123
  * 设置整个原始数据
124
124
  * @param data 新的 JSON 数据
125
+ * @param defaultsMap 默认值, 字段值为 undefined 时才懒填充,不覆盖接口数据
125
126
  */
126
127
  setRawData(data: Data, defaultsMap?: Record<string, any>): void;
128
+ /**
129
+ * 将初始化数据直接写入 rawData(仅填充空值,不覆盖接口数据)
130
+ * 与 defaults(懒填充)不同,此方法在初始化阶段一次性写入
131
+ *
132
+ * 支持两种子表路径形式:
133
+ * - `[n]` 通配符:展开到 rawData 中已有的每一行(无则创建一行),如 `$.sub[n].field`
134
+ * - 真实下标:直接写入指定行,如 `$.sub[0].field`
135
+ *
136
+ * 处理顺序:先展开 `[n]` 通配符,再写入真实下标路径。
137
+ * 这样可以保证:参数映射(`[n]`)先铺好默认值,自定义数据源(真实下标)再精确覆盖。
138
+ */
139
+ applyInitData(initDataMap: Record<string, any>): void;
140
+ private applyInitDataWildcard;
127
141
  /**
128
142
  * 内部方法:根据路径获取值
129
143
  */
@@ -18,6 +18,7 @@ export declare function useInteraction(docRef: Ref<Doc | null>): {
18
18
  readonly context: {
19
19
  readonly mainModelKey?: string | undefined;
20
20
  readonly subFieldKey?: string | undefined;
21
+ readonly isDataGroup2DClicked?: boolean | undefined;
21
22
  readonly regionId?: string | undefined;
22
23
  readonly secRefId?: string | undefined;
23
24
  };
@@ -5,7 +5,6 @@ export declare class TextHandler {
5
5
  static get2DInfo(context: LayoutContext): {
6
6
  xDataIndex: number | undefined;
7
7
  yDataIndex: number | undefined;
8
- valuePath2D: string | undefined;
9
8
  };
10
9
  /**
11
10
  * 合并部分run
@@ -10,7 +10,6 @@ export declare class FieldBaseHandler {
10
10
  static get2DInfo(context: LayoutContext): {
11
11
  xDataIndex: number | undefined;
12
12
  yDataIndex: number | undefined;
13
- valuePath2D: string | undefined;
14
13
  };
15
14
  static getValue(ctx: HandlerContext, valuePath: string): any;
16
15
  static getLabel(ctx: HandlerContext, valuePath: string): any;
@@ -24,7 +24,3 @@ export declare function repeat(count: number, callback: (index: number) => void)
24
24
  * distributeInteger(10, 3) // [3, 3, 4]
25
25
  */
26
26
  export declare function distributeInteger(total: number, count: number): number[];
27
- /**
28
- * 将主工程的数据转换为 Word 的 JSONPath 格式数据
29
- */
30
- export declare const mainData2WordData: (data: Record<string, any>) => Record<string, any>;
@@ -21,11 +21,13 @@ export type SubRenderer = {
21
21
  id: string;
22
22
  type: 'dynamic-table' | '2d-table' | 'fixed-table' | 'check-table' | 'table-header';
23
23
  dataIndex?: number;
24
- xDataIndex?: number;
25
- yDataIndex?: number;
26
24
  valuePath: string;
27
25
  widgetMeta?: RepeatingWidgetMeta | BoundedWidgetMeta | CheckTableWidgetMeta | _2DTableWidgetMeta;
28
26
  dataGroup2DAreaRange?: TableRange;
27
+ xDataIndex?: number;
28
+ yDataIndex?: number;
29
+ /** 用来标记二维表的子类型 交叉 / 横向 / 纵向 */
30
+ cellZone?: 'cross' | 'horizontal' | 'vertical';
29
31
  };
30
32
  export declare class TableCell extends LayoutGroup<Paragraph> implements IContainerMetrics {
31
33
  component: "tableCell";
@@ -7,7 +7,6 @@ type ModelRef = {
7
7
  id: string;
8
8
  start?: number;
9
9
  end?: number;
10
- valuePath2D?: string;
11
10
  xDataIndex?: number;
12
11
  yDataIndex?: number;
13
12
  };
@@ -27,6 +27,7 @@ export type PanelType =
27
27
  type ActiveContext = {
28
28
  mainModelKey: string;
29
29
  subFieldKey: string | undefined;
30
+ isDataGroup2DClicked?: boolean;
30
31
  regionId: string;
31
32
  /** 章节引用 id */
32
33
  secRefId: string;