@hailin-zheng/editor-core 2.2.42 → 2.2.43
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 +679 -679
- package/index-cjs.d.ts +32 -32
- package/index-cjs.js +24462 -24462
- package/index-cjs.js.map +1 -1
- package/index.d.ts +32 -32
- package/index.js +24462 -24462
- package/index.js.map +1 -1
- package/med_editor/doc-editor.d.ts +547 -547
- 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 +78 -78
- 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/med_editor/framework/vnode/editor-list-vnode.d.ts +18 -18
- package/package.json +18 -18
@@ -1,93 +1,93 @@
|
|
1
|
-
import { SelectionState } from "../../selection/document-selection";
|
2
|
-
import { TableElement } from "./table-impl";
|
3
|
-
/**
|
4
|
-
* 拆分单元格
|
5
|
-
* 蜀道难,难于上青天;拆分单元格,头发秃,精神衰,眼睛昏,身体废。
|
6
|
-
*
|
7
|
-
* 1.拆分为多列规则:不影响其他列宽度,将当前列宽度均分
|
8
|
-
*/
|
9
|
-
export declare class TableSplitCell {
|
10
|
-
/**
|
11
|
-
*
|
12
|
-
* 普通单元格可以任意拆分行和列
|
13
|
-
* 已合并的单元格,可以拆分任意数量的列;可以拆分的数量必须为合并单元格数量的约数
|
14
|
-
*/
|
15
|
-
static splitCell(ss: SelectionState, rows: number, cols: number): void;
|
16
|
-
/**
|
17
|
-
* 拆分普通的单元格
|
18
|
-
*/
|
19
|
-
private static splitNormalCell;
|
20
|
-
/**
|
21
|
-
* 拆分合并的单元格
|
22
|
-
* @param ss
|
23
|
-
* @param rows
|
24
|
-
* @param cols
|
25
|
-
*/
|
26
|
-
static splitMergeCell(ss: SelectionState, rows: number, cols: number): void;
|
27
|
-
/**
|
28
|
-
* 拆分横向正常的单元格
|
29
|
-
* @param ss
|
30
|
-
* @param rows
|
31
|
-
* @param cols
|
32
|
-
*/
|
33
|
-
static horSplitHorNormalCell(ss: SelectionState, rows: number, cols: number): {
|
34
|
-
startColIndex: number;
|
35
|
-
endColIndex: number;
|
36
|
-
};
|
37
|
-
/**
|
38
|
-
* 横向拆分合并的单元格
|
39
|
-
* @param ss
|
40
|
-
* @param rows
|
41
|
-
* @param cols
|
42
|
-
*/
|
43
|
-
static horSplitHorMergeCell(ss: SelectionState, rows: number, cols: number): {
|
44
|
-
startColIndex: number;
|
45
|
-
endColIndex: number;
|
46
|
-
};
|
47
|
-
/**
|
48
|
-
* 获取需要新创建的列数量
|
49
|
-
*/
|
50
|
-
private static getPrepareNewColCounts;
|
51
|
-
/**
|
52
|
-
* 应用横向拆分单元格补丁
|
53
|
-
*/
|
54
|
-
private static applyHorSplitColumnPatchPacks;
|
55
|
-
/**
|
56
|
-
* 存在横向合并的单元格,进行单元格分拆,打补丁
|
57
|
-
* @param tb
|
58
|
-
* @param focusRowIndex
|
59
|
-
* @param focusColInex
|
60
|
-
* @param splitRows
|
61
|
-
* @param packs
|
62
|
-
*/
|
63
|
-
private static applyHorSplitColumnCurrPatchPacks;
|
64
|
-
/**
|
65
|
-
* 纵向拆分合并的单元格
|
66
|
-
* 在指定行下插入复制行
|
67
|
-
* 存在
|
68
|
-
*/
|
69
|
-
private static verSplitVerMergeCell;
|
70
|
-
private static getSplitCols;
|
71
|
-
/**
|
72
|
-
* 获取横向合并的列
|
73
|
-
* @param tb
|
74
|
-
* @param currRowIndex
|
75
|
-
* @param currColIndex
|
76
|
-
* @param splitCols
|
77
|
-
*/
|
78
|
-
private static getHMergeCols;
|
79
|
-
/**
|
80
|
-
* 获取纵向合并的行数
|
81
|
-
* @param tb
|
82
|
-
* @param rowIndex
|
83
|
-
* @param colIndex
|
84
|
-
*/
|
85
|
-
static getVMergeRowsCount(tb: TableElement, rowIndex: number, colIndex: number): number;
|
86
|
-
/**
|
87
|
-
* 获取纵向合并的行数
|
88
|
-
* @param tb
|
89
|
-
* @param rowIndex
|
90
|
-
* @param colIndex
|
91
|
-
*/
|
92
|
-
static getHMergeColsCount(tb: TableElement, rowIndex: number, colIndex: number): number;
|
93
|
-
}
|
1
|
+
import { SelectionState } from "../../selection/document-selection";
|
2
|
+
import { TableElement } from "./table-impl";
|
3
|
+
/**
|
4
|
+
* 拆分单元格
|
5
|
+
* 蜀道难,难于上青天;拆分单元格,头发秃,精神衰,眼睛昏,身体废。
|
6
|
+
*
|
7
|
+
* 1.拆分为多列规则:不影响其他列宽度,将当前列宽度均分
|
8
|
+
*/
|
9
|
+
export declare class TableSplitCell {
|
10
|
+
/**
|
11
|
+
*
|
12
|
+
* 普通单元格可以任意拆分行和列
|
13
|
+
* 已合并的单元格,可以拆分任意数量的列;可以拆分的数量必须为合并单元格数量的约数
|
14
|
+
*/
|
15
|
+
static splitCell(ss: SelectionState, rows: number, cols: number): void;
|
16
|
+
/**
|
17
|
+
* 拆分普通的单元格
|
18
|
+
*/
|
19
|
+
private static splitNormalCell;
|
20
|
+
/**
|
21
|
+
* 拆分合并的单元格
|
22
|
+
* @param ss
|
23
|
+
* @param rows
|
24
|
+
* @param cols
|
25
|
+
*/
|
26
|
+
static splitMergeCell(ss: SelectionState, rows: number, cols: number): void;
|
27
|
+
/**
|
28
|
+
* 拆分横向正常的单元格
|
29
|
+
* @param ss
|
30
|
+
* @param rows
|
31
|
+
* @param cols
|
32
|
+
*/
|
33
|
+
static horSplitHorNormalCell(ss: SelectionState, rows: number, cols: number): {
|
34
|
+
startColIndex: number;
|
35
|
+
endColIndex: number;
|
36
|
+
};
|
37
|
+
/**
|
38
|
+
* 横向拆分合并的单元格
|
39
|
+
* @param ss
|
40
|
+
* @param rows
|
41
|
+
* @param cols
|
42
|
+
*/
|
43
|
+
static horSplitHorMergeCell(ss: SelectionState, rows: number, cols: number): {
|
44
|
+
startColIndex: number;
|
45
|
+
endColIndex: number;
|
46
|
+
};
|
47
|
+
/**
|
48
|
+
* 获取需要新创建的列数量
|
49
|
+
*/
|
50
|
+
private static getPrepareNewColCounts;
|
51
|
+
/**
|
52
|
+
* 应用横向拆分单元格补丁
|
53
|
+
*/
|
54
|
+
private static applyHorSplitColumnPatchPacks;
|
55
|
+
/**
|
56
|
+
* 存在横向合并的单元格,进行单元格分拆,打补丁
|
57
|
+
* @param tb
|
58
|
+
* @param focusRowIndex
|
59
|
+
* @param focusColInex
|
60
|
+
* @param splitRows
|
61
|
+
* @param packs
|
62
|
+
*/
|
63
|
+
private static applyHorSplitColumnCurrPatchPacks;
|
64
|
+
/**
|
65
|
+
* 纵向拆分合并的单元格
|
66
|
+
* 在指定行下插入复制行
|
67
|
+
* 存在
|
68
|
+
*/
|
69
|
+
private static verSplitVerMergeCell;
|
70
|
+
private static getSplitCols;
|
71
|
+
/**
|
72
|
+
* 获取横向合并的列
|
73
|
+
* @param tb
|
74
|
+
* @param currRowIndex
|
75
|
+
* @param currColIndex
|
76
|
+
* @param splitCols
|
77
|
+
*/
|
78
|
+
private static getHMergeCols;
|
79
|
+
/**
|
80
|
+
* 获取纵向合并的行数
|
81
|
+
* @param tb
|
82
|
+
* @param rowIndex
|
83
|
+
* @param colIndex
|
84
|
+
*/
|
85
|
+
static getVMergeRowsCount(tb: TableElement, rowIndex: number, colIndex: number): number;
|
86
|
+
/**
|
87
|
+
* 获取纵向合并的行数
|
88
|
+
* @param tb
|
89
|
+
* @param rowIndex
|
90
|
+
* @param colIndex
|
91
|
+
*/
|
92
|
+
static getHMergeColsCount(tb: TableElement, rowIndex: number, colIndex: number): number;
|
93
|
+
}
|
@@ -1,180 +1,180 @@
|
|
1
|
-
import { SelectionState } from "../../selection/document-selection";
|
2
|
-
import { Element } from "../../element-define";
|
3
|
-
import { TableCellElement } from "./table-cell-impl";
|
4
|
-
import { TableElement } from "./table-impl";
|
5
|
-
import { TableRowElement } from "./table-row-impl";
|
6
|
-
import { CellDiagonal } from "../../element-props";
|
7
|
-
export declare class TableUtil {
|
8
|
-
static canDeleteTable(ss: SelectionState): boolean;
|
9
|
-
/**
|
10
|
-
* 校验当前选区是否可以执行合并单元格操作
|
11
|
-
* @param ss
|
12
|
-
* @returns
|
13
|
-
*/
|
14
|
-
static canMergeCells(ss: SelectionState): boolean;
|
15
|
-
/**
|
16
|
-
* 获取横向合并当前单元格合并结束索引位置
|
17
|
-
* @param tb
|
18
|
-
* @param rowIndex
|
19
|
-
* @param colIndex
|
20
|
-
*/
|
21
|
-
static getHMergeEndIndex(tb: TableElement, rowIndex: number, colIndex: number): number;
|
22
|
-
/**
|
23
|
-
* 获取横向合并当前单元格合并开始索引位置
|
24
|
-
* @param tb
|
25
|
-
* @param rowIndex
|
26
|
-
* @param colIndex
|
27
|
-
*/
|
28
|
-
static getHMergeStartIndex(tb: TableElement, rowIndex: number, colIndex: number): number;
|
29
|
-
/**
|
30
|
-
* 获取纵向合并当前单元格合并结束索引位置
|
31
|
-
* @param tb
|
32
|
-
* @param rowIndex
|
33
|
-
* @param colIndex i
|
34
|
-
*/
|
35
|
-
static getVMergeEndIndex(tb: TableElement, rowIndex: number, colIndex: number): number;
|
36
|
-
/**
|
37
|
-
* 获取纵向合并当前单元格合并开始索引位置
|
38
|
-
* @param tb
|
39
|
-
* @param rowIndex
|
40
|
-
* @param colIndex i
|
41
|
-
*/
|
42
|
-
static getVMergeStartIndex(tb: TableElement, rowIndex: number, colIndex: number): number;
|
43
|
-
/**
|
44
|
-
* 合并单元格
|
45
|
-
* @param ss
|
46
|
-
* @returns
|
47
|
-
*/
|
48
|
-
static mergeCells(ss: SelectionState): void;
|
49
|
-
/**
|
50
|
-
* 在合并单元格后需要校验
|
51
|
-
* 1.如果某个行的所有单元格都不是normal,则需要删除当前行
|
52
|
-
* 2.如果某个列的所有的单元格都不是normal,则需要删除当前列
|
53
|
-
*/
|
54
|
-
private static checkRowBeMerged;
|
55
|
-
/**
|
56
|
-
* 移除行
|
57
|
-
* @param row
|
58
|
-
*/
|
59
|
-
private static removeRow;
|
60
|
-
/**
|
61
|
-
* 移除列
|
62
|
-
* @param tb
|
63
|
-
* @param colIndex
|
64
|
-
*/
|
65
|
-
private static removeCol;
|
66
|
-
/**
|
67
|
-
* 移除光标所在的当前行
|
68
|
-
* @param ss
|
69
|
-
*/
|
70
|
-
static removeCurrRow(ss: SelectionState): void;
|
71
|
-
/**
|
72
|
-
* 移除光标所在的当前列
|
73
|
-
* @param ss
|
74
|
-
*/
|
75
|
-
static removeCurrCol(ss: SelectionState): void;
|
76
|
-
/**
|
77
|
-
* 合并单元格
|
78
|
-
*/
|
79
|
-
static combineCells(tbElement: TableElement, startCell: TableCellElement, endCell: TableCellElement): void;
|
80
|
-
static canSplitCell(ss: SelectionState): boolean;
|
81
|
-
/**
|
82
|
-
* 将合并的单元格合并还原
|
83
|
-
* @param ss
|
84
|
-
*/
|
85
|
-
static restoreCell(ss: SelectionState): void;
|
86
|
-
private static restoreCellMerge;
|
87
|
-
private static getVMergeRows;
|
88
|
-
static insertCol(ss: SelectionState, insertColIndex: number): void;
|
89
|
-
/**
|
90
|
-
* 在指定位置插入行
|
91
|
-
* 动作:在指定行上方或者下方插入行
|
92
|
-
* 原则:插入的行单元格尽量不纵向合并
|
93
|
-
* @param ss
|
94
|
-
* @param insertRowIndex
|
95
|
-
*/
|
96
|
-
static insertRow(ss: SelectionState, insertRowIndex: number): TableRowElement;
|
97
|
-
/**
|
98
|
-
* 在指定位置插入新行
|
99
|
-
* @param tb
|
100
|
-
* @param insertRowIndex
|
101
|
-
*/
|
102
|
-
static insertNewRow(tb: TableElement, insertRowIndex: number): TableRowElement;
|
103
|
-
/**
|
104
|
-
* 在下方插入行
|
105
|
-
*/
|
106
|
-
static insertRowBelow(ss: SelectionState): void;
|
107
|
-
/**
|
108
|
-
* 在上方插入行
|
109
|
-
*/
|
110
|
-
static insertRowAbove(ss: SelectionState): void;
|
111
|
-
/**
|
112
|
-
* 在右侧插入列
|
113
|
-
*/
|
114
|
-
static insertColToRight(ss: SelectionState): void;
|
115
|
-
/**
|
116
|
-
* 在左侧插入列
|
117
|
-
*/
|
118
|
-
static insertColToLeft(ss: SelectionState): void;
|
119
|
-
/**
|
120
|
-
* 跳转到下一个单元格中
|
121
|
-
* @param ss
|
122
|
-
*/
|
123
|
-
static moveNextCell(ss: SelectionState): void;
|
124
|
-
/**
|
125
|
-
* 获取下一个可定位的单元格
|
126
|
-
* @param ss
|
127
|
-
* @returns
|
128
|
-
*/
|
129
|
-
static getNextCell(ss: SelectionState): TableCellElement | undefined;
|
130
|
-
/**
|
131
|
-
* 当前光标是否在最后一个单元格中
|
132
|
-
*/
|
133
|
-
static isLastVisiableCell(ss: SelectionState): boolean;
|
134
|
-
/**
|
135
|
-
* 移除当前table
|
136
|
-
*/
|
137
|
-
static removeTable(ss: SelectionState): void;
|
138
|
-
/**
|
139
|
-
* 设置表格单元格对角线
|
140
|
-
* @param ss
|
141
|
-
* @param diagonal
|
142
|
-
* @returns
|
143
|
-
*/
|
144
|
-
static setTableCellDiagonal(ss: SelectionState, diagonal: CellDiagonal): void;
|
145
|
-
/**
|
146
|
-
* 将当前表格截断成两个相邻的表格
|
147
|
-
* @param tb
|
148
|
-
* @param rowIndex
|
149
|
-
*/
|
150
|
-
static cutTable(tb: TableElement, rowIndex: number): void;
|
151
|
-
/**
|
152
|
-
* 获取表格选区区域最大的矩形区域
|
153
|
-
* @param tb
|
154
|
-
* @param startCell
|
155
|
-
* @param endCell
|
156
|
-
* @returns
|
157
|
-
*/
|
158
|
-
static getTableRectSelectedRegion(tb: TableElement, startCell: TableCellElement, endCell: TableCellElement): ITableSelectedRegion;
|
159
|
-
static createTable(rows: number, cols: number, ss: SelectionState): TableElement;
|
160
|
-
/**
|
161
|
-
* 计算表格列,用于新增表格的时候生成列
|
162
|
-
*/
|
163
|
-
static calcTableColsWidth(cols: Array<string | number>, tbWidth: number): Array<number>;
|
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;
|
174
|
-
}
|
175
|
-
export interface ITableSelectedRegion {
|
176
|
-
startRow: number;
|
177
|
-
endRow: number;
|
178
|
-
startCol: number;
|
179
|
-
endCol: number;
|
180
|
-
}
|
1
|
+
import { SelectionState } from "../../selection/document-selection";
|
2
|
+
import { Element } from "../../element-define";
|
3
|
+
import { TableCellElement } from "./table-cell-impl";
|
4
|
+
import { TableElement } from "./table-impl";
|
5
|
+
import { TableRowElement } from "./table-row-impl";
|
6
|
+
import { CellDiagonal } from "../../element-props";
|
7
|
+
export declare class TableUtil {
|
8
|
+
static canDeleteTable(ss: SelectionState): boolean;
|
9
|
+
/**
|
10
|
+
* 校验当前选区是否可以执行合并单元格操作
|
11
|
+
* @param ss
|
12
|
+
* @returns
|
13
|
+
*/
|
14
|
+
static canMergeCells(ss: SelectionState): boolean;
|
15
|
+
/**
|
16
|
+
* 获取横向合并当前单元格合并结束索引位置
|
17
|
+
* @param tb
|
18
|
+
* @param rowIndex
|
19
|
+
* @param colIndex
|
20
|
+
*/
|
21
|
+
static getHMergeEndIndex(tb: TableElement, rowIndex: number, colIndex: number): number;
|
22
|
+
/**
|
23
|
+
* 获取横向合并当前单元格合并开始索引位置
|
24
|
+
* @param tb
|
25
|
+
* @param rowIndex
|
26
|
+
* @param colIndex
|
27
|
+
*/
|
28
|
+
static getHMergeStartIndex(tb: TableElement, rowIndex: number, colIndex: number): number;
|
29
|
+
/**
|
30
|
+
* 获取纵向合并当前单元格合并结束索引位置
|
31
|
+
* @param tb
|
32
|
+
* @param rowIndex
|
33
|
+
* @param colIndex i
|
34
|
+
*/
|
35
|
+
static getVMergeEndIndex(tb: TableElement, rowIndex: number, colIndex: number): number;
|
36
|
+
/**
|
37
|
+
* 获取纵向合并当前单元格合并开始索引位置
|
38
|
+
* @param tb
|
39
|
+
* @param rowIndex
|
40
|
+
* @param colIndex i
|
41
|
+
*/
|
42
|
+
static getVMergeStartIndex(tb: TableElement, rowIndex: number, colIndex: number): number;
|
43
|
+
/**
|
44
|
+
* 合并单元格
|
45
|
+
* @param ss
|
46
|
+
* @returns
|
47
|
+
*/
|
48
|
+
static mergeCells(ss: SelectionState): void;
|
49
|
+
/**
|
50
|
+
* 在合并单元格后需要校验
|
51
|
+
* 1.如果某个行的所有单元格都不是normal,则需要删除当前行
|
52
|
+
* 2.如果某个列的所有的单元格都不是normal,则需要删除当前列
|
53
|
+
*/
|
54
|
+
private static checkRowBeMerged;
|
55
|
+
/**
|
56
|
+
* 移除行
|
57
|
+
* @param row
|
58
|
+
*/
|
59
|
+
private static removeRow;
|
60
|
+
/**
|
61
|
+
* 移除列
|
62
|
+
* @param tb
|
63
|
+
* @param colIndex
|
64
|
+
*/
|
65
|
+
private static removeCol;
|
66
|
+
/**
|
67
|
+
* 移除光标所在的当前行
|
68
|
+
* @param ss
|
69
|
+
*/
|
70
|
+
static removeCurrRow(ss: SelectionState): void;
|
71
|
+
/**
|
72
|
+
* 移除光标所在的当前列
|
73
|
+
* @param ss
|
74
|
+
*/
|
75
|
+
static removeCurrCol(ss: SelectionState): void;
|
76
|
+
/**
|
77
|
+
* 合并单元格
|
78
|
+
*/
|
79
|
+
static combineCells(tbElement: TableElement, startCell: TableCellElement, endCell: TableCellElement): void;
|
80
|
+
static canSplitCell(ss: SelectionState): boolean;
|
81
|
+
/**
|
82
|
+
* 将合并的单元格合并还原
|
83
|
+
* @param ss
|
84
|
+
*/
|
85
|
+
static restoreCell(ss: SelectionState): void;
|
86
|
+
private static restoreCellMerge;
|
87
|
+
private static getVMergeRows;
|
88
|
+
static insertCol(ss: SelectionState, insertColIndex: number): void;
|
89
|
+
/**
|
90
|
+
* 在指定位置插入行
|
91
|
+
* 动作:在指定行上方或者下方插入行
|
92
|
+
* 原则:插入的行单元格尽量不纵向合并
|
93
|
+
* @param ss
|
94
|
+
* @param insertRowIndex
|
95
|
+
*/
|
96
|
+
static insertRow(ss: SelectionState, insertRowIndex: number): TableRowElement;
|
97
|
+
/**
|
98
|
+
* 在指定位置插入新行
|
99
|
+
* @param tb
|
100
|
+
* @param insertRowIndex
|
101
|
+
*/
|
102
|
+
static insertNewRow(tb: TableElement, insertRowIndex: number): TableRowElement;
|
103
|
+
/**
|
104
|
+
* 在下方插入行
|
105
|
+
*/
|
106
|
+
static insertRowBelow(ss: SelectionState): void;
|
107
|
+
/**
|
108
|
+
* 在上方插入行
|
109
|
+
*/
|
110
|
+
static insertRowAbove(ss: SelectionState): void;
|
111
|
+
/**
|
112
|
+
* 在右侧插入列
|
113
|
+
*/
|
114
|
+
static insertColToRight(ss: SelectionState): void;
|
115
|
+
/**
|
116
|
+
* 在左侧插入列
|
117
|
+
*/
|
118
|
+
static insertColToLeft(ss: SelectionState): void;
|
119
|
+
/**
|
120
|
+
* 跳转到下一个单元格中
|
121
|
+
* @param ss
|
122
|
+
*/
|
123
|
+
static moveNextCell(ss: SelectionState): void;
|
124
|
+
/**
|
125
|
+
* 获取下一个可定位的单元格
|
126
|
+
* @param ss
|
127
|
+
* @returns
|
128
|
+
*/
|
129
|
+
static getNextCell(ss: SelectionState): TableCellElement | undefined;
|
130
|
+
/**
|
131
|
+
* 当前光标是否在最后一个单元格中
|
132
|
+
*/
|
133
|
+
static isLastVisiableCell(ss: SelectionState): boolean;
|
134
|
+
/**
|
135
|
+
* 移除当前table
|
136
|
+
*/
|
137
|
+
static removeTable(ss: SelectionState): void;
|
138
|
+
/**
|
139
|
+
* 设置表格单元格对角线
|
140
|
+
* @param ss
|
141
|
+
* @param diagonal
|
142
|
+
* @returns
|
143
|
+
*/
|
144
|
+
static setTableCellDiagonal(ss: SelectionState, diagonal: CellDiagonal): void;
|
145
|
+
/**
|
146
|
+
* 将当前表格截断成两个相邻的表格
|
147
|
+
* @param tb
|
148
|
+
* @param rowIndex
|
149
|
+
*/
|
150
|
+
static cutTable(tb: TableElement, rowIndex: number): void;
|
151
|
+
/**
|
152
|
+
* 获取表格选区区域最大的矩形区域
|
153
|
+
* @param tb
|
154
|
+
* @param startCell
|
155
|
+
* @param endCell
|
156
|
+
* @returns
|
157
|
+
*/
|
158
|
+
static getTableRectSelectedRegion(tb: TableElement, startCell: TableCellElement, endCell: TableCellElement): ITableSelectedRegion;
|
159
|
+
static createTable(rows: number, cols: number, ss: SelectionState): TableElement;
|
160
|
+
/**
|
161
|
+
* 计算表格列,用于新增表格的时候生成列
|
162
|
+
*/
|
163
|
+
static calcTableColsWidth(cols: Array<string | number>, tbWidth: number): Array<number>;
|
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;
|
174
|
+
}
|
175
|
+
export interface ITableSelectedRegion {
|
176
|
+
startRow: number;
|
177
|
+
endRow: number;
|
178
|
+
startCol: number;
|
179
|
+
endCol: number;
|
180
|
+
}
|
@@ -1,34 +1,34 @@
|
|
1
|
-
import { TextProps } from "../../element-props";
|
2
|
-
import { IEditorVNodeOptions, LeafRenderObject, RenderObject } from "../../render-define";
|
3
|
-
import { LeafElement, ElementFactory, Element, SerializeProps, ViewOptions, ICreateRenderData } from "../../element-define";
|
4
|
-
import { TextUnits } from "../../render-context";
|
5
|
-
export declare class TextGroupElement extends LeafElement<TextProps> {
|
6
|
-
textMeasures: Array<TextUnits>;
|
7
|
-
isMeasure: boolean;
|
8
|
-
constructor();
|
9
|
-
set text(val: string);
|
10
|
-
splice(index: number, deleteCount: number, addText?: string | null): Array<TextUnits>;
|
11
|
-
get text(): string;
|
12
|
-
createRenderObject(data: ICreateRenderData): RenderObject;
|
13
|
-
serialize(viewOptions: ViewOptions): SerializeProps & any;
|
14
|
-
clone(data: boolean): TextGroupElement;
|
15
|
-
destroy(): void;
|
16
|
-
spliceText(startOffset: number, endOffset: number, xCopy: boolean): TextGroupElement | null;
|
17
|
-
/**
|
18
|
-
* 修改样式
|
19
|
-
* @param format
|
20
|
-
*/
|
21
|
-
setFormat(format: Partial<TextProps>): void;
|
22
|
-
clearTextCache(): void;
|
23
|
-
}
|
24
|
-
export declare class TextGroupRenderObject extends LeafRenderObject<TextGroupElement> {
|
25
|
-
textMeasures: Array<TextUnits>;
|
26
|
-
constructor(element: TextGroupElement);
|
27
|
-
clone(): RenderObject;
|
28
|
-
measure(): void;
|
29
|
-
exportSVG(event: IEditorVNodeOptions): any;
|
30
|
-
}
|
31
|
-
export declare class TextGroupFactory extends ElementFactory<TextProps> {
|
32
|
-
match(type: string): boolean;
|
33
|
-
createElement(data: any): Element;
|
34
|
-
}
|
1
|
+
import { TextProps } from "../../element-props";
|
2
|
+
import { IEditorVNodeOptions, LeafRenderObject, RenderObject } from "../../render-define";
|
3
|
+
import { LeafElement, ElementFactory, Element, SerializeProps, ViewOptions, ICreateRenderData } from "../../element-define";
|
4
|
+
import { TextUnits } from "../../render-context";
|
5
|
+
export declare class TextGroupElement extends LeafElement<TextProps> {
|
6
|
+
textMeasures: Array<TextUnits>;
|
7
|
+
isMeasure: boolean;
|
8
|
+
constructor();
|
9
|
+
set text(val: string);
|
10
|
+
splice(index: number, deleteCount: number, addText?: string | null): Array<TextUnits>;
|
11
|
+
get text(): string;
|
12
|
+
createRenderObject(data: ICreateRenderData): RenderObject;
|
13
|
+
serialize(viewOptions: ViewOptions): SerializeProps & any;
|
14
|
+
clone(data: boolean): TextGroupElement;
|
15
|
+
destroy(): void;
|
16
|
+
spliceText(startOffset: number, endOffset: number, xCopy: boolean): TextGroupElement | null;
|
17
|
+
/**
|
18
|
+
* 修改样式
|
19
|
+
* @param format
|
20
|
+
*/
|
21
|
+
setFormat(format: Partial<TextProps>): void;
|
22
|
+
clearTextCache(): void;
|
23
|
+
}
|
24
|
+
export declare class TextGroupRenderObject extends LeafRenderObject<TextGroupElement> {
|
25
|
+
textMeasures: Array<TextUnits>;
|
26
|
+
constructor(element: TextGroupElement);
|
27
|
+
clone(): RenderObject;
|
28
|
+
measure(): void;
|
29
|
+
exportSVG(event: IEditorVNodeOptions): any;
|
30
|
+
}
|
31
|
+
export declare class TextGroupFactory extends ElementFactory<TextProps> {
|
32
|
+
match(type: string): boolean;
|
33
|
+
createElement(data: any): Element;
|
34
|
+
}
|
@@ -1,27 +1,27 @@
|
|
1
|
-
import { Element, ElementFactory, ICreateRenderData, InlineGroupElement, readElementProps, SerializeProps, ViewOptions } from "../../element-define";
|
2
|
-
import { IEditorVNodeOptions, InlineGroupRenderObject, RenderObject } from "../../render-define";
|
3
|
-
import { TrackRunProps } from "../../element-props";
|
4
|
-
export declare enum TrackRunTypeEnum {
|
5
|
-
Inserted = "ins-run",
|
6
|
-
Deleted = "del-run"
|
7
|
-
}
|
8
|
-
declare type NullableType<T> = T | null;
|
9
|
-
export declare class TrackRunElement extends InlineGroupElement<TrackRunProps> {
|
10
|
-
gotFocus: boolean;
|
11
|
-
constructor(trackType: TrackRunTypeEnum);
|
12
|
-
clone(data: boolean): Element;
|
13
|
-
createRenderObject(data: ICreateRenderData): NullableType<RenderObject>;
|
14
|
-
serialize(viewOptions: ViewOptions): SerializeProps | null;
|
15
|
-
split(index: number): TrackRunElement | null;
|
16
|
-
}
|
17
|
-
export declare class TrackRunRenderObject extends InlineGroupRenderObject<TrackRunElement> {
|
18
|
-
constructor(ele: TrackRunElement);
|
19
|
-
exportSVG(event: IEditorVNodeOptions): any;
|
20
|
-
private createModifyTips;
|
21
|
-
clone(): RenderObject;
|
22
|
-
}
|
23
|
-
export declare class RunElementFactory extends ElementFactory<TrackRunProps> {
|
24
|
-
createElement(data: readElementProps<TrackRunProps>): TrackRunElement;
|
25
|
-
match(type: string): boolean;
|
26
|
-
}
|
27
|
-
export {};
|
1
|
+
import { Element, ElementFactory, ICreateRenderData, InlineGroupElement, readElementProps, SerializeProps, ViewOptions } from "../../element-define";
|
2
|
+
import { IEditorVNodeOptions, InlineGroupRenderObject, RenderObject } from "../../render-define";
|
3
|
+
import { TrackRunProps } from "../../element-props";
|
4
|
+
export declare enum TrackRunTypeEnum {
|
5
|
+
Inserted = "ins-run",
|
6
|
+
Deleted = "del-run"
|
7
|
+
}
|
8
|
+
declare type NullableType<T> = T | null;
|
9
|
+
export declare class TrackRunElement extends InlineGroupElement<TrackRunProps> {
|
10
|
+
gotFocus: boolean;
|
11
|
+
constructor(trackType: TrackRunTypeEnum);
|
12
|
+
clone(data: boolean): Element;
|
13
|
+
createRenderObject(data: ICreateRenderData): NullableType<RenderObject>;
|
14
|
+
serialize(viewOptions: ViewOptions): SerializeProps | null;
|
15
|
+
split(index: number): TrackRunElement | null;
|
16
|
+
}
|
17
|
+
export declare class TrackRunRenderObject extends InlineGroupRenderObject<TrackRunElement> {
|
18
|
+
constructor(ele: TrackRunElement);
|
19
|
+
exportSVG(event: IEditorVNodeOptions): any;
|
20
|
+
private createModifyTips;
|
21
|
+
clone(): RenderObject;
|
22
|
+
}
|
23
|
+
export declare class RunElementFactory extends ElementFactory<TrackRunProps> {
|
24
|
+
createElement(data: readElementProps<TrackRunProps>): TrackRunElement;
|
25
|
+
match(type: string): boolean;
|
26
|
+
}
|
27
|
+
export {};
|