@gct-paas/word 0.1.11 → 0.1.13
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/calendar/src/calendar.vue.d.ts +1 -0
- package/dist/base/calendar/src/time.vue.d.ts +1 -0
- package/dist/base/index.d.ts +2 -0
- package/dist/base/modal/src/ModalRoot.vue.d.ts +2 -0
- package/dist/base/modal/src/modal.type.d.ts +3 -0
- package/dist/base/select/src/basic-select.vue.d.ts +9 -1
- package/dist/base/table/src/table.type.d.ts +19 -0
- package/dist/base/table/src/table.vue.d.ts +31 -56
- package/dist/base/tree/index.d.ts +1 -0
- package/dist/base/tree/src/tree-node.vue.d.ts +14 -0
- package/dist/base/tree/src/tree.type.d.ts +6 -0
- package/dist/base/tree/src/tree.vue.d.ts +18 -0
- package/dist/base/tree-select/index.d.ts +1 -0
- package/dist/base/tree-select/src/tree-select.vue.d.ts +45 -0
- package/dist/base/utils/image-size-util.d.ts +2 -0
- package/dist/capabilities/panel/schema/types.d.ts +4 -1
- package/dist/core/constants/index.d.ts +1 -0
- package/dist/core/cursor/logic/getCursorTextRawList.d.ts +2 -0
- package/dist/core/cursor/logic/index.d.ts +1 -0
- package/dist/core/data/DataManager.d.ts +38 -36
- package/dist/core/event/types.d.ts +1 -1
- package/dist/core/index.d.ts +3 -0
- package/dist/core/interaction/useInteraction.d.ts +0 -1
- package/dist/core/layout/LayoutContext.d.ts +1 -0
- package/dist/core/layout/handlers/FieldHandler.d.ts +0 -18
- package/dist/core/layout/handlers/fields/AttachmentHandler.d.ts +14 -0
- package/dist/core/layout/handlers/fields/BaseHandler.d.ts +67 -0
- package/dist/core/layout/handlers/fields/ImgHandler.d.ts +5 -0
- package/dist/core/layout/handlers/fields/InputHandler.d.ts +5 -0
- package/dist/core/layout/handlers/fields/OptionHandler.d.ts +15 -0
- package/dist/core/layout/handlers/fields/SignatureHandler.d.ts +24 -0
- package/dist/core/layout/handlers/fields/index.d.ts +6 -0
- package/dist/core/model/document/WrField.d.ts +3 -126
- package/dist/core/model/document/WsecPr.d.ts +39 -0
- package/dist/core/sdk/types/public-types.d.ts +2 -0
- package/dist/core/utils/calculate-formula.d.ts +5 -0
- package/dist/core/view/Doc.d.ts +5 -0
- package/dist/core/view/Page.d.ts +0 -3
- package/dist/core/view/Section.d.ts +4 -18
- package/dist/core/view/runs/ImageRun.d.ts +12 -0
- package/dist/core/view/runs/ImageWidget.d.ts +3 -0
- package/dist/core/view/runs/TextRun.d.ts +1 -0
- package/dist/core/view/runs/TextWidget.d.ts +8 -8
- package/dist/core/widget/widget-state.d.ts +21 -0
- package/dist/domain/active/active-types.d.ts +0 -1
- package/dist/domain/widget/component-type.d.ts +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.es.js +6367 -4743
- package/dist/runtime/_register_/composables/panel/useActivePanel.d.ts +1 -2
- package/dist/runtime/canvas/__common__/widget-container/overlay-layer.vue.d.ts +2 -0
- package/dist/runtime/canvas/__common__/widget-container/overlay-render.vue.d.ts +1 -1
- package/dist/runtime/canvas/table/design/table-structure-overlay/dynamic-label.vue.d.ts +1 -0
- package/dist/runtime/canvas/table/utils/useTableSelection.d.ts +0 -1
- package/dist/runtime/designer/doc-design-layout.vue.d.ts +3 -1
- package/dist/runtime/designer/ribbon/common/button-icon.vue.d.ts +3 -2
- package/dist/runtime/designer/ribbon/constant/font.d.ts +1 -1
- package/dist/runtime/factories/createValidateFactory.d.ts +3 -1
- package/dist/runtime/factories/useDependency.d.ts +5 -0
- package/dist/runtime/factories/useDocumentFactory.d.ts +2 -0
- package/dist/runtime/factories/useFormValidator.d.ts +3 -0
- package/dist/runtime/factories/useRenderData.d.ts +2 -0
- package/dist/runtime/interface/computed.d.ts +18 -0
- package/dist/runtime/interface/data.d.ts +1 -4
- package/dist/runtime/interface/render.d.ts +11 -0
- package/dist/runtime/interface/utils.d.ts +10 -0
- package/dist/runtime/renderer/doc-render-layout.vue.d.ts +58 -2
- package/dist/runtime/renderer/main/preview-canvas.vue.d.ts +3 -1
- package/dist/setup.d.ts +11 -0
- package/dist/suites/edhr/field-manifest/_common_/basic.d.ts +2 -0
- package/dist/suites/edhr/panel-schema/data-group/data-group.basic.d.ts +4 -1
- package/dist/suites/edhr/panel-schema/data-init/common/add-builtin-field/add-builtin-field-modal.vue.d.ts +1 -1
- package/dist/suites/edhr/panel-schema/data-init/common/add-builtin-param/add-builtin-param-modal.vue.d.ts +5 -3
- package/dist/suites/edhr/panel-schema/data-init/common/add-field/add-field-modal.vue.d.ts +15 -6
- package/dist/suites/edhr/panel-schema/data-init/common/add-field/add-field-select.vue.d.ts +1 -5
- package/dist/suites/edhr/panel-schema/data-init/common/add-field/useField.d.ts +1 -4
- package/dist/suites/edhr/panel-schema/data-init/common/add-online-form-model/online-form-model-select.vue.d.ts +12 -0
- package/dist/suites/edhr/panel-schema/data-init/common/add-sql/add-sql-modal.vue.d.ts +3 -4
- package/dist/suites/edhr/panel-schema/data-init/common/data-source-model-link.vue.d.ts +2 -2
- package/dist/suites/edhr/panel-schema/data-init/utils/index.d.ts +9 -17
- package/dist/suites/edhr/panel-schema/dynamic-table/dynamic-table.basic.d.ts +4 -1
- package/dist/suites/edhr/panel-schema/fixed-table/fixed-table.basic.d.ts +4 -1
- package/dist/suites/edhr/panel-schema/index.d.ts +12 -3
- package/dist/utils/ServiceUtil.d.ts +31 -4
- package/dist/utils/TriggerUtil.d.ts +27 -0
- package/dist/utils/func/core.d.ts +6 -0
- package/dist/utils/func/file.d.ts +2 -0
- package/dist/word.css +1005 -998
- package/package.json +2 -2
- package/dist/runtime/designer/ribbon/components/bullet-point-select.vue.d.ts +0 -73
- package/dist/runtime/designer/ribbon/components/multistage-no-select.vue.d.ts +0 -73
- package/dist/runtime/renderer/dialogs/upload-file/utils.d.ts +0 -16
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BaseHandler, HandlerContext } from './BaseHandler';
|
|
2
|
+
import { WrText } from '../../../model/document';
|
|
3
|
+
import { LayoutContext } from '../../LayoutContext';
|
|
4
|
+
import { TextRun } from '../../../view/runs/TextRun';
|
|
5
|
+
type WidgetOption = {
|
|
6
|
+
value: any;
|
|
7
|
+
label: string;
|
|
8
|
+
};
|
|
9
|
+
export declare class OptionHandler extends BaseHandler {
|
|
10
|
+
static layout(ctx: HandlerContext): void;
|
|
11
|
+
static isVerticalLayout(wr: WrText): boolean;
|
|
12
|
+
static layoutField(ctx: HandlerContext): void;
|
|
13
|
+
static layoutOptionItem(context: LayoutContext, wr: WrText, option: WidgetOption, optionIndex: number, layoutStyle: ReturnType<typeof TextRun.textStyle2LayoutStyle>): void;
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { BaseHandler, HandlerContext } from './BaseHandler';
|
|
2
|
+
import { ImageWidgetOptions } from '../../../view/runs/ImageWidget';
|
|
3
|
+
export declare class SignatureHandler extends BaseHandler {
|
|
4
|
+
static layout(ctx: HandlerContext): void;
|
|
5
|
+
/**
|
|
6
|
+
* 获取签名装饰信息
|
|
7
|
+
* @param ctx
|
|
8
|
+
* @param width
|
|
9
|
+
* @param height
|
|
10
|
+
* @param time
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
13
|
+
static getDecorationsInfo(ctx: HandlerContext, width: number, height: number, time: number): {
|
|
14
|
+
render: boolean;
|
|
15
|
+
rectWidth: number;
|
|
16
|
+
rectHeight: number;
|
|
17
|
+
decorations?: ImageWidgetOptions['decorations'];
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* 签名字段处理
|
|
21
|
+
* @param ctx
|
|
22
|
+
*/
|
|
23
|
+
static layoutField(ctx: HandlerContext): void;
|
|
24
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { BaseHandler, type HandlerContext } from './BaseHandler';
|
|
2
|
+
export { OptionHandler } from './OptionHandler';
|
|
3
|
+
export { ImgHandler } from './ImgHandler';
|
|
4
|
+
export { SignatureHandler } from './SignatureHandler';
|
|
5
|
+
export { InputHandler } from './InputHandler';
|
|
6
|
+
export { AttachmentHandler } from './AttachmentHandler';
|
|
@@ -1,131 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { WrPr } from './WrPr';
|
|
5
|
-
import { ModelNode, ModelNodeOptions } from '../base';
|
|
6
|
-
type IElement = ModelNode | RawElement;
|
|
7
|
-
/**
|
|
8
|
-
* 文本块实例类
|
|
9
|
-
*/
|
|
10
|
-
export declare class WrField extends ModelNode {
|
|
11
|
-
name: 'w:r';
|
|
12
|
-
type: "element";
|
|
13
|
-
handler: "field";
|
|
14
|
-
/** 父节点引用 */
|
|
15
|
-
parent?: Wp;
|
|
16
|
-
rPr?: WrPr;
|
|
17
|
-
text: string;
|
|
18
|
-
isComposition?: boolean;
|
|
19
|
-
isPlaceholder?: boolean;
|
|
20
|
-
elements?: IElement[];
|
|
21
|
-
widgetMeta?: WidgetMeta;
|
|
22
|
-
valuePath?: string;
|
|
23
|
-
constructor(options: ModelNodeOptions & {
|
|
24
|
-
text: string;
|
|
25
|
-
rPr?: WrPr;
|
|
26
|
-
elements?: IElement[];
|
|
27
|
-
isComposition?: boolean;
|
|
28
|
-
isPlaceholder?: boolean;
|
|
29
|
-
widgetMeta?: WidgetMeta;
|
|
30
|
-
valuePath?: string;
|
|
31
|
-
});
|
|
32
|
-
/**
|
|
33
|
-
* 在指定位置插入文本
|
|
34
|
-
* @param text 要插入的文本
|
|
35
|
-
* @param position 插入位置,默认在末尾
|
|
36
|
-
*/
|
|
37
|
-
insertText(text: string, position?: number): void;
|
|
38
|
-
/**
|
|
39
|
-
* 删除指定范围的文本
|
|
40
|
-
* @param start 开始位置
|
|
41
|
-
* @param length 删除长度,默认为 1
|
|
42
|
-
*/
|
|
43
|
-
deleteText(start: number, length?: number): void;
|
|
44
|
-
/**
|
|
45
|
-
* 替换指定范围的文本
|
|
46
|
-
* @param start 开始位置
|
|
47
|
-
* @param length 替换长度
|
|
48
|
-
* @param newText 新文本
|
|
49
|
-
*/
|
|
50
|
-
replaceText(start: number, length: number, newText: string): void;
|
|
51
|
-
/**
|
|
52
|
-
* 确保 rPr 实例存在,如果不存在则创建一个新的 WrPr 实例
|
|
53
|
-
*/
|
|
54
|
-
private ensureRPr;
|
|
55
|
-
/**
|
|
56
|
-
* 设置高亮
|
|
57
|
-
* @param highlight 颜色值(hex 格式,如 '#ff0000')
|
|
58
|
-
*/
|
|
59
|
-
setHighlight(highlight: WordHighlight): void;
|
|
60
|
-
/**
|
|
61
|
-
* 设置文本颜色
|
|
62
|
-
* @param color 颜色值(hex 格式,如 '#ff0000')
|
|
63
|
-
*/
|
|
64
|
-
setColor(color: string): void;
|
|
65
|
-
/**
|
|
66
|
-
* 设置文本加粗
|
|
67
|
-
* @param bold 是否加粗
|
|
68
|
-
*/
|
|
69
|
-
setBold(bold: boolean): void;
|
|
70
|
-
/**
|
|
71
|
-
* 设置文本斜体
|
|
72
|
-
* @param italic 是否斜体
|
|
73
|
-
*/
|
|
74
|
-
setItalic(italic: boolean): void;
|
|
75
|
-
/**
|
|
76
|
-
* 设置文本下划线
|
|
77
|
-
* @param underline 下划线类型('none' | 'single' | 'double' 等)
|
|
78
|
-
*/
|
|
79
|
-
setUnderline(underline?: string): void;
|
|
80
|
-
/**
|
|
81
|
-
* 设置文本删除线
|
|
82
|
-
* @param strike 是否删除线
|
|
83
|
-
*/
|
|
84
|
-
setStrike(strike: boolean): void;
|
|
85
|
-
/**
|
|
86
|
-
* 设置字体
|
|
87
|
-
* @param fontFamily 字体名称
|
|
88
|
-
*/
|
|
89
|
-
setFont(fontFamily: string): void;
|
|
90
|
-
/**
|
|
91
|
-
* 设置字号
|
|
92
|
-
* @param fontSize 字号大小(半磅单位)
|
|
93
|
-
*/
|
|
94
|
-
setFontSize(fontSize: number): void;
|
|
95
|
-
/**
|
|
96
|
-
* 设置样式
|
|
97
|
-
* @param styleUpdates 要更新的样式对象(只更新指定的属性)
|
|
98
|
-
*/
|
|
99
|
-
updateStyle(styleUpdates: Partial<TextStyle>): void;
|
|
100
|
-
/**
|
|
101
|
-
* 在指定字符位置拆分文本节点
|
|
102
|
-
* @param index 拆分位置(在此字符之前分割)
|
|
103
|
-
* @returns 返回 [beforeText, afterText],边界情况返回 null
|
|
104
|
-
* @example
|
|
105
|
-
* const text = new WrText('Hello World');
|
|
106
|
-
* const [before, after] = text.splitAt(5);
|
|
107
|
-
* // before: WrText('Hello'),after: WrText(' World')
|
|
108
|
-
* const [n, all] = text.splitAt(0);
|
|
109
|
-
* // n 为 null,all 为 this(无分割)
|
|
110
|
-
*/
|
|
111
|
-
splitAt(index: number): [WrText | null, WrText | null];
|
|
112
|
-
/**
|
|
113
|
-
* 从原始 XML JSON 转换为 WrText 实例
|
|
114
|
-
* @param json w:r XML JSON 对象
|
|
115
|
-
* @returns WrText 实例
|
|
116
|
-
*/
|
|
1
|
+
import { RawElement } from '../types';
|
|
2
|
+
import { WrText } from './WrText';
|
|
3
|
+
export declare class WrField extends WrText {
|
|
117
4
|
static fromXmlJson(json: RawElement & {
|
|
118
5
|
valuePath?: string;
|
|
119
6
|
widgetMeta?: any;
|
|
120
7
|
}): WrField;
|
|
121
|
-
/**
|
|
122
|
-
* 将实例转换为 XML JSON 格式
|
|
123
|
-
* 结构:w:r
|
|
124
|
-
* ├── w:rPr(如果存在)
|
|
125
|
-
* ├── w:t(文本内容)
|
|
126
|
-
* └── 其他元素
|
|
127
|
-
* @returns XML JSON 对象
|
|
128
|
-
*/
|
|
129
|
-
toXmlJson(): RawElement;
|
|
130
8
|
}
|
|
131
|
-
export {};
|
|
@@ -73,4 +73,43 @@ export declare class WsecPr extends ModelNode {
|
|
|
73
73
|
* 获取有效的左边距(考虑装订线)
|
|
74
74
|
*/
|
|
75
75
|
getEffectiveLeftMargin(): number | undefined;
|
|
76
|
+
setOrient(val: 'portrait' | 'landscape'): void;
|
|
77
|
+
/**
|
|
78
|
+
* 设置为横向(宽 > 高)
|
|
79
|
+
* 通过交换宽高数据实现
|
|
80
|
+
*/
|
|
81
|
+
setLandscape(): void;
|
|
82
|
+
/**
|
|
83
|
+
* 设置为纵向(高 > 宽)
|
|
84
|
+
* 通过交换宽高数据实现
|
|
85
|
+
*/
|
|
86
|
+
setPortrait(): void;
|
|
87
|
+
/**
|
|
88
|
+
* 设置上边距 (margin top)
|
|
89
|
+
* @param value 边距值,单位:twip(1/20点)
|
|
90
|
+
*/
|
|
91
|
+
setMarginTop(value: number): void;
|
|
92
|
+
/**
|
|
93
|
+
* 设置下边距 (margin bottom)
|
|
94
|
+
* @param value 边距值,单位:twip(1/20点)
|
|
95
|
+
*/
|
|
96
|
+
setMarginBottom(value: number): void;
|
|
97
|
+
/**
|
|
98
|
+
* 设置左边距 (margin left)
|
|
99
|
+
* @param value 边距值,单位:twip(1/20点)
|
|
100
|
+
*/
|
|
101
|
+
setMarginLeft(value: number): void;
|
|
102
|
+
/**
|
|
103
|
+
* 设置右边距 (margin right)
|
|
104
|
+
* @param value 边距值,单位:twip(1/20点)
|
|
105
|
+
*/
|
|
106
|
+
setMarginRight(value: number): void;
|
|
107
|
+
/**
|
|
108
|
+
* 同时设置四个边距
|
|
109
|
+
* @param top 上边距值,单位:twip(1/20点)
|
|
110
|
+
* @param bottom 下边距值,单位:twip(1/20点)
|
|
111
|
+
* @param left 左边距值,单位:twip(1/20点)
|
|
112
|
+
* @param right 右边距值,单位:twip(1/20点)
|
|
113
|
+
*/
|
|
114
|
+
setMargins(top: number, bottom: number, left: number, right: number): void;
|
|
76
115
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const formulaUtils: {
|
|
2
|
+
buildFormulaVariables: (deps: string[], rawData: any, subRowData: any) => Record<string, any>;
|
|
3
|
+
calculateFormula: (expr: string, rawData: any, subRowData: any) => Promise<any>;
|
|
4
|
+
executeFormula: (expr: string, data: any) => Promise<any>;
|
|
5
|
+
};
|
package/dist/core/view/Doc.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ import { DocModel } from '../model';
|
|
|
14
14
|
export interface DocInitOptions {
|
|
15
15
|
mode?: DocModeType;
|
|
16
16
|
model?: DocModel;
|
|
17
|
+
preview?: boolean;
|
|
17
18
|
mainModelKey: ModelKey;
|
|
18
19
|
pageSize?: {
|
|
19
20
|
width: number;
|
|
@@ -25,7 +26,10 @@ export interface DocInitOptions {
|
|
|
25
26
|
}
|
|
26
27
|
export declare class Doc {
|
|
27
28
|
id: string;
|
|
29
|
+
/** 渲染模式 */
|
|
28
30
|
mode: DocModeType;
|
|
31
|
+
/** 是否是预览模式 */
|
|
32
|
+
preview: boolean;
|
|
29
33
|
model?: DocModel;
|
|
30
34
|
sections: Section[];
|
|
31
35
|
pages: Page[];
|
|
@@ -71,6 +75,7 @@ export declare class Doc {
|
|
|
71
75
|
getFirstPage(): Page | null;
|
|
72
76
|
getLastPage(): Page | null;
|
|
73
77
|
setModel(model: DocModel): void;
|
|
78
|
+
setMode(modeType: DocModeType): void;
|
|
74
79
|
/** 触发布局计算 */
|
|
75
80
|
layout(): void;
|
|
76
81
|
/** 渲染文档 */
|
package/dist/core/view/Page.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ import { Table } from './Table';
|
|
|
3
3
|
import { LayoutGroup, LayoutGroupOptions } from './base';
|
|
4
4
|
import { IContainerMetrics } from './types';
|
|
5
5
|
import { Section } from './Section';
|
|
6
|
-
import { VOrientationType } from '../../domain/constants/enum';
|
|
7
6
|
export type PageChild = Paragraph | Table;
|
|
8
7
|
export interface PageOptions extends LayoutGroupOptions {
|
|
9
8
|
section: Section;
|
|
@@ -21,7 +20,5 @@ export declare class Page extends LayoutGroup<PageChild> implements IContainerMe
|
|
|
21
20
|
get contentMaxHeight(): number;
|
|
22
21
|
getContentHeight(): number;
|
|
23
22
|
getRemainingSize(): number;
|
|
24
|
-
setOrient(orient: VOrientationType): void;
|
|
25
|
-
setPadding(padding: [number, number, number, number]): void;
|
|
26
23
|
layout(): void;
|
|
27
24
|
}
|
|
@@ -6,20 +6,22 @@ export type SectionOption = {
|
|
|
6
6
|
};
|
|
7
7
|
pagePadding?: [number, number, number, number];
|
|
8
8
|
bgColor?: string;
|
|
9
|
+
refId: string;
|
|
9
10
|
};
|
|
10
11
|
export declare class Section {
|
|
11
12
|
id: string;
|
|
12
13
|
pageSize: SectionOption['pageSize'];
|
|
13
14
|
pagePadding: SectionOption['pagePadding'];
|
|
14
15
|
bgColor?: string;
|
|
15
|
-
|
|
16
|
+
refId: string;
|
|
17
|
+
constructor(options?: Partial<SectionOption>);
|
|
16
18
|
/**
|
|
17
19
|
* 从 WsecPr 模型创建 Section 视图
|
|
18
20
|
* @param json Word 文档的分节模型
|
|
19
21
|
* @param dpi 屏幕 DPI(默认 96)
|
|
20
22
|
* @returns Section 视图实例
|
|
21
23
|
*/
|
|
22
|
-
static
|
|
24
|
+
static fromModel(json: WsecPr, dpi?: number): Section;
|
|
23
25
|
/**
|
|
24
26
|
* 获取内容区域宽度(页面宽度 - 左边距 - 右边距)
|
|
25
27
|
* @returns 内容宽度(px)
|
|
@@ -30,22 +32,6 @@ export declare class Section {
|
|
|
30
32
|
* @returns 内容高度(px)
|
|
31
33
|
*/
|
|
32
34
|
getContentHeight(): number;
|
|
33
|
-
/**
|
|
34
|
-
* 解析数值:支持多种单位格式
|
|
35
|
-
* @param value 数值字符串或数字
|
|
36
|
-
* @param defaultUnit 默认单位('twip' | 'px' | 'mm' | 'cm' | 'inch')
|
|
37
|
-
* @param dpi 屏幕 DPI(默认 96)
|
|
38
|
-
* @returns 转换后的 px 值
|
|
39
|
-
*/
|
|
40
|
-
static parseValue(value: string | number, defaultUnit?: 'twip' | 'px' | 'mm' | 'cm' | 'inch', dpi?: number): number;
|
|
41
|
-
/**
|
|
42
|
-
* 单位转换为 px
|
|
43
|
-
* @param value 数值
|
|
44
|
-
* @param unit 单位
|
|
45
|
-
* @param dpi 屏幕 DPI(默认 96)
|
|
46
|
-
* @returns px 值
|
|
47
|
-
*/
|
|
48
|
-
private static convertToPixel;
|
|
49
35
|
/**
|
|
50
36
|
* 获取页面尺寸信息(用于调试)
|
|
51
37
|
* @returns 格式化的页面信息
|
|
@@ -12,6 +12,15 @@ export interface IImageRun {
|
|
|
12
12
|
}
|
|
13
13
|
export interface ImageRunOptions extends LayoutNodeOptions {
|
|
14
14
|
src: string;
|
|
15
|
+
decorations?: Array<{
|
|
16
|
+
text: string;
|
|
17
|
+
width: number;
|
|
18
|
+
height: number;
|
|
19
|
+
fontSize: number;
|
|
20
|
+
x: number;
|
|
21
|
+
y: number;
|
|
22
|
+
position: 'right' | 'bottom';
|
|
23
|
+
}>;
|
|
15
24
|
}
|
|
16
25
|
/**
|
|
17
26
|
* 图片运行类
|
|
@@ -22,5 +31,8 @@ export declare class ImageRun extends LayoutNode implements IImageRun {
|
|
|
22
31
|
src: string;
|
|
23
32
|
/** 是否保持等比 */
|
|
24
33
|
keepAspect: boolean;
|
|
34
|
+
decorations?: ImageRunOptions['decorations'];
|
|
35
|
+
get width(): number;
|
|
36
|
+
get height(): number;
|
|
25
37
|
constructor(options: ImageRunOptions);
|
|
26
38
|
}
|
|
@@ -8,12 +8,14 @@ export interface IImageWidget extends IImageRun {
|
|
|
8
8
|
valuePath: string;
|
|
9
9
|
/** 组件元数据 */
|
|
10
10
|
widgetMeta: WidgetMeta;
|
|
11
|
+
signature?: string;
|
|
11
12
|
}
|
|
12
13
|
export interface ImageWidgetOptions extends ImageRunOptions {
|
|
13
14
|
/** 值路径 */
|
|
14
15
|
valuePath: string;
|
|
15
16
|
/** 组件元数据 */
|
|
16
17
|
widgetMeta: WidgetMeta;
|
|
18
|
+
signature?: string;
|
|
17
19
|
}
|
|
18
20
|
/**
|
|
19
21
|
* 图片运行类
|
|
@@ -22,5 +24,6 @@ export interface ImageWidgetOptions extends ImageRunOptions {
|
|
|
22
24
|
export declare class ImageWidget extends ImageRun implements IImageWidget {
|
|
23
25
|
valuePath: string;
|
|
24
26
|
widgetMeta: WidgetMeta;
|
|
27
|
+
signature?: string;
|
|
25
28
|
constructor(options: ImageWidgetOptions);
|
|
26
29
|
}
|
|
@@ -85,6 +85,7 @@ export declare class TextRun extends LayoutNode implements ITextRun {
|
|
|
85
85
|
lineHeight: number;
|
|
86
86
|
ascent: number;
|
|
87
87
|
descent: number;
|
|
88
|
+
style?: TextStyle;
|
|
88
89
|
constructor(options: TextRunOptions);
|
|
89
90
|
static measureText(payload: Konva.TextConfig): {
|
|
90
91
|
width: number;
|
|
@@ -16,6 +16,10 @@ export interface ITextWidget extends ITextRun {
|
|
|
16
16
|
id: string;
|
|
17
17
|
value: any;
|
|
18
18
|
};
|
|
19
|
+
widgetFileItem?: {
|
|
20
|
+
index: number;
|
|
21
|
+
value: string;
|
|
22
|
+
};
|
|
19
23
|
}
|
|
20
24
|
export interface TextWidgetOptions extends TextRunOptions {
|
|
21
25
|
/** 组件元数据 */
|
|
@@ -26,10 +30,8 @@ export interface TextWidgetOptions extends TextRunOptions {
|
|
|
26
30
|
isEmptyPlaceholder?: boolean;
|
|
27
31
|
isIconPlaceholder?: boolean;
|
|
28
32
|
isSpacePlaceholder?: boolean;
|
|
29
|
-
widgetOption?:
|
|
30
|
-
|
|
31
|
-
value: any;
|
|
32
|
-
};
|
|
33
|
+
widgetOption?: ITextWidget['widgetOption'];
|
|
34
|
+
widgetFileItem?: ITextWidget['widgetFileItem'];
|
|
33
35
|
}
|
|
34
36
|
export declare class TextWidget extends TextRun implements ITextWidget {
|
|
35
37
|
widgetMeta: WidgetMeta;
|
|
@@ -37,9 +39,7 @@ export declare class TextWidget extends TextRun implements ITextWidget {
|
|
|
37
39
|
isEmptyPlaceholder: boolean;
|
|
38
40
|
isIconPlaceholder: boolean;
|
|
39
41
|
isSpacePlaceholder: boolean;
|
|
40
|
-
widgetOption?:
|
|
41
|
-
|
|
42
|
-
value: any;
|
|
43
|
-
};
|
|
42
|
+
widgetOption?: ITextWidget['widgetOption'];
|
|
43
|
+
widgetFileItem?: ITextWidget['widgetFileItem'];
|
|
44
44
|
constructor(options: TextWidgetOptions);
|
|
45
45
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface WidgetStateContext {
|
|
2
|
+
docMode: string;
|
|
3
|
+
isEditMode: boolean;
|
|
4
|
+
isPrintMode: boolean;
|
|
5
|
+
formType?: string;
|
|
6
|
+
viewState?: string;
|
|
7
|
+
required?: boolean;
|
|
8
|
+
newRequired?: boolean;
|
|
9
|
+
readonly?: boolean;
|
|
10
|
+
newReadonly?: boolean;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
newDisabled?: boolean;
|
|
13
|
+
cannotInput?: boolean;
|
|
14
|
+
isLinkedModelField?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare function resolveWidgetState(ctx: WidgetStateContext): {
|
|
17
|
+
required: boolean;
|
|
18
|
+
readonly: boolean;
|
|
19
|
+
disabled: boolean;
|
|
20
|
+
displayStatus: "readonly-component" | "readonly-text" | "edit-component";
|
|
21
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type ExternalComponentType = 'fw:input' | 'fw:number' | 'fw:double' | 'fw:enum' | 'fw:enum-multiple' | 'fw:date-time' | 'fw:date' | 'fw:time' | 'fw:select' | 'fw:select-multiple' | 'fw:tree-select' | 'fw:tree-select-multiple' | 'fw:table-select' | 'fw:rdo-table-select' | 'fw:signature' | 'fw:image' | 'fw:file' | 'pw:image' | 'pw:barcode' | 'pw:qrcode' | 'pw:diagonal' | 'pw:serialnumber';
|
|
2
2
|
/** 渲染组件标识 后续支持自定义组件 */
|
|
3
|
-
export type ExternalNodeType = 'render:gct-placeholder' | 'render:gct-control' | 'render:gct-space' | 'render:gct-text' | 'render:gct-image';
|
|
3
|
+
export type ExternalNodeType = 'render:gct-placeholder' | 'render:gct-control' | 'render:gct-space' | 'render:gct-text' | 'render:gct-image' | 'render:gct-signature';
|
|
4
4
|
/** 渲染节点集合 */
|
|
5
5
|
export interface FieldNodeRenderers {
|
|
6
6
|
/** 暗提示节点 */
|
package/dist/index.d.ts
CHANGED
|
@@ -4,5 +4,7 @@ export { default as DocRenderLayout } from './runtime/renderer/doc-render-layout
|
|
|
4
4
|
export { GctLayout } from './base';
|
|
5
5
|
export { registerEdhrSuite } from './suites/edhr';
|
|
6
6
|
export { useDocEngine } from './runtime/useDocEngine';
|
|
7
|
+
export { getSubmitFormData } from './runtime/interface/utils';
|
|
8
|
+
export { validateAllFields } from './runtime/factories/useFormValidator';
|
|
7
9
|
export * from './setup';
|
|
8
10
|
export type { DocModeType, CompleteComponentType, BuiltinComponentType } from './core';
|