@hailin-zheng/editor-core 1.1.13 → 1.1.15
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 +4 -3
- package/index-cjs.js.map +1 -1
- package/index.js +4 -3
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
@@ -9016,7 +9016,7 @@ class ColumnPatchUtil {
|
|
9016
9016
|
//要分割的列坐标
|
9017
9017
|
const newLinePointMap = this.getLinePointMap(splitCols);
|
9018
9018
|
const resArray = new Set();
|
9019
|
-
const allPointMap = oldLinePointMap.concat(newLinePointMap);
|
9019
|
+
const allPointMap = oldLinePointMap.concat(newLinePointMap).sort((a, b) => a.index - b.index);
|
9020
9020
|
for (let i = 0; i < allPointMap.length; i++) {
|
9021
9021
|
const part = allPointMap[i];
|
9022
9022
|
resArray.add(part.offset);
|
@@ -9240,7 +9240,7 @@ class TableSplitCell {
|
|
9240
9240
|
const mergeCols = this.getHMergeColsCount(tb, focusRowIndex, focusCellIndex);
|
9241
9241
|
//只有拆分的行数需要满足此条件
|
9242
9242
|
if (mergeRows > 1 && rows > 1) {
|
9243
|
-
if (
|
9243
|
+
if (mergeRows % rows !== 0) {
|
9244
9244
|
throw new Error(`当前合并的行数为:${mergeRows},当前可拆分的行数是${mergeRows}的约数`);
|
9245
9245
|
}
|
9246
9246
|
}
|
@@ -9341,6 +9341,8 @@ class TableSplitCell {
|
|
9341
9341
|
const splitCols = this.getSplitCols(colsWidth, cols);
|
9342
9342
|
const [otherPacks, currPacks] = ColumnPatchUtil.getPatchPacks(hMergeCols, splitCols);
|
9343
9343
|
this.applyHorSplitColumnPatchPacks(tb, focusRowIndex, 1, otherPacks);
|
9344
|
+
//当前单元格执行补丁前,需要先还原单元格
|
9345
|
+
TableUtil.restoreCell(ss);
|
9344
9346
|
this.applyHorSplitColumnCurrPatchPacks(tb, focusRowIndex, focusCellIndex, rows, currPacks);
|
9345
9347
|
tb.pubOnChange('to-child');
|
9346
9348
|
tb.refreshView();
|
@@ -9404,7 +9406,6 @@ class TableSplitCell {
|
|
9404
9406
|
static applyHorSplitColumnCurrPatchPacks(tb, focusRowIndex, focusColInex, splitRows, packs) {
|
9405
9407
|
//获取当前列的合并行数
|
9406
9408
|
let vMergeRows = this.getVMergeRowsCount(tb, focusRowIndex, focusColInex);
|
9407
|
-
vMergeRows = vMergeRows === 1 ? 0 : vMergeRows;
|
9408
9409
|
const startRow = tb.getChild(focusRowIndex);
|
9409
9410
|
const endRow = tb.getChild(focusRowIndex + vMergeRows - 1);
|
9410
9411
|
for (let i = 0; i < packs.length; i++) {
|