@univerjs/sheets 0.2.13 → 0.2.14
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/lib/cjs/index.js +2 -2
- package/lib/es/index.js +2 -20
- package/lib/umd/index.js +2 -2
- package/package.json +11 -11
package/lib/es/index.js
CHANGED
|
@@ -385,24 +385,6 @@ function getWorksheetDisposableID(unitId, worksheet) {
|
|
|
385
385
|
return `${unitId}|${worksheet.getSheetId()}`;
|
|
386
386
|
}
|
|
387
387
|
__name(getWorksheetDisposableID, "getWorksheetDisposableID");
|
|
388
|
-
function handleCustom(oldVal, newVal) {
|
|
389
|
-
const merge2 = mergeCustom(oldVal.custom, newVal.custom);
|
|
390
|
-
merge2 && Tools.removeNull(merge2), Tools.isEmptyObject(merge2) ? delete oldVal.custom : oldVal.custom = merge2;
|
|
391
|
-
}
|
|
392
|
-
__name(handleCustom, "handleCustom");
|
|
393
|
-
function mergeCustom(oldCustom, newCustom) {
|
|
394
|
-
return newCustom === null ? newCustom : newCustom === void 0 ? oldCustom : { ...oldCustom, ...newCustom };
|
|
395
|
-
}
|
|
396
|
-
__name(mergeCustom, "mergeCustom");
|
|
397
|
-
function transformCustom(oldCustom, newCustom) {
|
|
398
|
-
if (!newCustom || !Object.keys(newCustom).length)
|
|
399
|
-
return oldCustom;
|
|
400
|
-
const backupCustom = oldCustom || {};
|
|
401
|
-
for (const k in newCustom)
|
|
402
|
-
k in backupCustom || (backupCustom[k] = null);
|
|
403
|
-
return backupCustom;
|
|
404
|
-
}
|
|
405
|
-
__name(transformCustom, "transformCustom");
|
|
406
388
|
function handleStyle(styles, oldVal, newVal) {
|
|
407
389
|
var _a20;
|
|
408
390
|
const oldStyle = styles.getStyleByCell(oldVal);
|
|
@@ -553,7 +535,7 @@ const SetRangeValuesUndoMutationFactory = /* @__PURE__ */ __name((accessor, para
|
|
|
553
535
|
const cellMatrix = worksheet.getCellMatrix(), styles = workbook.getStyles(), undoData = new ObjectMatrix();
|
|
554
536
|
return new ObjectMatrix(cellValue).forValue((row, col, newVal) => {
|
|
555
537
|
const cell = Tools.deepClone(cellMatrix == null ? void 0 : cellMatrix.getValue(row, col)) || {}, oldStyle = styles.getStyleByCell(cell), newStyle = styles.getStyleByCell(newVal);
|
|
556
|
-
cell.s = transformStyle(oldStyle, newStyle),
|
|
538
|
+
cell.s = transformStyle(oldStyle, newStyle), undoData.setValue(row, col, setNull(cell));
|
|
557
539
|
}), {
|
|
558
540
|
...params,
|
|
559
541
|
options: {},
|
|
@@ -575,7 +557,7 @@ const SetRangeValuesUndoMutationFactory = /* @__PURE__ */ __name((accessor, para
|
|
|
575
557
|
cellMatrix == null || cellMatrix.setValue(row, col, {});
|
|
576
558
|
else {
|
|
577
559
|
const oldVal = cellMatrix.getValue(row, col) || {}, type = getCellType(styles, newVal, oldVal);
|
|
578
|
-
newVal.f !== void 0 && (oldVal.f = newVal.f), newVal.si !== void 0 && (oldVal.si = newVal.si), newVal.p !== void 0 && (oldVal.p = newVal.p), newVal.v !== void 0 && (oldVal.v = getCellValue(type, newVal)), oldVal.v !== void 0 && (oldVal.t = type, oldVal.v = getCellValue(type, oldVal)), newVal.s !== void 0 && handleStyle(styles, oldVal, newVal), newVal.custom !== void 0 &&
|
|
560
|
+
newVal.f !== void 0 && (oldVal.f = newVal.f), newVal.si !== void 0 && (oldVal.si = newVal.si), newVal.p !== void 0 && (oldVal.p = newVal.p), newVal.v !== void 0 && (oldVal.v = getCellValue(type, newVal)), oldVal.v !== void 0 && (oldVal.t = type, oldVal.v = getCellValue(type, oldVal)), newVal.s !== void 0 && handleStyle(styles, oldVal, newVal), newVal.custom !== void 0 && (oldVal.custom = newVal.custom), cellMatrix.setValue(row, col, Tools.removeNull(oldVal));
|
|
579
561
|
}
|
|
580
562
|
}), !0;
|
|
581
563
|
}, "handler")
|