@gct-paas/word 0.1.36 → 0.1.38
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/base/select/src/basic-select.vue.d.ts +3 -0
- package/dist/core/command/commands/Backspace.d.ts +2 -0
- package/dist/core/data/DataManager.d.ts +19 -4
- package/dist/core/data/data-path-suffix.d.ts +7 -0
- package/dist/core/data/enricher-types.d.ts +6 -0
- package/dist/core/data/enrichers/build-field-enrichers.d.ts +6 -0
- package/dist/core/data/post-change-pipeline.d.ts +102 -0
- package/dist/core/layout/handlers/FieldHandler.d.ts +2 -0
- package/dist/core/layout/handlers/fields/index.d.ts +1 -0
- package/dist/core/layout/logic/LayoutBuilder.d.ts +4 -0
- package/dist/core/model/document/WrText.d.ts +4 -0
- package/dist/core/utils/expand.d.ts +10 -0
- package/dist/index.es.js +46240 -519
- package/dist/runtime/interface/render.d.ts +3 -0
- package/dist/sdk/doc-runtime/check-table/expand-runtime-json.d.ts +12 -0
- package/dist/sdk/doc-runtime/check-table/index.d.ts +4 -0
- package/dist/sdk/doc-runtime/check-table/map-check-table-item-infos.d.ts +14 -0
- package/dist/sdk/doc-runtime/check-table/resolve-check-table-item-infos.d.ts +5 -0
- package/dist/sdk/doc-runtime/check-table/types.d.ts +29 -0
- package/dist/sdk/doc-runtime/factories/document-initializer.d.ts +5 -0
- package/dist/sdk/doc-runtime/factories/useDocumentFactory.d.ts +2 -2
- package/dist/sdk/types/index.d.ts +2 -2
- package/dist/suites/edhr/check-table/check-table-dyn-value.d.ts +4 -0
- package/dist/suites/edhr/panel-schema/data-init/utils/sql.d.ts +2 -2
- package/dist/suites/edhr/paper-widget-manifest/basic/serialnumber-manifest.d.ts +1 -1
- package/dist/word.css +129 -109
- package/package.json +2 -1
|
@@ -18,6 +18,8 @@ type __VLS_Props = {
|
|
|
18
18
|
class?: string;
|
|
19
19
|
/** 是否只读 */
|
|
20
20
|
readonly?: boolean;
|
|
21
|
+
/** 是否禁用 */
|
|
22
|
+
disabled?: boolean;
|
|
21
23
|
/** 不显示右侧箭头 */
|
|
22
24
|
noArrow?: boolean;
|
|
23
25
|
/** 是否需要分组展示 */
|
|
@@ -64,6 +66,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
|
|
|
64
66
|
onEdit?: ((option: DropdownOption) => any) | undefined;
|
|
65
67
|
"onUpdate:modelValue"?: ((val: string | number | (string | number)[]) => any) | undefined;
|
|
66
68
|
}>, {
|
|
69
|
+
disabled: boolean;
|
|
67
70
|
options: DropdownOption[];
|
|
68
71
|
placeholder: string;
|
|
69
72
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
@@ -30,6 +30,8 @@ export declare class Backspace extends CommandBase<'backspace'> {
|
|
|
30
30
|
* 处理组件 run 的删除
|
|
31
31
|
*/
|
|
32
32
|
private handleWidgetRun;
|
|
33
|
+
/** 处理表格内联纸张组件(时间差/序号等):整段删除,不按 char 删模型 */
|
|
34
|
+
private handleInlinePageWidgetRun;
|
|
33
35
|
/** 处理悬浮 run 的删除 */
|
|
34
36
|
private handleOverlayPageWidgetRun;
|
|
35
37
|
/**
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { Doc } from '../view/Doc';
|
|
2
|
+
import { PostChangePipelineContext } from './post-change-pipeline';
|
|
3
|
+
export type EmitSource = 'user' | 'dependency' | 'enrichment' | 'parent';
|
|
2
4
|
export type Data = Record<string, any>;
|
|
3
5
|
export type PartialData = Partial<Data>;
|
|
4
6
|
type JsonPath = string;
|
|
@@ -13,12 +15,17 @@ export declare class DataManager {
|
|
|
13
15
|
private subscriptions;
|
|
14
16
|
private depGraph;
|
|
15
17
|
private depQueue;
|
|
16
|
-
private depScheduled;
|
|
17
18
|
private computing;
|
|
18
19
|
private layoutScheduled;
|
|
19
20
|
private emitScheduled;
|
|
20
21
|
private emitQueue;
|
|
21
22
|
private rawData;
|
|
23
|
+
private postChangePipeline?;
|
|
24
|
+
/** 无字段依赖的常量公式(如 true)已执行过的 depKey,防止重复 register 死循环 */
|
|
25
|
+
private ranImmediateDepKeys;
|
|
26
|
+
/** 正在执行「注册时立即跑」的依赖,避免 setMultiple 再次走完整 postChange */
|
|
27
|
+
private runningImmediateDep;
|
|
28
|
+
private immediateDepDataTouched;
|
|
22
29
|
/**
|
|
23
30
|
* 默认值 Map
|
|
24
31
|
* key: jsonpath 路径 (支持 [n] 数组索引)
|
|
@@ -32,8 +39,11 @@ export declare class DataManager {
|
|
|
32
39
|
/**
|
|
33
40
|
* 调度 layout,自动合并同一微任务队列中的多个操作
|
|
34
41
|
*/
|
|
42
|
+
attachPostChangePipeline(ctx: PostChangePipelineContext): void;
|
|
35
43
|
private scheduleLayout;
|
|
36
44
|
getLabelPath(path: JsonPath): JsonPath;
|
|
45
|
+
/** 供 PostChangePipeline 在同一微任务内刷新公式依赖 */
|
|
46
|
+
flushDependenciesNow(): Promise<void>;
|
|
37
47
|
/**
|
|
38
48
|
* 根据 jsonpath 获取原始数据(仅返回 rawData 中的值)
|
|
39
49
|
* @param path jsonpath 路径 (例如: "document.body.children[0].text" 或 "user.name")
|
|
@@ -54,7 +64,7 @@ export declare class DataManager {
|
|
|
54
64
|
* @param value 要设置的值
|
|
55
65
|
* @returns 是否设置成功
|
|
56
66
|
*/
|
|
57
|
-
set(path: JsonPath, value: any, source?:
|
|
67
|
+
set(path: JsonPath, value: any, source?: EmitSource): boolean;
|
|
58
68
|
/**
|
|
59
69
|
* 从带数字下标的 path 推断二维坐标(供 setMultiple / patch / 业务回填等无 modelRef 的场景)
|
|
60
70
|
* - 单轴:$.f_ewb[0].f_name → y=0;$.f_ewblink[1].x → x=1(需能从 rawData 的交叉 key 识别轴,或命中 link 命名启发)
|
|
@@ -106,7 +116,9 @@ export declare class DataManager {
|
|
|
106
116
|
* @param updates 路径与值的映射对象
|
|
107
117
|
* @returns 是否全部设置成功
|
|
108
118
|
*/
|
|
109
|
-
setMultiple(updates: Record<JsonPath, any>, source?:
|
|
119
|
+
setMultiple(updates: Record<JsonPath, any>, source?: EmitSource): boolean;
|
|
120
|
+
/** 依赖赋值写回 rawData,不触发 emit(用于注册期常量公式立即执行) */
|
|
121
|
+
private applyDependencyWrites;
|
|
110
122
|
/**
|
|
111
123
|
* 在数组末尾添加一个或多个元素
|
|
112
124
|
* @param path 数组的 jsonpath 路径
|
|
@@ -210,9 +222,10 @@ export declare class DataManager {
|
|
|
210
222
|
*/
|
|
211
223
|
private emit;
|
|
212
224
|
/**
|
|
225
|
+
* 通知订阅者与依赖队列(不触发布局)
|
|
213
226
|
* 实际执行 emit 逻辑
|
|
214
227
|
*/
|
|
215
|
-
private
|
|
228
|
+
private doEmitNotify;
|
|
216
229
|
/**
|
|
217
230
|
* 获取父路径
|
|
218
231
|
*/
|
|
@@ -256,6 +269,8 @@ export declare class DataManager {
|
|
|
256
269
|
private collectDependencies;
|
|
257
270
|
/** 统一执行组件依赖 */
|
|
258
271
|
private flushDependencies;
|
|
272
|
+
/** 注册时立即执行无依赖的常量公式(true / 显示值等) */
|
|
273
|
+
private runImmediateDependency;
|
|
259
274
|
/** 执行依赖 */
|
|
260
275
|
private runDepsByPath;
|
|
261
276
|
/** 运行公式 */
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** 与 rawData 并存的 label 后缀(展示用) */
|
|
2
|
+
export declare const LABEL_SUFFIX = "_lb_";
|
|
3
|
+
/** 与 rawData 并存的外链 href 后缀(超链接字段) */
|
|
4
|
+
export declare const HREF_SUFFIX = "_href_";
|
|
5
|
+
export declare function getLabelPath(path: string): string;
|
|
6
|
+
export declare function getHrefPath(path: string): string;
|
|
7
|
+
export declare function isDerivedDataPath(path: string): boolean;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Wr } from '../../model/document';
|
|
2
|
+
import { PostChangePipelineContext } from '../post-change-pipeline';
|
|
3
|
+
import { DataEnricherRegistration } from '../enricher-types';
|
|
4
|
+
export declare function buildFieldEnricherRegistrations(instances: Wr[], ctx: PostChangePipelineContext): DataEnricherRegistration[];
|
|
5
|
+
/** 收集 init 后需 enrich 的运行时路径(将 [n] 等占位替换为 0) */
|
|
6
|
+
export declare function collectInitialEnrichPaths(instances: Wr[]): string[];
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { FIELD_TYPE } from '../../domain/field/field-type';
|
|
2
|
+
import { FieldManifest } from '../../capabilities/field-manifest';
|
|
3
|
+
import { FieldMeta } from '../../capabilities/model-field-runtime';
|
|
4
|
+
import { Doc } from '../view/Doc';
|
|
5
|
+
import { DataManager, EmitSource } from './DataManager';
|
|
6
|
+
/**
|
|
7
|
+
* Pipeline 运行时上下文
|
|
8
|
+
*
|
|
9
|
+
* 主要给 enrichers 使用:
|
|
10
|
+
* - 获取字段 manifest
|
|
11
|
+
* - 动态加载字段 meta
|
|
12
|
+
*/
|
|
13
|
+
export type PostChangePipelineContext = {
|
|
14
|
+
/**
|
|
15
|
+
* 根据字段类型获取 manifest
|
|
16
|
+
*/
|
|
17
|
+
getFieldManifest: (type: FIELD_TYPE) => FieldManifest | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* 根据模型 key + 字段 key 获取字段 meta
|
|
20
|
+
*/
|
|
21
|
+
loadFieldByKey: (modelKey: string, key: string) => Promise<FieldMeta | undefined>;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* 数据变更后的处理流水线
|
|
25
|
+
*
|
|
26
|
+
* 主要职责:
|
|
27
|
+
* 1. 等待依赖字段刷新完成
|
|
28
|
+
* 2. 根据 changedPaths 找到对应 enrichers
|
|
29
|
+
* 3. 执行 enrich 逻辑
|
|
30
|
+
* 4. 将 enrich 结果再次写回 DataManager
|
|
31
|
+
*
|
|
32
|
+
* 典型场景:
|
|
33
|
+
* - 自动填充字段
|
|
34
|
+
* - 字段联动
|
|
35
|
+
* - 数据增强
|
|
36
|
+
* - 根据某字段自动计算其它字段
|
|
37
|
+
*/
|
|
38
|
+
export declare class PostChangePipeline {
|
|
39
|
+
/**
|
|
40
|
+
* 数据管理器
|
|
41
|
+
*/
|
|
42
|
+
private dataManager;
|
|
43
|
+
/**
|
|
44
|
+
* 文档实例
|
|
45
|
+
*/
|
|
46
|
+
private doc;
|
|
47
|
+
/**
|
|
48
|
+
* 当前注册的 enrichers
|
|
49
|
+
*
|
|
50
|
+
* 每个 enricher:
|
|
51
|
+
* - match(path) 判断是否处理该字段
|
|
52
|
+
* - enrich(path, value) 生成补充数据
|
|
53
|
+
*/
|
|
54
|
+
private enrichers;
|
|
55
|
+
/**
|
|
56
|
+
* 防止同一路径重复并发执行
|
|
57
|
+
*
|
|
58
|
+
* key:
|
|
59
|
+
* path
|
|
60
|
+
*
|
|
61
|
+
* value:
|
|
62
|
+
* 当前执行中的 Promise
|
|
63
|
+
*/
|
|
64
|
+
private inFlight;
|
|
65
|
+
/**
|
|
66
|
+
* pipeline 上下文
|
|
67
|
+
*/
|
|
68
|
+
private pipelineCtx?;
|
|
69
|
+
constructor(
|
|
70
|
+
/**
|
|
71
|
+
* 数据管理器
|
|
72
|
+
*/
|
|
73
|
+
dataManager: DataManager,
|
|
74
|
+
/**
|
|
75
|
+
* 文档实例
|
|
76
|
+
*/
|
|
77
|
+
doc: Doc);
|
|
78
|
+
/**
|
|
79
|
+
* 设置 pipeline 上下文
|
|
80
|
+
*
|
|
81
|
+
* 设置后会重新构建 enrichers
|
|
82
|
+
*/
|
|
83
|
+
setContext(ctx: PostChangePipelineContext): void;
|
|
84
|
+
/**
|
|
85
|
+
* 重建 enricher 注册列表
|
|
86
|
+
*
|
|
87
|
+
* 从当前文档中的 widget instances
|
|
88
|
+
* 动态生成 enrichers
|
|
89
|
+
*/
|
|
90
|
+
rebuildRegistrations(): void;
|
|
91
|
+
/**
|
|
92
|
+
* 变更后执行流水线
|
|
93
|
+
*
|
|
94
|
+
* @param changedPaths 本次变化的字段路径
|
|
95
|
+
* @param source 变更来源
|
|
96
|
+
*/
|
|
97
|
+
flush(changedPaths: string[], source: EmitSource): Promise<void>;
|
|
98
|
+
/**
|
|
99
|
+
* 执行某个 path 对应的 enrichers
|
|
100
|
+
*/
|
|
101
|
+
private runEnrichersForPath;
|
|
102
|
+
}
|
|
@@ -2,4 +2,6 @@ import { WrText } from '../../model/document';
|
|
|
2
2
|
import { LayoutContext } from '../LayoutContext';
|
|
3
3
|
export declare class FieldHandler {
|
|
4
4
|
static layout(context: LayoutContext, wr: WrText): void;
|
|
5
|
+
/** 检验表交叉区 value_:按同行检验项 type_ 渲染,值路径固定 value_ */
|
|
6
|
+
private static layoutCheckTableCrossValue;
|
|
5
7
|
}
|
|
@@ -3,3 +3,4 @@ export { FieldImageHandler } from './FieldImageHandler';
|
|
|
3
3
|
export { SignatureHandler } from './SignatureHandler';
|
|
4
4
|
export { InputHandler } from './InputHandler';
|
|
5
5
|
export { AttachmentHandler } from './AttachmentHandler';
|
|
6
|
+
export { FieldBaseHandler } from './FieldBaseHandler';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BuiltinComponentType } from '../../constants';
|
|
2
|
+
import { LayoutNode } from '../../view/base';
|
|
2
3
|
import { TextWidget } from '../../view/runs/TextWidget';
|
|
3
4
|
import { Page } from '../../view/Page';
|
|
4
5
|
import { BaseMetaNode, LineInfo } from '../types';
|
|
@@ -30,3 +31,6 @@ export declare function validateTextWidgetMarker(raw: TextWidget, checkMarker: b
|
|
|
30
31
|
* @param node - 节点
|
|
31
32
|
*/
|
|
32
33
|
export declare function isClickPaperWidgetAllNode(node: BaseMetaNode): boolean;
|
|
34
|
+
export declare function isOverlayPageWidgetType(type?: string): boolean;
|
|
35
|
+
/** 表格内联纸张组件(时间差/序号等),布局为多 char run、模型为 WrPageWidget */
|
|
36
|
+
export declare function isInlineTextPageWidgetRun(run?: LayoutNode | null): run is TextWidget;
|
|
@@ -110,6 +110,10 @@ export declare class WrText extends ModelNode {
|
|
|
110
110
|
cloneWithId(id: string): WrText;
|
|
111
111
|
/** 需要进行拼接成运行时的 modelId */
|
|
112
112
|
cloneWithSuffix(suffix: string, index: string | undefined): WrText;
|
|
113
|
+
/**
|
|
114
|
+
* 按 layout run 的 modelRef.id 拼接运行时后缀($p 页眉页脚 / @ 数据分组与动态关联)
|
|
115
|
+
*/
|
|
116
|
+
cloneWithRuntimeRefFrom(runtimeModelRefId: string): WrText;
|
|
113
117
|
/**
|
|
114
118
|
* 从原始 XML JSON 转换为 WrText 实例
|
|
115
119
|
* @param json w:r XML JSON 对象
|
|
@@ -116,6 +116,16 @@ export declare class TableExpander {
|
|
|
116
116
|
private getFillEndColForRegion;
|
|
117
117
|
private findLinkSubTableRegionForCell;
|
|
118
118
|
private resolveLinkSubTableCellMeta;
|
|
119
|
+
/**
|
|
120
|
+
* 检验表纵向主体下标(对应 subValuePath 上的 [n] / 交叉区 [n_y])。
|
|
121
|
+
* 二维表由 repeat 展开赋值;检验表由接口预扩行,按主体行在 region 内的偏移计算。
|
|
122
|
+
*/
|
|
123
|
+
private applyCheckTableYDataIndex;
|
|
124
|
+
private resolveCheckTableYDataIndex;
|
|
125
|
+
/** 检验表主体数据条数(与二维表 repeatCount 同源) */
|
|
126
|
+
private getCheckTableDataCount;
|
|
127
|
+
/** 单条数据占用的主体模板行数(接口预扩行后由「扩后行数 / 数据条数」反推) */
|
|
128
|
+
private getCheckTableTemplateBodyRowStride;
|
|
119
129
|
/** 根据主单元格的 rowspan/colspan,为被覆盖的从属单元格设置 mergeFromId */
|
|
120
130
|
private transformMergeRelations;
|
|
121
131
|
/**
|