@hailin-zheng/editor-core 2.1.26 → 2.1.28
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/controls/ButtonBase.d.ts +10 -10
- package/controls/Canvas.d.ts +7 -7
- package/controls/Config.d.ts +12 -12
- package/controls/FlexBox.d.ts +81 -81
- package/controls/Input.d.ts +33 -33
- package/controls/MedTimeLine/TimeAxis.d.ts +21 -21
- package/controls/MedTimeLine/TimeSlider.d.ts +19 -19
- package/controls/Menu.d.ts +31 -31
- package/controls/Node.d.ts +232 -232
- package/controls/NodeEvent.d.ts +138 -138
- package/controls/Rect.d.ts +4 -4
- package/controls/ScrollView.d.ts +57 -57
- package/controls/StackPanel.d.ts +27 -27
- package/controls/SurfaceView.d.ts +44 -44
- package/controls/Text.d.ts +46 -46
- package/controls/TextBase.d.ts +19 -19
- package/controls/ViewPaint.d.ts +64 -64
- package/controls/Window.d.ts +27 -27
- package/controls/WrapPanel.d.ts +10 -10
- package/controls/event-subject.d.ts +42 -42
- package/editor.css +544 -544
- package/index-cjs.d.ts +31 -31
- package/index-cjs.js +26744 -26740
- package/index-cjs.js.map +1 -1
- package/index.d.ts +31 -31
- package/index.js +26748 -26744
- package/index.js.map +1 -1
- package/med_editor/doc-editor.d.ts +457 -458
- package/med_editor/doc-rule.d.ts +46 -46
- package/med_editor/editor-core.d.ts +21 -21
- package/med_editor/framework/ast-parser.d.ts +4 -4
- package/med_editor/framework/common-util.d.ts +76 -76
- package/med_editor/framework/document-arrange.d.ts +85 -85
- package/med_editor/framework/document-change.d.ts +295 -295
- package/med_editor/framework/document-combine.d.ts +24 -24
- package/med_editor/framework/document-comment.d.ts +38 -38
- package/med_editor/framework/document-context.d.ts +143 -143
- package/med_editor/framework/document-eval-func.d.ts +18 -18
- package/med_editor/framework/document-event.d.ts +262 -262
- package/med_editor/framework/document-input-cursor.d.ts +43 -43
- package/med_editor/framework/document-paginator.d.ts +47 -47
- package/med_editor/framework/document-print-offscreen.d.ts +58 -58
- package/med_editor/framework/document-print.d.ts +18 -18
- package/med_editor/framework/document-segmenter.d.ts +2 -2
- package/med_editor/framework/document-selection.d.ts +97 -97
- package/med_editor/framework/document-svg.d.ts +32 -32
- package/med_editor/framework/document-template.d.ts +13 -13
- package/med_editor/framework/document-textline-mode.d.ts +6 -6
- package/med_editor/framework/dynamic-execute.d.ts +23 -23
- package/med_editor/framework/editor-calendar-vnode.d.ts +42 -42
- package/med_editor/framework/element-define.d.ts +412 -412
- package/med_editor/framework/element-event-define.d.ts +107 -107
- package/med_editor/framework/element-props.d.ts +345 -345
- package/med_editor/framework/element-reader.d.ts +20 -20
- package/med_editor/framework/element-serialize.d.ts +36 -36
- package/med_editor/framework/element-trace-manage.d.ts +106 -106
- package/med_editor/framework/element-trace-tracking.d.ts +89 -89
- package/med_editor/framework/element-type-handler.d.ts +9 -9
- package/med_editor/framework/element-util.d.ts +409 -409
- package/med_editor/framework/event-subject.d.ts +56 -56
- package/med_editor/framework/impl/checkbox/checkbox-impl.d.ts +19 -19
- package/med_editor/framework/impl/comments/comment-content-impl.d.ts +39 -39
- package/med_editor/framework/impl/comments/comment-element-impl.d.ts +24 -24
- package/med_editor/framework/impl/comments/comments-container-impl.d.ts +19 -19
- package/med_editor/framework/impl/comments/comments-util.d.ts +5 -5
- package/med_editor/framework/impl/comments/validate-msg-impl.d.ts +19 -19
- package/med_editor/framework/impl/data-element/data-decorate-impl.d.ts +15 -15
- package/med_editor/framework/impl/data-element/data-element-barcode.d.ts +32 -32
- package/med_editor/framework/impl/data-element/data-element-base-impl.d.ts +83 -83
- package/med_editor/framework/impl/data-element/data-element-check-impl.d.ts +26 -26
- package/med_editor/framework/impl/data-element/data-element-date-impl.d.ts +23 -23
- package/med_editor/framework/impl/data-element/data-element-group-impl.d.ts +17 -17
- package/med_editor/framework/impl/data-element/data-element-image-impl.d.ts +23 -23
- package/med_editor/framework/impl/data-element/data-element-list-impl.d.ts +21 -21
- package/med_editor/framework/impl/data-element/data-element-text-impl.d.ts +22 -22
- package/med_editor/framework/impl/data-element/qrcode.d.ts +93 -93
- package/med_editor/framework/impl/decorate/fill-null-space-imple.d.ts +16 -16
- package/med_editor/framework/impl/document/doc-body-impl.d.ts +20 -20
- package/med_editor/framework/impl/document/doc-body-part-impl.d.ts +22 -22
- package/med_editor/framework/impl/document/doc-container-impl.d.ts +7 -7
- package/med_editor/framework/impl/document/doc-footer-impl.d.ts +19 -19
- package/med_editor/framework/impl/document/doc-header-impl.d.ts +19 -19
- package/med_editor/framework/impl/document/doc-impl.d.ts +81 -81
- package/med_editor/framework/impl/index.d.ts +40 -40
- package/med_editor/framework/impl/media-formula/menstrual-history.d.ts +31 -31
- package/med_editor/framework/impl/media-formula/permanent-teeth.d.ts +34 -34
- package/med_editor/framework/impl/paragraph/p-impl.d.ts +38 -38
- package/med_editor/framework/impl/picture/RectEle.d.ts +44 -44
- package/med_editor/framework/impl/picture/image-impl.d.ts +24 -24
- package/med_editor/framework/impl/radio/radio-impl.d.ts +17 -17
- package/med_editor/framework/impl/svg/svg-impl.d.ts +20 -20
- package/med_editor/framework/impl/symbol/br-symbol-impl.d.ts +18 -18
- package/med_editor/framework/impl/symbol/p-symbol-impl.d.ts +16 -16
- package/med_editor/framework/impl/symbol/page-br-symbol-impl.d.ts +20 -20
- package/med_editor/framework/impl/symbol/tab-symbol-impl.d.ts +15 -15
- package/med_editor/framework/impl/table/table-cell-impl.d.ts +34 -34
- package/med_editor/framework/impl/table/table-impl.d.ts +49 -49
- package/med_editor/framework/impl/table/table-row-impl.d.ts +27 -27
- package/med_editor/framework/impl/table/table-split-cell-patch.d.ts +20 -20
- package/med_editor/framework/impl/table/table-split-cell.d.ts +92 -92
- package/med_editor/framework/impl/table/table-util.d.ts +180 -180
- package/med_editor/framework/impl/text/text-impl.d.ts +34 -34
- package/med_editor/framework/impl/text/track-run-impl.d.ts +27 -27
- package/med_editor/framework/notify.d.ts +13 -13
- package/med_editor/framework/paragraph-arrange.d.ts +107 -107
- package/med_editor/framework/range-util.d.ts +36 -36
- package/med_editor/framework/render-context.d.ts +111 -111
- package/med_editor/framework/render-define.d.ts +141 -141
- package/med_editor/framework/selection-overlays.d.ts +32 -32
- package/med_editor/rule-control.d.ts +66 -66
- package/package.json +18 -18
- package/timeline/TimeLineControl.d.ts +47 -47
- package/timeline/TimeValueGridControl.d.ts +106 -106
- package/timeline/TimelineConfig.d.ts +68 -68
- package/timeline/TimelineScrollbar.d.ts +25 -25
- package/timeline/TimelineStatus.d.ts +61 -61
- package/timeline/TimelineTick.d.ts +63 -63
- package/timeline/example.d.ts +2 -2
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export declare const reactiveMap: WeakMap<object, object>;
|
|
2
|
-
export declare const targetMaps: WeakMap<object, Map<propType, Set<notifyCallback>>>;
|
|
3
|
-
declare type propType = string | number | symbol;
|
|
4
|
-
interface notifyCallback {
|
|
5
|
-
(target: object, p: propType, oldValue: any, newValue: any): string | undefined | void;
|
|
6
|
-
}
|
|
7
|
-
export declare function watchChanged<T extends object>(source: T, cb: notifyCallback): T;
|
|
8
|
-
export declare function setNotifyChangedCallback(target: object, p: propType, cb: notifyCallback): void;
|
|
9
|
-
export declare const isDate: (val: unknown) => val is Date;
|
|
10
|
-
export declare const objectToString: () => string;
|
|
11
|
-
export declare const toTypeString: (value: unknown) => string;
|
|
12
|
-
export declare const toRawType: (value: unknown) => string;
|
|
13
|
-
export {};
|
|
1
|
+
export declare const reactiveMap: WeakMap<object, object>;
|
|
2
|
+
export declare const targetMaps: WeakMap<object, Map<propType, Set<notifyCallback>>>;
|
|
3
|
+
declare type propType = string | number | symbol;
|
|
4
|
+
interface notifyCallback {
|
|
5
|
+
(target: object, p: propType, oldValue: any, newValue: any): string | undefined | void;
|
|
6
|
+
}
|
|
7
|
+
export declare function watchChanged<T extends object>(source: T, cb: notifyCallback): T;
|
|
8
|
+
export declare function setNotifyChangedCallback(target: object, p: propType, cb: notifyCallback): void;
|
|
9
|
+
export declare const isDate: (val: unknown) => val is Date;
|
|
10
|
+
export declare const objectToString: () => string;
|
|
11
|
+
export declare const toTypeString: (value: unknown) => string;
|
|
12
|
+
export declare const toRawType: (value: unknown) => string;
|
|
13
|
+
export {};
|
|
@@ -1,107 +1,107 @@
|
|
|
1
|
-
import { LeafRenderObject, RenderObject } from "./render-define";
|
|
2
|
-
import { FillNullSpaceRenderObject, ParagraphElement, ParagraphRenderObject, TextGroupRenderObject } from "./impl";
|
|
3
|
-
import { Element, InlineGroupElement, LeafElement, ViewOptions } from "./element-define";
|
|
4
|
-
import { RenderContextType } from "./render-context";
|
|
5
|
-
import { DynamicExecute } from "./dynamic-execute";
|
|
6
|
-
export declare class ParagraphMeasure {
|
|
7
|
-
options: ViewOptions;
|
|
8
|
-
renderCtx: RenderContextType;
|
|
9
|
-
execute: DynamicExecute;
|
|
10
|
-
constructor(options: ViewOptions, renderCtx: RenderContextType, execute: DynamicExecute);
|
|
11
|
-
/**
|
|
12
|
-
* 段落排版:
|
|
13
|
-
* 1.当前段落不存在项目符号,按照缩进和悬挂处理
|
|
14
|
-
* 2.存在项目符号
|
|
15
|
-
* 2.1首行要缩进 30:"一个项目符号的长度位置"
|
|
16
|
-
* @param p
|
|
17
|
-
* @param limitWidth
|
|
18
|
-
*/
|
|
19
|
-
measureParagraph(p: ParagraphElement, limitWidth: Readonly<number>): Array<ParagraphRenderObject>;
|
|
20
|
-
/**
|
|
21
|
-
* 校验当前段落属性
|
|
22
|
-
*/
|
|
23
|
-
private verifyPara;
|
|
24
|
-
/**
|
|
25
|
-
* 获取段落行布局横向坐标起始位置,被段落text-align影响
|
|
26
|
-
*/
|
|
27
|
-
private setParaTextAlign;
|
|
28
|
-
/**
|
|
29
|
-
* 设置两端对齐
|
|
30
|
-
* @param render
|
|
31
|
-
* @param count
|
|
32
|
-
* @param spaceWidth
|
|
33
|
-
*/
|
|
34
|
-
private setAlignJustify;
|
|
35
|
-
arrange(parentLine: MeasureLine, ele: Element): void;
|
|
36
|
-
arrangeInlineGroupElement(parentLine: MeasureLine, ele: InlineGroupElement): void;
|
|
37
|
-
private arrangeInlineItems;
|
|
38
|
-
arrangeLeafElement(parentLine: MeasureLine, ele: LeafElement): void;
|
|
39
|
-
arrangeLeafRender(parentLine: MeasureLine, render: LeafRenderObject): void;
|
|
40
|
-
cutTextRender(render: TextGroupRenderObject, limitWidth: number, lineEmpty: boolean, isCloseToBody: any): ICutLineData;
|
|
41
|
-
/**
|
|
42
|
-
* 处理前置标点,前置标点不能出现在末尾
|
|
43
|
-
* @param render
|
|
44
|
-
* @param i
|
|
45
|
-
* @param lineEmpty
|
|
46
|
-
*/
|
|
47
|
-
private patchHandleLeadingPunctuation;
|
|
48
|
-
/**
|
|
49
|
-
* 处理后置标点,后置标点不能出现在行首
|
|
50
|
-
* @param render
|
|
51
|
-
* @param i
|
|
52
|
-
* @param inCloseBody
|
|
53
|
-
* @param lineEmpty
|
|
54
|
-
*/
|
|
55
|
-
private patchHandlePostPunctuation;
|
|
56
|
-
/**
|
|
57
|
-
* 是否包含后置标点
|
|
58
|
-
* @param str
|
|
59
|
-
* @returns
|
|
60
|
-
*/
|
|
61
|
-
private containPostPunctuation;
|
|
62
|
-
private containLeadingPunctuation;
|
|
63
|
-
/**
|
|
64
|
-
* 文本开头是否包含后置标点
|
|
65
|
-
* @param render
|
|
66
|
-
* @returns
|
|
67
|
-
*/
|
|
68
|
-
private containerStartSymbolInTextStart;
|
|
69
|
-
cutFillNullRender(render: FillNullSpaceRenderObject, limitWidth: number): ICutLineData;
|
|
70
|
-
/**
|
|
71
|
-
* 获取段落行渲染单位个数,字符需要计算为字符长度
|
|
72
|
-
*/
|
|
73
|
-
private getRenderUnitLength;
|
|
74
|
-
/**
|
|
75
|
-
* 解析可见性表达式
|
|
76
|
-
* @param ele
|
|
77
|
-
* @param execute
|
|
78
|
-
* @private
|
|
79
|
-
*/
|
|
80
|
-
parseVisibleExpression(ele: Element, execute: DynamicExecute): void;
|
|
81
|
-
/**
|
|
82
|
-
* 元素可见行求值
|
|
83
|
-
* @param ele
|
|
84
|
-
* @param executeCtx
|
|
85
|
-
* @private
|
|
86
|
-
*/
|
|
87
|
-
evalVisibleExpr(ele: Element, executeCtx: DynamicExecute): boolean;
|
|
88
|
-
createRenderObject<T extends Element>(element: T): ReturnType<T['createRenderObject']>;
|
|
89
|
-
}
|
|
90
|
-
interface MeasureLine {
|
|
91
|
-
add(child: RenderObject): void;
|
|
92
|
-
lineWidth(): number;
|
|
93
|
-
updateHeight(child: RenderObject): void;
|
|
94
|
-
limitWidth: number;
|
|
95
|
-
lineLength(): number;
|
|
96
|
-
applyNewLine(): void;
|
|
97
|
-
applyNewPara(): void;
|
|
98
|
-
parent: MeasureLine | null;
|
|
99
|
-
isCloseToBody: boolean;
|
|
100
|
-
arrange(): void;
|
|
101
|
-
}
|
|
102
|
-
interface ICutLineData {
|
|
103
|
-
firstItem: RenderObject | null;
|
|
104
|
-
lastItem: RenderObject | null;
|
|
105
|
-
br?: boolean;
|
|
106
|
-
}
|
|
107
|
-
export {};
|
|
1
|
+
import { LeafRenderObject, RenderObject } from "./render-define";
|
|
2
|
+
import { FillNullSpaceRenderObject, ParagraphElement, ParagraphRenderObject, TextGroupRenderObject } from "./impl";
|
|
3
|
+
import { Element, InlineGroupElement, LeafElement, ViewOptions } from "./element-define";
|
|
4
|
+
import { RenderContextType } from "./render-context";
|
|
5
|
+
import { DynamicExecute } from "./dynamic-execute";
|
|
6
|
+
export declare class ParagraphMeasure {
|
|
7
|
+
options: ViewOptions;
|
|
8
|
+
renderCtx: RenderContextType;
|
|
9
|
+
execute: DynamicExecute;
|
|
10
|
+
constructor(options: ViewOptions, renderCtx: RenderContextType, execute: DynamicExecute);
|
|
11
|
+
/**
|
|
12
|
+
* 段落排版:
|
|
13
|
+
* 1.当前段落不存在项目符号,按照缩进和悬挂处理
|
|
14
|
+
* 2.存在项目符号
|
|
15
|
+
* 2.1首行要缩进 30:"一个项目符号的长度位置"
|
|
16
|
+
* @param p
|
|
17
|
+
* @param limitWidth
|
|
18
|
+
*/
|
|
19
|
+
measureParagraph(p: ParagraphElement, limitWidth: Readonly<number>): Array<ParagraphRenderObject>;
|
|
20
|
+
/**
|
|
21
|
+
* 校验当前段落属性
|
|
22
|
+
*/
|
|
23
|
+
private verifyPara;
|
|
24
|
+
/**
|
|
25
|
+
* 获取段落行布局横向坐标起始位置,被段落text-align影响
|
|
26
|
+
*/
|
|
27
|
+
private setParaTextAlign;
|
|
28
|
+
/**
|
|
29
|
+
* 设置两端对齐
|
|
30
|
+
* @param render
|
|
31
|
+
* @param count
|
|
32
|
+
* @param spaceWidth
|
|
33
|
+
*/
|
|
34
|
+
private setAlignJustify;
|
|
35
|
+
arrange(parentLine: MeasureLine, ele: Element): void;
|
|
36
|
+
arrangeInlineGroupElement(parentLine: MeasureLine, ele: InlineGroupElement): void;
|
|
37
|
+
private arrangeInlineItems;
|
|
38
|
+
arrangeLeafElement(parentLine: MeasureLine, ele: LeafElement): void;
|
|
39
|
+
arrangeLeafRender(parentLine: MeasureLine, render: LeafRenderObject): void;
|
|
40
|
+
cutTextRender(render: TextGroupRenderObject, limitWidth: number, lineEmpty: boolean, isCloseToBody: any): ICutLineData;
|
|
41
|
+
/**
|
|
42
|
+
* 处理前置标点,前置标点不能出现在末尾
|
|
43
|
+
* @param render
|
|
44
|
+
* @param i
|
|
45
|
+
* @param lineEmpty
|
|
46
|
+
*/
|
|
47
|
+
private patchHandleLeadingPunctuation;
|
|
48
|
+
/**
|
|
49
|
+
* 处理后置标点,后置标点不能出现在行首
|
|
50
|
+
* @param render
|
|
51
|
+
* @param i
|
|
52
|
+
* @param inCloseBody
|
|
53
|
+
* @param lineEmpty
|
|
54
|
+
*/
|
|
55
|
+
private patchHandlePostPunctuation;
|
|
56
|
+
/**
|
|
57
|
+
* 是否包含后置标点
|
|
58
|
+
* @param str
|
|
59
|
+
* @returns
|
|
60
|
+
*/
|
|
61
|
+
private containPostPunctuation;
|
|
62
|
+
private containLeadingPunctuation;
|
|
63
|
+
/**
|
|
64
|
+
* 文本开头是否包含后置标点
|
|
65
|
+
* @param render
|
|
66
|
+
* @returns
|
|
67
|
+
*/
|
|
68
|
+
private containerStartSymbolInTextStart;
|
|
69
|
+
cutFillNullRender(render: FillNullSpaceRenderObject, limitWidth: number): ICutLineData;
|
|
70
|
+
/**
|
|
71
|
+
* 获取段落行渲染单位个数,字符需要计算为字符长度
|
|
72
|
+
*/
|
|
73
|
+
private getRenderUnitLength;
|
|
74
|
+
/**
|
|
75
|
+
* 解析可见性表达式
|
|
76
|
+
* @param ele
|
|
77
|
+
* @param execute
|
|
78
|
+
* @private
|
|
79
|
+
*/
|
|
80
|
+
parseVisibleExpression(ele: Element, execute: DynamicExecute): void;
|
|
81
|
+
/**
|
|
82
|
+
* 元素可见行求值
|
|
83
|
+
* @param ele
|
|
84
|
+
* @param executeCtx
|
|
85
|
+
* @private
|
|
86
|
+
*/
|
|
87
|
+
evalVisibleExpr(ele: Element, executeCtx: DynamicExecute): boolean;
|
|
88
|
+
createRenderObject<T extends Element>(element: T): ReturnType<T['createRenderObject']>;
|
|
89
|
+
}
|
|
90
|
+
interface MeasureLine {
|
|
91
|
+
add(child: RenderObject): void;
|
|
92
|
+
lineWidth(): number;
|
|
93
|
+
updateHeight(child: RenderObject): void;
|
|
94
|
+
limitWidth: number;
|
|
95
|
+
lineLength(): number;
|
|
96
|
+
applyNewLine(): void;
|
|
97
|
+
applyNewPara(): void;
|
|
98
|
+
parent: MeasureLine | null;
|
|
99
|
+
isCloseToBody: boolean;
|
|
100
|
+
arrange(): void;
|
|
101
|
+
}
|
|
102
|
+
interface ICutLineData {
|
|
103
|
+
firstItem: RenderObject | null;
|
|
104
|
+
lastItem: RenderObject | null;
|
|
105
|
+
br?: boolean;
|
|
106
|
+
}
|
|
107
|
+
export {};
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { BranchElement, Element, LeafElement, SelectionContentRange } from "./element-define";
|
|
2
|
-
import { TableElement } from "./impl/table/table-impl";
|
|
3
|
-
export declare class RangeUtil {
|
|
4
|
-
static getSectionRange(startControl: LeafElement, startOffset: number, endControl: LeafElement, endOffset: number, ancestorCommonControl: BranchElement): SelectionContentRange;
|
|
5
|
-
static getCollapsedRange(startControl: LeafElement, startOffset: number, endOffset: number, ancestorCommonControl: BranchElement): SelectionContentRange;
|
|
6
|
-
/**
|
|
7
|
-
* 获取表格选区的内容
|
|
8
|
-
* @param startControl
|
|
9
|
-
* @param startOffset
|
|
10
|
-
* @param endControl
|
|
11
|
-
* @param endOffset
|
|
12
|
-
* @param tb
|
|
13
|
-
*/
|
|
14
|
-
static getTableSelectionRange(startControl: LeafElement, startOffset: number, endControl: LeafElement, endOffset: number, tb: TableElement): SelectionContentRange;
|
|
15
|
-
private static getStartForbackTreeData;
|
|
16
|
-
private static getEndForwardTreeData;
|
|
17
|
-
private static getChildTreeData;
|
|
18
|
-
private static setRangeFullSelected;
|
|
19
|
-
static rangeEquals(selRange1: SelectionContentRange, selRange2: SelectionContentRange): boolean;
|
|
20
|
-
static getStartRangeTarget(parentRange: SelectionContentRange): SelectionContentRange | null;
|
|
21
|
-
static getEndRangeTarget(parentRange: SelectionContentRange): SelectionContentRange | null;
|
|
22
|
-
/**
|
|
23
|
-
* 循环递归执行选区对象方法
|
|
24
|
-
* @param range
|
|
25
|
-
* @param handler
|
|
26
|
-
*/
|
|
27
|
-
static recursionTraversalRangeHandler(range: SelectionContentRange, handler: (range: SelectionContentRange) => void): void;
|
|
28
|
-
/**
|
|
29
|
-
* 判断元素是否被完全选中
|
|
30
|
-
* @param range
|
|
31
|
-
* @param ele
|
|
32
|
-
*/
|
|
33
|
-
static checkElementFullInRange(range: SelectionContentRange, ele: Element): boolean;
|
|
34
|
-
private static pushToArray;
|
|
35
|
-
private static unshiftToArray;
|
|
36
|
-
}
|
|
1
|
+
import { BranchElement, Element, LeafElement, SelectionContentRange } from "./element-define";
|
|
2
|
+
import { TableElement } from "./impl/table/table-impl";
|
|
3
|
+
export declare class RangeUtil {
|
|
4
|
+
static getSectionRange(startControl: LeafElement, startOffset: number, endControl: LeafElement, endOffset: number, ancestorCommonControl: BranchElement): SelectionContentRange;
|
|
5
|
+
static getCollapsedRange(startControl: LeafElement, startOffset: number, endOffset: number, ancestorCommonControl: BranchElement): SelectionContentRange;
|
|
6
|
+
/**
|
|
7
|
+
* 获取表格选区的内容
|
|
8
|
+
* @param startControl
|
|
9
|
+
* @param startOffset
|
|
10
|
+
* @param endControl
|
|
11
|
+
* @param endOffset
|
|
12
|
+
* @param tb
|
|
13
|
+
*/
|
|
14
|
+
static getTableSelectionRange(startControl: LeafElement, startOffset: number, endControl: LeafElement, endOffset: number, tb: TableElement): SelectionContentRange;
|
|
15
|
+
private static getStartForbackTreeData;
|
|
16
|
+
private static getEndForwardTreeData;
|
|
17
|
+
private static getChildTreeData;
|
|
18
|
+
private static setRangeFullSelected;
|
|
19
|
+
static rangeEquals(selRange1: SelectionContentRange, selRange2: SelectionContentRange): boolean;
|
|
20
|
+
static getStartRangeTarget(parentRange: SelectionContentRange): SelectionContentRange | null;
|
|
21
|
+
static getEndRangeTarget(parentRange: SelectionContentRange): SelectionContentRange | null;
|
|
22
|
+
/**
|
|
23
|
+
* 循环递归执行选区对象方法
|
|
24
|
+
* @param range
|
|
25
|
+
* @param handler
|
|
26
|
+
*/
|
|
27
|
+
static recursionTraversalRangeHandler(range: SelectionContentRange, handler: (range: SelectionContentRange) => void): void;
|
|
28
|
+
/**
|
|
29
|
+
* 判断元素是否被完全选中
|
|
30
|
+
* @param range
|
|
31
|
+
* @param ele
|
|
32
|
+
*/
|
|
33
|
+
static checkElementFullInRange(range: SelectionContentRange, ele: Element): boolean;
|
|
34
|
+
private static pushToArray;
|
|
35
|
+
private static unshiftToArray;
|
|
36
|
+
}
|
|
@@ -1,111 +1,111 @@
|
|
|
1
|
-
import { Position, Rect } from "./element-define";
|
|
2
|
-
import { TextProps } from "./element-props";
|
|
3
|
-
import { TextGroupElement, TextGroupRenderObject } from "./impl/text/text-impl";
|
|
4
|
-
export declare enum TextUnitsHolder {
|
|
5
|
-
char = 0,
|
|
6
|
-
sourceSize = 1,
|
|
7
|
-
actualSize = 2,
|
|
8
|
-
actualBoundingBoxAscent = 3
|
|
9
|
-
}
|
|
10
|
-
export interface TextUnits {
|
|
11
|
-
sourceSize: number;
|
|
12
|
-
actualSize: number;
|
|
13
|
-
char: string;
|
|
14
|
-
}
|
|
15
|
-
export interface IRenderContextContract {
|
|
16
|
-
contentContext: PaintContent;
|
|
17
|
-
overlaysContext: PaintContent;
|
|
18
|
-
mainContext: PaintContent;
|
|
19
|
-
drawMode: 'view' | 'print';
|
|
20
|
-
clear(): void;
|
|
21
|
-
commit(pageSetting: ISetCanvasPageProps, pageOffset: Position): void;
|
|
22
|
-
init(pageSetting: ISetCanvasPageProps): void;
|
|
23
|
-
tran(effect: () => void): void;
|
|
24
|
-
update(pageSetting: ISetCanvasPageProps): void;
|
|
25
|
-
}
|
|
26
|
-
export declare type RenderContextType = IRenderContextContract;
|
|
27
|
-
export declare type ISetCanvasPageProps = {
|
|
28
|
-
width: number;
|
|
29
|
-
height: number;
|
|
30
|
-
scale: number;
|
|
31
|
-
};
|
|
32
|
-
export declare class RenderContext implements IRenderContextContract {
|
|
33
|
-
readonly mainContext: PaintContent;
|
|
34
|
-
contentContext: PaintContent;
|
|
35
|
-
overlaysContext: PaintContent;
|
|
36
|
-
drawMode: 'view' | 'print';
|
|
37
|
-
contentOffCanvas: HTMLCanvasElement;
|
|
38
|
-
overlayOffCanvas: HTMLCanvasElement;
|
|
39
|
-
constructor(mainContext: PaintContent);
|
|
40
|
-
pageSetting: ISetCanvasPageProps;
|
|
41
|
-
pageRect: Rect;
|
|
42
|
-
init(pageSetting: ISetCanvasPageProps): void;
|
|
43
|
-
/**
|
|
44
|
-
* 更新绘制画布大小
|
|
45
|
-
*/
|
|
46
|
-
update(pageSetting: ISetCanvasPageProps): void;
|
|
47
|
-
clear(): void;
|
|
48
|
-
commit(pageSetting: ISetCanvasPageProps, pageOffset: Position): void;
|
|
49
|
-
tran(effect: () => void): void;
|
|
50
|
-
}
|
|
51
|
-
export declare class PaintContent {
|
|
52
|
-
ctx: CanvasRenderingContext2D;
|
|
53
|
-
constructor(ctx: CanvasRenderingContext2D);
|
|
54
|
-
init(): void;
|
|
55
|
-
private cacheFontBoundingBoxAscentMap;
|
|
56
|
-
getActualFontBoundingBoxAscent(font: string): number | undefined;
|
|
57
|
-
setGlobalAlpha(alpha: number): void;
|
|
58
|
-
getGlobalAlpha(): number;
|
|
59
|
-
clear(): void;
|
|
60
|
-
drawText(text: string, textProps: TextProps, x: number, y: number, width: number, height: number): void;
|
|
61
|
-
fillCircular(x: number, y: number, r: number, color?: string): void;
|
|
62
|
-
drawTextUnits(textGroupRender: TextGroupRenderObject, x: number, y: number): void;
|
|
63
|
-
drawText2(str: string, font: string, color: string, x: number, y: number, width: number, height: number): void;
|
|
64
|
-
getParaLineHeight(textEle: TextGroupElement): number;
|
|
65
|
-
measureText(text: string, textProps: TextProps): {
|
|
66
|
-
width: number;
|
|
67
|
-
height: number;
|
|
68
|
-
};
|
|
69
|
-
measureTextMetrics(font: string, str?: string): {
|
|
70
|
-
fontBoundingBoxAscent?: number;
|
|
71
|
-
fontBoundingBoxDescent?: number;
|
|
72
|
-
width: number;
|
|
73
|
-
actualBoundingBoxAscent: number;
|
|
74
|
-
actualBoundingBoxDescent: number;
|
|
75
|
-
actualBoundingBoxLeft: number;
|
|
76
|
-
actualBoundingBoxRight: number;
|
|
77
|
-
};
|
|
78
|
-
measureTextWidth(text: string, font: {
|
|
79
|
-
fontSize: number;
|
|
80
|
-
fontName: string;
|
|
81
|
-
}): number;
|
|
82
|
-
measureTextUnits(units: Array<TextUnits>, textProps: TextProps): void;
|
|
83
|
-
clearRect(x: number, y: number, width: number, height: number): void;
|
|
84
|
-
save(): void;
|
|
85
|
-
restore(): void;
|
|
86
|
-
scale(ratio: number): void;
|
|
87
|
-
/**
|
|
88
|
-
* 包装任务执行:save->exec->restore
|
|
89
|
-
* @param effect
|
|
90
|
-
*/
|
|
91
|
-
tran(effect: () => void): void;
|
|
92
|
-
strokeRect(x: number, y: number, width: number, height: number, strokeColor?: string, strokeWidth?: number, radius?: number): void;
|
|
93
|
-
/**
|
|
94
|
-
* 绘制水平线
|
|
95
|
-
* @param x
|
|
96
|
-
* @param y
|
|
97
|
-
* @param width
|
|
98
|
-
* @param lineColor
|
|
99
|
-
* @param lineWidth
|
|
100
|
-
*/
|
|
101
|
-
drawHoriLine(x: number, y: number, width: number, lineColor?: string, lineWidth?: number): void;
|
|
102
|
-
fillRect(x: number, y: number, width: number, height: number, fillColor?: string, shadowBlur?: number, shadowColor?: string, borderRadius?: number): void;
|
|
103
|
-
strokeLines(lines: Array<Position>, width?: number, strokeColor?: string): void;
|
|
104
|
-
fillLines(lines: Array<Position>, width?: number, fillColor?: string, lineDash?: Array<number>): void;
|
|
105
|
-
drawCheckBox(x: number, y: number, width: number, height: number, isChecked: boolean): void;
|
|
106
|
-
drawRadioBox(x: number, y: number, width: number, height: number, isChecked: boolean): void;
|
|
107
|
-
drawDashLine(points: Array<Position>, lineDash: Array<number>, lineColor?: string, lineWidth?: number): void;
|
|
108
|
-
roundRect(x: number, y: number, width: number, height: number, radius: number): void;
|
|
109
|
-
clip(x: number, y: number, width: number, height: number): void;
|
|
110
|
-
clipFunc(pathFunc: () => void): void;
|
|
111
|
-
}
|
|
1
|
+
import { Position, Rect } from "./element-define";
|
|
2
|
+
import { TextProps } from "./element-props";
|
|
3
|
+
import { TextGroupElement, TextGroupRenderObject } from "./impl/text/text-impl";
|
|
4
|
+
export declare enum TextUnitsHolder {
|
|
5
|
+
char = 0,
|
|
6
|
+
sourceSize = 1,
|
|
7
|
+
actualSize = 2,
|
|
8
|
+
actualBoundingBoxAscent = 3
|
|
9
|
+
}
|
|
10
|
+
export interface TextUnits {
|
|
11
|
+
sourceSize: number;
|
|
12
|
+
actualSize: number;
|
|
13
|
+
char: string;
|
|
14
|
+
}
|
|
15
|
+
export interface IRenderContextContract {
|
|
16
|
+
contentContext: PaintContent;
|
|
17
|
+
overlaysContext: PaintContent;
|
|
18
|
+
mainContext: PaintContent;
|
|
19
|
+
drawMode: 'view' | 'print';
|
|
20
|
+
clear(): void;
|
|
21
|
+
commit(pageSetting: ISetCanvasPageProps, pageOffset: Position): void;
|
|
22
|
+
init(pageSetting: ISetCanvasPageProps): void;
|
|
23
|
+
tran(effect: () => void): void;
|
|
24
|
+
update(pageSetting: ISetCanvasPageProps): void;
|
|
25
|
+
}
|
|
26
|
+
export declare type RenderContextType = IRenderContextContract;
|
|
27
|
+
export declare type ISetCanvasPageProps = {
|
|
28
|
+
width: number;
|
|
29
|
+
height: number;
|
|
30
|
+
scale: number;
|
|
31
|
+
};
|
|
32
|
+
export declare class RenderContext implements IRenderContextContract {
|
|
33
|
+
readonly mainContext: PaintContent;
|
|
34
|
+
contentContext: PaintContent;
|
|
35
|
+
overlaysContext: PaintContent;
|
|
36
|
+
drawMode: 'view' | 'print';
|
|
37
|
+
contentOffCanvas: HTMLCanvasElement;
|
|
38
|
+
overlayOffCanvas: HTMLCanvasElement;
|
|
39
|
+
constructor(mainContext: PaintContent);
|
|
40
|
+
pageSetting: ISetCanvasPageProps;
|
|
41
|
+
pageRect: Rect;
|
|
42
|
+
init(pageSetting: ISetCanvasPageProps): void;
|
|
43
|
+
/**
|
|
44
|
+
* 更新绘制画布大小
|
|
45
|
+
*/
|
|
46
|
+
update(pageSetting: ISetCanvasPageProps): void;
|
|
47
|
+
clear(): void;
|
|
48
|
+
commit(pageSetting: ISetCanvasPageProps, pageOffset: Position): void;
|
|
49
|
+
tran(effect: () => void): void;
|
|
50
|
+
}
|
|
51
|
+
export declare class PaintContent {
|
|
52
|
+
ctx: CanvasRenderingContext2D;
|
|
53
|
+
constructor(ctx: CanvasRenderingContext2D);
|
|
54
|
+
init(): void;
|
|
55
|
+
private cacheFontBoundingBoxAscentMap;
|
|
56
|
+
getActualFontBoundingBoxAscent(font: string): number | undefined;
|
|
57
|
+
setGlobalAlpha(alpha: number): void;
|
|
58
|
+
getGlobalAlpha(): number;
|
|
59
|
+
clear(): void;
|
|
60
|
+
drawText(text: string, textProps: TextProps, x: number, y: number, width: number, height: number): void;
|
|
61
|
+
fillCircular(x: number, y: number, r: number, color?: string): void;
|
|
62
|
+
drawTextUnits(textGroupRender: TextGroupRenderObject, x: number, y: number): void;
|
|
63
|
+
drawText2(str: string, font: string, color: string, x: number, y: number, width: number, height: number): void;
|
|
64
|
+
getParaLineHeight(textEle: TextGroupElement): number;
|
|
65
|
+
measureText(text: string, textProps: TextProps): {
|
|
66
|
+
width: number;
|
|
67
|
+
height: number;
|
|
68
|
+
};
|
|
69
|
+
measureTextMetrics(font: string, str?: string): {
|
|
70
|
+
fontBoundingBoxAscent?: number;
|
|
71
|
+
fontBoundingBoxDescent?: number;
|
|
72
|
+
width: number;
|
|
73
|
+
actualBoundingBoxAscent: number;
|
|
74
|
+
actualBoundingBoxDescent: number;
|
|
75
|
+
actualBoundingBoxLeft: number;
|
|
76
|
+
actualBoundingBoxRight: number;
|
|
77
|
+
};
|
|
78
|
+
measureTextWidth(text: string, font: {
|
|
79
|
+
fontSize: number;
|
|
80
|
+
fontName: string;
|
|
81
|
+
}): number;
|
|
82
|
+
measureTextUnits(units: Array<TextUnits>, textProps: TextProps): void;
|
|
83
|
+
clearRect(x: number, y: number, width: number, height: number): void;
|
|
84
|
+
save(): void;
|
|
85
|
+
restore(): void;
|
|
86
|
+
scale(ratio: number): void;
|
|
87
|
+
/**
|
|
88
|
+
* 包装任务执行:save->exec->restore
|
|
89
|
+
* @param effect
|
|
90
|
+
*/
|
|
91
|
+
tran(effect: () => void): void;
|
|
92
|
+
strokeRect(x: number, y: number, width: number, height: number, strokeColor?: string, strokeWidth?: number, radius?: number): void;
|
|
93
|
+
/**
|
|
94
|
+
* 绘制水平线
|
|
95
|
+
* @param x
|
|
96
|
+
* @param y
|
|
97
|
+
* @param width
|
|
98
|
+
* @param lineColor
|
|
99
|
+
* @param lineWidth
|
|
100
|
+
*/
|
|
101
|
+
drawHoriLine(x: number, y: number, width: number, lineColor?: string, lineWidth?: number): void;
|
|
102
|
+
fillRect(x: number, y: number, width: number, height: number, fillColor?: string, shadowBlur?: number, shadowColor?: string, borderRadius?: number): void;
|
|
103
|
+
strokeLines(lines: Array<Position>, width?: number, strokeColor?: string): void;
|
|
104
|
+
fillLines(lines: Array<Position>, width?: number, fillColor?: string, lineDash?: Array<number>): void;
|
|
105
|
+
drawCheckBox(x: number, y: number, width: number, height: number, isChecked: boolean): void;
|
|
106
|
+
drawRadioBox(x: number, y: number, width: number, height: number, isChecked: boolean): void;
|
|
107
|
+
drawDashLine(points: Array<Position>, lineDash: Array<number>, lineColor?: string, lineWidth?: number): void;
|
|
108
|
+
roundRect(x: number, y: number, width: number, height: number, radius: number): void;
|
|
109
|
+
clip(x: number, y: number, width: number, height: number): void;
|
|
110
|
+
clipFunc(pathFunc: () => void): void;
|
|
111
|
+
}
|