@hailin-zheng/editor-core 2.0.14 → 2.0.16
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/index-cjs.js +204 -84
- package/index-cjs.js.map +1 -1
- package/index.js +204 -84
- package/index.js.map +1 -1
- package/med_editor/doc-editor.d.ts +4 -2
- package/med_editor/framework/document-event.d.ts +8 -0
- package/med_editor/framework/document-template.d.ts +9 -0
- package/med_editor/framework/element-util.d.ts +6 -0
- package/med_editor/framework/impl/table/table-util.d.ts +10 -0
- package/package.json +1 -1
- package/med_editor/framework/document-restriction.d.ts +0 -17
@@ -187,8 +187,9 @@ export declare class DocEditor {
|
|
187
187
|
/**
|
188
188
|
* 新建文档
|
189
189
|
* @param doc
|
190
|
+
* @param name
|
190
191
|
*/
|
191
|
-
createNewDoc(doc?: DocumentElement | null): void;
|
192
|
+
createNewDoc(doc?: DocumentElement | null, name?: string): void;
|
192
193
|
destroy(): void;
|
193
194
|
/**
|
194
195
|
* 获取选区文本属性
|
@@ -282,7 +283,8 @@ export declare class DocEditor {
|
|
282
283
|
* @param width
|
283
284
|
* @param height
|
284
285
|
*/
|
285
|
-
setPaperSize(width:
|
286
|
+
setPaperSize(width: string): any;
|
287
|
+
setPaperSize(width: number, height: number): any;
|
286
288
|
/**
|
287
289
|
* 显示当前元素到视图中
|
288
290
|
* @param element
|
@@ -208,10 +208,18 @@ export declare class DocumentEvent {
|
|
208
208
|
* 向左移动光标
|
209
209
|
*/
|
210
210
|
moveCursorToLeft(): void;
|
211
|
+
/**
|
212
|
+
* 向左移动光标处理函数
|
213
|
+
* @param startControl
|
214
|
+
* @param startOffset
|
215
|
+
* @private
|
216
|
+
*/
|
217
|
+
private moveCursorToLeftHandle;
|
211
218
|
/**
|
212
219
|
* 向右移动光标
|
213
220
|
*/
|
214
221
|
moveCursorToRight(): void;
|
222
|
+
moveCursorToRightHandle(startControl: LeafElement, startOffset: number): void;
|
215
223
|
/**
|
216
224
|
* 向上移动光标
|
217
225
|
*/
|
@@ -1,4 +1,13 @@
|
|
1
1
|
import { DocumentElement } from "./impl/document/doc-impl";
|
2
2
|
export declare class DocumentTemplate {
|
3
3
|
static createA4Doc(): DocumentElement;
|
4
|
+
static createDoc(name?: string): DocumentElement;
|
5
|
+
static getPaper(name: string): {
|
6
|
+
width: number;
|
7
|
+
height: number;
|
8
|
+
top: number;
|
9
|
+
left: number;
|
10
|
+
right: number;
|
11
|
+
bottom: number;
|
12
|
+
};
|
4
13
|
}
|
@@ -396,5 +396,11 @@ export declare class ElementUtil {
|
|
396
396
|
static getFillSvgRect(x: number, y: number, width: number, height: number, fill: string): any;
|
397
397
|
static getMousePos(e: MouseEvent): Position;
|
398
398
|
static createClipPath(id: string, width: number, height: number, x?: number, y?: number): any;
|
399
|
+
/**
|
400
|
+
* 判断是否光标可以设置接受编辑
|
401
|
+
* @returns
|
402
|
+
*/
|
403
|
+
static canSetCursor(startControl: LeafElement, startOffset: number, editable: boolean, viewOptions: ViewOptions): boolean;
|
404
|
+
static fixedOffset(control: LeafElement, offset: number): number;
|
399
405
|
}
|
400
406
|
export {};
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { SelectionState } from "../../document-selection";
|
2
|
+
import { Element } from "../../element-define";
|
2
3
|
import { TableCellElement } from "./table-cell-impl";
|
3
4
|
import { TableElement } from "./table-impl";
|
4
5
|
import { TableRowElement } from "./table-row-impl";
|
@@ -161,6 +162,15 @@ export declare class TableUtil {
|
|
161
162
|
*/
|
162
163
|
static calcTableColsWidth(cols: Array<string | number>, tbWidth: number): Array<number>;
|
163
164
|
static setTableCellBgColorAtSelection(ss: SelectionState, bgColor: string): void;
|
165
|
+
static getTableData(tb: TableElement): any;
|
166
|
+
/**
|
167
|
+
* 获取单元格内的数据元的值
|
168
|
+
* @param target
|
169
|
+
*/
|
170
|
+
static getCellData(target: Element): {
|
171
|
+
id: string;
|
172
|
+
value: any;
|
173
|
+
} | null;
|
164
174
|
}
|
165
175
|
export interface ITableSelectedRegion {
|
166
176
|
startRow: number;
|
package/package.json
CHANGED
@@ -1,17 +0,0 @@
|
|
1
|
-
import { Element } from "./element-define";
|
2
|
-
/**
|
3
|
-
* 文档结构冲突的规则
|
4
|
-
* 限定某些结构下面能包含什么以及不能包含什么
|
5
|
-
* 例如,向文档粘贴时,不能在数据元中粘贴数据元或者数据组
|
6
|
-
*/
|
7
|
-
export declare class DocumentStriction {
|
8
|
-
rules: Array<IDocStrictionRules>;
|
9
|
-
constructor();
|
10
|
-
}
|
11
|
-
declare type CheckCondition = Element | ((ele: Element) => boolean);
|
12
|
-
export interface IDocStrictionRules {
|
13
|
-
match: (item: Element) => boolean;
|
14
|
-
include: Array<CheckCondition>;
|
15
|
-
exclude: Array<CheckCondition>;
|
16
|
-
}
|
17
|
-
export {};
|