@univerjs/sheets 0.2.7 → 0.2.8
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 +1 -1
- package/lib/es/index.js +41 -28
- package/lib/types/basics/cell-style.d.ts +0 -1
- package/lib/types/basics/cell-type.d.ts +0 -1
- package/lib/types/basics/cell-value.d.ts +0 -1
- package/lib/types/basics/const/default-spreadsheet-plugin-data.d.ts +0 -1
- package/lib/types/basics/interfaces/i-ruler-manager.d.ts +0 -1
- package/lib/types/basics/interfaces/mutation-interface.d.ts +0 -1
- package/lib/types/basics/interfaces/selection-config.d.ts +0 -1
- package/lib/types/basics/interfaces/spreadsheet-config.d.ts +0 -1
- package/lib/types/basics/rangeMerge.d.ts +0 -1
- package/lib/types/basics/selection.d.ts +0 -1
- package/lib/types/basics/sheet-header.d.ts +0 -1
- package/lib/types/basics/utils.d.ts +0 -1
- package/lib/types/commands/commands/__tests__/create-command-test-bed.d.ts +0 -1
- package/lib/types/commands/commands/add-range-protection.command.d.ts +0 -1
- package/lib/types/commands/commands/add-worksheet-merge.command.d.ts +0 -1
- package/lib/types/commands/commands/clear-selection-all.command.d.ts +0 -1
- package/lib/types/commands/commands/clear-selection-content.command.d.ts +0 -1
- package/lib/types/commands/commands/clear-selection-format.command.d.ts +0 -1
- package/lib/types/commands/commands/copy-worksheet.command.d.ts +0 -1
- package/lib/types/commands/commands/delete-range-move-left.command.d.ts +0 -1
- package/lib/types/commands/commands/delete-range-move-up.command.d.ts +0 -1
- package/lib/types/commands/commands/delete-range-protection.command.d.ts +0 -1
- package/lib/types/commands/commands/insert-defined-name.command.d.ts +0 -1
- package/lib/types/commands/commands/insert-range-move-down.command.d.ts +0 -1
- package/lib/types/commands/commands/insert-range-move-right.command.d.ts +0 -1
- package/lib/types/commands/commands/insert-row-col.command.d.ts +0 -1
- package/lib/types/commands/commands/insert-sheet.command.d.ts +0 -1
- package/lib/types/commands/commands/move-range.command.d.ts +0 -1
- package/lib/types/commands/commands/move-rows-cols.command.d.ts +0 -1
- package/lib/types/commands/commands/remove-defined-name.command.d.ts +0 -1
- package/lib/types/commands/commands/remove-row-col.command.d.ts +0 -1
- package/lib/types/commands/commands/remove-sheet.command.d.ts +0 -1
- package/lib/types/commands/commands/remove-worksheet-merge.command.d.ts +0 -1
- package/lib/types/commands/commands/reorder-range.command.d.ts +0 -1
- package/lib/types/commands/commands/set-border-command.d.ts +0 -1
- package/lib/types/commands/commands/set-col-visible.command.d.ts +0 -1
- package/lib/types/commands/commands/set-defined-name.command.d.ts +0 -1
- package/lib/types/commands/commands/set-frozen-cancel.command.d.ts +0 -1
- package/lib/types/commands/commands/set-frozen.command.d.ts +0 -1
- package/lib/types/commands/commands/set-hide-gridlines.command.d.ts +0 -1
- package/lib/types/commands/commands/set-range-protection.command.d.ts +0 -1
- package/lib/types/commands/commands/set-range-values.command.d.ts +0 -1
- package/lib/types/commands/commands/set-row-visible.command.d.ts +0 -1
- package/lib/types/commands/commands/set-style.command.d.ts +0 -1
- package/lib/types/commands/commands/set-tab-color.command.d.ts +0 -1
- package/lib/types/commands/commands/set-workbook-name.command.d.ts +0 -1
- package/lib/types/commands/commands/set-worksheet-activate.command.d.ts +0 -1
- package/lib/types/commands/commands/set-worksheet-col-width.command.d.ts +0 -1
- package/lib/types/commands/commands/set-worksheet-hide.command.d.ts +0 -1
- package/lib/types/commands/commands/set-worksheet-name.command.d.ts +0 -1
- package/lib/types/commands/commands/set-worksheet-order.command.d.ts +0 -1
- package/lib/types/commands/commands/set-worksheet-permission-points.command.d.ts +0 -1
- package/lib/types/commands/commands/set-worksheet-right-to-left.command.d.ts +0 -1
- package/lib/types/commands/commands/set-worksheet-row-height.command.d.ts +0 -1
- package/lib/types/commands/commands/set-worksheet-show.command.d.ts +0 -1
- package/lib/types/commands/commands/utils/merged-cell-util.d.ts +0 -1
- package/lib/types/commands/commands/utils/selection-utils.d.ts +0 -1
- package/lib/types/commands/commands/utils/target-util.d.ts +0 -1
- package/lib/types/commands/mutations/__tests__/create-command-test-bed.d.ts +0 -1
- package/lib/types/commands/mutations/add-range-protection.mutation.d.ts +0 -1
- package/lib/types/commands/mutations/add-worksheet-merge.mutation.d.ts +0 -1
- package/lib/types/commands/mutations/add-worksheet-protection.mutation.d.ts +0 -1
- package/lib/types/commands/mutations/delete-range-protection.mutation.d.ts +0 -1
- package/lib/types/commands/mutations/delete-worksheet-protection.mutation.d.ts +0 -1
- package/lib/types/commands/mutations/empty.mutation.d.ts +0 -1
- package/lib/types/commands/mutations/insert-row-col.mutation.d.ts +0 -1
- package/lib/types/commands/mutations/insert-sheet.mutation.d.ts +0 -1
- package/lib/types/commands/mutations/move-range.mutation.d.ts +3 -2
- package/lib/types/commands/mutations/move-rows-cols.mutation.d.ts +0 -1
- package/lib/types/commands/mutations/numfmt-mutation.d.ts +0 -1
- package/lib/types/commands/mutations/remove-row-col.mutation.d.ts +0 -1
- package/lib/types/commands/mutations/remove-sheet.mutation.d.ts +0 -1
- package/lib/types/commands/mutations/remove-worksheet-merge.mutation.d.ts +0 -1
- package/lib/types/commands/mutations/reorder-range.mutation.d.ts +0 -1
- package/lib/types/commands/mutations/set-col-visible.mutation.d.ts +0 -1
- package/lib/types/commands/mutations/set-frozen.mutation.d.ts +0 -1
- package/lib/types/commands/mutations/set-hide-gridlines.mutatiom.d.ts +0 -1
- package/lib/types/commands/mutations/set-range-protection.mutation.d.ts +0 -1
- package/lib/types/commands/mutations/set-range-values.mutation.d.ts +0 -1
- package/lib/types/commands/mutations/set-row-visible.mutation.d.ts +0 -1
- package/lib/types/commands/mutations/set-tab-color.mutation.d.ts +0 -1
- package/lib/types/commands/mutations/set-workbook-name.mutation.d.ts +0 -1
- package/lib/types/commands/mutations/set-worksheet-col-width.mutation.d.ts +0 -1
- package/lib/types/commands/mutations/set-worksheet-hide.mutation.d.ts +0 -1
- package/lib/types/commands/mutations/set-worksheet-name.mutation.d.ts +0 -1
- package/lib/types/commands/mutations/set-worksheet-order.mutation.d.ts +0 -1
- package/lib/types/commands/mutations/set-worksheet-permission-points.mutation.d.ts +0 -1
- package/lib/types/commands/mutations/set-worksheet-protection.mutation.d.ts +0 -1
- package/lib/types/commands/mutations/set-worksheet-right-to-left.mutation.d.ts +0 -1
- package/lib/types/commands/mutations/set-worksheet-row-height.mutation.d.ts +0 -1
- package/lib/types/commands/operations/scroll-to-cell.operation.d.ts +0 -1
- package/lib/types/commands/operations/selection.operation.d.ts +0 -1
- package/lib/types/commands/operations/set-worksheet-active.operation.d.ts +0 -1
- package/lib/types/commands/utils/handle-merge-operation.d.ts +0 -1
- package/lib/types/commands/utils/handle-range-mutation.d.ts +0 -1
- package/lib/types/commands/utils/selection-command-util.d.ts +0 -1
- package/lib/types/controllers/__tests__/util.d.ts +0 -1
- package/lib/types/controllers/basic-worksheet.controller.d.ts +0 -1
- package/lib/types/controllers/calculate-result-apply.controller.d.ts +0 -1
- package/lib/types/controllers/defined-name-data.controller.d.ts +0 -1
- package/lib/types/controllers/merge-cell.controller.d.ts +0 -1
- package/lib/types/controllers/number-cell.controller.d.ts +0 -1
- package/lib/types/locale/en-US.d.ts +0 -1
- package/lib/types/locale/ru-RU.d.ts +0 -1
- package/lib/types/locale/vi-VN.d.ts +0 -1
- package/lib/types/locale/zh-TW.d.ts +0 -1
- package/lib/types/model/range-protection-render.model.d.ts +0 -1
- package/lib/types/model/range-protection-rule.model.d.ts +1 -2
- package/lib/types/services/__tests__/util.d.ts +0 -1
- package/lib/types/services/border-style-manager.service.d.ts +0 -1
- package/lib/types/services/numfmt/numfmt.service.d.ts +0 -1
- package/lib/types/services/numfmt/type.d.ts +0 -1
- package/lib/types/services/permission/permission-point/range/edit.d.ts +0 -1
- package/lib/types/services/permission/permission-point/range/view.d.ts +0 -1
- package/lib/types/services/permission/permission-point/workbook/comment.d.ts +0 -1
- package/lib/types/services/permission/permission-point/workbook/copy-sheet.d.ts +0 -1
- package/lib/types/services/permission/permission-point/workbook/copy.d.ts +0 -1
- package/lib/types/services/permission/permission-point/workbook/create-sheet.d.ts +0 -1
- package/lib/types/services/permission/permission-point/workbook/delete-sheet.d.ts +0 -1
- package/lib/types/services/permission/permission-point/workbook/duplicate.d.ts +0 -1
- package/lib/types/services/permission/permission-point/workbook/editable.d.ts +0 -1
- package/lib/types/services/permission/permission-point/workbook/export.d.ts +0 -1
- package/lib/types/services/permission/permission-point/workbook/hide-sheet.d.ts +0 -1
- package/lib/types/services/permission/permission-point/workbook/history.d.ts +0 -1
- package/lib/types/services/permission/permission-point/workbook/manage-collaborator.d.ts +0 -1
- package/lib/types/services/permission/permission-point/workbook/move-sheet.d.ts +0 -1
- package/lib/types/services/permission/permission-point/workbook/print.d.ts +0 -1
- package/lib/types/services/permission/permission-point/workbook/recover-history.d.ts +0 -1
- package/lib/types/services/permission/permission-point/workbook/rename-sheet.d.ts +0 -1
- package/lib/types/services/permission/permission-point/workbook/share.d.ts +0 -1
- package/lib/types/services/permission/permission-point/workbook/view-history.d.ts +0 -1
- package/lib/types/services/permission/permission-point/workbook/view.d.ts +0 -1
- package/lib/types/services/permission/permission-point/worksheet/copy.d.ts +0 -1
- package/lib/types/services/permission/permission-point/worksheet/delete-column.d.ts +0 -1
- package/lib/types/services/permission/permission-point/worksheet/delete-row.d.ts +0 -1
- package/lib/types/services/permission/permission-point/worksheet/edit-extra-object.d.ts +0 -1
- package/lib/types/services/permission/permission-point/worksheet/edit.d.ts +0 -1
- package/lib/types/services/permission/permission-point/worksheet/filter.d.ts +0 -1
- package/lib/types/services/permission/permission-point/worksheet/insert-column.d.ts +0 -1
- package/lib/types/services/permission/permission-point/worksheet/insert-hyperlink.d.ts +0 -1
- package/lib/types/services/permission/permission-point/worksheet/insert-row.d.ts +0 -1
- package/lib/types/services/permission/permission-point/worksheet/manage-collaborator.d.ts +0 -1
- package/lib/types/services/permission/permission-point/worksheet/pivot-table.d.ts +0 -1
- package/lib/types/services/permission/permission-point/worksheet/select-protected-cells.d.ts +0 -1
- package/lib/types/services/permission/permission-point/worksheet/select-un-protected-cells.d.ts +0 -1
- package/lib/types/services/permission/permission-point/worksheet/set-cell-style.d.ts +0 -1
- package/lib/types/services/permission/permission-point/worksheet/set-cell-value.d.ts +0 -1
- package/lib/types/services/permission/permission-point/worksheet/set-column-style.d.ts +0 -1
- package/lib/types/services/permission/permission-point/worksheet/set-row-style.d.ts +0 -1
- package/lib/types/services/permission/permission-point/worksheet/sort.d.ts +0 -1
- package/lib/types/services/permission/permission-point/worksheet/view.d.ts +0 -1
- package/lib/types/services/permission/range-permission/range-protection.ref-range.d.ts +0 -1
- package/lib/types/services/permission/range-permission/range-protection.service.d.ts +0 -1
- package/lib/types/services/permission/range-permission/util.d.ts +0 -1
- package/lib/types/services/permission/type.d.ts +0 -1
- package/lib/types/services/permission/util.d.ts +0 -1
- package/lib/types/services/permission/workbook-permission/util.d.ts +0 -1
- package/lib/types/services/permission/workbook-permission/workbook-permission.service.d.ts +0 -1
- package/lib/types/services/permission/worksheet-permission/type.d.ts +0 -1
- package/lib/types/services/permission/worksheet-permission/utils.d.ts +0 -1
- package/lib/types/services/permission/worksheet-permission/worksheet-permission-point.model.d.ts +1 -2
- package/lib/types/services/permission/worksheet-permission/worksheet-permission-rule.model.d.ts +1 -2
- package/lib/types/services/permission/worksheet-permission/worksheet-permission.service.d.ts +0 -1
- package/lib/types/services/ref-range/__tests__/__testing__.d.ts +0 -1
- package/lib/types/services/ref-range/__tests__/ref-range.service.spec.d.ts +0 -1
- package/lib/types/services/ref-range/ref-range.service.d.ts +0 -1
- package/lib/types/services/ref-range/type.d.ts +0 -1
- package/lib/types/services/ref-range/util.d.ts +0 -1
- package/lib/types/services/selections/ref-selections.service.d.ts +0 -1
- package/lib/types/services/selections/selection-manager.service.d.ts +0 -1
- package/lib/types/services/sheet-interceptor/__tests__/create-core-test-bed.d.ts +0 -1
- package/lib/types/services/sheet-interceptor/interceptor-const.d.ts +0 -1
- package/lib/types/services/sheet-interceptor/sheet-interceptor.service.d.ts +0 -1
- package/lib/types/services/sheet-interceptor/utils/interceptor.d.ts +0 -1
- package/lib/types/sheets-plugin.d.ts +0 -1
- package/lib/umd/index.js +1 -1
- package/package.json +13 -13
package/lib/es/index.js
CHANGED
|
@@ -1069,18 +1069,18 @@ function getMoveRangeUndoRedoMutations(accessor, from, to, ignoreMerge = !1) {
|
|
|
1069
1069
|
return null;
|
|
1070
1070
|
const fromCellValue = new ObjectMatrix(), newFromCellValue = new ObjectMatrix();
|
|
1071
1071
|
Range.foreach(fromRange, (row, col) => {
|
|
1072
|
-
fromCellValue.setValue(row, col, fromCellMatrix.getValue(row, col)), newFromCellValue.setValue(row, col, null);
|
|
1072
|
+
fromCellValue.setValue(row, col, Tools.deepClone(fromCellMatrix.getValue(row, col))), newFromCellValue.setValue(row, col, null);
|
|
1073
1073
|
});
|
|
1074
|
-
const toCellValue = new ObjectMatrix();
|
|
1074
|
+
const toCellValue = new ObjectMatrix(), newToCellValue = new ObjectMatrix();
|
|
1075
1075
|
Range.foreach(toRange, (row, col) => {
|
|
1076
|
-
toCellValue.setValue(row, col, toCellMatrix.getValue(row, col));
|
|
1077
|
-
})
|
|
1078
|
-
const newToCellValue = new ObjectMatrix();
|
|
1079
|
-
Range.foreach(fromRange, (row, col) => {
|
|
1076
|
+
toCellValue.setValue(row, col, Tools.deepClone(toCellMatrix.getValue(row, col)));
|
|
1077
|
+
}), Range.foreach(fromRange, (row, col) => {
|
|
1080
1078
|
const cellRange = cellToRange(row, col), relativeRange = Rectangle.getRelativeRange(cellRange, fromRange), range = Rectangle.getPositionRange(relativeRange, toRange);
|
|
1081
|
-
newToCellValue.setValue(range.startRow, range.startColumn, fromCellMatrix.getValue(row, col));
|
|
1079
|
+
newToCellValue.setValue(range.startRow, range.startColumn, Tools.deepClone(fromCellMatrix.getValue(row, col)));
|
|
1082
1080
|
});
|
|
1083
1081
|
const doMoveRangeMutation = {
|
|
1082
|
+
fromRange: from.range,
|
|
1083
|
+
toRange: to.range,
|
|
1084
1084
|
from: {
|
|
1085
1085
|
value: newFromCellValue.getMatrix(),
|
|
1086
1086
|
subUnitId: fromSubUnitId
|
|
@@ -1091,6 +1091,8 @@ function getMoveRangeUndoRedoMutations(accessor, from, to, ignoreMerge = !1) {
|
|
|
1091
1091
|
},
|
|
1092
1092
|
unitId
|
|
1093
1093
|
}, undoMoveRangeMutation = {
|
|
1094
|
+
fromRange: to.range,
|
|
1095
|
+
toRange: from.range,
|
|
1094
1096
|
from: {
|
|
1095
1097
|
value: fromCellValue.getMatrix(),
|
|
1096
1098
|
subUnitId: fromSubUnitId
|
|
@@ -1109,7 +1111,7 @@ function getMoveRangeUndoRedoMutations(accessor, from, to, ignoreMerge = !1) {
|
|
|
1109
1111
|
};
|
|
1110
1112
|
}
|
|
1111
1113
|
__name(getMoveRangeUndoRedoMutations, "getMoveRangeUndoRedoMutations");
|
|
1112
|
-
var I = /* @__PURE__ */ ((E) => (E[E.UNIVER_UNKNOWN = 0] = "UNIVER_UNKNOWN", E[E.UNIVER_DOC = 1] = "UNIVER_DOC", E[E.UNIVER_SHEET = 2] = "UNIVER_SHEET", E[E.UNIVER_SLIDE = 3] = "UNIVER_SLIDE", E[E.UNRECOGNIZED = -1] = "UNRECOGNIZED", E))(I || {}), P = /* @__PURE__ */ ((E) => (E[E.View = 0] = "View", E[E.Edit = 1] = "Edit", E[E.ManageCollaborator = 2] = "ManageCollaborator", E[E.Print = 3] = "Print", E[E.Duplicate = 4] = "Duplicate", E[E.Comment = 5] = "Comment", E[E.Copy = 6] = "Copy", E[E.Share = 7] = "Share", E[E.Export = 8] = "Export", E[E.MoveWorksheet = 9] = "MoveWorksheet", E[E.DeleteWorksheet = 10] = "DeleteWorksheet", E[E.HideWorksheet = 11] = "HideWorksheet", E[E.RenameWorksheet = 12] = "RenameWorksheet", E[E.CreateWorksheet = 13] = "CreateWorksheet", E[E.SetWorksheetStyle = 14] = "SetWorksheetStyle", E[E.EditWorksheetCell = 15] = "EditWorksheetCell", E[E.InsertHyperlink = 16] = "InsertHyperlink", E[E.Sort = 17] = "Sort", E[E.Filter = 18] = "Filter", E[E.PivotTable = 19] = "PivotTable", E[E.FloatImg = 20] = "FloatImg", E[E.History = 21] = "History", E[E.RwHgtClWdt = 22] = "RwHgtClWdt", E[E.ViemRwHgtClWdt = 23] = "ViemRwHgtClWdt", E[E.ViewFilter = 24] = "ViewFilter", E[E.MoveSheet = 25] = "MoveSheet", E[E.DeleteSheet = 26] = "DeleteSheet", E[E.HideSheet = 27] = "HideSheet", E[E.CopySheet = 28] = "CopySheet", E[E.RenameSheet = 29] = "RenameSheet", E[E.CreateSheet = 30] = "CreateSheet", E[E.SelectProtectedCells = 31] = "SelectProtectedCells", E[E.SelectUnProtectedCells = 32] = "SelectUnProtectedCells", E[E.SetCellStyle = 33] = "SetCellStyle", E[E.SetCellValue = 34] = "SetCellValue", E[E.SetRowStyle = 35] = "SetRowStyle", E[E.SetColumnStyle = 36] = "SetColumnStyle", E[E.InsertRow = 37] = "InsertRow", E[E.InsertColumn = 38] = "InsertColumn", E[E.DeleteRow = 39] = "DeleteRow", E[E.DeleteColumn = 40] = "DeleteColumn", E[E.EditExtraObject = 41] = "EditExtraObject", E[E.Delete = 42] = "Delete", E[E.RecoverHistory = 43] = "RecoverHistory", E[E.ViewHistory = 44] = "ViewHistory", E[E.UNRECOGNIZED = -1] = "UNRECOGNIZED", E))(P || {}), l = /* @__PURE__ */ ((E) => (E[E.Unkonwn = 0] = "Unkonwn", E[E.Workbook = 1] = "Workbook", E[E.Worksheet = 2] = "Worksheet", E[E.SelectRange = 3] = "SelectRange", E[E.Document = 4] = "Document", E[E.Slide = 5] = "Slide", E[E.UNRECOGNIZED = -1] = "UNRECOGNIZED", E))(l || {});
|
|
1114
|
+
var I = /* @__PURE__ */ ((E) => (E[E.UNIVER_UNKNOWN = 0] = "UNIVER_UNKNOWN", E[E.UNIVER_DOC = 1] = "UNIVER_DOC", E[E.UNIVER_SHEET = 2] = "UNIVER_SHEET", E[E.UNIVER_SLIDE = 3] = "UNIVER_SLIDE", E[E.UNIVER_PROJECT = 4] = "UNIVER_PROJECT", E[E.UNRECOGNIZED = -1] = "UNRECOGNIZED", E))(I || {}), P = /* @__PURE__ */ ((E) => (E[E.View = 0] = "View", E[E.Edit = 1] = "Edit", E[E.ManageCollaborator = 2] = "ManageCollaborator", E[E.Print = 3] = "Print", E[E.Duplicate = 4] = "Duplicate", E[E.Comment = 5] = "Comment", E[E.Copy = 6] = "Copy", E[E.Share = 7] = "Share", E[E.Export = 8] = "Export", E[E.MoveWorksheet = 9] = "MoveWorksheet", E[E.DeleteWorksheet = 10] = "DeleteWorksheet", E[E.HideWorksheet = 11] = "HideWorksheet", E[E.RenameWorksheet = 12] = "RenameWorksheet", E[E.CreateWorksheet = 13] = "CreateWorksheet", E[E.SetWorksheetStyle = 14] = "SetWorksheetStyle", E[E.EditWorksheetCell = 15] = "EditWorksheetCell", E[E.InsertHyperlink = 16] = "InsertHyperlink", E[E.Sort = 17] = "Sort", E[E.Filter = 18] = "Filter", E[E.PivotTable = 19] = "PivotTable", E[E.FloatImg = 20] = "FloatImg", E[E.History = 21] = "History", E[E.RwHgtClWdt = 22] = "RwHgtClWdt", E[E.ViemRwHgtClWdt = 23] = "ViemRwHgtClWdt", E[E.ViewFilter = 24] = "ViewFilter", E[E.MoveSheet = 25] = "MoveSheet", E[E.DeleteSheet = 26] = "DeleteSheet", E[E.HideSheet = 27] = "HideSheet", E[E.CopySheet = 28] = "CopySheet", E[E.RenameSheet = 29] = "RenameSheet", E[E.CreateSheet = 30] = "CreateSheet", E[E.SelectProtectedCells = 31] = "SelectProtectedCells", E[E.SelectUnProtectedCells = 32] = "SelectUnProtectedCells", E[E.SetCellStyle = 33] = "SetCellStyle", E[E.SetCellValue = 34] = "SetCellValue", E[E.SetRowStyle = 35] = "SetRowStyle", E[E.SetColumnStyle = 36] = "SetColumnStyle", E[E.InsertRow = 37] = "InsertRow", E[E.InsertColumn = 38] = "InsertColumn", E[E.DeleteRow = 39] = "DeleteRow", E[E.DeleteColumn = 40] = "DeleteColumn", E[E.EditExtraObject = 41] = "EditExtraObject", E[E.Delete = 42] = "Delete", E[E.RecoverHistory = 43] = "RecoverHistory", E[E.ViewHistory = 44] = "ViewHistory", E[E.UNRECOGNIZED = -1] = "UNRECOGNIZED", E))(P || {}), l = /* @__PURE__ */ ((E) => (E[E.Unkonwn = 0] = "Unkonwn", E[E.Workbook = 1] = "Workbook", E[E.Worksheet = 2] = "Worksheet", E[E.SelectRange = 3] = "SelectRange", E[E.Document = 4] = "Document", E[E.Slide = 5] = "Slide", E[E.UNRECOGNIZED = -1] = "UNRECOGNIZED", E))(l || {});
|
|
1113
1115
|
const _WorksheetCopyPermission = class _WorksheetCopyPermission {
|
|
1114
1116
|
constructor(unitId, subUnitId) {
|
|
1115
1117
|
__publicField(this, "value", !0);
|
|
@@ -4918,8 +4920,8 @@ let WorksheetProtectionRuleModel = (_a4 = class {
|
|
|
4918
4920
|
}
|
|
4919
4921
|
}), this._model = result;
|
|
4920
4922
|
}
|
|
4921
|
-
deleteUnitModel() {
|
|
4922
|
-
this._model.
|
|
4923
|
+
deleteUnitModel(unitId) {
|
|
4924
|
+
this._model.delete(unitId);
|
|
4923
4925
|
}
|
|
4924
4926
|
_ensureSubUnitMap(unitId) {
|
|
4925
4927
|
let subUnitMap = this._model.get(unitId);
|
|
@@ -5029,8 +5031,8 @@ let RangeProtectionRuleModel = (_a5 = class {
|
|
|
5029
5031
|
}), result.set(unitId, map2);
|
|
5030
5032
|
}), this._model = result;
|
|
5031
5033
|
}
|
|
5032
|
-
deleteUnitModel() {
|
|
5033
|
-
this._model.
|
|
5034
|
+
deleteUnitModel(unitId) {
|
|
5035
|
+
this._model.delete(unitId);
|
|
5034
5036
|
}
|
|
5035
5037
|
createRuleId(unitId, subUnitId) {
|
|
5036
5038
|
let id = Tools.generateRandomId(4);
|
|
@@ -5122,8 +5124,8 @@ let WorksheetProtectionPointModel = (_a6 = class {
|
|
|
5122
5124
|
}
|
|
5123
5125
|
}), this._model = result;
|
|
5124
5126
|
}
|
|
5125
|
-
deleteUnitModel() {
|
|
5126
|
-
this._model.
|
|
5127
|
+
deleteUnitModel(unitId) {
|
|
5128
|
+
this._model.delete(unitId);
|
|
5127
5129
|
}
|
|
5128
5130
|
_ensureSubUnitMap(unitId) {
|
|
5129
5131
|
let subUnitMap = this._model.get(unitId);
|
|
@@ -5233,8 +5235,8 @@ let WorksheetPermissionService = (_a7 = class extends RxDisposable {
|
|
|
5233
5235
|
});
|
|
5234
5236
|
}), this._worksheetProtectionRuleModel.changeRuleInitState(!0);
|
|
5235
5237
|
}, "onLoad"),
|
|
5236
|
-
onUnLoad: /* @__PURE__ */ __name(() => {
|
|
5237
|
-
this._worksheetProtectionRuleModel.deleteUnitModel();
|
|
5238
|
+
onUnLoad: /* @__PURE__ */ __name((unitId) => {
|
|
5239
|
+
this._worksheetProtectionRuleModel.deleteUnitModel(unitId);
|
|
5238
5240
|
}, "onUnLoad")
|
|
5239
5241
|
})
|
|
5240
5242
|
);
|
|
@@ -5266,8 +5268,8 @@ let WorksheetPermissionService = (_a7 = class extends RxDisposable {
|
|
|
5266
5268
|
});
|
|
5267
5269
|
});
|
|
5268
5270
|
}, "onLoad"),
|
|
5269
|
-
onUnLoad: /* @__PURE__ */ __name(() => {
|
|
5270
|
-
this._worksheetProtectionPointRuleModel.deleteUnitModel();
|
|
5271
|
+
onUnLoad: /* @__PURE__ */ __name((unitId) => {
|
|
5272
|
+
this._worksheetProtectionPointRuleModel.deleteUnitModel(unitId);
|
|
5271
5273
|
}, "onUnLoad")
|
|
5272
5274
|
})
|
|
5273
5275
|
);
|
|
@@ -6220,7 +6222,7 @@ const handleInsertRow = /* @__PURE__ */ __name((param, targetRange) => {
|
|
|
6220
6222
|
}
|
|
6221
6223
|
}
|
|
6222
6224
|
return runRefRangeMutations(operator, range);
|
|
6223
|
-
}, "handleDefaultRangeChangeWithEffectRefCommands"), handleDefaultRangeChangeWithEffectRefCommandsSkipNoInterests = /* @__PURE__ */ __name((range, commandInfo, deps) => getEffectedRangesOnCommand(commandInfo, deps).some((effectRange) => Rectangle.intersects(effectRange, range)) ? handleDefaultRangeChangeWithEffectRefCommands(range, commandInfo) : range, "handleDefaultRangeChangeWithEffectRefCommandsSkipNoInterests"), handleCommonDefaultRangeChangeWithEffectRefCommands = /* @__PURE__ */ __name((range, commandInfo) => {
|
|
6225
|
+
}, "handleDefaultRangeChangeWithEffectRefCommands"), handleDefaultRangeChangeWithEffectRefCommandsSkipNoInterests = /* @__PURE__ */ __name((range, commandInfo, deps) => [DeleteRangeMoveLeftCommand.id, DeleteRangeMoveUpCommand.id].includes(commandInfo.id) || getEffectedRangesOnCommand(commandInfo, deps).some((effectRange) => Rectangle.intersects(effectRange, range)) ? handleDefaultRangeChangeWithEffectRefCommands(range, commandInfo) : range, "handleDefaultRangeChangeWithEffectRefCommandsSkipNoInterests"), handleCommonDefaultRangeChangeWithEffectRefCommands = /* @__PURE__ */ __name((range, commandInfo) => {
|
|
6224
6226
|
let operator = [];
|
|
6225
6227
|
switch (commandInfo.id) {
|
|
6226
6228
|
case EffectRefRangId.DeleteRangeMoveLeftCommandId:
|
|
@@ -6296,11 +6298,14 @@ function adjustRangeOnMutation(range, mutation) {
|
|
|
6296
6298
|
baseRangeOperator = handleBaseInsertRange(params.range, range), baseRangeOperator.type = OperatorType.HorizontalMove;
|
|
6297
6299
|
break;
|
|
6298
6300
|
case MoveRangeMutation.id:
|
|
6299
|
-
|
|
6300
|
-
|
|
6301
|
-
|
|
6302
|
-
|
|
6303
|
-
|
|
6301
|
+
{
|
|
6302
|
+
const fromRange = params.fromRange, toRange = params.toRange;
|
|
6303
|
+
baseRangeOperator = handleBaseMoveRange(
|
|
6304
|
+
fromRange,
|
|
6305
|
+
toRange,
|
|
6306
|
+
range
|
|
6307
|
+
);
|
|
6308
|
+
}
|
|
6304
6309
|
break;
|
|
6305
6310
|
}
|
|
6306
6311
|
return baseRangeOperator ? Array.isArray(baseRangeOperator) ? runRefRangeMutations(baseRangeOperator, range) : runRefRangeMutations([baseRangeOperator], range) : range;
|
|
@@ -6410,7 +6415,7 @@ function getEffectedRangesOnMutation(mutation) {
|
|
|
6410
6415
|
}
|
|
6411
6416
|
case MoveRangeMutation.id: {
|
|
6412
6417
|
const params = mutation.params;
|
|
6413
|
-
return [new ObjectMatrix(params.from).getRange(), new ObjectMatrix(params.to).getRange()];
|
|
6418
|
+
return [new ObjectMatrix(params.from.value).getRange(), new ObjectMatrix(params.to.value).getRange()];
|
|
6414
6419
|
}
|
|
6415
6420
|
case InsertColMutation.id: {
|
|
6416
6421
|
const range = mutation.params.range;
|
|
@@ -6450,7 +6455,15 @@ const MERGE_REDO = createInterceptorKey("MERGE_REDO"), MERGE_UNDO = createInterc
|
|
|
6450
6455
|
}
|
|
6451
6456
|
onMutation(mutation) {
|
|
6452
6457
|
var _a20, _b;
|
|
6453
|
-
if (((_a20 = mutation.params) == null ? void 0 : _a20.unitId) !== this._unitId
|
|
6458
|
+
if (((_a20 = mutation.params) == null ? void 0 : _a20.unitId) !== this._unitId)
|
|
6459
|
+
return;
|
|
6460
|
+
if (mutation.id === MoveRangeMutation.id) {
|
|
6461
|
+
const params = mutation.params;
|
|
6462
|
+
if (params.from.subUnitId !== this._subUnitId || params.to.subUnitId !== this._subUnitId)
|
|
6463
|
+
return;
|
|
6464
|
+
} else if (((_b = mutation.params) == null ? void 0 : _b.subUnitId) !== this._subUnitId)
|
|
6465
|
+
return;
|
|
6466
|
+
if (!this._range)
|
|
6454
6467
|
return;
|
|
6455
6468
|
if (this._skipIntersects) {
|
|
6456
6469
|
const effectRanges = getEffectedRangesOnMutation(mutation);
|
|
@@ -8064,8 +8077,8 @@ let RangeProtectionService = (_a17 = class extends Disposable {
|
|
|
8064
8077
|
});
|
|
8065
8078
|
});
|
|
8066
8079
|
}, "onLoad"),
|
|
8067
|
-
onUnLoad: /* @__PURE__ */ __name(() => {
|
|
8068
|
-
this._selectionProtectionRuleModel.deleteUnitModel();
|
|
8080
|
+
onUnLoad: /* @__PURE__ */ __name((unitId) => {
|
|
8081
|
+
this._selectionProtectionRuleModel.deleteUnitModel(unitId);
|
|
8069
8082
|
}, "onUnLoad")
|
|
8070
8083
|
})
|
|
8071
8084
|
);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { CellValue, ICellData, Nullable, Styles, CellValueType } from '@univerjs/core';
|
|
2
|
-
|
|
3
2
|
/**
|
|
4
3
|
* Get cell value type by style, new value and old value.
|
|
5
4
|
* If the new value contains t, then take t directly. In other cases, we need to dynamically determine based on actual data and styles
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Dimension, ICellData, IColumnData, IObjectArrayPrimitiveType, IObjectMatrixPrimitiveType, IRange, IRowData, IWorksheetData, Nullable } from '@univerjs/core';
|
|
2
|
-
|
|
3
2
|
/** Params of `RemoveSheetMutation` */
|
|
4
3
|
export interface IRemoveSheetMutationParams {
|
|
5
4
|
subUnitId: string;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { IRange, ObjectMatrix } from '@univerjs/core';
|
|
2
|
-
|
|
3
2
|
export declare const createTopMatrixFromRanges: (ranges: IRange[]) => ObjectMatrix<number>;
|
|
4
3
|
export declare const createTopMatrixFromMatrix: (matrix: ObjectMatrix<1>) => ObjectMatrix<number>;
|
|
5
4
|
export declare const findAllRectangle: (topMatrix: ObjectMatrix<number>) => IRange[];
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { IRange, ISelection, ISelectionCellWithMergeInfo, ISelectionWithCoord, Nullable, ThemeService } from '@univerjs/core';
|
|
2
|
-
|
|
3
2
|
export declare const SELECTION_CONTROL_BORDER_BUFFER_WIDTH = 1.5;
|
|
4
3
|
export declare const SELECTION_CONTROL_BORDER_BUFFER_COLOR = "rgba(255, 255, 255, 0.01)";
|
|
5
4
|
/**
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ICellData, IObjectMatrixPrimitiveType, IRange, Nullable, UniverInstanceService, Workbook, Worksheet } from '@univerjs/core';
|
|
2
2
|
import { IExpandParams } from '../commands/commands/utils/selection-utils';
|
|
3
|
-
|
|
4
3
|
export declare const groupByKey: <T = Record<string, unknown>>(arr: T[], key: string, blankKey?: string) => Record<string, T[]>;
|
|
5
4
|
export declare const createUniqueKey: (initValue?: number) => () => number;
|
|
6
5
|
export declare function expandToContinuousRange(startRange: IRange, directions: IExpandParams, worksheet: Worksheet): IRange;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ICellData, ICommand, IObjectMatrixPrimitiveType, IRange } from '@univerjs/core';
|
|
2
2
|
import { ISheetCommandSharedParams } from '../utils/interface';
|
|
3
|
-
|
|
4
3
|
export interface ISetRangeValuesCommandParams extends Partial<ISheetCommandSharedParams> {
|
|
5
4
|
range?: IRange;
|
|
6
5
|
/**
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { IRange, ISelectionCell, Nullable, Workbook, Worksheet } from '@univerjs/core';
|
|
2
2
|
import { ISetSelectionsOperationParams } from '../../operations/selection.operation';
|
|
3
3
|
import { ISelectionWithStyle } from '../../../basics/selection';
|
|
4
|
-
|
|
5
4
|
export interface IExpandParams {
|
|
6
5
|
left?: boolean;
|
|
7
6
|
right?: boolean;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { IMutation, IMutationInfo } from '@univerjs/core';
|
|
2
2
|
import { IRangeProtectionRule } from '../../model/range-protection-rule.model';
|
|
3
3
|
import { IDeleteSelectionProtectionMutationParams } from './delete-range-protection.mutation';
|
|
4
|
-
|
|
5
4
|
export interface IAddRangeProtectionMutationParams {
|
|
6
5
|
rules: IRangeProtectionRule[];
|
|
7
6
|
unitId: string;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { IAccessor, IMutation } from '@univerjs/core';
|
|
2
2
|
import { IAddWorksheetMergeMutationParams, IRemoveWorksheetMergeMutationParams } from '../../basics/interfaces/mutation-interface';
|
|
3
|
-
|
|
4
3
|
export declare const AddMergeUndoMutationFactory: (accessor: IAccessor, params: IAddWorksheetMergeMutationParams) => IRemoveWorksheetMergeMutationParams;
|
|
5
4
|
export declare const AddWorksheetMergeMutation: IMutation<IAddWorksheetMergeMutationParams>;
|