@hailin-zheng/editor-core 2.2.39 → 2.2.41
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/editor.css +638 -638
- package/index-cjs.d.ts +32 -32
- package/index-cjs.js +24337 -24326
- package/index-cjs.js.map +1 -1
- package/index.d.ts +32 -32
- package/index.js +24337 -24326
- package/index.js.map +1 -1
- package/med_editor/doc-editor.d.ts +546 -545
- package/med_editor/doc-rule.d.ts +174 -174
- package/med_editor/editor-core.d.ts +18 -18
- package/med_editor/framework/code-interpreter/ast-parser.d.ts +4 -4
- package/med_editor/framework/code-interpreter/document-eval-func.d.ts +18 -18
- package/med_editor/framework/code-interpreter/dynamic-execute.d.ts +42 -42
- package/med_editor/framework/doc-layout/document-arrange.d.ts +95 -95
- package/med_editor/framework/doc-layout/paragraph-arrange.d.ts +110 -110
- package/med_editor/framework/document-change.d.ts +346 -346
- 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 +162 -162
- package/med_editor/framework/document-event.d.ts +261 -261
- package/med_editor/framework/document-input-cursor.d.ts +32 -32
- package/med_editor/framework/document-paginator.d.ts +46 -46
- package/med_editor/framework/document-svg.d.ts +36 -36
- 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/element-define.d.ts +440 -440
- package/med_editor/framework/element-event-define.d.ts +102 -102
- package/med_editor/framework/element-props.d.ts +344 -344
- package/med_editor/framework/element-reader.d.ts +20 -20
- package/med_editor/framework/element-serialize.d.ts +39 -39
- package/med_editor/framework/element-type-handler.d.ts +8 -8
- package/med_editor/framework/history/element-trace-manage.d.ts +107 -107
- package/med_editor/framework/history/element-trace-tracking.d.ts +89 -89
- 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/validate-msg-impl.d.ts +19 -19
- package/med_editor/framework/impl/data-element/data-container-impl.d.ts +25 -25
- package/med_editor/framework/impl/data-element/data-decorate-impl.d.ts +16 -16
- 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 +122 -122
- 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 +28 -28
- 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 +19 -19
- 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 +85 -85
- package/med_editor/framework/impl/index.d.ts +41 -41
- 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/shape/line-impl.d.ts +31 -31
- 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 +93 -93
- 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/infrastructure/event-subject.d.ts +57 -57
- package/med_editor/framework/infrastructure/notify.d.ts +13 -13
- package/med_editor/framework/print/document-print-offscreen.d.ts +59 -59
- package/med_editor/framework/print/document-print.d.ts +19 -19
- package/med_editor/framework/render-context.d.ts +111 -111
- package/med_editor/framework/render-define.d.ts +169 -169
- package/med_editor/framework/search/search-panel.d.ts +31 -31
- package/med_editor/framework/selection/document-selection.d.ts +92 -92
- package/med_editor/framework/selection/range-util.d.ts +36 -36
- package/med_editor/framework/selection/selection-overlays.d.ts +36 -36
- package/med_editor/framework/suggestions/input-suggestions.d.ts +29 -29
- package/med_editor/framework/util/adjust-viewport-elements.d.ts +12 -12
- package/med_editor/framework/util/common-util.d.ts +77 -77
- package/med_editor/framework/util/document-segmenter.d.ts +2 -2
- package/med_editor/framework/util/element-util.d.ts +417 -417
- package/med_editor/framework/vnode/editor-calendar-vnode.d.ts +44 -44
- package/package.json +18 -18
@@ -1,417 +1,417 @@
|
|
1
|
-
import { EditorContext } from "../document-context";
|
2
|
-
import { BranchElement, Element, LeafElement, Position, Rect, SelectionContentRange, ViewOptions } from "../element-define";
|
3
|
-
import { HitRegion } from "../element-event-define";
|
4
|
-
import { DataEleBaseProps, TextProps } from "../element-props";
|
5
|
-
import { DataElementInlineGroup } from "../impl/data-element/data-element-base-impl";
|
6
|
-
import { ParagraphElement, ParagraphLineRectRenderObject } from "../impl/paragraph/p-impl";
|
7
|
-
import { TableCellRenderObject } from "../impl/table/table-cell-impl";
|
8
|
-
import { TableElement, TableRenderObject } from "../impl/table/table-impl";
|
9
|
-
import { TableRowRenderObject } from "../impl/table/table-row-impl";
|
10
|
-
import { TextGroupElement, TextGroupRenderObject } from "../impl/text/text-impl";
|
11
|
-
import { TrackRunElement, TrackRunTypeEnum } from "../impl/text/track-run-impl";
|
12
|
-
import { BlockContainerRenderObject, BlockContentRenderObject, BorderType, BranchRenderObject, CursorType, InlineGroupRenderObject, LeafRenderObject, RenderObject } from "../render-define";
|
13
|
-
import { DataElementGroupElement } from "../impl";
|
14
|
-
export declare class ElementUtil {
|
15
|
-
static setCanvasProps(canvas: HTMLCanvasElement, ctx: CanvasRenderingContext2D, viewOptions: {
|
16
|
-
width: number;
|
17
|
-
height: number;
|
18
|
-
}): void;
|
19
|
-
static getDpr(): number;
|
20
|
-
static getDprNumber(val: number, scale?: number): number;
|
21
|
-
static readTextProps(dest: TextProps | null, props: TextProps | undefined, options: ViewOptions): TextProps;
|
22
|
-
static readEleBaseProps(dest: DataEleBaseProps, props: DataEleBaseProps): DataEleBaseProps;
|
23
|
-
/**
|
24
|
-
* 获取内容区域最大高度
|
25
|
-
* @param render
|
26
|
-
* @param renderHeight
|
27
|
-
* @returns
|
28
|
-
*/
|
29
|
-
static innerRectMaxHeight(render: BlockContentRenderObject, renderHeight: number): number;
|
30
|
-
/**
|
31
|
-
* 根据内框内容高度,更新外框框体高度
|
32
|
-
* @param render
|
33
|
-
* @param innerRect
|
34
|
-
*/
|
35
|
-
static updateRenderHeightByInnerRect(render: BlockContentRenderObject, innerRect: Rect): void;
|
36
|
-
/**
|
37
|
-
* 克隆框体
|
38
|
-
* @param rect
|
39
|
-
* @returns
|
40
|
-
*/
|
41
|
-
static cloneRect(rect: Rect): Rect;
|
42
|
-
/**
|
43
|
-
* 重新限定子元素以及当前高度值,并返回内边框内容高度
|
44
|
-
* @param render
|
45
|
-
* @param resetX 测量段落外框时,内框不需要重置x,因为内框已经存在对齐
|
46
|
-
* @returns
|
47
|
-
*/
|
48
|
-
static remeasure(render: BlockContainerRenderObject | BlockContentRenderObject, resetX?: boolean): number;
|
49
|
-
static remeasureTableRow(rowRender: TableRowRenderObject, forceColIndex?: number): number;
|
50
|
-
/**
|
51
|
-
* 获取表格行绘制元素的内容高度,用于缩放行高度时,获取最小内容高度,缩放的高度不能小于内容最小高度
|
52
|
-
*/
|
53
|
-
static getTableRowRenderContentHeight(rowRender: TableRowRenderObject): number;
|
54
|
-
/**
|
55
|
-
* 获取单元格内容高度
|
56
|
-
* 单元格暂不处理上下margin、padding
|
57
|
-
* @param cellRender
|
58
|
-
* @returns
|
59
|
-
*/
|
60
|
-
static getTableCellRenderContentHeight(cellRender: TableCellRenderObject): number;
|
61
|
-
/**
|
62
|
-
* 处理单元格内容纵向对齐
|
63
|
-
* @param render
|
64
|
-
*/
|
65
|
-
private static measureCellVAlign;
|
66
|
-
/**
|
67
|
-
* 设置横向排列方式
|
68
|
-
* @private
|
69
|
-
* @param render
|
70
|
-
* @param limitRect
|
71
|
-
*/
|
72
|
-
static setHorizontalAlign(render: RenderObject, limitRect: Rect): void;
|
73
|
-
/**
|
74
|
-
* 重新测量合并单元格高度
|
75
|
-
* @param tbRender
|
76
|
-
* @returns
|
77
|
-
*/
|
78
|
-
static remeasureTableMerge(tbRender: TableRenderObject): void;
|
79
|
-
/**
|
80
|
-
* 获取向下纵向合并的行
|
81
|
-
* @param render
|
82
|
-
* @param rowIndex
|
83
|
-
* @param colIndex
|
84
|
-
* @returns
|
85
|
-
*/
|
86
|
-
private static getContinueVMergeRenderRows;
|
87
|
-
/**
|
88
|
-
* 根据横向当前被合并的单元格
|
89
|
-
* @param tb
|
90
|
-
* @param rowIndex
|
91
|
-
* @param colIndex
|
92
|
-
*/
|
93
|
-
static getHorizontalRestartCellIndex(tb: TableElement, rowIndex: number, colIndex: number): number;
|
94
|
-
/**
|
95
|
-
* 根据横向当前被合并的单元格
|
96
|
-
* @param tb
|
97
|
-
* @param rowIndex
|
98
|
-
* @param colIndex
|
99
|
-
*/
|
100
|
-
static getVerticalRestartCellIndex(tb: TableElement, rowIndex: number, colIndex: number): number;
|
101
|
-
/**
|
102
|
-
* 获取合并单元格主单元格
|
103
|
-
* @param tb
|
104
|
-
* @param rowIndex
|
105
|
-
* @param colIndex
|
106
|
-
* @returns
|
107
|
-
*/
|
108
|
-
static getRestartCellPosition(tb: TableElement, rowIndex: number, colIndex: number): {
|
109
|
-
rowIndex: number;
|
110
|
-
colIndex: number;
|
111
|
-
};
|
112
|
-
/**
|
113
|
-
* 调整单元格高度填满整个行的高度
|
114
|
-
*/
|
115
|
-
private static resizeCellToFillRow;
|
116
|
-
/**
|
117
|
-
* 获取元素的全局索引位置
|
118
|
-
* @param control
|
119
|
-
* @returns
|
120
|
-
*/
|
121
|
-
static getControlIndex(control: Element): number;
|
122
|
-
static getControlIndex(control: Element, pure: boolean): number;
|
123
|
-
static getControlByIndex(control: Element, counter: {
|
124
|
-
currIndex: number;
|
125
|
-
index: number;
|
126
|
-
}, pure: boolean): Element | null;
|
127
|
-
/**
|
128
|
-
* 获取元素的全局索引位置,不统计段落符号
|
129
|
-
* @param pure
|
130
|
-
* @param control
|
131
|
-
* @returns
|
132
|
-
*/
|
133
|
-
private static _getControlIndex;
|
134
|
-
/**
|
135
|
-
* 根据全局索引位置获取元素,不统计段落符号
|
136
|
-
* @param control
|
137
|
-
* @param counter
|
138
|
-
* @returns
|
139
|
-
*/
|
140
|
-
private static _getControlByIndex;
|
141
|
-
/**
|
142
|
-
* 获取同级紧挨前方的兄弟元素
|
143
|
-
* @param element
|
144
|
-
* @returns
|
145
|
-
*/
|
146
|
-
static getPrevSiblingElement(element: Element): Element | null;
|
147
|
-
/**
|
148
|
-
* 获取同级紧挨下方的元素
|
149
|
-
* @param element
|
150
|
-
* @returns
|
151
|
-
*/
|
152
|
-
static getNextSiblingElement(element: Element): Element | null;
|
153
|
-
static getNextSiblingTrackElement(element: Element, type: TrackRunTypeEnum, userId: string): TrackRunElement | null;
|
154
|
-
static getPrevSiblingTrackElement(element: Element, type: TrackRunTypeEnum, userId: string): TrackRunElement | null;
|
155
|
-
/**
|
156
|
-
* 根据默认配置创建长文本
|
157
|
-
* @param viewOptions
|
158
|
-
* @returns
|
159
|
-
*/
|
160
|
-
static getNewTextGroup(textProps: TextProps): TextGroupElement;
|
161
|
-
static createTextProps(dest: TextProps | null, viewOptions: ViewOptions): TextProps;
|
162
|
-
/**
|
163
|
-
* 获取容器内的最小渲染元素集合
|
164
|
-
* @param parPos
|
165
|
-
* @param array
|
166
|
-
*/
|
167
|
-
static getAvailHitLeafRenderObjects(render: RenderObject, parPos: Position): Array<{
|
168
|
-
render: LeafRenderObject;
|
169
|
-
rect: Rect;
|
170
|
-
}>;
|
171
|
-
/**
|
172
|
-
* 获取容器内的最小渲染元素集合
|
173
|
-
* @param parPos
|
174
|
-
* @param array
|
175
|
-
*/
|
176
|
-
static getAvailHitRenderObjects(render: RenderObject, parPos: Position): Array<{
|
177
|
-
render: RenderObject;
|
178
|
-
rect: Rect;
|
179
|
-
}>;
|
180
|
-
/**
|
181
|
-
* 获取绘制元素的绝对位置框
|
182
|
-
*/
|
183
|
-
static getRenderObjectAbsoluteRect(render: RenderObject, parPos: Position): Rect;
|
184
|
-
/**
|
185
|
-
* 检查当前绘制元素是否属于有效点击元素
|
186
|
-
*/
|
187
|
-
static checkAvailHitRender(render: RenderObject): boolean;
|
188
|
-
/**
|
189
|
-
* 验证点击可操作性
|
190
|
-
* 主要限制页眉页脚的编辑模式
|
191
|
-
*/
|
192
|
-
static verifyHitable(sourceElement: LeafElement | null | undefined): boolean;
|
193
|
-
static getDistanceToRect(rect: Rect, point: Position): number;
|
194
|
-
/**
|
195
|
-
* 获取父级层级渲染对象
|
196
|
-
* @param render
|
197
|
-
* @returns
|
198
|
-
*/
|
199
|
-
static getParentRenders(render: RenderObject): Array<RenderObject>;
|
200
|
-
static getRenderMapElements(render: RenderObject): Array<Element>;
|
201
|
-
static getParentRender<T extends BranchRenderObject>(child: RenderObject, parentType: {
|
202
|
-
new (...args: any): T;
|
203
|
-
}): T | null;
|
204
|
-
static getParentRenderByPredicate(child: RenderObject, predicate: (item: RenderObject) => boolean): RenderObject | null;
|
205
|
-
/**
|
206
|
-
* 获取父级层级元素对象
|
207
|
-
* @param element
|
208
|
-
* @returns
|
209
|
-
*/
|
210
|
-
static getParentElements(element: Element | null | undefined): Array<Element>;
|
211
|
-
/**
|
212
|
-
* 获取最后一个子元素
|
213
|
-
* @param element
|
214
|
-
* @returns
|
215
|
-
*/
|
216
|
-
static getLastLeafElement(element: Element, predicate?: null | ((item: Element) => boolean)): LeafElement | null;
|
217
|
-
/**
|
218
|
-
* 获取第一个子元素
|
219
|
-
* @param element
|
220
|
-
* @returns
|
221
|
-
*/
|
222
|
-
static getFirstLeafElement(element: Element): LeafElement | null;
|
223
|
-
/**
|
224
|
-
* 校验两个元素是否在同一个段落中
|
225
|
-
* @param element1
|
226
|
-
* @param element2
|
227
|
-
*/
|
228
|
-
static isInSameParagraph(element1: Element, element2: Element): boolean;
|
229
|
-
static getBorderCursor(borderType: BorderType): CursorType;
|
230
|
-
static getParentByType<P extends Element, T>(child: P | null, parentType: {
|
231
|
-
new (...args: any): T;
|
232
|
-
}): T | null;
|
233
|
-
static getParent(child: Element | null, predicate: (item: Element) => boolean): Element | null;
|
234
|
-
/**
|
235
|
-
* 修正段落内容
|
236
|
-
* @returns
|
237
|
-
*/
|
238
|
-
static fixParagraphContent(control: ParagraphElement): void;
|
239
|
-
/**
|
240
|
-
* 获取绘制元素相对于整个画布的绝对位置
|
241
|
-
* 整个画布绘制的时候不一定从x=0,y=0时绘制的,下拉滚动时,上面从负y坐标开始绘制
|
242
|
-
* 如果计算某个元素相对画布的左上角的绝对坐标位置,需要childPos的y值减去translateY
|
243
|
-
* @param render
|
244
|
-
* @param refPos 参照位置
|
245
|
-
* @returns
|
246
|
-
*/
|
247
|
-
static getRenderAbsolutePaintPos(render: RenderObject, refPos?: Position | null): Position;
|
248
|
-
static getRenderAbsolutePaintRect(render: RenderObject, childPos?: Position | null): Rect;
|
249
|
-
/**
|
250
|
-
* 获取选中区域的开始区域
|
251
|
-
* @param range
|
252
|
-
* @returns
|
253
|
-
*/
|
254
|
-
static getFirstSelectedRange(range: SelectionContentRange): SelectionContentRange;
|
255
|
-
/**
|
256
|
-
* 获取选中区域的开始区域
|
257
|
-
* @param range \
|
258
|
-
* @returns
|
259
|
-
*/
|
260
|
-
static getLastSelectedRange(range: SelectionContentRange): SelectionContentRange;
|
261
|
-
/**
|
262
|
-
* 克隆选区内容
|
263
|
-
* @param range
|
264
|
-
* @param isDelete
|
265
|
-
* @returns
|
266
|
-
*/
|
267
|
-
static cloneRange(range: SelectionContentRange, isDelete: boolean, cloneMode?: 'clone' | 'source' | 'copy'): Element | null;
|
268
|
-
/**
|
269
|
-
* 获取所有的子级元素
|
270
|
-
* @param branchEle
|
271
|
-
* @returns
|
272
|
-
*/
|
273
|
-
static getChildrenElements(branchEle: BranchElement): Array<Element>;
|
274
|
-
/**
|
275
|
-
* 递归向前寻找最近的元素
|
276
|
-
* @param currElement
|
277
|
-
* @param viewOptions
|
278
|
-
* @returns
|
279
|
-
*/
|
280
|
-
static getRecursionPrevSiblingElement(currElement: Element | null, viewOptions: ViewOptions): CursorPositionInfo | null;
|
281
|
-
/**
|
282
|
-
* 递归元素里面向前寻找可以定位的元素
|
283
|
-
*/
|
284
|
-
static getRecursionSiblingElementCursorPosition(ele: Element, viewOptions: ViewOptions, direction: 'left' | 'right'): CursorPositionInfo | null;
|
285
|
-
static getElementPositionCursor(ele: LeafElement, viewOptions: ViewOptions, direction: 'left' | 'right'): CursorPositionInfo | null;
|
286
|
-
/**
|
287
|
-
* 循环向前寻找可定位的数据元
|
288
|
-
* @param currElement
|
289
|
-
*/
|
290
|
-
static getPrevDataElement(ctx: EditorContext, currElement: DataElementInlineGroup): DataElementInlineGroup | null;
|
291
|
-
/**
|
292
|
-
* 递归向后寻找最近的元素
|
293
|
-
*/
|
294
|
-
static getRecursionNextSiblingElement(currElement: Element | null, viewOptions: ViewOptions): CursorPositionInfo | null;
|
295
|
-
/**
|
296
|
-
* 获取行内最大渲染单元格高度,主要处理纵向合并单元格问题
|
297
|
-
* @param row
|
298
|
-
* @returns
|
299
|
-
*/
|
300
|
-
static getRowMaxCellHeight(row: TableRowRenderObject): number;
|
301
|
-
/**
|
302
|
-
* 校验是否为空内容
|
303
|
-
* @param ele
|
304
|
-
*/
|
305
|
-
static checkEmptyRenderContent(ele: BranchRenderObject): boolean;
|
306
|
-
/**
|
307
|
-
* 测量行内编组元素
|
308
|
-
* @param render
|
309
|
-
*/
|
310
|
-
static remeasureInlineGroupRender(render: InlineGroupRenderObject): void;
|
311
|
-
static getParaLinePos(childRender: RenderObject, childRenderPos: Position): Rect;
|
312
|
-
static getParentRenderPos(parentRender: RenderObject, childRender: RenderObject, childRenderPos: Position): Rect;
|
313
|
-
/**
|
314
|
-
* 获取绘制元素所在的区域
|
315
|
-
*/
|
316
|
-
static getRenderObjectRegion(render: RenderObject): HitRegion | undefined;
|
317
|
-
/**
|
318
|
-
* 获取文档元素所在的区域
|
319
|
-
* @param element
|
320
|
-
* @returns
|
321
|
-
*/
|
322
|
-
static getElementRegion(element: Element): HitRegion | undefined;
|
323
|
-
static getElementRegionTarget(element: Element | null): {
|
324
|
-
type: HitRegion;
|
325
|
-
target: BranchElement;
|
326
|
-
} | null;
|
327
|
-
/**
|
328
|
-
* 根据坐标系统偏移位获取所在的文本偏移位置
|
329
|
-
* @param textRender
|
330
|
-
* @param x
|
331
|
-
* @returns
|
332
|
-
*/
|
333
|
-
static getTextRenderOffset(textRender: TextGroupRenderObject, x: number): number;
|
334
|
-
static getHitRenderOffset(render: LeafRenderObject, x: number): number;
|
335
|
-
static getTextRenderHorX(currRender: TextGroupRenderObject, startOffset: number, endOffset: number): {
|
336
|
-
startX: number;
|
337
|
-
endX: number;
|
338
|
-
};
|
339
|
-
/**
|
340
|
-
* 获取一个元素结尾偏移量
|
341
|
-
* 文本以字符长度进行确定
|
342
|
-
* @param ele
|
343
|
-
* @returns
|
344
|
-
*/
|
345
|
-
static getElementEndOffset(ele: LeafElement): number;
|
346
|
-
/**
|
347
|
-
* 判断当前偏移量是否是最终偏移量
|
348
|
-
* @param ele
|
349
|
-
* @param offset
|
350
|
-
*/
|
351
|
-
static isElementEndOffset(ele: LeafElement, offset: number): boolean;
|
352
|
-
/**
|
353
|
-
* 获取直接子节点的所有渲染元素
|
354
|
-
* @param ele
|
355
|
-
* @returns
|
356
|
-
*/
|
357
|
-
static getChildRenders<T extends RenderObject>(ele: BranchRenderObject): Array<T>;
|
358
|
-
/**
|
359
|
-
* 获取当前单元格内所有的段落行
|
360
|
-
* @param cell
|
361
|
-
* @returns
|
362
|
-
*/
|
363
|
-
static getCellParaLines(cell: TableCellRenderObject): Array<ParagraphLineRectRenderObject>;
|
364
|
-
static getRandomColor(seed: number): string;
|
365
|
-
static getSeedRandom(seed: number): number;
|
366
|
-
static findChildRender(render: BranchRenderObject, predicate: (child: RenderObject) => boolean): RenderObject | null;
|
367
|
-
/**
|
368
|
-
* 向上查找类型为数据元的父级
|
369
|
-
* @param ele
|
370
|
-
* @returns
|
371
|
-
*/
|
372
|
-
static getDataElement(ele: Element): DataElementInlineGroup | null;
|
373
|
-
/**
|
374
|
-
* 向上查找类型为数据元的父级
|
375
|
-
* @param ele
|
376
|
-
* @returns
|
377
|
-
*/
|
378
|
-
static getDataGroupElement(ele: Element): DataElementGroupElement | null;
|
379
|
-
static getOSPlatform(): 'Windows' | 'Mac' | 'Linux';
|
380
|
-
static getCheckboxPath(x: number, y: number, width: number, height: number): Array<Position>;
|
381
|
-
static getStrokeSvgPath(pathPoints: Array<Position> | string, stroke: string, width: number): any;
|
382
|
-
static createLine(x1: number, y1: number, x2: number, y2: number, stroke: string, width: number): any;
|
383
|
-
static getRectPath(x: number, y: number, width: number, height: number): string;
|
384
|
-
static getFillSvgPath(pathPoints: Array<Position> | string, fill: string, width: number): any;
|
385
|
-
static createSvgLine(attrs: any): any;
|
386
|
-
static createSvgPath(attrs: any): any;
|
387
|
-
static getFillSvgRect(x: number, y: number, width: number, height: number, fill: string): any;
|
388
|
-
static getMousePos(e: MouseEvent, scale?: number): Position;
|
389
|
-
static createSvgEle(sel: string, attrs: any, children?: Array<any>): any;
|
390
|
-
static createSvgText(text: string, attrs: any): any;
|
391
|
-
static createClipPath(id: string, width: number, height: number, x?: number, y?: number): any;
|
392
|
-
/**
|
393
|
-
* 判断是否光标可以设置接受编辑
|
394
|
-
* @returns
|
395
|
-
*/
|
396
|
-
static canSetCursor(startControl: LeafElement, startOffset: number, editable: boolean, viewOptions: ViewOptions): boolean;
|
397
|
-
static fixedOffset(control: LeafElement, offset: number): number;
|
398
|
-
/**
|
399
|
-
* 设置光标在数据元内容末尾
|
400
|
-
*/
|
401
|
-
static setDataElemEndFocus(ss: {
|
402
|
-
resetRange: (ele: any, offset: any) => void;
|
403
|
-
}, ele: DataElementInlineGroup): void;
|
404
|
-
static setEleAttribute(ele: Element, attr: string, value: any): void;
|
405
|
-
static getEleAttribute(ele: Element, attr: string): any;
|
406
|
-
static removeEleAttribute(ele: Element, attr: string): void;
|
407
|
-
static getMatchItems(item: Element, predicate: (item: Element) => boolean): Element<any>[];
|
408
|
-
static isDataEle(ele: Element): boolean;
|
409
|
-
}
|
410
|
-
/**
|
411
|
-
* 用于光标定位的信息
|
412
|
-
*/
|
413
|
-
interface CursorPositionInfo {
|
414
|
-
ele: LeafElement;
|
415
|
-
offset: number;
|
416
|
-
}
|
417
|
-
export {};
|
1
|
+
import { EditorContext } from "../document-context";
|
2
|
+
import { BranchElement, Element, LeafElement, Position, Rect, SelectionContentRange, ViewOptions } from "../element-define";
|
3
|
+
import { HitRegion } from "../element-event-define";
|
4
|
+
import { DataEleBaseProps, TextProps } from "../element-props";
|
5
|
+
import { DataElementInlineGroup } from "../impl/data-element/data-element-base-impl";
|
6
|
+
import { ParagraphElement, ParagraphLineRectRenderObject } from "../impl/paragraph/p-impl";
|
7
|
+
import { TableCellRenderObject } from "../impl/table/table-cell-impl";
|
8
|
+
import { TableElement, TableRenderObject } from "../impl/table/table-impl";
|
9
|
+
import { TableRowRenderObject } from "../impl/table/table-row-impl";
|
10
|
+
import { TextGroupElement, TextGroupRenderObject } from "../impl/text/text-impl";
|
11
|
+
import { TrackRunElement, TrackRunTypeEnum } from "../impl/text/track-run-impl";
|
12
|
+
import { BlockContainerRenderObject, BlockContentRenderObject, BorderType, BranchRenderObject, CursorType, InlineGroupRenderObject, LeafRenderObject, RenderObject } from "../render-define";
|
13
|
+
import { DataElementGroupElement } from "../impl";
|
14
|
+
export declare class ElementUtil {
|
15
|
+
static setCanvasProps(canvas: HTMLCanvasElement, ctx: CanvasRenderingContext2D, viewOptions: {
|
16
|
+
width: number;
|
17
|
+
height: number;
|
18
|
+
}): void;
|
19
|
+
static getDpr(): number;
|
20
|
+
static getDprNumber(val: number, scale?: number): number;
|
21
|
+
static readTextProps(dest: TextProps | null, props: TextProps | undefined, options: ViewOptions): TextProps;
|
22
|
+
static readEleBaseProps(dest: DataEleBaseProps, props: DataEleBaseProps): DataEleBaseProps;
|
23
|
+
/**
|
24
|
+
* 获取内容区域最大高度
|
25
|
+
* @param render
|
26
|
+
* @param renderHeight
|
27
|
+
* @returns
|
28
|
+
*/
|
29
|
+
static innerRectMaxHeight(render: BlockContentRenderObject, renderHeight: number): number;
|
30
|
+
/**
|
31
|
+
* 根据内框内容高度,更新外框框体高度
|
32
|
+
* @param render
|
33
|
+
* @param innerRect
|
34
|
+
*/
|
35
|
+
static updateRenderHeightByInnerRect(render: BlockContentRenderObject, innerRect: Rect): void;
|
36
|
+
/**
|
37
|
+
* 克隆框体
|
38
|
+
* @param rect
|
39
|
+
* @returns
|
40
|
+
*/
|
41
|
+
static cloneRect(rect: Rect): Rect;
|
42
|
+
/**
|
43
|
+
* 重新限定子元素以及当前高度值,并返回内边框内容高度
|
44
|
+
* @param render
|
45
|
+
* @param resetX 测量段落外框时,内框不需要重置x,因为内框已经存在对齐
|
46
|
+
* @returns
|
47
|
+
*/
|
48
|
+
static remeasure(render: BlockContainerRenderObject | BlockContentRenderObject, resetX?: boolean): number;
|
49
|
+
static remeasureTableRow(rowRender: TableRowRenderObject, forceColIndex?: number): number;
|
50
|
+
/**
|
51
|
+
* 获取表格行绘制元素的内容高度,用于缩放行高度时,获取最小内容高度,缩放的高度不能小于内容最小高度
|
52
|
+
*/
|
53
|
+
static getTableRowRenderContentHeight(rowRender: TableRowRenderObject): number;
|
54
|
+
/**
|
55
|
+
* 获取单元格内容高度
|
56
|
+
* 单元格暂不处理上下margin、padding
|
57
|
+
* @param cellRender
|
58
|
+
* @returns
|
59
|
+
*/
|
60
|
+
static getTableCellRenderContentHeight(cellRender: TableCellRenderObject): number;
|
61
|
+
/**
|
62
|
+
* 处理单元格内容纵向对齐
|
63
|
+
* @param render
|
64
|
+
*/
|
65
|
+
private static measureCellVAlign;
|
66
|
+
/**
|
67
|
+
* 设置横向排列方式
|
68
|
+
* @private
|
69
|
+
* @param render
|
70
|
+
* @param limitRect
|
71
|
+
*/
|
72
|
+
static setHorizontalAlign(render: RenderObject, limitRect: Rect): void;
|
73
|
+
/**
|
74
|
+
* 重新测量合并单元格高度
|
75
|
+
* @param tbRender
|
76
|
+
* @returns
|
77
|
+
*/
|
78
|
+
static remeasureTableMerge(tbRender: TableRenderObject): void;
|
79
|
+
/**
|
80
|
+
* 获取向下纵向合并的行
|
81
|
+
* @param render
|
82
|
+
* @param rowIndex
|
83
|
+
* @param colIndex
|
84
|
+
* @returns
|
85
|
+
*/
|
86
|
+
private static getContinueVMergeRenderRows;
|
87
|
+
/**
|
88
|
+
* 根据横向当前被合并的单元格
|
89
|
+
* @param tb
|
90
|
+
* @param rowIndex
|
91
|
+
* @param colIndex
|
92
|
+
*/
|
93
|
+
static getHorizontalRestartCellIndex(tb: TableElement, rowIndex: number, colIndex: number): number;
|
94
|
+
/**
|
95
|
+
* 根据横向当前被合并的单元格
|
96
|
+
* @param tb
|
97
|
+
* @param rowIndex
|
98
|
+
* @param colIndex
|
99
|
+
*/
|
100
|
+
static getVerticalRestartCellIndex(tb: TableElement, rowIndex: number, colIndex: number): number;
|
101
|
+
/**
|
102
|
+
* 获取合并单元格主单元格
|
103
|
+
* @param tb
|
104
|
+
* @param rowIndex
|
105
|
+
* @param colIndex
|
106
|
+
* @returns
|
107
|
+
*/
|
108
|
+
static getRestartCellPosition(tb: TableElement, rowIndex: number, colIndex: number): {
|
109
|
+
rowIndex: number;
|
110
|
+
colIndex: number;
|
111
|
+
};
|
112
|
+
/**
|
113
|
+
* 调整单元格高度填满整个行的高度
|
114
|
+
*/
|
115
|
+
private static resizeCellToFillRow;
|
116
|
+
/**
|
117
|
+
* 获取元素的全局索引位置
|
118
|
+
* @param control
|
119
|
+
* @returns
|
120
|
+
*/
|
121
|
+
static getControlIndex(control: Element): number;
|
122
|
+
static getControlIndex(control: Element, pure: boolean): number;
|
123
|
+
static getControlByIndex(control: Element, counter: {
|
124
|
+
currIndex: number;
|
125
|
+
index: number;
|
126
|
+
}, pure: boolean): Element | null;
|
127
|
+
/**
|
128
|
+
* 获取元素的全局索引位置,不统计段落符号
|
129
|
+
* @param pure
|
130
|
+
* @param control
|
131
|
+
* @returns
|
132
|
+
*/
|
133
|
+
private static _getControlIndex;
|
134
|
+
/**
|
135
|
+
* 根据全局索引位置获取元素,不统计段落符号
|
136
|
+
* @param control
|
137
|
+
* @param counter
|
138
|
+
* @returns
|
139
|
+
*/
|
140
|
+
private static _getControlByIndex;
|
141
|
+
/**
|
142
|
+
* 获取同级紧挨前方的兄弟元素
|
143
|
+
* @param element
|
144
|
+
* @returns
|
145
|
+
*/
|
146
|
+
static getPrevSiblingElement(element: Element): Element | null;
|
147
|
+
/**
|
148
|
+
* 获取同级紧挨下方的元素
|
149
|
+
* @param element
|
150
|
+
* @returns
|
151
|
+
*/
|
152
|
+
static getNextSiblingElement(element: Element): Element | null;
|
153
|
+
static getNextSiblingTrackElement(element: Element, type: TrackRunTypeEnum, userId: string): TrackRunElement | null;
|
154
|
+
static getPrevSiblingTrackElement(element: Element, type: TrackRunTypeEnum, userId: string): TrackRunElement | null;
|
155
|
+
/**
|
156
|
+
* 根据默认配置创建长文本
|
157
|
+
* @param viewOptions
|
158
|
+
* @returns
|
159
|
+
*/
|
160
|
+
static getNewTextGroup(textProps: TextProps): TextGroupElement;
|
161
|
+
static createTextProps(dest: TextProps | null, viewOptions: ViewOptions): TextProps;
|
162
|
+
/**
|
163
|
+
* 获取容器内的最小渲染元素集合
|
164
|
+
* @param parPos
|
165
|
+
* @param array
|
166
|
+
*/
|
167
|
+
static getAvailHitLeafRenderObjects(render: RenderObject, parPos: Position): Array<{
|
168
|
+
render: LeafRenderObject;
|
169
|
+
rect: Rect;
|
170
|
+
}>;
|
171
|
+
/**
|
172
|
+
* 获取容器内的最小渲染元素集合
|
173
|
+
* @param parPos
|
174
|
+
* @param array
|
175
|
+
*/
|
176
|
+
static getAvailHitRenderObjects(render: RenderObject, parPos: Position): Array<{
|
177
|
+
render: RenderObject;
|
178
|
+
rect: Rect;
|
179
|
+
}>;
|
180
|
+
/**
|
181
|
+
* 获取绘制元素的绝对位置框
|
182
|
+
*/
|
183
|
+
static getRenderObjectAbsoluteRect(render: RenderObject, parPos: Position): Rect;
|
184
|
+
/**
|
185
|
+
* 检查当前绘制元素是否属于有效点击元素
|
186
|
+
*/
|
187
|
+
static checkAvailHitRender(render: RenderObject): boolean;
|
188
|
+
/**
|
189
|
+
* 验证点击可操作性
|
190
|
+
* 主要限制页眉页脚的编辑模式
|
191
|
+
*/
|
192
|
+
static verifyHitable(sourceElement: LeafElement | null | undefined): boolean;
|
193
|
+
static getDistanceToRect(rect: Rect, point: Position): number;
|
194
|
+
/**
|
195
|
+
* 获取父级层级渲染对象
|
196
|
+
* @param render
|
197
|
+
* @returns
|
198
|
+
*/
|
199
|
+
static getParentRenders(render: RenderObject): Array<RenderObject>;
|
200
|
+
static getRenderMapElements(render: RenderObject): Array<Element>;
|
201
|
+
static getParentRender<T extends BranchRenderObject>(child: RenderObject, parentType: {
|
202
|
+
new (...args: any): T;
|
203
|
+
}): T | null;
|
204
|
+
static getParentRenderByPredicate(child: RenderObject, predicate: (item: RenderObject) => boolean): RenderObject | null;
|
205
|
+
/**
|
206
|
+
* 获取父级层级元素对象
|
207
|
+
* @param element
|
208
|
+
* @returns
|
209
|
+
*/
|
210
|
+
static getParentElements(element: Element | null | undefined): Array<Element>;
|
211
|
+
/**
|
212
|
+
* 获取最后一个子元素
|
213
|
+
* @param element
|
214
|
+
* @returns
|
215
|
+
*/
|
216
|
+
static getLastLeafElement(element: Element, predicate?: null | ((item: Element) => boolean)): LeafElement | null;
|
217
|
+
/**
|
218
|
+
* 获取第一个子元素
|
219
|
+
* @param element
|
220
|
+
* @returns
|
221
|
+
*/
|
222
|
+
static getFirstLeafElement(element: Element): LeafElement | null;
|
223
|
+
/**
|
224
|
+
* 校验两个元素是否在同一个段落中
|
225
|
+
* @param element1
|
226
|
+
* @param element2
|
227
|
+
*/
|
228
|
+
static isInSameParagraph(element1: Element, element2: Element): boolean;
|
229
|
+
static getBorderCursor(borderType: BorderType): CursorType;
|
230
|
+
static getParentByType<P extends Element, T>(child: P | null, parentType: {
|
231
|
+
new (...args: any): T;
|
232
|
+
}): T | null;
|
233
|
+
static getParent(child: Element | null, predicate: (item: Element) => boolean): Element | null;
|
234
|
+
/**
|
235
|
+
* 修正段落内容
|
236
|
+
* @returns
|
237
|
+
*/
|
238
|
+
static fixParagraphContent(control: ParagraphElement): void;
|
239
|
+
/**
|
240
|
+
* 获取绘制元素相对于整个画布的绝对位置
|
241
|
+
* 整个画布绘制的时候不一定从x=0,y=0时绘制的,下拉滚动时,上面从负y坐标开始绘制
|
242
|
+
* 如果计算某个元素相对画布的左上角的绝对坐标位置,需要childPos的y值减去translateY
|
243
|
+
* @param render
|
244
|
+
* @param refPos 参照位置
|
245
|
+
* @returns
|
246
|
+
*/
|
247
|
+
static getRenderAbsolutePaintPos(render: RenderObject, refPos?: Position | null): Position;
|
248
|
+
static getRenderAbsolutePaintRect(render: RenderObject, childPos?: Position | null): Rect;
|
249
|
+
/**
|
250
|
+
* 获取选中区域的开始区域
|
251
|
+
* @param range
|
252
|
+
* @returns
|
253
|
+
*/
|
254
|
+
static getFirstSelectedRange(range: SelectionContentRange): SelectionContentRange;
|
255
|
+
/**
|
256
|
+
* 获取选中区域的开始区域
|
257
|
+
* @param range \
|
258
|
+
* @returns
|
259
|
+
*/
|
260
|
+
static getLastSelectedRange(range: SelectionContentRange): SelectionContentRange;
|
261
|
+
/**
|
262
|
+
* 克隆选区内容
|
263
|
+
* @param range
|
264
|
+
* @param isDelete
|
265
|
+
* @returns
|
266
|
+
*/
|
267
|
+
static cloneRange(range: SelectionContentRange, isDelete: boolean, cloneMode?: 'clone' | 'source' | 'copy'): Element | null;
|
268
|
+
/**
|
269
|
+
* 获取所有的子级元素
|
270
|
+
* @param branchEle
|
271
|
+
* @returns
|
272
|
+
*/
|
273
|
+
static getChildrenElements(branchEle: BranchElement): Array<Element>;
|
274
|
+
/**
|
275
|
+
* 递归向前寻找最近的元素
|
276
|
+
* @param currElement
|
277
|
+
* @param viewOptions
|
278
|
+
* @returns
|
279
|
+
*/
|
280
|
+
static getRecursionPrevSiblingElement(currElement: Element | null, viewOptions: ViewOptions): CursorPositionInfo | null;
|
281
|
+
/**
|
282
|
+
* 递归元素里面向前寻找可以定位的元素
|
283
|
+
*/
|
284
|
+
static getRecursionSiblingElementCursorPosition(ele: Element, viewOptions: ViewOptions, direction: 'left' | 'right'): CursorPositionInfo | null;
|
285
|
+
static getElementPositionCursor(ele: LeafElement, viewOptions: ViewOptions, direction: 'left' | 'right'): CursorPositionInfo | null;
|
286
|
+
/**
|
287
|
+
* 循环向前寻找可定位的数据元
|
288
|
+
* @param currElement
|
289
|
+
*/
|
290
|
+
static getPrevDataElement(ctx: EditorContext, currElement: DataElementInlineGroup): DataElementInlineGroup | null;
|
291
|
+
/**
|
292
|
+
* 递归向后寻找最近的元素
|
293
|
+
*/
|
294
|
+
static getRecursionNextSiblingElement(currElement: Element | null, viewOptions: ViewOptions): CursorPositionInfo | null;
|
295
|
+
/**
|
296
|
+
* 获取行内最大渲染单元格高度,主要处理纵向合并单元格问题
|
297
|
+
* @param row
|
298
|
+
* @returns
|
299
|
+
*/
|
300
|
+
static getRowMaxCellHeight(row: TableRowRenderObject): number;
|
301
|
+
/**
|
302
|
+
* 校验是否为空内容
|
303
|
+
* @param ele
|
304
|
+
*/
|
305
|
+
static checkEmptyRenderContent(ele: BranchRenderObject): boolean;
|
306
|
+
/**
|
307
|
+
* 测量行内编组元素
|
308
|
+
* @param render
|
309
|
+
*/
|
310
|
+
static remeasureInlineGroupRender(render: InlineGroupRenderObject): void;
|
311
|
+
static getParaLinePos(childRender: RenderObject, childRenderPos: Position): Rect;
|
312
|
+
static getParentRenderPos(parentRender: RenderObject, childRender: RenderObject, childRenderPos: Position): Rect;
|
313
|
+
/**
|
314
|
+
* 获取绘制元素所在的区域
|
315
|
+
*/
|
316
|
+
static getRenderObjectRegion(render: RenderObject): HitRegion | undefined;
|
317
|
+
/**
|
318
|
+
* 获取文档元素所在的区域
|
319
|
+
* @param element
|
320
|
+
* @returns
|
321
|
+
*/
|
322
|
+
static getElementRegion(element: Element): HitRegion | undefined;
|
323
|
+
static getElementRegionTarget(element: Element | null): {
|
324
|
+
type: HitRegion;
|
325
|
+
target: BranchElement;
|
326
|
+
} | null;
|
327
|
+
/**
|
328
|
+
* 根据坐标系统偏移位获取所在的文本偏移位置
|
329
|
+
* @param textRender
|
330
|
+
* @param x
|
331
|
+
* @returns
|
332
|
+
*/
|
333
|
+
static getTextRenderOffset(textRender: TextGroupRenderObject, x: number): number;
|
334
|
+
static getHitRenderOffset(render: LeafRenderObject, x: number): number;
|
335
|
+
static getTextRenderHorX(currRender: TextGroupRenderObject, startOffset: number, endOffset: number): {
|
336
|
+
startX: number;
|
337
|
+
endX: number;
|
338
|
+
};
|
339
|
+
/**
|
340
|
+
* 获取一个元素结尾偏移量
|
341
|
+
* 文本以字符长度进行确定
|
342
|
+
* @param ele
|
343
|
+
* @returns
|
344
|
+
*/
|
345
|
+
static getElementEndOffset(ele: LeafElement): number;
|
346
|
+
/**
|
347
|
+
* 判断当前偏移量是否是最终偏移量
|
348
|
+
* @param ele
|
349
|
+
* @param offset
|
350
|
+
*/
|
351
|
+
static isElementEndOffset(ele: LeafElement, offset: number): boolean;
|
352
|
+
/**
|
353
|
+
* 获取直接子节点的所有渲染元素
|
354
|
+
* @param ele
|
355
|
+
* @returns
|
356
|
+
*/
|
357
|
+
static getChildRenders<T extends RenderObject>(ele: BranchRenderObject): Array<T>;
|
358
|
+
/**
|
359
|
+
* 获取当前单元格内所有的段落行
|
360
|
+
* @param cell
|
361
|
+
* @returns
|
362
|
+
*/
|
363
|
+
static getCellParaLines(cell: TableCellRenderObject): Array<ParagraphLineRectRenderObject>;
|
364
|
+
static getRandomColor(seed: number): string;
|
365
|
+
static getSeedRandom(seed: number): number;
|
366
|
+
static findChildRender(render: BranchRenderObject, predicate: (child: RenderObject) => boolean): RenderObject | null;
|
367
|
+
/**
|
368
|
+
* 向上查找类型为数据元的父级
|
369
|
+
* @param ele
|
370
|
+
* @returns
|
371
|
+
*/
|
372
|
+
static getDataElement(ele: Element): DataElementInlineGroup | null;
|
373
|
+
/**
|
374
|
+
* 向上查找类型为数据元的父级
|
375
|
+
* @param ele
|
376
|
+
* @returns
|
377
|
+
*/
|
378
|
+
static getDataGroupElement(ele: Element): DataElementGroupElement | null;
|
379
|
+
static getOSPlatform(): 'Windows' | 'Mac' | 'Linux';
|
380
|
+
static getCheckboxPath(x: number, y: number, width: number, height: number): Array<Position>;
|
381
|
+
static getStrokeSvgPath(pathPoints: Array<Position> | string, stroke: string, width: number): any;
|
382
|
+
static createLine(x1: number, y1: number, x2: number, y2: number, stroke: string, width: number): any;
|
383
|
+
static getRectPath(x: number, y: number, width: number, height: number): string;
|
384
|
+
static getFillSvgPath(pathPoints: Array<Position> | string, fill: string, width: number): any;
|
385
|
+
static createSvgLine(attrs: any): any;
|
386
|
+
static createSvgPath(attrs: any): any;
|
387
|
+
static getFillSvgRect(x: number, y: number, width: number, height: number, fill: string): any;
|
388
|
+
static getMousePos(e: MouseEvent, scale?: number): Position;
|
389
|
+
static createSvgEle(sel: string, attrs: any, children?: Array<any>): any;
|
390
|
+
static createSvgText(text: string, attrs: any): any;
|
391
|
+
static createClipPath(id: string, width: number, height: number, x?: number, y?: number): any;
|
392
|
+
/**
|
393
|
+
* 判断是否光标可以设置接受编辑
|
394
|
+
* @returns
|
395
|
+
*/
|
396
|
+
static canSetCursor(startControl: LeafElement, startOffset: number, editable: boolean, viewOptions: ViewOptions): boolean;
|
397
|
+
static fixedOffset(control: LeafElement, offset: number): number;
|
398
|
+
/**
|
399
|
+
* 设置光标在数据元内容末尾
|
400
|
+
*/
|
401
|
+
static setDataElemEndFocus(ss: {
|
402
|
+
resetRange: (ele: any, offset: any) => void;
|
403
|
+
}, ele: DataElementInlineGroup): void;
|
404
|
+
static setEleAttribute(ele: Element, attr: string, value: any): void;
|
405
|
+
static getEleAttribute(ele: Element, attr: string): any;
|
406
|
+
static removeEleAttribute(ele: Element, attr: string): void;
|
407
|
+
static getMatchItems(item: Element, predicate: (item: Element) => boolean): Element<any>[];
|
408
|
+
static isDataEle(ele: Element): boolean;
|
409
|
+
}
|
410
|
+
/**
|
411
|
+
* 用于光标定位的信息
|
412
|
+
*/
|
413
|
+
interface CursorPositionInfo {
|
414
|
+
ele: LeafElement;
|
415
|
+
offset: number;
|
416
|
+
}
|
417
|
+
export {};
|