@gct-paas/word 0.1.25 → 0.1.27
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/core/interaction/InteractionController.d.ts +2 -0
- package/dist/core/utils/expand.d.ts +18 -23
- package/dist/core/view/Doc.d.ts +5 -1
- package/dist/core/view/TableCell.d.ts +2 -0
- package/dist/core/widget/widget-state.d.ts +5 -0
- package/dist/index.es.js +546 -471
- package/dist/runtime/canvas/table/utils/index.d.ts +6 -17
- package/dist/runtime/interface/render.d.ts +0 -6
- package/dist/sdk/doc-runtime/factories/document-initializer.d.ts +1 -1
- package/dist/sdk/types/index.d.ts +10 -4
- package/dist/utils/func/form.d.ts +2 -0
- package/dist/word.css +17 -17
- package/package.json +1 -1
|
@@ -20,6 +20,8 @@ export declare class InteractionController {
|
|
|
20
20
|
onChangeDragHoverId(hitId: string): void;
|
|
21
21
|
onSetActiveTableId(tableId: string): void;
|
|
22
22
|
clearActiveTableId(): void;
|
|
23
|
+
/** 填报模式下点击只读/禁用组件:与点空白一致,收起字段焦点并回到纸张 */
|
|
24
|
+
private settleFillModeNonInteractiveField;
|
|
23
25
|
private syncActiveTableByMeta;
|
|
24
26
|
resolveIntent(id: string | undefined, hitId: string | undefined): void;
|
|
25
27
|
onActivePanelData(payload: {
|
|
@@ -2,6 +2,16 @@ import { DataManager } from '../data/DataManager';
|
|
|
2
2
|
import { Wtr, Wtbl, Wtc } from '../model/document';
|
|
3
3
|
import { RepeatingRegion, BoundedRegion, TableHeaderRegion, SubTableHeaderRegion, CheckTableRegion, _2DTableRegion } from '../model/logic';
|
|
4
4
|
import { Doc } from '../view/Doc';
|
|
5
|
+
export type TableRange = {
|
|
6
|
+
start: {
|
|
7
|
+
row: number;
|
|
8
|
+
col: number;
|
|
9
|
+
};
|
|
10
|
+
end: {
|
|
11
|
+
row: number;
|
|
12
|
+
col: number;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
5
15
|
export type CellFragment = {
|
|
6
16
|
id: string;
|
|
7
17
|
expandFromId: string;
|
|
@@ -58,6 +68,7 @@ export declare class TableExpander {
|
|
|
58
68
|
private initializeCheckTableMapper;
|
|
59
69
|
private initializeTableHeaderMapper;
|
|
60
70
|
private initializeBoundedItemDataIndex;
|
|
71
|
+
private getDataGroup2DItemRange;
|
|
61
72
|
private initializeDataGroup2DDataIndex;
|
|
62
73
|
private initializeRows;
|
|
63
74
|
getRepeatCount(region: RepeatingRegion | _2DTableRegion): number;
|
|
@@ -73,33 +84,17 @@ export declare class TableExpander {
|
|
|
73
84
|
*
|
|
74
85
|
* @param range - 整体范围 {start:{row,col} end:{row,col}},表示需要分配数据项的总区域
|
|
75
86
|
* @param itemRange - 局部范围 {start:{row,col} end:{row,col}},表示一个数据项的模板大小
|
|
87
|
+
* @param fillDirection - `x`:先横向扩展再换行;`y`:先纵向扩展再换列(与 `x` 的行列外层循环互为镜像)
|
|
76
88
|
* @returns Map,key 为字符串 "row,col",值为对应的数据索引
|
|
77
89
|
*
|
|
78
|
-
*
|
|
90
|
+
* 横向(x)算法:
|
|
79
91
|
* 1. 局部范围内的单元格数据索引为 0
|
|
80
92
|
* 2. 从局部范围右侧开始,按 itemWidth 宽度逐个扩展数据项
|
|
81
|
-
* 3.
|
|
82
|
-
* 4.
|
|
83
|
-
*
|
|
93
|
+
* 3. 当同一行带内无法再放置更多数据项时,换到下一个 itemHeight 行带
|
|
94
|
+
* 4. 换行后从整体范围的最左侧列开始继续扩展
|
|
95
|
+
*
|
|
96
|
+
* 纵向(y)算法:与 x 对称——先在模板列宽内从模板下方按 itemHeight 向下铺,再换到下一组列(列宽对齐 itemWidth),新一组列从整体范围最顶行重新起铺。
|
|
84
97
|
*/
|
|
85
|
-
computeDataIndexMap(range:
|
|
86
|
-
start: {
|
|
87
|
-
row: number;
|
|
88
|
-
col: number;
|
|
89
|
-
};
|
|
90
|
-
end: {
|
|
91
|
-
row: number;
|
|
92
|
-
col: number;
|
|
93
|
-
};
|
|
94
|
-
}, itemRange: {
|
|
95
|
-
start: {
|
|
96
|
-
row: number;
|
|
97
|
-
col: number;
|
|
98
|
-
};
|
|
99
|
-
end: {
|
|
100
|
-
row: number;
|
|
101
|
-
col: number;
|
|
102
|
-
};
|
|
103
|
-
}): IndexMap;
|
|
98
|
+
computeDataIndexMap(range: TableRange, itemRange: TableRange, fillDirection?: 'x' | 'y'): IndexMap;
|
|
104
99
|
}
|
|
105
100
|
export {};
|
package/dist/core/view/Doc.d.ts
CHANGED
|
@@ -18,6 +18,8 @@ export interface DocInitOptions {
|
|
|
18
18
|
mainModelKey: ModelKey;
|
|
19
19
|
/** 文档运行时元信息(接口数据 + 业务数据) */
|
|
20
20
|
docRuntimeMeta: DocRuntimeMeta;
|
|
21
|
+
/** 按钮区渲染模式 */
|
|
22
|
+
btnRenderModeType: DocModeType;
|
|
21
23
|
formType: string;
|
|
22
24
|
paramsConfig: Record<string, any>;
|
|
23
25
|
pageSize?: {
|
|
@@ -37,6 +39,8 @@ export declare class Doc {
|
|
|
37
39
|
id: string;
|
|
38
40
|
/** 渲染模式 */
|
|
39
41
|
mode: DocModeType;
|
|
42
|
+
/** 按钮区渲染模式 */
|
|
43
|
+
btnRenderModeType: DocModeType;
|
|
40
44
|
/** 是否是设计器预览模式 */
|
|
41
45
|
preview: boolean;
|
|
42
46
|
model?: DocModel;
|
|
@@ -92,7 +96,7 @@ export declare class Doc {
|
|
|
92
96
|
getFirstPage(): Page | null;
|
|
93
97
|
getLastPage(): Page | null;
|
|
94
98
|
setModel(model: DocModel): void;
|
|
95
|
-
setMode(modeType: DocModeType): void;
|
|
99
|
+
setMode(modeType: DocModeType, updateButton?: boolean): void;
|
|
96
100
|
/** 触发布局计算 */
|
|
97
101
|
layout(): void;
|
|
98
102
|
/** 渲染文档 */
|
|
@@ -6,6 +6,7 @@ import { TableRow } from './TableRow';
|
|
|
6
6
|
import { RepeatingWidgetMeta } from '../model/logic/RepeatingRegion';
|
|
7
7
|
import { BoundedWidgetMeta } from '../model/logic/BoundedRegion';
|
|
8
8
|
import { CheckTableWidgetMeta } from '../model/logic/CheckTableRegion';
|
|
9
|
+
import { TableRange } from '../utils/expand';
|
|
9
10
|
export interface TableCellOptions extends LayoutGroupOptions {
|
|
10
11
|
colspan?: number;
|
|
11
12
|
rowspan?: number;
|
|
@@ -23,6 +24,7 @@ export type SubRenderer = {
|
|
|
23
24
|
yDataIndex?: number;
|
|
24
25
|
valuePath: string;
|
|
25
26
|
widgetMeta?: RepeatingWidgetMeta | BoundedWidgetMeta | CheckTableWidgetMeta;
|
|
27
|
+
dataGroup2DRange?: TableRange;
|
|
26
28
|
};
|
|
27
29
|
export declare class TableCell extends LayoutGroup<Paragraph> implements IContainerMetrics {
|
|
28
30
|
component: "tableCell";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Doc } from '../view/Doc';
|
|
2
2
|
import { FieldPermissionInfo } from '../../sdk/types';
|
|
3
|
+
import { WidgetMeta } from './widget-meta';
|
|
3
4
|
export type WidgetDisplayStatus = 'readonly-component' | 'edit-component' | 'readonly-text';
|
|
4
5
|
export interface WidgetStateContext {
|
|
5
6
|
doc: Doc;
|
|
@@ -21,6 +22,10 @@ interface ResolveDisplayStatusFromAuthOptions {
|
|
|
21
22
|
editString: WidgetDisplayStatus;
|
|
22
23
|
}
|
|
23
24
|
export declare function resolveDisplayStatusFromAuth(options: ResolveDisplayStatusFromAuthOptions): WidgetDisplayStatus | null;
|
|
25
|
+
/**
|
|
26
|
+
* 填报模式下字段是否因只读/禁用而不可激活(与 InteractionPolicy 对组件的判定一致)
|
|
27
|
+
*/
|
|
28
|
+
export declare function isWidgetMetaInteractionBlockedInFillMode(doc: Doc, widgetMeta: WidgetMeta | undefined | null): boolean;
|
|
24
29
|
export declare function resolveWidgetState(ctx: WidgetStateContext): {
|
|
25
30
|
required: boolean;
|
|
26
31
|
readonly: boolean;
|