@hailin-zheng/editor-core 1.1.15 → 1.1.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 +26 -2
- package/index-cjs.js.map +1 -1
- package/index.js +26 -2
- package/index.js.map +1 -1
- package/med_editor/framework/impl/table/table-row-impl.d.ts +5 -0
- package/package.json +1 -1
package/index-cjs.js
CHANGED
@@ -1337,6 +1337,7 @@ class BranchElement extends Element {
|
|
1337
1337
|
}
|
1338
1338
|
}
|
1339
1339
|
function clearChildrenRenderCache(ele) {
|
1340
|
+
ele.cacheRender = null;
|
1340
1341
|
for (let i = 0; i < ele.length; i++) {
|
1341
1342
|
const curr = ele.getChild(i);
|
1342
1343
|
curr.cacheRender = null;
|
@@ -3963,12 +3964,33 @@ class TableRowElement extends BlockContainerElement {
|
|
3963
3964
|
//在差异更新中,由于行内单元格存在合并行的情况,需要将当前行内存在合并的单元格,将其修改标志改为修改
|
3964
3965
|
const changeSub = this.onChangeSubject.subscribe(() => {
|
3965
3966
|
if (this.modifyFlag === exports.ModifyFlag.Track) {
|
3966
|
-
|
3967
|
+
this.checkRowModifyState();
|
3967
3968
|
this.pubOnChange('to-child');
|
3968
3969
|
}
|
3969
3970
|
});
|
3970
3971
|
this.addsubscribe(this, changeSub);
|
3971
3972
|
}
|
3973
|
+
/**
|
3974
|
+
* 解决纵向合并行的行缓存高度bug
|
3975
|
+
* @private
|
3976
|
+
*/
|
3977
|
+
checkRowModifyState() {
|
3978
|
+
const tb = ElementUtil.getParentByType(this, TableElement);
|
3979
|
+
if (!tb) {
|
3980
|
+
return;
|
3981
|
+
}
|
3982
|
+
const currRowIndex = this.getIndex();
|
3983
|
+
for (let i = 0; i < this.length; i++) {
|
3984
|
+
const cell = this.getChild(i);
|
3985
|
+
if (cell.props.vMerge === 'continue') {
|
3986
|
+
const endRowIndex = TableUtil.getVMergeEndIndex(tb, currRowIndex, i);
|
3987
|
+
const startRowIndex = TableUtil.getVMergeStartIndex(tb, currRowIndex, i);
|
3988
|
+
for (let j = startRowIndex; j <= endRowIndex; j++) {
|
3989
|
+
clearChildrenRenderCache(tb.getChild(j));
|
3990
|
+
}
|
3991
|
+
}
|
3992
|
+
}
|
3993
|
+
}
|
3972
3994
|
createRenderObject() {
|
3973
3995
|
return new TableRowRenderObject(this);
|
3974
3996
|
}
|
@@ -5143,7 +5165,7 @@ class TextGroupElement extends LeafElement {
|
|
5143
5165
|
* @param format
|
5144
5166
|
*/
|
5145
5167
|
setFormat(format) {
|
5146
|
-
formatEle(this, format);
|
5168
|
+
//History.formatEle(this, format);
|
5147
5169
|
Object.keys(format).forEach(key => {
|
5148
5170
|
this.props[key] = format[key];
|
5149
5171
|
});
|
@@ -9253,7 +9275,9 @@ class TableSplitCell {
|
|
9253
9275
|
if (rows === 1 && cols === 1) {
|
9254
9276
|
return;
|
9255
9277
|
}
|
9278
|
+
//获取当前单元格
|
9256
9279
|
const focusCell = ElementUtil.getParentByType(ss.startControl, TableCellElement);
|
9280
|
+
//获取当前行
|
9257
9281
|
const focusRow = ElementUtil.getParentByType(focusCell, TableRowElement);
|
9258
9282
|
const tb = ElementUtil.getParentByType(focusRow, TableElement);
|
9259
9283
|
if (!focusCell || !focusRow || !tb) {
|