@daxiangme/form-core 0.1.0
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/LICENSE +2 -0
- package/README.md +16 -0
- package/dist/index.d.ts +1679 -0
- package/dist/index.js +5546 -0
- package/dist/index.js.map +1 -0
- package/package.json +35 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1679 @@
|
|
|
1
|
+
/** 将勾选字段的默认值作为一个文档变更写入。 */
|
|
2
|
+
export declare function applyDesignerBatchDefaults(document: DesignerDocument, values: Record<string, unknown>): number;
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 将指定外观维度批量恢复为继承表单默认值。
|
|
6
|
+
*
|
|
7
|
+
* @returns 实际发生配置变化的容器数量。
|
|
8
|
+
*/
|
|
9
|
+
export declare function applyDesignerContainerAppearanceInheritance(document: DesignerDocument, dimensions: readonly DesignerContainerAppearanceDimension[]): number;
|
|
10
|
+
|
|
11
|
+
/** 按依赖拓扑执行一个子实体当前行的计算规则,并把结果写回该行值副本。 */
|
|
12
|
+
export declare function applyDesignerCurrentRowValueRules(document: DesignerDocument, rowValues: Record<string, unknown>, entityCode: string, runtime: Omit<DesignerExpressionRuntimeContext, 'currentRow'>, options?: {
|
|
13
|
+
phase?: 'INITIALIZE' | 'CHANGE';
|
|
14
|
+
changedFieldIds?: Iterable<string>;
|
|
15
|
+
confirmationAdapter?: DesignerLinkageConfirmationAdapter;
|
|
16
|
+
}): Promise<string[]>;
|
|
17
|
+
|
|
18
|
+
/** 将预览中的直接字段设为统一 PC 跨度并清零偏移;移动布局保持不变。 */
|
|
19
|
+
export declare function applyDesignerQuickGrid(document: DesignerDocument, selectedNodeId: string, span: 24 | 12 | 8 | 6): number;
|
|
20
|
+
|
|
21
|
+
/** 按依赖拓扑执行字段计算与联动,并直接更新当前运行值副本。 */
|
|
22
|
+
export declare function applyDesignerValueRules(document: DesignerDocument, valueStore: DesignerRuntimeValueStore, runtime: Omit<DesignerExpressionRuntimeContext, 'fields'>, options?: {
|
|
23
|
+
phase?: 'INITIALIZE' | 'CHANGE';
|
|
24
|
+
changedFieldIds?: Iterable<string>;
|
|
25
|
+
confirmationAdapter?: DesignerLinkageConfirmationAdapter;
|
|
26
|
+
}): Promise<string[]>;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* 判断现有节点是否可以进入指定容器。
|
|
30
|
+
*
|
|
31
|
+
* @param nodes 当前完整布局树。
|
|
32
|
+
* @param nodeId 被移动节点标识。
|
|
33
|
+
* @param targetContainerId 目标容器标识;根布局传空值。
|
|
34
|
+
* @returns 不会形成自身后代循环时返回 `true`。
|
|
35
|
+
*/
|
|
36
|
+
export declare function canMoveDesignerNode(nodes: DesignerLayoutNode[], nodeId: string, targetContainerId: string | null): boolean;
|
|
37
|
+
|
|
38
|
+
/** 使用 JSON 往返克隆设计文档,确保 Core 状态不携带 Vue 代理。 */
|
|
39
|
+
export declare function cloneDesignerDocument(document: DesignerDocument): DesignerDocument;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* 深复制一条子表行并分配新身份,避免复制后的字段值与源行共享可变引用。
|
|
43
|
+
*
|
|
44
|
+
* @param source 源子表行。
|
|
45
|
+
* @returns 可独立编辑的新子表行。
|
|
46
|
+
*/
|
|
47
|
+
export declare function cloneDesignerSubtableRow(source: DesignerSubtableRow): DesignerSubtableRow;
|
|
48
|
+
|
|
49
|
+
/** 返回允许批量设置默认值的语义字段。 */
|
|
50
|
+
export declare function collectDesignerBatchDefaultFields(document: DesignerDocument): DesignerField[];
|
|
51
|
+
|
|
52
|
+
/** 收集表达式直接读取的字段主键。 */
|
|
53
|
+
export declare function collectDesignerExpressionFieldIds(expression: DesignerExpression): Set<string>;
|
|
54
|
+
|
|
55
|
+
/** 返回当前文档已经放置到布局中的字段主键。 */
|
|
56
|
+
export declare function collectPlacedFieldIds(nodes: DesignerLayoutNode[]): Set<string>;
|
|
57
|
+
|
|
58
|
+
/** 收集已经在画布中放置的一级子表关系编码。 */
|
|
59
|
+
export declare function collectPlacedRelationCodes(nodes: DesignerLayoutNode[]): Set<string>;
|
|
60
|
+
|
|
61
|
+
/** 按语义类型返回允许切换的字段组件。 */
|
|
62
|
+
export declare function compatibleDesignerComponents(semanticType: DesignerSemanticType): DesignerComponentRegistration[];
|
|
63
|
+
|
|
64
|
+
/** 统计当前文档中支持表面外观的显式容器数量。 */
|
|
65
|
+
export declare function countDesignerSurfaceContainers(document: DesignerDocument): number;
|
|
66
|
+
|
|
67
|
+
/** 创建字段高级行为默认值。 */
|
|
68
|
+
export declare function createDefaultDesignerFieldBehavior(): DesignerFieldBehavior;
|
|
69
|
+
|
|
70
|
+
/** 创建首次打开时用于产品验收的扁平栅格示例。 */
|
|
71
|
+
export declare function createDemoDesignerDocument(documentId: string): DesignerDocument;
|
|
72
|
+
|
|
73
|
+
/** 为根字段、模块字段或子表行生成互不冲突的反馈键。 */
|
|
74
|
+
export declare function createDesignerFieldFeedbackKey(fieldId: string, context?: {
|
|
75
|
+
viewCode?: string;
|
|
76
|
+
containerId?: string;
|
|
77
|
+
rowId?: string;
|
|
78
|
+
}): string;
|
|
79
|
+
|
|
80
|
+
/** 生成 Core 内部唯一标识;结果不承担数据库主键语义。 */
|
|
81
|
+
export declare function createDesignerId(prefix: string): string;
|
|
82
|
+
|
|
83
|
+
/** 将布局树投影成大纲数据。 */
|
|
84
|
+
export declare function createDesignerOutline(document: DesignerDocument): DesignerOutlineItem[];
|
|
85
|
+
|
|
86
|
+
/** 创建一个空弹层模块。 */
|
|
87
|
+
export declare function createDesignerOverlayModule(document: DesignerDocument, kind: DesignerOverlayModule['kind']): DesignerOverlayModule;
|
|
88
|
+
|
|
89
|
+
/** 为尚未放置的一级关系创建行子表或块子表容器。 */
|
|
90
|
+
export declare function createDesignerRelationContainer(document: DesignerDocument, relationCode: string, componentType: 'row-subtable' | 'block-subtable'): DesignerContainerNode | undefined;
|
|
91
|
+
|
|
92
|
+
/** 创建合法且可立即编辑的字段状态规则。 */
|
|
93
|
+
export declare function createDesignerStateRule(document: DesignerDocument, field: DesignerField): DesignerFieldStateRule;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* 为子表所有呈现模式生成同一个列模板和最小宽度。
|
|
97
|
+
*
|
|
98
|
+
* @param columns 稳定列投影。
|
|
99
|
+
* @param options 序号列、操作列及其宽度配置。
|
|
100
|
+
* @returns 可直接绑定到表格滚动内容和每一行的布局参数。
|
|
101
|
+
*/
|
|
102
|
+
export declare function createDesignerSubtableGridLayout(columns: readonly DesignerSubtableColumn[], options?: DesignerSubtableGridOptions): DesignerSubtableGridLayout;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* 按当前列结构创建一条只存在于预览副本中的空白子表行。
|
|
106
|
+
*
|
|
107
|
+
* @param columns 当前子表列投影。
|
|
108
|
+
* @param seedValues 可选初始值;未声明列不会被擅自写入。
|
|
109
|
+
* @returns 具有全新行身份和值容器的子表行。
|
|
110
|
+
*/
|
|
111
|
+
export declare function createDesignerSubtableRow(columns: readonly DesignerSubtableColumn[], seedValues?: Readonly<Record<string, unknown>>): DesignerSubtableRow;
|
|
112
|
+
|
|
113
|
+
/** 创建当前类型的严格验证规则默认值。 */
|
|
114
|
+
export declare function createDesignerValidationRule(type: DesignerValidationRuleType, document: DesignerDocument, field: DesignerField, sequence: number): DesignerValidationRule;
|
|
115
|
+
|
|
116
|
+
/** 创建公式或联动默认规则;联动显式携带覆盖策略。 */
|
|
117
|
+
export declare function createDesignerValueRule(mode?: DesignerFieldValueRule['mode']): DesignerFieldValueRule;
|
|
118
|
+
|
|
119
|
+
/** 创建一份不含业务绑定的空设计文档。 */
|
|
120
|
+
export declare function createEmptyDesignerDocument(documentId: string, name?: string): DesignerDocument;
|
|
121
|
+
|
|
122
|
+
/** 创建只包含本地主实体的数据模型目录。 */
|
|
123
|
+
export declare function createLocalDesignerDataSchema(name: string): DesignerDocument['dataSchema'];
|
|
124
|
+
|
|
125
|
+
/** 根据注册项原子创建本地字段或容器节点。 */
|
|
126
|
+
export declare function createNodeFromComponent(document: DesignerDocument, componentType: string, overrides?: {
|
|
127
|
+
label?: string;
|
|
128
|
+
configuration?: Record<string, unknown>;
|
|
129
|
+
entityCode?: string;
|
|
130
|
+
}): DesignerLayoutNode | undefined;
|
|
131
|
+
|
|
132
|
+
/** 对未知输入进行解码和完整结构诊断。 */
|
|
133
|
+
export declare function decodeDesignerDocument(source: unknown): DesignerDocumentDecodeResult;
|
|
134
|
+
|
|
135
|
+
/** 新文档默认动作栏:只显示底部右侧提交按钮。 */
|
|
136
|
+
export declare const DEFAULT_DESIGNER_ACTION_BAR: DesignerActionBar;
|
|
137
|
+
|
|
138
|
+
/** 新旧文档共用的默认提交策略;普通隐藏字段默认仍参与提交。 */
|
|
139
|
+
export declare const DEFAULT_DESIGNER_SUBMIT_POLICY: DesignerSubmitPolicy;
|
|
140
|
+
|
|
141
|
+
/** 永久删除未放置字段,防止布局中出现悬空引用。 */
|
|
142
|
+
export declare function deleteUnplacedDesignerField(document: DesignerDocument, fieldId: string): boolean;
|
|
143
|
+
|
|
144
|
+
/** 45 类独立表单组件的完整静态注册表。 */
|
|
145
|
+
export declare const DESIGNER_COMPONENTS: readonly DesignerComponentRegistration[];
|
|
146
|
+
|
|
147
|
+
/** 数字字段的货币代码;运行时再映射为展示符号。 */
|
|
148
|
+
export declare const DESIGNER_CURRENCY_PRESETS: DesignerPropertyOption[];
|
|
149
|
+
|
|
150
|
+
/** 设计器文档当前稳定版本。 */
|
|
151
|
+
export declare const DESIGNER_DOCUMENT_VERSION: "1.0";
|
|
152
|
+
|
|
153
|
+
/** 文件大小预设,单位为 MB。 */
|
|
154
|
+
export declare const DESIGNER_FILE_SIZE_PRESETS: DesignerPropertyOption[];
|
|
155
|
+
|
|
156
|
+
/** 附件类型编辑器支持的已知扩展名和快捷分组。 */
|
|
157
|
+
export declare const DESIGNER_FILE_TYPE_OPTIONS: Array<{
|
|
158
|
+
label: string;
|
|
159
|
+
extensions: string[];
|
|
160
|
+
group: boolean;
|
|
161
|
+
}>;
|
|
162
|
+
|
|
163
|
+
/** 属性面板共用的标准字号预设,单位为 px。 */
|
|
164
|
+
export declare const DESIGNER_FONT_SIZE_PRESETS: DesignerPropertyOption[];
|
|
165
|
+
|
|
166
|
+
/** Core 允许持久化的语义编码格式,不接受数据库表达式或路径。 */
|
|
167
|
+
export declare const DESIGNER_IDENTIFIER_PATTERN: RegExp;
|
|
168
|
+
|
|
169
|
+
/** 子表初始记录数量预设。 */
|
|
170
|
+
export declare const DESIGNER_INITIAL_COUNT_PRESETS: DesignerPropertyOption[];
|
|
171
|
+
|
|
172
|
+
/** 文本和意见控件共用的长度预设。 */
|
|
173
|
+
export declare const DESIGNER_LENGTH_PRESETS: DesignerPropertyOption[];
|
|
174
|
+
|
|
175
|
+
/** 主体视图使用的稳定内部编码。 */
|
|
176
|
+
export declare const DESIGNER_MAIN_VIEW_CODE = "main";
|
|
177
|
+
|
|
178
|
+
/** 移动端 24 栅格跨度预设。 */
|
|
179
|
+
export declare const DESIGNER_MOBILE_SPAN_PRESETS: DesignerPropertyOption[];
|
|
180
|
+
|
|
181
|
+
/** 支持 0 表示不限制的多选数量预设。 */
|
|
182
|
+
export declare const DESIGNER_OPTIONAL_SELECTION_COUNT_PRESETS: DesignerPropertyOption[];
|
|
183
|
+
|
|
184
|
+
/** 子表和引用列表共用的分页数量预设。 */
|
|
185
|
+
export declare const DESIGNER_PAGE_SIZE_PRESETS: DesignerPropertyOption[];
|
|
186
|
+
|
|
187
|
+
/** PC 端 24 栅格跨度预设。 */
|
|
188
|
+
export declare const DESIGNER_PC_SPAN_PRESETS: DesignerPropertyOption[];
|
|
189
|
+
|
|
190
|
+
/** 多选控件共用的数量上限预设。 */
|
|
191
|
+
export declare const DESIGNER_SELECTION_COUNT_PRESETS: DesignerPropertyOption[];
|
|
192
|
+
|
|
193
|
+
/** 属性面板共用的标准间距预设,单位为 px。 */
|
|
194
|
+
export declare const DESIGNER_SPACING_PRESETS: DesignerPropertyOption[];
|
|
195
|
+
|
|
196
|
+
/** 浏览器定位超时预设,存储值继续使用毫秒。 */
|
|
197
|
+
export declare const DESIGNER_TIMEOUT_PRESETS: DesignerPropertyOption[];
|
|
198
|
+
|
|
199
|
+
/** Core 仅保存声明式动作引用,不接受自由脚本。 */
|
|
200
|
+
export declare interface DesignerAction {
|
|
201
|
+
code: string;
|
|
202
|
+
name: string;
|
|
203
|
+
handlerType: 'SAVE' | 'RESET' | 'DELETE' | 'PRINT' | 'NAVIGATE';
|
|
204
|
+
target?: string;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/** 表单运行态动作栏配置。 */
|
|
208
|
+
export declare interface DesignerActionBar {
|
|
209
|
+
visible: boolean;
|
|
210
|
+
position: 'TOP' | 'BOTTOM' | 'BOTH';
|
|
211
|
+
align: 'LEFT' | 'CENTER' | 'RIGHT';
|
|
212
|
+
buttons: DesignerActionBarButton[];
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/** 运行态动作栏中的受控按钮。 */
|
|
216
|
+
export declare interface DesignerActionBarButton {
|
|
217
|
+
action: 'SUBMIT' | 'RESET' | 'PRINT';
|
|
218
|
+
label: string;
|
|
219
|
+
enabled: boolean;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/** 生成动作栏按钮约定使用的稳定词条 key。 */
|
|
223
|
+
export declare function designerActionI18nKey(action: string): string;
|
|
224
|
+
|
|
225
|
+
/** 表单整体外观配置。 */
|
|
226
|
+
export declare interface DesignerAppearance {
|
|
227
|
+
labelPosition: 'TOP' | 'LEFT' | 'RIGHT';
|
|
228
|
+
labelWidth: number;
|
|
229
|
+
labelSuffix: string;
|
|
230
|
+
labelAlign: 'LEFT' | 'RIGHT';
|
|
231
|
+
defaultPlaceholder: string;
|
|
232
|
+
gridGutter: number;
|
|
233
|
+
/** 字段栅格的纵向行距,单位为 px,合法范围为 0~64。 */
|
|
234
|
+
rowGap: number;
|
|
235
|
+
defaultPcSpan: number;
|
|
236
|
+
defaultMobileSpan: number;
|
|
237
|
+
readonlyDisplayMode: 'CONTROL' | 'TEXT';
|
|
238
|
+
size: 'SMALL' | 'DEFAULT' | 'LARGE';
|
|
239
|
+
/** 普通字段控件统一使用的圆角;THEME 表示继续跟随系统主题。 */
|
|
240
|
+
controlRadius: DesignerRadiusPreset;
|
|
241
|
+
/** 支持表面的显式布局容器在未覆盖时使用的默认样式。 */
|
|
242
|
+
containerStyle: DesignerContainerStyle;
|
|
243
|
+
/** 支持表面的显式布局容器在未覆盖时使用的默认圆角。 */
|
|
244
|
+
containerRadius: DesignerRadiusPreset;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/** 本地字段与未来权威字段来源之间的绑定状态。 */
|
|
248
|
+
export declare type DesignerBindingStatus = 'UNBOUND' | 'BOUND' | 'STALE' | 'INCOMPATIBLE' | 'MISSING';
|
|
249
|
+
|
|
250
|
+
/** 24 栅格投影中的字段或布局节点单元。 */
|
|
251
|
+
export declare interface DesignerCanvasCell {
|
|
252
|
+
nodeId: string;
|
|
253
|
+
index: number;
|
|
254
|
+
row: number;
|
|
255
|
+
start: number;
|
|
256
|
+
span: number;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/** 24 栅格投影中的空白可放置单元。 */
|
|
260
|
+
export declare interface DesignerCanvasGap {
|
|
261
|
+
index: number;
|
|
262
|
+
row: number;
|
|
263
|
+
start: number;
|
|
264
|
+
span: number;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/** 设计态只读栅格投影,不作为第二份 Schema 持久化。 */
|
|
268
|
+
export declare interface DesignerCanvasProjection {
|
|
269
|
+
cells: DesignerCanvasCell[];
|
|
270
|
+
gaps: DesignerCanvasGap[];
|
|
271
|
+
rowCount: number;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
/** 设计器组件在静态 Core 中的能力状态。 */
|
|
275
|
+
export declare type DesignerComponentAvailability = 'AVAILABLE' | 'CONDITIONAL' | 'UNAVAILABLE';
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* 校验组件目录中的新组件能否放入目标容器。
|
|
279
|
+
*
|
|
280
|
+
* @param document 当前设计文档。
|
|
281
|
+
* @param componentType 待创建的稳定组件编码。
|
|
282
|
+
* @param target 包含目标容器、命名插槽、索引和可选栅格列的完整落点。
|
|
283
|
+
* @returns 空字符串表示允许,否则返回可直接展示的拒绝原因。
|
|
284
|
+
*/
|
|
285
|
+
export declare function designerComponentDropRejection(document: DesignerDocument, componentType: string, target: DesignerDropTarget): string;
|
|
286
|
+
|
|
287
|
+
/** 组件可绑定的运行事件。 */
|
|
288
|
+
export declare type DesignerComponentEvent = 'CHANGE' | 'BLUR' | 'FOCUS' | 'CLICK';
|
|
289
|
+
|
|
290
|
+
/** 组件面板的稳定分类。 */
|
|
291
|
+
export declare type DesignerComponentGroup = 'LAYOUT' | 'BASIC' | 'ADVANCED' | 'DYNAMIC' | 'SUBTABLE' | 'AUXILIARY';
|
|
292
|
+
|
|
293
|
+
/** 组件注册项是组件目录、节点工厂、属性和渲染行为的唯一真源。 */
|
|
294
|
+
export declare interface DesignerComponentRegistration {
|
|
295
|
+
componentType: string;
|
|
296
|
+
name: string;
|
|
297
|
+
icon: string;
|
|
298
|
+
group: DesignerComponentGroup;
|
|
299
|
+
nodeKind: 'FIELD' | 'CONTAINER';
|
|
300
|
+
semanticType: DesignerSemanticType;
|
|
301
|
+
compatibleSemanticTypes: DesignerSemanticType[];
|
|
302
|
+
configurationVersion: number;
|
|
303
|
+
defaultConfiguration: Readonly<Record<string, unknown>>;
|
|
304
|
+
defaultSpan: number;
|
|
305
|
+
/** 新建节点的外层字段标签默认状态;已有文档继续使用节点自身布局值。 */
|
|
306
|
+
defaultShowLabel: boolean;
|
|
307
|
+
/** 详情态外层标签策略;自描述组件可以隐藏重复标签,但不改写布局配置。 */
|
|
308
|
+
detailLabelPolicy: 'INHERIT' | 'HIDE';
|
|
309
|
+
/** 只有 SURFACE 容器才允许继承或覆盖表单级容器外观。 */
|
|
310
|
+
containerAppearance: 'NONE' | 'SURFACE';
|
|
311
|
+
availability: DesignerComponentAvailability;
|
|
312
|
+
unavailableReason: string;
|
|
313
|
+
acceptsChildren: boolean;
|
|
314
|
+
/** 注册项显式声明可绑定事件;未声明时不显示事件入口。 */
|
|
315
|
+
supportedEvents?: DesignerComponentEvent[];
|
|
316
|
+
properties: DesignerPropertyDefinition[];
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/** 返回容器表面和圆角对应的公共主题工具类。 */
|
|
320
|
+
export declare function designerContainerAppearanceClasses(resolved: DesignerResolvedContainerAppearance | undefined): string[];
|
|
321
|
+
|
|
322
|
+
/** 批量恢复容器外观继承时可独立处理的配置维度。 */
|
|
323
|
+
export declare type DesignerContainerAppearanceDimension = 'STYLE' | 'RADIUS';
|
|
324
|
+
|
|
325
|
+
/** 显式布局或辅助组件节点。 */
|
|
326
|
+
export declare interface DesignerContainerNode {
|
|
327
|
+
nodeType: 'CONTAINER';
|
|
328
|
+
id: string;
|
|
329
|
+
componentType: string;
|
|
330
|
+
configurationVersion: number;
|
|
331
|
+
configuration: Record<string, unknown>;
|
|
332
|
+
layout: DesignerResponsiveGrid;
|
|
333
|
+
slots: DesignerLayoutSlot[];
|
|
334
|
+
/** 容器或辅助组件仅保存注册表允许的事件绑定。 */
|
|
335
|
+
eventBindings?: Partial<Record<DesignerComponentEvent, string>>;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
/** 容器节点对表单默认圆角的覆盖值。 */
|
|
339
|
+
export declare type DesignerContainerRadiusOverride = 'INHERIT' | DesignerRadiusPreset;
|
|
340
|
+
|
|
341
|
+
/** 表单显式布局容器允许使用的表面样式。 */
|
|
342
|
+
export declare type DesignerContainerStyle = 'NONE' | 'BORDERED' | 'SHADOW';
|
|
343
|
+
|
|
344
|
+
/** 容器节点对表单默认表面样式的覆盖值。 */
|
|
345
|
+
export declare type DesignerContainerStyleOverride = 'INHERIT' | DesignerContainerStyle | 'FILLED';
|
|
346
|
+
|
|
347
|
+
/** 返回字段控件圆角对应的公共主题工具类。 */
|
|
348
|
+
export declare function designerControlRadiusClass(radius: DesignerRadiusPreset): string;
|
|
349
|
+
|
|
350
|
+
/** 设计文档中的语义实体身份。 */
|
|
351
|
+
export declare interface DesignerDataEntity {
|
|
352
|
+
id: string;
|
|
353
|
+
code: string;
|
|
354
|
+
name: string;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/** 首次参数初始化和来源索引构建的结果。 */
|
|
358
|
+
export declare interface DesignerDataModelPreparation {
|
|
359
|
+
document: DesignerDocument;
|
|
360
|
+
sourceMetadata: DesignerSourceMetadataIndex;
|
|
361
|
+
diagnostics: DesignerDiagnostic[];
|
|
362
|
+
initialized: boolean;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
/** 设计文档保存的外部数据模型身份;不包含物理表、物理列或键映射。 */
|
|
366
|
+
export declare interface DesignerDataModelSource {
|
|
367
|
+
provider: string;
|
|
368
|
+
sourceId: string;
|
|
369
|
+
sourceRevision?: number;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
/** 文档内持久化的数据模型目录。 */
|
|
373
|
+
export declare interface DesignerDataSchema {
|
|
374
|
+
source?: DesignerDataModelSource;
|
|
375
|
+
rootEntity: DesignerDataEntity;
|
|
376
|
+
relations: DesignerOneToManyRelation[];
|
|
377
|
+
fields: DesignerField[];
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
/** 受控数据源运行 Adapter。 */
|
|
381
|
+
export declare interface DesignerDataSourceAdapter {
|
|
382
|
+
execute: (definition: DesignerDataSourceDefinition, input: Record<string, unknown>) => Promise<Record<string, unknown>>;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
/** Core 只保存稳定来源身份和映射,不保存 URL、SQL、请求头或凭据。 */
|
|
386
|
+
export declare interface DesignerDataSourceDefinition {
|
|
387
|
+
id: string;
|
|
388
|
+
code: string;
|
|
389
|
+
name: string;
|
|
390
|
+
provider: string;
|
|
391
|
+
sourceId: string;
|
|
392
|
+
sourceRevision?: number;
|
|
393
|
+
inputMappings: DesignerDataSourceMapping[];
|
|
394
|
+
outputMappings: DesignerDataSourceMapping[];
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
/** 数据源输入或输出映射。 */
|
|
398
|
+
export declare interface DesignerDataSourceMapping {
|
|
399
|
+
source: string;
|
|
400
|
+
target: string;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
/**
|
|
404
|
+
* 根据日期组件的当前语义返回合法显示格式。
|
|
405
|
+
*
|
|
406
|
+
* @param sourceValue 日期类型或日期范围类型。
|
|
407
|
+
* @returns 可供属性编辑器展示的受控格式。
|
|
408
|
+
*/
|
|
409
|
+
export declare function designerDateFormatOptions(sourceValue: unknown): DesignerPropertyOption[];
|
|
410
|
+
|
|
411
|
+
/** 设计器当前设备。移动端只复用同一份 Schema。 */
|
|
412
|
+
export declare type DesignerDevice = 'desktop' | 'mobile';
|
|
413
|
+
|
|
414
|
+
/** 单端 24 栅格配置。 */
|
|
415
|
+
export declare interface DesignerDeviceGrid {
|
|
416
|
+
span: number;
|
|
417
|
+
offset: number;
|
|
418
|
+
showLabel: boolean;
|
|
419
|
+
labelPosition: 'INHERIT' | 'TOP' | 'LEFT' | 'RIGHT';
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
/** 设计文档的可定位诊断。 */
|
|
423
|
+
export declare interface DesignerDiagnostic {
|
|
424
|
+
severity: DesignerDiagnosticSeverity;
|
|
425
|
+
code: string;
|
|
426
|
+
message: string;
|
|
427
|
+
path: string;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
/** 文档诊断级别。 */
|
|
431
|
+
export declare type DesignerDiagnosticSeverity = 'ERROR' | 'WARNING';
|
|
432
|
+
|
|
433
|
+
/** 返回弹窗外壳圆角对应的公共主题工具类;旧内存态缺省时继续跟随系统。 */
|
|
434
|
+
export declare function designerDialogRadiusClass(radius: DesignerRadiusPreset | undefined): string;
|
|
435
|
+
|
|
436
|
+
/** 独立设计器完整文档。 */
|
|
437
|
+
export declare interface DesignerDocument {
|
|
438
|
+
documentVersion: typeof DESIGNER_DOCUMENT_VERSION;
|
|
439
|
+
id: string;
|
|
440
|
+
name: string;
|
|
441
|
+
description: string;
|
|
442
|
+
dataSchema: DesignerDataSchema;
|
|
443
|
+
uiSchema: DesignerUiSchema;
|
|
444
|
+
appearance: DesignerAppearance;
|
|
445
|
+
submitPolicy: DesignerSubmitPolicy;
|
|
446
|
+
actionBar: DesignerActionBar;
|
|
447
|
+
variables: DesignerVariableDefinition[];
|
|
448
|
+
dataSources: DesignerDataSourceDefinition[];
|
|
449
|
+
eventFlows: DesignerEventFlow[];
|
|
450
|
+
i18n: DesignerI18nConfiguration;
|
|
451
|
+
actions: DesignerAction[];
|
|
452
|
+
extensions: Record<string, unknown>;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
/** 文档解码结果。错误诊断存在时不返回文档。 */
|
|
456
|
+
export declare interface DesignerDocumentDecodeResult {
|
|
457
|
+
document?: DesignerDocument;
|
|
458
|
+
diagnostics: DesignerDiagnostic[];
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
/** 设计态拖放会话;该状态只服务当前交互,不进入设计文档。 */
|
|
462
|
+
export declare interface DesignerDragSession {
|
|
463
|
+
active: boolean;
|
|
464
|
+
source: 'PALETTE' | 'CANVAS' | null;
|
|
465
|
+
sourceNodeId: string;
|
|
466
|
+
target?: DesignerDropTarget;
|
|
467
|
+
accepted: boolean;
|
|
468
|
+
rejectionReason: string;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
/** 画布中可接收新节点的稳定目标。 */
|
|
472
|
+
export declare interface DesignerDropTarget {
|
|
473
|
+
containerId: string | null;
|
|
474
|
+
slotCode: string;
|
|
475
|
+
index: number;
|
|
476
|
+
placement?: 'BEFORE' | 'AFTER' | 'INSIDE' | 'GRID';
|
|
477
|
+
columnStart?: number;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
/** 事件动作目录项的运行能力状态。 */
|
|
481
|
+
export declare interface DesignerEventActionAvailability {
|
|
482
|
+
type: DesignerEventActionType;
|
|
483
|
+
available: boolean;
|
|
484
|
+
unavailableReason: string;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
/** 引导式事件流中的单个动作。 */
|
|
488
|
+
export declare interface DesignerEventActionStep {
|
|
489
|
+
id: string;
|
|
490
|
+
stepType: 'ACTION';
|
|
491
|
+
name: string;
|
|
492
|
+
actionType: DesignerEventActionType;
|
|
493
|
+
configuration: Record<string, unknown>;
|
|
494
|
+
guard?: DesignerExpression;
|
|
495
|
+
guardFailure: 'SKIP' | 'BLOCK';
|
|
496
|
+
onError: DesignerEventErrorPolicy;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
/** 声明式动作步骤类型。 */
|
|
500
|
+
export declare type DesignerEventActionType = 'SET_FIELD' | 'CLEAR_FIELD' | 'COPY_FIELD' | 'SET_VARIABLE' | 'VALIDATE' | 'SUBMIT' | 'RESET' | 'PRINT' | 'MESSAGE' | 'OPEN_MODULE' | 'CONFIRM_MODULE' | 'CANCEL_MODULE' | 'NAVIGATE_RESOURCE' | 'REFRESH_DATA_SOURCE' | 'HOST_ACTION';
|
|
501
|
+
|
|
502
|
+
/** 条件分支。 */
|
|
503
|
+
export declare interface DesignerEventConditionBranch {
|
|
504
|
+
id: string;
|
|
505
|
+
name: string;
|
|
506
|
+
condition: DesignerExpression;
|
|
507
|
+
steps: DesignerEventStep[];
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
/** 引导式事件流中的条件节点。 */
|
|
511
|
+
export declare interface DesignerEventConditionStep {
|
|
512
|
+
id: string;
|
|
513
|
+
stepType: 'CONDITION';
|
|
514
|
+
name: string;
|
|
515
|
+
branches: DesignerEventConditionBranch[];
|
|
516
|
+
elseSteps: DesignerEventStep[];
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
/** 事件动作的错误处理策略。 */
|
|
520
|
+
export declare type DesignerEventErrorPolicy = 'STOP' | 'CONTINUE';
|
|
521
|
+
|
|
522
|
+
/** 事件流执行结果。 */
|
|
523
|
+
export declare interface DesignerEventExecutionResult {
|
|
524
|
+
completed: boolean;
|
|
525
|
+
blocked: boolean;
|
|
526
|
+
executedStepIds: string[];
|
|
527
|
+
errors: string[];
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
/** 可由字段、容器或表单生命周期引用的声明式事件流。 */
|
|
531
|
+
export declare interface DesignerEventFlow {
|
|
532
|
+
id: string;
|
|
533
|
+
code: string;
|
|
534
|
+
name: string;
|
|
535
|
+
trigger: {
|
|
536
|
+
scope: 'FORM';
|
|
537
|
+
event: DesignerFormEvent;
|
|
538
|
+
} | {
|
|
539
|
+
scope: 'COMPONENT';
|
|
540
|
+
event: DesignerComponentEvent;
|
|
541
|
+
nodeId: string;
|
|
542
|
+
};
|
|
543
|
+
enabled: boolean;
|
|
544
|
+
steps: DesignerEventStep[];
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
/** 事件流运行 Host;所有可能产生外部副作用的能力均由显式回调或 Adapter 提供。 */
|
|
548
|
+
export declare interface DesignerEventRuntimeHost {
|
|
549
|
+
document: DesignerDocument;
|
|
550
|
+
valueStore: DesignerRuntimeValueStore;
|
|
551
|
+
variables: Record<string, unknown>;
|
|
552
|
+
currentRow?: Record<string, unknown>;
|
|
553
|
+
expressionContext: DesignerExpressionRuntimeContext['context'];
|
|
554
|
+
adapters?: DesignerRuntimeAdapters;
|
|
555
|
+
validate?: () => Promise<boolean>;
|
|
556
|
+
submit?: () => Promise<void>;
|
|
557
|
+
reset?: () => void;
|
|
558
|
+
print?: () => void;
|
|
559
|
+
message?: (message: string, level: 'SUCCESS' | 'INFO' | 'WARNING' | 'ERROR') => void;
|
|
560
|
+
openModule?: (moduleCode: string) => void;
|
|
561
|
+
confirmModule?: (moduleCode: string) => void;
|
|
562
|
+
cancelModule?: (moduleCode: string) => void;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
/** 事件流递归步骤。 */
|
|
566
|
+
export declare type DesignerEventStep = DesignerEventActionStep | DesignerEventConditionStep;
|
|
567
|
+
|
|
568
|
+
/** 声明式表达式 AST;Core 不持久化或执行自由脚本。 */
|
|
569
|
+
export declare type DesignerExpression = {
|
|
570
|
+
kind: 'LITERAL';
|
|
571
|
+
value: string | number | boolean | null;
|
|
572
|
+
} | {
|
|
573
|
+
kind: 'FIELD';
|
|
574
|
+
fieldId: string;
|
|
575
|
+
scope: DesignerExpressionFieldScope;
|
|
576
|
+
} | {
|
|
577
|
+
kind: 'VARIABLE';
|
|
578
|
+
variableCode: string;
|
|
579
|
+
} | {
|
|
580
|
+
kind: 'CONTEXT';
|
|
581
|
+
key: DesignerExpressionContextKey;
|
|
582
|
+
} | {
|
|
583
|
+
kind: 'CALL';
|
|
584
|
+
function: DesignerExpressionFunction;
|
|
585
|
+
arguments: DesignerExpression[];
|
|
586
|
+
};
|
|
587
|
+
|
|
588
|
+
/** 表达式可读取的受控上下文值。 */
|
|
589
|
+
export declare type DesignerExpressionContextKey = 'RUNTIME_MODE' | 'DEVICE' | 'CURRENT_USER_ID' | 'CURRENT_TENANT_ID' | 'NOW';
|
|
590
|
+
|
|
591
|
+
/** 表达式读取字段时的受控数据作用域。 */
|
|
592
|
+
export declare type DesignerExpressionFieldScope = 'ROOT' | 'CURRENT_ROW';
|
|
593
|
+
|
|
594
|
+
/** 表达式解释器允许的纯函数目录。 */
|
|
595
|
+
export declare type DesignerExpressionFunction = 'AND' | 'OR' | 'NOT' | 'EQ' | 'NE' | 'GT' | 'GTE' | 'LT' | 'LTE' | 'EMPTY' | 'NOT_EMPTY' | 'IN' | 'CONTAINS' | 'ADD' | 'SUBTRACT' | 'MULTIPLY' | 'DIVIDE' | 'CONCAT' | 'COALESCE' | 'LENGTH' | 'IF';
|
|
596
|
+
|
|
597
|
+
/** 运行表达式时由 Host 提供的只读上下文。 */
|
|
598
|
+
export declare interface DesignerExpressionRuntimeContext {
|
|
599
|
+
fields: Record<string, unknown>;
|
|
600
|
+
currentRow?: Record<string, unknown>;
|
|
601
|
+
variables: Record<string, unknown>;
|
|
602
|
+
context: Partial<Record<DesignerExpressionContextKey, unknown>>;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
/** 数据 Schema 中的本地语义字段。 */
|
|
606
|
+
export declare interface DesignerField {
|
|
607
|
+
id: string;
|
|
608
|
+
/** 字段所属语义实体编码;根级字段必须属于主实体,子表列必须属于对应子实体。 */
|
|
609
|
+
entityCode: string;
|
|
610
|
+
key: string;
|
|
611
|
+
label: string;
|
|
612
|
+
semanticType: DesignerSemanticType;
|
|
613
|
+
componentType: string;
|
|
614
|
+
configurationVersion: number;
|
|
615
|
+
configuration: Record<string, unknown>;
|
|
616
|
+
defaultValue: unknown;
|
|
617
|
+
helpText: string;
|
|
618
|
+
required: boolean;
|
|
619
|
+
validation: DesignerFieldValidation;
|
|
620
|
+
/** 条件状态、计算联动、独立验证、提交投影和事件绑定。 */
|
|
621
|
+
behavior: DesignerFieldBehavior;
|
|
622
|
+
display: DesignerFieldDisplay;
|
|
623
|
+
bindingStatus: DesignerBindingStatus;
|
|
624
|
+
primaryKey: boolean;
|
|
625
|
+
systemField: boolean;
|
|
626
|
+
displayOrder: number;
|
|
627
|
+
binding?: DesignerFieldBinding;
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
/** 字段行为配置。 */
|
|
631
|
+
export declare interface DesignerFieldBehavior {
|
|
632
|
+
stateRules: DesignerFieldStateRule[];
|
|
633
|
+
valueRules: DesignerFieldValueRule[];
|
|
634
|
+
validationRules: DesignerValidationRule[];
|
|
635
|
+
submitBehavior: DesignerFieldSubmitBehavior;
|
|
636
|
+
eventBindings: Partial<Record<DesignerComponentEvent, string>>;
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
/** 高级配置编辑器只消费能力状态,不持有 Adapter 实例。 */
|
|
640
|
+
export declare interface DesignerFieldBehaviorCapabilities {
|
|
641
|
+
remoteValidation: boolean;
|
|
642
|
+
dataSource: boolean;
|
|
643
|
+
navigation: boolean;
|
|
644
|
+
hostAction: boolean;
|
|
645
|
+
linkageConfirmation: boolean;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
/** 高级配置保存前可定位到页签与规则的诊断。 */
|
|
649
|
+
export declare interface DesignerFieldBehaviorDiagnostic {
|
|
650
|
+
severity: DesignerDiagnosticSeverity;
|
|
651
|
+
code: string;
|
|
652
|
+
message: string;
|
|
653
|
+
path: string;
|
|
654
|
+
tab: 'state' | 'value' | 'validation' | 'submit';
|
|
655
|
+
ruleId?: string;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
/** 可选外部字段绑定引用;Core 只保存稳定引用,不解释业务来源。 */
|
|
659
|
+
export declare interface DesignerFieldBinding {
|
|
660
|
+
provider: string;
|
|
661
|
+
sourceId: string;
|
|
662
|
+
fieldId: string;
|
|
663
|
+
fieldPath: string;
|
|
664
|
+
sourceDataType: string;
|
|
665
|
+
sourceRevision?: number;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
/** 字段展示配置。 */
|
|
669
|
+
export declare interface DesignerFieldDisplay {
|
|
670
|
+
placeholder: string;
|
|
671
|
+
hidden: boolean;
|
|
672
|
+
readonly: boolean;
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
/** 字段下方分别展示的错误与非阻断警告。 */
|
|
676
|
+
export declare interface DesignerFieldFeedback {
|
|
677
|
+
error?: string;
|
|
678
|
+
warning?: string;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
/** 生成字段帮助文字约定使用的稳定词条 key。 */
|
|
682
|
+
export declare function designerFieldHelpI18nKey(fieldKey: string): string;
|
|
683
|
+
|
|
684
|
+
/** 生成字段标签约定使用的稳定词条 key。 */
|
|
685
|
+
export declare function designerFieldLabelI18nKey(fieldKey: string): string;
|
|
686
|
+
|
|
687
|
+
/** 引用数据字段的 UI 节点。 */
|
|
688
|
+
export declare interface DesignerFieldNode {
|
|
689
|
+
nodeType: 'FIELD';
|
|
690
|
+
id: string;
|
|
691
|
+
fieldId: string;
|
|
692
|
+
layout: DesignerResponsiveGrid;
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
/** 校验字段从当前实体作用域移动到目标作用域是否被允许。 */
|
|
696
|
+
export declare function designerFieldScopeDropRejection(document: DesignerDocument, field: DesignerField, targetContainerId: string | null): string;
|
|
697
|
+
|
|
698
|
+
/** 字段运行状态规则。 */
|
|
699
|
+
export declare interface DesignerFieldStateRule {
|
|
700
|
+
id: string;
|
|
701
|
+
target: 'VISIBLE' | 'REQUIRED' | 'DISABLED';
|
|
702
|
+
condition: DesignerExpression;
|
|
703
|
+
valueWhenTrue: boolean;
|
|
704
|
+
valueWhenFalse?: boolean;
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
/** 字段是否进入最终提交数据。 */
|
|
708
|
+
export declare type DesignerFieldSubmitBehavior = 'AUTO' | 'INCLUDE' | 'EXCLUDE';
|
|
709
|
+
|
|
710
|
+
/** 字段基础校验。专属校验继续存放在版本化组件配置中。 */
|
|
711
|
+
export declare interface DesignerFieldValidation {
|
|
712
|
+
minimumLength?: number;
|
|
713
|
+
maximumLength?: number;
|
|
714
|
+
minimum?: number;
|
|
715
|
+
maximum?: number;
|
|
716
|
+
pattern?: string;
|
|
717
|
+
message?: string;
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
/** 字段计算或赋值联动规则。 */
|
|
721
|
+
export declare type DesignerFieldValueRule = DesignerFormulaValueRule | DesignerLinkageValueRule;
|
|
722
|
+
|
|
723
|
+
/** 表单生命周期事件。 */
|
|
724
|
+
export declare type DesignerFormEvent = 'INITIALIZED' | 'BEFORE_SUBMIT' | 'AFTER_SUBMIT' | 'RESET';
|
|
725
|
+
|
|
726
|
+
/** 确定性重算并使目标字段保持只读的计算公式。 */
|
|
727
|
+
export declare interface DesignerFormulaValueRule {
|
|
728
|
+
id: string;
|
|
729
|
+
mode: 'FORMULA';
|
|
730
|
+
expression: DesignerExpression;
|
|
731
|
+
condition?: DesignerExpression;
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
/** 字段页一次生成主表和子表布局时的受控请求。 */
|
|
735
|
+
export declare interface DesignerGenerateLayoutRequest {
|
|
736
|
+
fieldIds: string[];
|
|
737
|
+
relations: Array<{
|
|
738
|
+
relationCode: string;
|
|
739
|
+
componentType: 'row-subtable' | 'block-subtable';
|
|
740
|
+
}>;
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
/** Host 动作与同应用资源导航 Adapter。 */
|
|
744
|
+
export declare interface DesignerHostActionAdapter {
|
|
745
|
+
execute: (actionCode: string, input: Record<string, unknown>) => Promise<void>;
|
|
746
|
+
navigateResource: (resourceCode: string, openInNewPage: boolean) => Promise<void>;
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
/** 表单国际化配置。 */
|
|
750
|
+
export declare interface DesignerI18nConfiguration {
|
|
751
|
+
enabled: boolean;
|
|
752
|
+
defaultLocale: string;
|
|
753
|
+
locales: string[];
|
|
754
|
+
entries: DesignerI18nEntry[];
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
/** 国际化词条。 */
|
|
758
|
+
export declare interface DesignerI18nEntry {
|
|
759
|
+
key: string;
|
|
760
|
+
values: Record<string, string>;
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
/** Host 首次初始化 Core 时使用的数据模型参数。 */
|
|
764
|
+
export declare interface DesignerInitialDataModel {
|
|
765
|
+
provider: string;
|
|
766
|
+
sourceId: string;
|
|
767
|
+
sourceRevision?: number;
|
|
768
|
+
rootEntity: DesignerInitialEntity;
|
|
769
|
+
relations: DesignerInitialOneToManyRelation[];
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
/** Host 首次向独立 Core 注入的实体描述。 */
|
|
773
|
+
export declare interface DesignerInitialEntity {
|
|
774
|
+
entityId: string;
|
|
775
|
+
entityCode: string;
|
|
776
|
+
entityName: string;
|
|
777
|
+
physicalTableName?: string;
|
|
778
|
+
fields: DesignerInitialField[];
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
/** Host 首次向独立 Core 注入的字段描述。 */
|
|
782
|
+
export declare interface DesignerInitialField {
|
|
783
|
+
fieldId: string;
|
|
784
|
+
fieldCode: string;
|
|
785
|
+
fieldName: string;
|
|
786
|
+
sourceDataType: string;
|
|
787
|
+
semanticType: DesignerSemanticType;
|
|
788
|
+
defaultComponentType: string;
|
|
789
|
+
physicalColumnName?: string;
|
|
790
|
+
required?: boolean;
|
|
791
|
+
readonly?: boolean;
|
|
792
|
+
primaryKey?: boolean;
|
|
793
|
+
systemField?: boolean;
|
|
794
|
+
displayOrder?: number;
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
/** Host 首次向独立 Core 注入的一级一对多关系。 */
|
|
798
|
+
export declare interface DesignerInitialOneToManyRelation {
|
|
799
|
+
relationId: string;
|
|
800
|
+
relationCode: string;
|
|
801
|
+
relationName: string;
|
|
802
|
+
parentEntityId: string;
|
|
803
|
+
childEntity: DesignerInitialEntity;
|
|
804
|
+
loadMode?: 'SYNC' | 'ASYNC';
|
|
805
|
+
keyMappings?: Array<{
|
|
806
|
+
parentFieldId: string;
|
|
807
|
+
childFieldId: string;
|
|
808
|
+
}>;
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
/** 设计器 UI Schema 节点。 */
|
|
812
|
+
export declare type DesignerLayoutNode = DesignerFieldNode | DesignerContainerNode;
|
|
813
|
+
|
|
814
|
+
/** 容器中的稳定命名插槽。 */
|
|
815
|
+
export declare interface DesignerLayoutSlot {
|
|
816
|
+
id: string;
|
|
817
|
+
slotCode: string;
|
|
818
|
+
label: string;
|
|
819
|
+
children: DesignerLayoutNode[];
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
/** 联动覆盖已有字段值前由 Host 提供的受控确认 Adapter。 */
|
|
823
|
+
export declare interface DesignerLinkageConfirmationAdapter {
|
|
824
|
+
confirmOverwrite: (request: {
|
|
825
|
+
fieldId: string;
|
|
826
|
+
fieldLabel: string;
|
|
827
|
+
currentValue: unknown;
|
|
828
|
+
nextValue: unknown;
|
|
829
|
+
}) => Promise<boolean>;
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
/** 联动规则覆盖已有目标值时采用的受控策略。 */
|
|
833
|
+
export declare type DesignerLinkageOverwritePolicy = 'ALWAYS' | 'EMPTY_ONLY' | 'CONFIRM';
|
|
834
|
+
|
|
835
|
+
/** 仅在依赖字段变化后执行的数据联动。 */
|
|
836
|
+
export declare interface DesignerLinkageValueRule {
|
|
837
|
+
id: string;
|
|
838
|
+
mode: 'LINKAGE';
|
|
839
|
+
expression: DesignerExpression;
|
|
840
|
+
condition?: DesignerExpression;
|
|
841
|
+
overwritePolicy: DesignerLinkageOverwritePolicy;
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
/** 生成弹层模块名称约定使用的稳定词条 key。 */
|
|
845
|
+
export declare function designerModuleI18nKey(moduleCode: string): string;
|
|
846
|
+
|
|
847
|
+
/**
|
|
848
|
+
* 校验现有设计节点能否移动到目标容器。
|
|
849
|
+
*
|
|
850
|
+
* @param document 当前设计文档。
|
|
851
|
+
* @param nodeId 待移动节点标识。
|
|
852
|
+
* @param target 包含目标容器、命名插槽、索引和可选栅格列的完整落点。
|
|
853
|
+
* @returns 空字符串表示允许,否则返回可直接展示的拒绝原因。
|
|
854
|
+
*/
|
|
855
|
+
export declare function designerNodeDropRejection(document: DesignerDocument, nodeId: string, target: DesignerDropTarget): string;
|
|
856
|
+
|
|
857
|
+
/** 数字字段格式化所需的受控配置。 */
|
|
858
|
+
export declare interface DesignerNumberFormatConfiguration {
|
|
859
|
+
precision?: unknown;
|
|
860
|
+
currencyPrefix?: unknown;
|
|
861
|
+
thousandsSeparator?: unknown;
|
|
862
|
+
uppercaseRmb?: unknown;
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
/** 当前 Core 支持的主实体到一级子实体一对多关系。 */
|
|
866
|
+
export declare interface DesignerOneToManyRelation {
|
|
867
|
+
id: string;
|
|
868
|
+
code: string;
|
|
869
|
+
name: string;
|
|
870
|
+
parentEntityId: string;
|
|
871
|
+
childEntity: DesignerDataEntity;
|
|
872
|
+
loadMode: 'SYNC' | 'ASYNC';
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
/** 静态选项的稳定结构。 */
|
|
876
|
+
export declare interface DesignerOption {
|
|
877
|
+
label: string;
|
|
878
|
+
value: string | number | boolean;
|
|
879
|
+
disabled?: boolean;
|
|
880
|
+
children?: DesignerOption[];
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
/** 大纲使用的只读投影节点。 */
|
|
884
|
+
export declare interface DesignerOutlineItem {
|
|
885
|
+
id: string;
|
|
886
|
+
label: string;
|
|
887
|
+
typeLabel: string;
|
|
888
|
+
children: DesignerOutlineItem[];
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
/** 弹层模块的数据草稿来源。 */
|
|
892
|
+
export declare type DesignerOverlayDataContext = 'FORM_DRAFT' | 'SUBTABLE_ROW_DRAFT';
|
|
893
|
+
|
|
894
|
+
/** 弹层模块类型。 */
|
|
895
|
+
export declare type DesignerOverlayKind = 'DIALOG' | 'DRAWER';
|
|
896
|
+
|
|
897
|
+
/** 弹窗在运行态允许使用的最大高度档位。 */
|
|
898
|
+
export declare type DesignerOverlayMaxHeightPreset = 'COMPACT' | 'STANDARD' | 'SPACIOUS' | 'VIEWPORT';
|
|
899
|
+
|
|
900
|
+
/** 主体之外可被事件打开的弹窗或抽屉视图。 */
|
|
901
|
+
export declare interface DesignerOverlayModule {
|
|
902
|
+
id: string;
|
|
903
|
+
code: string;
|
|
904
|
+
name: string;
|
|
905
|
+
kind: DesignerOverlayKind;
|
|
906
|
+
dataContext: DesignerOverlayDataContext;
|
|
907
|
+
width: number;
|
|
908
|
+
/** 弹窗使用的受控圆角档位;抽屉保留该值但不渲染圆角。 */
|
|
909
|
+
radius: DesignerRadiusPreset;
|
|
910
|
+
/** 弹窗运行最大高度;抽屉保留该值但继续占满可用高度。 */
|
|
911
|
+
maxHeightPreset: DesignerOverlayMaxHeightPreset;
|
|
912
|
+
root: DesignerLayoutNode[];
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
/** 注册项贡献给属性工作台的结构化属性。 */
|
|
916
|
+
export declare interface DesignerPropertyDefinition {
|
|
917
|
+
key: string;
|
|
918
|
+
label: string;
|
|
919
|
+
section: 'BASIC' | 'DATA' | 'DISPLAY' | 'CAPABILITY';
|
|
920
|
+
editor: DesignerPropertyEditor;
|
|
921
|
+
description?: string;
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
/**
|
|
925
|
+
* 组件注册项使用的业务语义属性编辑器。
|
|
926
|
+
*
|
|
927
|
+
* 判别联合把受控选项、单位、范围和专属能力集中在注册表,属性面板只解释该接口,
|
|
928
|
+
* 不再根据字段 key 或 JavaScript 值类型猜测应该使用哪一种输入控件。
|
|
929
|
+
*/
|
|
930
|
+
export declare type DesignerPropertyEditor = (DesignerPropertyEditorBase & {
|
|
931
|
+
type: 'TEXT';
|
|
932
|
+
maxLength?: number;
|
|
933
|
+
}) | (DesignerPropertyEditorBase & {
|
|
934
|
+
type: 'TEXTAREA';
|
|
935
|
+
rows?: number;
|
|
936
|
+
maxLength?: number;
|
|
937
|
+
}) | (DesignerPropertyEditorBase & {
|
|
938
|
+
type: 'NUMBER';
|
|
939
|
+
minimum?: number;
|
|
940
|
+
maximum?: number;
|
|
941
|
+
step?: number;
|
|
942
|
+
unit?: string;
|
|
943
|
+
}) | (DesignerPropertyEditorBase & {
|
|
944
|
+
type: 'BOOLEAN';
|
|
945
|
+
}) | (DesignerPropertyEditorBase & {
|
|
946
|
+
type: 'SELECT' | 'SEGMENTED';
|
|
947
|
+
options: DesignerPropertyOption[];
|
|
948
|
+
}) | (DesignerPropertyEditorBase & {
|
|
949
|
+
type: 'PRESET_NUMBER';
|
|
950
|
+
options: DesignerPropertyOption[];
|
|
951
|
+
minimum?: number;
|
|
952
|
+
maximum?: number;
|
|
953
|
+
unit?: string;
|
|
954
|
+
}) | (DesignerPropertyEditorBase & {
|
|
955
|
+
type: 'COLOR';
|
|
956
|
+
}) | (DesignerPropertyEditorBase & {
|
|
957
|
+
type: 'OPTIONS';
|
|
958
|
+
}) | (DesignerPropertyEditorBase & {
|
|
959
|
+
type: 'DATE_FORMAT';
|
|
960
|
+
sourceKey: string;
|
|
961
|
+
}) | (DesignerPropertyEditorBase & {
|
|
962
|
+
type: 'FILE_TYPES';
|
|
963
|
+
}) | (DesignerPropertyEditorBase & {
|
|
964
|
+
type: 'URL';
|
|
965
|
+
maxLength?: number;
|
|
966
|
+
}) | (DesignerPropertyEditorBase & {
|
|
967
|
+
type: 'RESOURCE_REFERENCE';
|
|
968
|
+
resourceType: 'DICTIONARY' | 'PROCESS' | 'FORM' | 'ASSET_POLICY';
|
|
969
|
+
unavailableReason: string;
|
|
970
|
+
}) | (DesignerPropertyEditorBase & {
|
|
971
|
+
type: 'GRID_SPAN';
|
|
972
|
+
device: DesignerDevice;
|
|
973
|
+
}) | (DesignerPropertyEditorBase & {
|
|
974
|
+
type: 'GRID_OFFSET';
|
|
975
|
+
spanKey: string;
|
|
976
|
+
}) | (DesignerPropertyEditorBase & {
|
|
977
|
+
type: 'IDENTIFIER';
|
|
978
|
+
maxLength?: number;
|
|
979
|
+
});
|
|
980
|
+
|
|
981
|
+
/** 属性编辑器的共享行为;历史值策略只影响编辑显示,不会改写文档。 */
|
|
982
|
+
export declare interface DesignerPropertyEditorBase {
|
|
983
|
+
visibleWhen?: (configuration: Readonly<Record<string, unknown>>) => boolean;
|
|
984
|
+
legacyValuePolicy?: 'PRESERVE' | 'REJECT';
|
|
985
|
+
/** 为需要保留的旧枚举值提供可理解的显示名称,避免属性面板暴露内部编码。 */
|
|
986
|
+
legacyValueLabels?: Readonly<Record<string, string>>;
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
/** 属性编辑器中的稳定原子选项。 */
|
|
990
|
+
export declare interface DesignerPropertyOption {
|
|
991
|
+
label: string;
|
|
992
|
+
value: string | number | boolean;
|
|
993
|
+
disabled?: boolean;
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
/** 当前容器快捷栅格的影响预览。 */
|
|
997
|
+
export declare interface DesignerQuickGridPreview {
|
|
998
|
+
targetLabel: string;
|
|
999
|
+
affectedNodeIds: string[];
|
|
1000
|
+
skippedCount: number;
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
/** 表单字段控件和显式容器共用的受控圆角档位。 */
|
|
1004
|
+
export declare type DesignerRadiusPreset = 'THEME' | 'NONE' | 'SMALL' | 'BASE' | 'LARGE';
|
|
1005
|
+
|
|
1006
|
+
/** 一级子表关系可修改的语义身份属性。 */
|
|
1007
|
+
export declare interface DesignerRelationPatch {
|
|
1008
|
+
name?: string;
|
|
1009
|
+
code?: string;
|
|
1010
|
+
childEntityName?: string;
|
|
1011
|
+
childEntityCode?: string;
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
/** 受控远程验证 Adapter。 */
|
|
1015
|
+
export declare interface DesignerRemoteValidationAdapter {
|
|
1016
|
+
validate: (request: {
|
|
1017
|
+
provider: string;
|
|
1018
|
+
validatorId: string;
|
|
1019
|
+
value: unknown;
|
|
1020
|
+
fieldId: string;
|
|
1021
|
+
}) => Promise<{
|
|
1022
|
+
valid: boolean;
|
|
1023
|
+
message?: string;
|
|
1024
|
+
}>;
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
/** 设计与运行渲染器共同消费的容器外观解析结果。 */
|
|
1028
|
+
export declare interface DesignerResolvedContainerAppearance {
|
|
1029
|
+
style: Exclude<DesignerContainerStyleOverride, 'INHERIT'>;
|
|
1030
|
+
radius: DesignerRadiusPreset;
|
|
1031
|
+
styleSource: 'FORM' | 'COMPONENT';
|
|
1032
|
+
radiusSource: 'FORM' | 'COMPONENT';
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
/** 字段解释后的运行状态。 */
|
|
1036
|
+
export declare interface DesignerResolvedFieldState {
|
|
1037
|
+
visible: boolean;
|
|
1038
|
+
required: boolean;
|
|
1039
|
+
disabled: boolean;
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
/** PC 与移动端共用字段树时的响应式布局。 */
|
|
1043
|
+
export declare interface DesignerResponsiveGrid {
|
|
1044
|
+
pc: DesignerDeviceGrid;
|
|
1045
|
+
mobile: DesignerDeviceGrid;
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
/** 主实体可修改的语义身份属性。 */
|
|
1049
|
+
export declare type DesignerRootEntityPatch = Partial<Pick<DesignerDataEntity, 'name' | 'code'>>;
|
|
1050
|
+
|
|
1051
|
+
/** 静态运行预览可选 Adapter 集合;缺少能力时必须失败关闭。 */
|
|
1052
|
+
export declare interface DesignerRuntimeAdapters {
|
|
1053
|
+
asset?: FormAssetAdapter;
|
|
1054
|
+
remoteValidation?: DesignerRemoteValidationAdapter;
|
|
1055
|
+
dataSource?: DesignerDataSourceAdapter;
|
|
1056
|
+
hostAction?: DesignerHostActionAdapter;
|
|
1057
|
+
linkageConfirmation?: DesignerLinkageConfirmationAdapter;
|
|
1058
|
+
navigation?: FormNavigationAdapter;
|
|
1059
|
+
directory?: FormDirectoryAdapter;
|
|
1060
|
+
ocr?: FormOcrAdapter;
|
|
1061
|
+
scan?: FormScanAdapter;
|
|
1062
|
+
location?: FormLocationAdapter;
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1065
|
+
/** 设计器与静态运行预览共用的模式。 */
|
|
1066
|
+
export declare type DesignerRuntimeMode = 'DESIGN' | 'CREATE' | 'EDIT' | 'READ_ONLY' | 'DETAIL';
|
|
1067
|
+
|
|
1068
|
+
/**
|
|
1069
|
+
* 静态运行预览的值仓库。
|
|
1070
|
+
*
|
|
1071
|
+
* 普通字段与集合值分开保存;集合以子表容器节点 ID 为键,整个仓库只属于预览副本,不允许写回设计文档。
|
|
1072
|
+
*/
|
|
1073
|
+
export declare interface DesignerRuntimeValueStore {
|
|
1074
|
+
fields: Record<string, unknown>;
|
|
1075
|
+
collections: Record<string, DesignerSubtableRow[]>;
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
/** 设计器字段的语义数据类型,不包含任何数据库方言。 */
|
|
1079
|
+
export declare type DesignerSemanticType = 'STRING' | 'LONG_TEXT' | 'NUMBER' | 'BOOLEAN' | 'DATE' | 'DATE_TIME' | 'FILE' | 'REFERENCE' | 'OBJECT' | 'ARRAY';
|
|
1080
|
+
|
|
1081
|
+
/** Sortable 在设计器内部暴露的最小移动上下文,避免工作台依赖第三方完整事件类型。 */
|
|
1082
|
+
export declare interface DesignerSortableMoveEvent {
|
|
1083
|
+
dragged: HTMLElement;
|
|
1084
|
+
related: HTMLElement;
|
|
1085
|
+
to: HTMLElement;
|
|
1086
|
+
willInsertAfter?: boolean;
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
/** 物理来源信息只存在于当前 Core 会话,绝不进入设计文档。 */
|
|
1090
|
+
export declare interface DesignerSourceMetadataIndex {
|
|
1091
|
+
provider: string;
|
|
1092
|
+
sourceId: string;
|
|
1093
|
+
sourceRevision?: number;
|
|
1094
|
+
entities: Record<string, {
|
|
1095
|
+
physicalTableName?: string;
|
|
1096
|
+
}>;
|
|
1097
|
+
fields: Record<string, {
|
|
1098
|
+
physicalColumnName?: string;
|
|
1099
|
+
}>;
|
|
1100
|
+
relations: Record<string, {
|
|
1101
|
+
keyMappings: Array<{
|
|
1102
|
+
parentFieldId: string;
|
|
1103
|
+
childFieldId: string;
|
|
1104
|
+
}>;
|
|
1105
|
+
}>;
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1108
|
+
/** 提交投影结果。 */
|
|
1109
|
+
export declare interface DesignerSubmissionProjection {
|
|
1110
|
+
fields: Record<string, unknown>;
|
|
1111
|
+
collections: Record<string, DesignerSubtableRow[]>;
|
|
1112
|
+
excludedFieldIds: string[];
|
|
1113
|
+
}
|
|
1114
|
+
|
|
1115
|
+
/** 表单提交时对普通隐藏字段的统一处理策略。 */
|
|
1116
|
+
export declare interface DesignerSubmitPolicy {
|
|
1117
|
+
ignoreHiddenFields: boolean;
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1120
|
+
/**
|
|
1121
|
+
* 子表各展示形态共用的只读列投影。
|
|
1122
|
+
*
|
|
1123
|
+
* 列标识来自布局节点,字段身份来自 Data Schema;该投影不进入设计文档,也不持有可变节点引用。
|
|
1124
|
+
*/
|
|
1125
|
+
export declare interface DesignerSubtableColumn {
|
|
1126
|
+
columnId: string;
|
|
1127
|
+
fieldId: string;
|
|
1128
|
+
fieldKey: string;
|
|
1129
|
+
label: string;
|
|
1130
|
+
componentType: string;
|
|
1131
|
+
semanticType: DesignerSemanticType;
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
/** 子表表头、编辑行和详情行共用的 CSS Grid 布局结果。 */
|
|
1135
|
+
export declare interface DesignerSubtableGridLayout {
|
|
1136
|
+
template: string;
|
|
1137
|
+
minimumWidth: string;
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
/** 子表栅格可选区域;序号列和操作列必须与数据列一起生成同一模板。 */
|
|
1141
|
+
export declare interface DesignerSubtableGridOptions {
|
|
1142
|
+
showIndex?: boolean;
|
|
1143
|
+
showActions?: boolean;
|
|
1144
|
+
indexWidth?: number;
|
|
1145
|
+
actionWidth?: number;
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1148
|
+
/** 子表列投影的设计态与运行态可见性选项。 */
|
|
1149
|
+
export declare interface DesignerSubtableProjectionOptions {
|
|
1150
|
+
/** 设计态可保留历史隐藏字段以便用户修复;运行态必须保持关闭。 */
|
|
1151
|
+
includeHidden?: boolean;
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1154
|
+
/**
|
|
1155
|
+
* 静态预览中的子表行。
|
|
1156
|
+
*
|
|
1157
|
+
* `rowId` 只标识当前预览副本中的一行;`values` 使用字段 ID 作为键,避免字段编码调整后串行数据。
|
|
1158
|
+
*/
|
|
1159
|
+
export declare interface DesignerSubtableRow {
|
|
1160
|
+
rowId: string;
|
|
1161
|
+
values: Record<string, unknown>;
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
/** 可设计视图集合。主体 root 保持旧协议位置,弹层作为增量集合。 */
|
|
1165
|
+
export declare interface DesignerUiSchema {
|
|
1166
|
+
root: DesignerLayoutNode[];
|
|
1167
|
+
overlays: DesignerOverlayModule[];
|
|
1168
|
+
}
|
|
1169
|
+
|
|
1170
|
+
/** 字段验证目录中的可创建规则。 */
|
|
1171
|
+
export declare interface DesignerValidationCatalogItem {
|
|
1172
|
+
type: DesignerValidationRuleType;
|
|
1173
|
+
label: string;
|
|
1174
|
+
description: string;
|
|
1175
|
+
available: boolean;
|
|
1176
|
+
unavailableReason: string;
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1179
|
+
/** 跨字段比较允许的受控操作符。 */
|
|
1180
|
+
export declare type DesignerValidationComparisonOperator = 'EQ' | 'NE' | 'GT' | 'GTE' | 'LT' | 'LTE';
|
|
1181
|
+
|
|
1182
|
+
/** 各验证规则类型对应的严格参数。 */
|
|
1183
|
+
export declare interface DesignerValidationConfigurationMap {
|
|
1184
|
+
LENGTH: DesignerValidationRangeConfiguration;
|
|
1185
|
+
RANGE: DesignerValidationRangeConfiguration;
|
|
1186
|
+
PRECISION: {
|
|
1187
|
+
scale: number;
|
|
1188
|
+
};
|
|
1189
|
+
FORMAT: {
|
|
1190
|
+
format: 'EMAIL' | 'PHONE' | 'IDENTIFIER';
|
|
1191
|
+
};
|
|
1192
|
+
REGEX: {
|
|
1193
|
+
pattern: string;
|
|
1194
|
+
};
|
|
1195
|
+
DATE: {
|
|
1196
|
+
minimum?: string;
|
|
1197
|
+
maximum?: string;
|
|
1198
|
+
};
|
|
1199
|
+
SELECTION: DesignerValidationRangeConfiguration;
|
|
1200
|
+
FILE: {
|
|
1201
|
+
maximumCount?: number;
|
|
1202
|
+
maximumSizeMb?: number;
|
|
1203
|
+
accept?: string;
|
|
1204
|
+
};
|
|
1205
|
+
COMPARE_FIELD: {
|
|
1206
|
+
fieldId: string;
|
|
1207
|
+
operator: DesignerValidationComparisonOperator;
|
|
1208
|
+
};
|
|
1209
|
+
EXPRESSION: {
|
|
1210
|
+
expression: DesignerExpression;
|
|
1211
|
+
};
|
|
1212
|
+
SUBTABLE: {
|
|
1213
|
+
containerId: string;
|
|
1214
|
+
minimumRows?: number;
|
|
1215
|
+
maximumRows?: number;
|
|
1216
|
+
};
|
|
1217
|
+
REMOTE: {
|
|
1218
|
+
provider: string;
|
|
1219
|
+
validatorId: string;
|
|
1220
|
+
};
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1223
|
+
/** 最小值与最大值区间配置。 */
|
|
1224
|
+
export declare interface DesignerValidationRangeConfiguration {
|
|
1225
|
+
minimum?: number;
|
|
1226
|
+
maximum?: number;
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
/** 单条运行验证结果。 */
|
|
1230
|
+
export declare interface DesignerValidationResult {
|
|
1231
|
+
fieldId: string;
|
|
1232
|
+
ruleId: string;
|
|
1233
|
+
severity: 'ERROR' | 'WARNING';
|
|
1234
|
+
message: string;
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1237
|
+
/** 声明式字段验证规则判别联合,JSON 外形保持 `type + configuration`。 */
|
|
1238
|
+
export declare type DesignerValidationRule = {
|
|
1239
|
+
[Type in DesignerValidationRuleType]: DesignerValidationRuleBase & {
|
|
1240
|
+
type: Type;
|
|
1241
|
+
configuration: DesignerValidationConfigurationMap[Type];
|
|
1242
|
+
};
|
|
1243
|
+
}[DesignerValidationRuleType];
|
|
1244
|
+
|
|
1245
|
+
/** 验证规则通用字段;规则参数由具体类型收紧。 */
|
|
1246
|
+
export declare interface DesignerValidationRuleBase {
|
|
1247
|
+
id: string;
|
|
1248
|
+
name: string;
|
|
1249
|
+
enabled: boolean;
|
|
1250
|
+
trigger: 'CHANGE' | 'BLUR' | 'SUBMIT';
|
|
1251
|
+
severity: 'ERROR' | 'WARNING';
|
|
1252
|
+
message: string;
|
|
1253
|
+
condition?: DesignerExpression;
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
/** 字段验证规则类型。必填仍由字段 required 或状态规则独立决定。 */
|
|
1257
|
+
export declare type DesignerValidationRuleType = 'LENGTH' | 'RANGE' | 'PRECISION' | 'FORMAT' | 'REGEX' | 'DATE' | 'SELECTION' | 'FILE' | 'COMPARE_FIELD' | 'EXPRESSION' | 'SUBTABLE' | 'REMOTE';
|
|
1258
|
+
|
|
1259
|
+
/** 表单持久化变量定义;运行值不写入设计文档。 */
|
|
1260
|
+
export declare interface DesignerVariableDefinition {
|
|
1261
|
+
id: string;
|
|
1262
|
+
code: string;
|
|
1263
|
+
name: string;
|
|
1264
|
+
valueType: 'STRING' | 'NUMBER' | 'BOOLEAN' | 'DATE' | 'OBJECT';
|
|
1265
|
+
initialValue: string | number | boolean | null;
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1268
|
+
/** 诊断高级协议的白名单、引用、表达式和受控枚举。 */
|
|
1269
|
+
export declare function diagnoseDesignerAdvancedDocument(document: DesignerDocument): DesignerDiagnostic[];
|
|
1270
|
+
|
|
1271
|
+
/** 对持久化数据模型目录执行实体、关系和字段作用域诊断。 */
|
|
1272
|
+
export declare function diagnoseDesignerDataModel(document: DesignerDocument): DesignerDiagnostic[];
|
|
1273
|
+
|
|
1274
|
+
/**
|
|
1275
|
+
* 校验未知文档输入的版本、字段、组件、布局、typed slots 和引用完整性。
|
|
1276
|
+
*
|
|
1277
|
+
* 该入口承担导入边界,任何非法结构都必须返回诊断而不能把类型异常抛给工作台。
|
|
1278
|
+
*/
|
|
1279
|
+
export declare function diagnoseDesignerDocument(source: unknown): DesignerDiagnostic[];
|
|
1280
|
+
|
|
1281
|
+
/** 诊断表达式节点、字段/变量引用、作用域和复杂度。 */
|
|
1282
|
+
export declare function diagnoseDesignerExpression(expression: unknown, document: DesignerDocument, path: string, options?: {
|
|
1283
|
+
allowCurrentRow: boolean;
|
|
1284
|
+
}): DesignerDiagnostic[];
|
|
1285
|
+
|
|
1286
|
+
/**
|
|
1287
|
+
* 使用行为与事件流草稿构造临时文档并返回字段级诊断。
|
|
1288
|
+
*
|
|
1289
|
+
* 文档诊断负责严格 Schema、表达式、循环与引用;本模块补充产品级重复名称和 Adapter 能力诊断。
|
|
1290
|
+
*/
|
|
1291
|
+
export declare function diagnoseDesignerFieldBehaviorDraft(input: {
|
|
1292
|
+
document: DesignerDocument;
|
|
1293
|
+
fieldId: string;
|
|
1294
|
+
behavior: DesignerFieldBehavior;
|
|
1295
|
+
eventFlows: DesignerEventFlow[];
|
|
1296
|
+
capabilities: DesignerFieldBehaviorCapabilities;
|
|
1297
|
+
}): DesignerFieldBehaviorDiagnostic[];
|
|
1298
|
+
|
|
1299
|
+
/** 复制节点及其字段引用,确保复制后的数据字段保持独立。 */
|
|
1300
|
+
export declare function duplicateDesignerNode(document: DesignerDocument, nodeId: string): DesignerLayoutNode | undefined;
|
|
1301
|
+
|
|
1302
|
+
/** 复制模块及其视图节点;字段身份继续复用,节点身份全部重新生成。 */
|
|
1303
|
+
export declare function duplicateDesignerOverlayModule(document: DesignerDocument, moduleCode: string): DesignerOverlayModule | undefined;
|
|
1304
|
+
|
|
1305
|
+
/** 复制子表时生成新的本地关系和子实体,禁止两个可写子表共享同一关系。 */
|
|
1306
|
+
export declare function duplicateDesignerSubtableRelation(document: DesignerDocument, source: Extract<DesignerLayoutNode, {
|
|
1307
|
+
nodeType: 'CONTAINER';
|
|
1308
|
+
}>, copy: Extract<DesignerLayoutNode, {
|
|
1309
|
+
nodeType: 'CONTAINER';
|
|
1310
|
+
}>): void;
|
|
1311
|
+
|
|
1312
|
+
/** 为新建子表建立独立的一级一对多关系,并将稳定 relationCode 写入节点配置。 */
|
|
1313
|
+
export declare function ensureDesignerSubtableRelation(document: DesignerDocument, node: Extract<DesignerLayoutNode, {
|
|
1314
|
+
nodeType: 'CONTAINER';
|
|
1315
|
+
}>): DesignerOneToManyRelation | undefined;
|
|
1316
|
+
|
|
1317
|
+
/** 将表达式结果按布尔条件解释;异常和非布尔结果一律视为不成立。 */
|
|
1318
|
+
export declare function evaluateDesignerCondition(expression: DesignerExpression | undefined, runtime: DesignerExpressionRuntimeContext): boolean;
|
|
1319
|
+
|
|
1320
|
+
/** 计算声明式表达式;未知函数、越界深度或非法数值运算会失败关闭。 */
|
|
1321
|
+
export declare function evaluateDesignerExpression(expression: DesignerExpression, runtime: DesignerExpressionRuntimeContext): unknown;
|
|
1322
|
+
|
|
1323
|
+
/**
|
|
1324
|
+
* 执行声明式事件流。
|
|
1325
|
+
*
|
|
1326
|
+
* 运行器限制最大深度、步骤数量和同一流重复进入;未提供的外部能力失败关闭。
|
|
1327
|
+
*/
|
|
1328
|
+
export declare function executeDesignerEventFlow(flow: DesignerEventFlow, host: DesignerEventRuntimeHost, activeFlowIds?: Set<string>): Promise<DesignerEventExecutionResult>;
|
|
1329
|
+
|
|
1330
|
+
/** 按稳定组件编码读取注册项。 */
|
|
1331
|
+
export declare function findDesignerComponent(componentType: string): DesignerComponentRegistration | undefined;
|
|
1332
|
+
|
|
1333
|
+
/** 查找当前布局中的节点。 */
|
|
1334
|
+
export declare function findDesignerNode(nodes: DesignerLayoutNode[], nodeId: string): DesignerLayoutNode | undefined;
|
|
1335
|
+
|
|
1336
|
+
/** 查找已放置的关系容器。 */
|
|
1337
|
+
export declare function findSubtableNodeByRelationCode(nodes: DesignerLayoutNode[], relationCode: string): Extract<DesignerLayoutNode, {
|
|
1338
|
+
nodeType: 'CONTAINER';
|
|
1339
|
+
}> | undefined;
|
|
1340
|
+
|
|
1341
|
+
/** 文件上传、元数据解析与下载端口。物理删除不属于字段编辑语义。 */
|
|
1342
|
+
export declare interface FormAssetAdapter {
|
|
1343
|
+
upload: (request: FormAssetUploadRequest) => Promise<FormAssetReference>;
|
|
1344
|
+
resolve: (request: FormAssetResolveRequest) => Promise<FormAssetReference[]>;
|
|
1345
|
+
download: (request: FormAssetDownloadRequest) => Promise<FormAssetDownloadResult>;
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
/** 文件下载请求。 */
|
|
1349
|
+
export declare interface FormAssetDownloadRequest {
|
|
1350
|
+
assetId: string;
|
|
1351
|
+
fieldId: string;
|
|
1352
|
+
fieldCode: string;
|
|
1353
|
+
context: FormRuntimeAdapterContext;
|
|
1354
|
+
}
|
|
1355
|
+
|
|
1356
|
+
/** 文件下载结果;宿主可以返回可访问 URL 或需要浏览器保存的 Blob。 */
|
|
1357
|
+
export declare type FormAssetDownloadResult = {
|
|
1358
|
+
kind: 'URL';
|
|
1359
|
+
url: string;
|
|
1360
|
+
fileName?: string;
|
|
1361
|
+
} | {
|
|
1362
|
+
kind: 'BLOB';
|
|
1363
|
+
blob: Blob;
|
|
1364
|
+
fileName: string;
|
|
1365
|
+
contentType?: string;
|
|
1366
|
+
};
|
|
1367
|
+
|
|
1368
|
+
/** 文件上传完成后供运行表单展示的资源元数据。 */
|
|
1369
|
+
export declare interface FormAssetReference {
|
|
1370
|
+
assetId: string;
|
|
1371
|
+
name: string;
|
|
1372
|
+
size: number;
|
|
1373
|
+
contentType?: string;
|
|
1374
|
+
downloadUrl?: string;
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1377
|
+
/** 文件元数据批量解析请求。 */
|
|
1378
|
+
export declare interface FormAssetResolveRequest {
|
|
1379
|
+
assetIds: string[];
|
|
1380
|
+
fieldId: string;
|
|
1381
|
+
fieldCode: string;
|
|
1382
|
+
context: FormRuntimeAdapterContext;
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1385
|
+
/** 文件上传请求;Schema 只保存约束,真实文件和宿主上下文只存在于本次调用。 */
|
|
1386
|
+
export declare interface FormAssetUploadRequest {
|
|
1387
|
+
file: File;
|
|
1388
|
+
fieldId: string;
|
|
1389
|
+
fieldCode: string;
|
|
1390
|
+
policyRef?: string;
|
|
1391
|
+
context: FormRuntimeAdapterContext;
|
|
1392
|
+
}
|
|
1393
|
+
|
|
1394
|
+
/**
|
|
1395
|
+
* 将数字字段值格式化为设计、只读与详情共用的展示文本。
|
|
1396
|
+
*
|
|
1397
|
+
* @param value 原始数字值。
|
|
1398
|
+
* @param configuration 数字组件的受控格式配置。
|
|
1399
|
+
* @returns 包含精度、千分位、货币前缀和可选人民币大写的展示文本。
|
|
1400
|
+
*/
|
|
1401
|
+
export declare function formatDesignerNumber(value: number, configuration: DesignerNumberFormatConfiguration): string;
|
|
1402
|
+
|
|
1403
|
+
/**
|
|
1404
|
+
* 将数字转换为人民币大写文本。
|
|
1405
|
+
*
|
|
1406
|
+
* @param value 待转换金额。
|
|
1407
|
+
* @returns 人民币大写文本;超出受控范围时返回明确说明。
|
|
1408
|
+
*/
|
|
1409
|
+
export declare function formatDesignerRmbUppercase(value: number): string;
|
|
1410
|
+
|
|
1411
|
+
/** 人员、组织、角色和岗位等目录选择端口。 */
|
|
1412
|
+
export declare interface FormDirectoryAdapter {
|
|
1413
|
+
query: (request: {
|
|
1414
|
+
subjectType: string;
|
|
1415
|
+
keyword: string;
|
|
1416
|
+
pageNo: number;
|
|
1417
|
+
pageSize: number;
|
|
1418
|
+
context: FormRuntimeAdapterContext;
|
|
1419
|
+
}) => Promise<{
|
|
1420
|
+
items: Array<{
|
|
1421
|
+
id: string;
|
|
1422
|
+
label: string;
|
|
1423
|
+
description?: string;
|
|
1424
|
+
}>;
|
|
1425
|
+
totalCount: number;
|
|
1426
|
+
}>;
|
|
1427
|
+
}
|
|
1428
|
+
|
|
1429
|
+
/** 定位端口。 */
|
|
1430
|
+
export declare interface FormLocationAdapter {
|
|
1431
|
+
locate: (request: {
|
|
1432
|
+
context: FormRuntimeAdapterContext;
|
|
1433
|
+
}) => Promise<{
|
|
1434
|
+
longitude: number;
|
|
1435
|
+
latitude: number;
|
|
1436
|
+
address?: string;
|
|
1437
|
+
}>;
|
|
1438
|
+
}
|
|
1439
|
+
|
|
1440
|
+
/** 同应用资源导航端口。 */
|
|
1441
|
+
export declare interface FormNavigationAdapter {
|
|
1442
|
+
navigate: (request: {
|
|
1443
|
+
resourceCode: string;
|
|
1444
|
+
openInNewPage: boolean;
|
|
1445
|
+
context: FormRuntimeAdapterContext;
|
|
1446
|
+
}) => Promise<void>;
|
|
1447
|
+
}
|
|
1448
|
+
|
|
1449
|
+
/** OCR 识别端口。 */
|
|
1450
|
+
export declare interface FormOcrAdapter {
|
|
1451
|
+
recognize: (request: {
|
|
1452
|
+
file: File;
|
|
1453
|
+
fieldId: string;
|
|
1454
|
+
fieldCode: string;
|
|
1455
|
+
provider?: string;
|
|
1456
|
+
context: FormRuntimeAdapterContext;
|
|
1457
|
+
}) => Promise<Record<string, unknown>>;
|
|
1458
|
+
}
|
|
1459
|
+
|
|
1460
|
+
/** 宿主注入给远程能力的稳定运行上下文,不包含认证凭据或传输配置。 */
|
|
1461
|
+
export declare interface FormRuntimeAdapterContext {
|
|
1462
|
+
applicationCode?: string;
|
|
1463
|
+
resourceCode?: string;
|
|
1464
|
+
formId?: string;
|
|
1465
|
+
recordToken?: string;
|
|
1466
|
+
moduleCode?: string;
|
|
1467
|
+
rowKey?: string;
|
|
1468
|
+
extension?: Readonly<Record<string, unknown>>;
|
|
1469
|
+
}
|
|
1470
|
+
|
|
1471
|
+
/** 对外公开的运行 Adapter 集合别名。 */
|
|
1472
|
+
export declare type FormRuntimeAdapters = DesignerRuntimeAdapters;
|
|
1473
|
+
|
|
1474
|
+
/** 扫码端口。 */
|
|
1475
|
+
export declare interface FormScanAdapter {
|
|
1476
|
+
scan: (request: {
|
|
1477
|
+
context: FormRuntimeAdapterContext;
|
|
1478
|
+
}) => Promise<{
|
|
1479
|
+
text: string;
|
|
1480
|
+
}>;
|
|
1481
|
+
}
|
|
1482
|
+
|
|
1483
|
+
/**
|
|
1484
|
+
* 将字段页选择的主实体字段和一级子关系作为一个布局事务写入文档。
|
|
1485
|
+
*
|
|
1486
|
+
* 已放置字段和关系会被跳过;主键、系统字段不会被自动生成成普通可写控件。
|
|
1487
|
+
*/
|
|
1488
|
+
export declare function generateDesignerDataModelLayout(document: DesignerDocument, request: DesignerGenerateLayoutRequest): {
|
|
1489
|
+
createdNodeIds: string[];
|
|
1490
|
+
skippedFieldIds: string[];
|
|
1491
|
+
};
|
|
1492
|
+
|
|
1493
|
+
/**
|
|
1494
|
+
* 为预设选择追加合法的历史当前值,避免打开旧草稿时出现空白或自动迁移。
|
|
1495
|
+
*
|
|
1496
|
+
* @param options 当前编辑器允许产生的预设选项。
|
|
1497
|
+
* @param current 文档中已经存在的值。
|
|
1498
|
+
* @param formatCurrent 历史值显示函数。
|
|
1499
|
+
* @returns 保留原选项顺序并在必要时前置“当前值”的新数组。
|
|
1500
|
+
*/
|
|
1501
|
+
export declare function includeDesignerCurrentOption(options: readonly DesignerPropertyOption[], current: unknown, formatCurrent?: (value: string | number | boolean) => string): DesignerPropertyOption[];
|
|
1502
|
+
|
|
1503
|
+
/** 在指定根或命名插槽中插入节点。 */
|
|
1504
|
+
export declare function insertDesignerNode(document: DesignerDocument, node: DesignerLayoutNode, target: DesignerDropTarget): boolean;
|
|
1505
|
+
|
|
1506
|
+
/** 校验安全正则文本,拒绝回溯风险结构、反向引用和超长模式。 */
|
|
1507
|
+
export declare function isSafeDesignerRegularExpression(pattern: string): boolean;
|
|
1508
|
+
|
|
1509
|
+
/** 原子移动现有节点,并阻止容器移动到自身后代。 */
|
|
1510
|
+
export declare function moveDesignerNode(document: DesignerDocument, nodeId: string, target: DesignerDropTarget): boolean;
|
|
1511
|
+
|
|
1512
|
+
/**
|
|
1513
|
+
* 在指定视图上下文中复用现有根布局算法。
|
|
1514
|
+
*
|
|
1515
|
+
* mutation 完成后始终恢复主表 root 引用,防止模块视图意外替换主体。
|
|
1516
|
+
*/
|
|
1517
|
+
export declare function mutateDesignerView(document: DesignerDocument, viewCode: string, mutation: (document: DesignerDocument) => void): void;
|
|
1518
|
+
|
|
1519
|
+
/**
|
|
1520
|
+
* 在克隆后的文档中补齐高级协议默认值。
|
|
1521
|
+
*
|
|
1522
|
+
* 旧文档动作栏保持隐藏以维持历史视觉;旧基础校验转换为稳定规则,但不会修改调用方原对象。
|
|
1523
|
+
*/
|
|
1524
|
+
export declare function normalizeDesignerAdvancedDocument(source: Record<string, unknown>): void;
|
|
1525
|
+
|
|
1526
|
+
/**
|
|
1527
|
+
* 规范化旧草稿的数据模型身份和一级子表关系。
|
|
1528
|
+
*
|
|
1529
|
+
* 该函数只补缺失值;已经存在但非法的值交给文档诊断失败关闭,避免静默修复用户输入。
|
|
1530
|
+
*/
|
|
1531
|
+
export declare function normalizeDesignerDataModel(document: DesignerDocument): void;
|
|
1532
|
+
|
|
1533
|
+
/**
|
|
1534
|
+
* 生成数值型受控选项。
|
|
1535
|
+
*
|
|
1536
|
+
* @param values 数值集合。
|
|
1537
|
+
* @param labeler 显示文案函数。
|
|
1538
|
+
* @returns Element Plus 可直接消费的稳定选项。
|
|
1539
|
+
*/
|
|
1540
|
+
export declare function numberOptions(values: number[], labeler: (value: number) => string): DesignerPropertyOption[];
|
|
1541
|
+
|
|
1542
|
+
/** 将未放置字段放入其所属主实体或已存在的子表容器。 */
|
|
1543
|
+
export declare function placeDesignerDataField(document: DesignerDocument, fieldId: string): DesignerFieldNode | undefined;
|
|
1544
|
+
|
|
1545
|
+
/**
|
|
1546
|
+
* 以首次复制语义应用 Host 参数,并建立非持久化物理来源索引。
|
|
1547
|
+
*
|
|
1548
|
+
* 已存在字段、布局、关系或外部来源身份时不会覆盖当前文档;参数变化也不会形成命令历史。
|
|
1549
|
+
*/
|
|
1550
|
+
export declare function prepareDesignerDataModel(source: DesignerDocument, initialDataModel?: DesignerInitialDataModel): DesignerDataModelPreparation;
|
|
1551
|
+
|
|
1552
|
+
/** 计算当前节点所在容器的直接普通字段,不进入嵌套布局或子表。 */
|
|
1553
|
+
export declare function previewDesignerQuickGrid(document: DesignerDocument, selectedNodeId: string): DesignerQuickGridPreview;
|
|
1554
|
+
|
|
1555
|
+
/**
|
|
1556
|
+
* 将顺序布局节点投影为只读 24 栅格行。
|
|
1557
|
+
*
|
|
1558
|
+
* 投影只负责设计态定位和空白落点,权威顺序、跨度与偏移仍保存在 UI Schema 中。
|
|
1559
|
+
*
|
|
1560
|
+
* @param nodes 当前根或命名插槽中的顺序节点。
|
|
1561
|
+
* @param device 当前设计设备。
|
|
1562
|
+
* @returns 可供画布渲染的节点单元、空白单元和总行数。
|
|
1563
|
+
*/
|
|
1564
|
+
export declare function projectDesignerCanvas(nodes: DesignerLayoutNode[], device: DesignerDevice): DesignerCanvasProjection;
|
|
1565
|
+
|
|
1566
|
+
/** 将同一字段的一组验证结果折叠为错误与警告双通道。 */
|
|
1567
|
+
export declare function projectDesignerFieldFeedback(results: DesignerValidationResult[]): DesignerFieldFeedback | undefined;
|
|
1568
|
+
|
|
1569
|
+
/**
|
|
1570
|
+
* 根据表单策略、字段覆盖和最终运行状态生成提交投影。
|
|
1571
|
+
*
|
|
1572
|
+
* 技术隐藏字段始终保留;其他字段的 EXCLUDE 优先于全局策略。该函数只返回新对象,不修改预览值仓库。
|
|
1573
|
+
*/
|
|
1574
|
+
export declare function projectDesignerSubmission(document: DesignerDocument, valueStore: DesignerRuntimeValueStore, fieldStates: Record<string, DesignerResolvedFieldState>, options?: {
|
|
1575
|
+
dirtyOverlayModuleIds?: string[];
|
|
1576
|
+
}): DesignerSubmissionProjection;
|
|
1577
|
+
|
|
1578
|
+
/**
|
|
1579
|
+
* 将容器的命名插槽投影为稳定子表列。
|
|
1580
|
+
*
|
|
1581
|
+
* 只有字段节点可以形成数据列;布局节点由 DropPolicy 拒绝,历史异常节点在投影阶段失败关闭,
|
|
1582
|
+
* 不会被伪装为可编辑文本列。缺失字段仍保留列身份并标记为失效,方便设计态定位问题。
|
|
1583
|
+
*
|
|
1584
|
+
* @param container 子表容器节点。
|
|
1585
|
+
* @param fields 文档中的本地字段集合。
|
|
1586
|
+
* @param slotCode 可选命名插槽;省略时使用首个插槽。
|
|
1587
|
+
* @param options 设计态或运行态的可见性选项。
|
|
1588
|
+
* @returns 不持有可变节点引用的稳定列投影。
|
|
1589
|
+
*/
|
|
1590
|
+
export declare function projectDesignerSubtableColumns(container: DesignerContainerNode, fields: readonly DesignerField[], slotCode?: string, options?: DesignerSubtableProjectionOptions): DesignerSubtableColumn[];
|
|
1591
|
+
|
|
1592
|
+
/** 从布局移除节点;字段仍保留在字段页以支持重新放置。 */
|
|
1593
|
+
export declare function removeDesignerNode(document: DesignerDocument, nodeId: string): DesignerLayoutNode | undefined;
|
|
1594
|
+
|
|
1595
|
+
/** 删除弹层模块;字段定义和其他视图保持不变。 */
|
|
1596
|
+
export declare function removeDesignerOverlayModule(document: DesignerDocument, moduleCode: string): boolean;
|
|
1597
|
+
|
|
1598
|
+
/**
|
|
1599
|
+
* 解析显式容器最终生效的表面样式和圆角。
|
|
1600
|
+
*
|
|
1601
|
+
* 非表面组件不会获得容器外观类;非法值由文档诊断拒绝,这里只提供渲染期保守回退。
|
|
1602
|
+
*/
|
|
1603
|
+
export declare function resolveDesignerContainerAppearance(appearance: DesignerAppearance, node: DesignerContainerNode): DesignerResolvedContainerAppearance | undefined;
|
|
1604
|
+
|
|
1605
|
+
/** 根据运行能力输出事件动作的可新增状态。 */
|
|
1606
|
+
export declare function resolveDesignerEventActionAvailability(type: DesignerEventActionType, capabilities: DesignerFieldBehaviorCapabilities): DesignerEventActionAvailability;
|
|
1607
|
+
|
|
1608
|
+
/** 诊断字段计算依赖,并返回可安全执行的拓扑顺序。 */
|
|
1609
|
+
export declare function resolveDesignerFieldEvaluationOrder(document: DesignerDocument): {
|
|
1610
|
+
orderedFields: DesignerField[];
|
|
1611
|
+
diagnostics: DesignerDiagnostic[];
|
|
1612
|
+
};
|
|
1613
|
+
|
|
1614
|
+
/** 根据静态配置和条件规则计算字段最终显示、必填及禁用状态。 */
|
|
1615
|
+
export declare function resolveDesignerFieldState(field: DesignerField, runtime: DesignerExpressionRuntimeContext): DesignerResolvedFieldState;
|
|
1616
|
+
|
|
1617
|
+
/**
|
|
1618
|
+
* 按当前语言、默认语言和原文的固定顺序解释设计器国际化词条。
|
|
1619
|
+
*
|
|
1620
|
+
* 空翻译不会遮蔽后续回退值,未启用国际化时直接返回原文。
|
|
1621
|
+
*/
|
|
1622
|
+
export declare function resolveDesignerLocalizedText(configuration: DesignerI18nConfiguration, key: string, locale: string, fallback: string): string;
|
|
1623
|
+
|
|
1624
|
+
/**
|
|
1625
|
+
* 解析数字输入与展示共同使用的有效精度。
|
|
1626
|
+
*
|
|
1627
|
+
* @param configuration 数字组件的受控格式配置。
|
|
1628
|
+
* @returns 0~10 之间的整数;人民币大写只影响附加文本,不改变字段输入和主显示精度。
|
|
1629
|
+
*/
|
|
1630
|
+
export declare function resolveDesignerNumberPrecision(configuration: DesignerNumberFormatConfiguration): number;
|
|
1631
|
+
|
|
1632
|
+
/** 将稳定高度档位解析为公共弹窗能够消费的 CSS 最大高度。 */
|
|
1633
|
+
export declare function resolveDesignerOverlayMaxHeight(preset: DesignerOverlayMaxHeightPreset): string;
|
|
1634
|
+
|
|
1635
|
+
/** 返回目标落点对应的数据实体编码。 */
|
|
1636
|
+
export declare function resolveDesignerTargetEntityCode(document: DesignerDocument, containerId: string | null): string | undefined;
|
|
1637
|
+
|
|
1638
|
+
/**
|
|
1639
|
+
* 生成当前字段可创建的验证规则目录。
|
|
1640
|
+
*
|
|
1641
|
+
* 历史远程规则由编辑器额外保留;目录在缺少 Adapter 时只提供禁用说明,禁止新建。
|
|
1642
|
+
*/
|
|
1643
|
+
export declare function resolveDesignerValidationCatalog(document: DesignerDocument, field: DesignerField, capabilities: DesignerFieldBehaviorCapabilities): DesignerValidationCatalogItem[];
|
|
1644
|
+
|
|
1645
|
+
/** 返回主体或指定模块的布局根节点。 */
|
|
1646
|
+
export declare function resolveDesignerViewRoot(document: DesignerDocument, viewCode: string): DesignerLayoutNode[];
|
|
1647
|
+
|
|
1648
|
+
/** 将未放置字段重新加入根布局。 */
|
|
1649
|
+
export declare function restoreDesignerFieldNode(document: DesignerDocument, fieldId: string): DesignerFieldNode | undefined;
|
|
1650
|
+
|
|
1651
|
+
/** 生成稳定排序的设计文档快照。 */
|
|
1652
|
+
export declare function serializeDesignerDocument(document: DesignerDocument): string;
|
|
1653
|
+
|
|
1654
|
+
/** 将字段状态规则转换为列表摘要。 */
|
|
1655
|
+
export declare function summarizeDesignerStateRule(rule: DesignerFieldStateRule): string;
|
|
1656
|
+
|
|
1657
|
+
/** 将验证规则转换为列表摘要。 */
|
|
1658
|
+
export declare function summarizeDesignerValidationRule(rule: DesignerValidationRule): string;
|
|
1659
|
+
|
|
1660
|
+
/** 将公式或联动转换为列表摘要。 */
|
|
1661
|
+
export declare function summarizeDesignerValueRule(rule: DesignerFieldValueRule): string;
|
|
1662
|
+
|
|
1663
|
+
/** 同步标签页配置与 typed slots,保留仍然存在的标签内容。 */
|
|
1664
|
+
export declare function synchronizeContainerSlots(node: DesignerContainerNode): void;
|
|
1665
|
+
|
|
1666
|
+
/** 以一个事务修改一级子表关系及子实体身份,并同步引用和字段作用域。 */
|
|
1667
|
+
export declare function updateDesignerRelation(document: DesignerDocument, currentCode: string, patch: DesignerRelationPatch): string;
|
|
1668
|
+
|
|
1669
|
+
/** 以一个事务修改主实体身份,并同步主实体字段作用域。 */
|
|
1670
|
+
export declare function updateDesignerRootEntity(document: DesignerDocument, patch: DesignerRootEntityPatch): string;
|
|
1671
|
+
|
|
1672
|
+
/** 按触发时机验证一个字段;必填验证与规则验证互相独立。 */
|
|
1673
|
+
export declare function validateDesignerField(field: DesignerField, value: unknown, trigger: DesignerValidationRule['trigger'], runtime: DesignerExpressionRuntimeContext, options?: {
|
|
1674
|
+
state?: DesignerResolvedFieldState;
|
|
1675
|
+
remoteAdapter?: DesignerRemoteValidationAdapter;
|
|
1676
|
+
collectionRows?: number;
|
|
1677
|
+
}): Promise<DesignerValidationResult[]>;
|
|
1678
|
+
|
|
1679
|
+
export { }
|