diff --git a/packages/core/src/shared/rectangle.ts b/packages/core/src/shared/rectangle.ts index 38b87ee8837d..2b05d12fd9f2 100644 --- a/packages/core/src/shared/rectangle.ts +++ b/packages/core/src/shared/rectangle.ts @@ -227,8 +227,8 @@ export class Rectangle { ...(absoluteRange || {}), startRow: absoluteRange ? ([AbsoluteRefType.ROW, AbsoluteRefType.ALL].includes(absoluteRange.startAbsoluteRefType || 0) ? absoluteRange.startRow : relativeRange.startRow + originRange.startRow) : (relativeRange.startRow + originRange.startRow), endRow: absoluteRange ? ([AbsoluteRefType.ROW, AbsoluteRefType.ALL].includes(absoluteRange.endAbsoluteRefType || 0) ? absoluteRange.endRow : relativeRange.endRow + relativeRange.startRow + originRange.startRow) : (relativeRange.endRow + relativeRange.startRow + originRange.startRow), - startColumn: absoluteRange ? ([AbsoluteRefType.COLUMN, AbsoluteRefType.ALL].includes(absoluteRange.startAbsoluteRefType || 0) ? absoluteRange.startColumn : relativeRange.startColumn + originRange.startColumn) : relativeRange.startColumn + originRange.startColumn, - endColumn: absoluteRange ? ([AbsoluteRefType.COLUMN, AbsoluteRefType.ALL].includes(absoluteRange.endAbsoluteRefType || 0) ? absoluteRange.endColumn : relativeRange.endColumn + relativeRange.startColumn + originRange.startColumn) : relativeRange.endColumn + relativeRange.startColumn + originRange.startColumn, + startColumn: absoluteRange ? ([AbsoluteRefType.COLUMN, AbsoluteRefType.ALL].includes(absoluteRange.startAbsoluteRefType || 0) ? absoluteRange.startColumn : relativeRange.startColumn + originRange.startColumn) : (relativeRange.startColumn + originRange.startColumn), + endColumn: absoluteRange ? ([AbsoluteRefType.COLUMN, AbsoluteRefType.ALL].includes(absoluteRange.endAbsoluteRefType || 0) ? absoluteRange.endColumn : relativeRange.endColumn + relativeRange.startColumn + originRange.startColumn) : (relativeRange.endColumn + relativeRange.startColumn + originRange.startColumn), }) as IRange; }; diff --git a/packages/sheets-ui/src/index.ts b/packages/sheets-ui/src/index.ts index cf1d0b2333d1..8b450e90cf64 100644 --- a/packages/sheets-ui/src/index.ts +++ b/packages/sheets-ui/src/index.ts @@ -14,170 +14,170 @@ * limitations under the License. */ -export { SheetsUIPart } from './consts/ui-name'; -export { SHEET_UI_PLUGIN_NAME } from './consts/plugin-name'; export { getEditorObject } from './basics/editor/get-editor-object'; -export { SheetsScrollRenderController } from './controllers/render-controllers/scroll.render-controller'; -export { deriveStateFromActiveSheet$, getCurrentRangeDisable$, getObservableWithExclusiveRange$, getCurrentExclusiveRangeInterest$ } from './controllers/menu/menu-util'; -export { SheetsRenderService } from './services/sheets-render.service'; - -export { SHEET_VIEWPORT_KEY as VIEWPORT_KEY } from './common/keys'; -export { AutoFillController } from './controllers/auto-fill.controller'; -export { CellCustomRenderController } from './controllers/cell-custom-render.controller'; -export { SheetUIController } from './controllers/sheet-ui.controller'; -export { PASTE_SPECIAL_MENU_ID } from './controllers/menu/menu'; -export { whenFormulaEditorActivated } from './controllers/shortcuts/utils'; -export { - getCoordByCell, - getCoordByOffset, - getSheetObject, - getTransformCoord, -} from './controllers/utils/component-tools'; -export { matchedSelectionByRowColIndex as checkInHeaderRanges } from './controllers/utils/selections-tools'; -export { useActiveWorkbook, useActiveWorksheet, useWorkbooks } from './components/hook'; -export { whenSheetEditorFocused } from './controllers/shortcuts/utils'; -export type { IEditorBridgeServiceParam } from './services/editor-bridge.service'; -export { AutoFillService, IAutoFillService } from './services/auto-fill/auto-fill.service'; -export { getAutoFillRepeatRange } from './services/auto-fill/tools'; -export type { ICopyDataPiece, ISheetAutoFillHook } from './services/auto-fill/type'; -export { APPLY_TYPE, DATA_TYPE, type IAutoFillRule } from './services/auto-fill/type'; -export { type ICopyDataInTypeIndexInfo } from './services/auto-fill/type'; -export { - ISheetClipboardService, - PREDEFINED_HOOK_NAME, - SheetClipboardService, -} from './services/clipboard/clipboard.service'; -export type { ICellDataWithSpanInfo, ISheetClipboardHook, ISheetDiscreteRangeLocation, ICopyPastePayload } from './services/clipboard/type'; -export { COPY_TYPE } from './services/clipboard/type'; -export { getRepeatRange } from './services/clipboard/utils'; -export { CellEditorManagerService, ICellEditorManagerService } from './services/editor/cell-editor-manager.service'; -export { IFormulaEditorManagerService } from './services/editor/formula-editor-manager.service'; -export { - EditorBridgeService, - IEditorBridgeService, - type IEditorBridgeServiceVisibleParam, -} from './services/editor-bridge.service'; -export { MarkSelectionService } from './services/mark-selection/mark-selection.service'; -export { IMarkSelectionService } from './services/mark-selection/mark-selection.service'; -export { SheetSelectionRenderService } from './services/selection/selection-render.service'; -export { getAllSelection, getTopLeftSelection } from './services/selection/base-selection-render.service'; -export { BaseSelectionRenderService, ISheetSelectionRenderService } from './services/selection/base-selection-render.service'; -export { SelectionControl as SelectionShape } from './services/selection/selection-shape'; -export type { ISheetSkeletonManagerParam } from './services/sheet-skeleton-manager.service'; -export { SheetSkeletonManagerService, attachRangeWithCoord } from './services/sheet-skeleton-manager.service'; -export { UniverSheetsUIPlugin } from './sheets-ui-plugin'; -export { SheetRenderController } from './controllers/render-controllers/sheet.render-controller'; -export { HoverManagerService } from './services/hover-manager.service'; -export { DragManagerService } from './services/drag-manager.service'; -export { CellAlertManagerService, CellAlertType, type ICellAlert } from './services/cell-alert-manager.service'; -export { HoverRenderController } from './controllers/hover-render.controller'; -export { DragRenderController } from './controllers/drag-render.controller'; -export { SHEET_VIEW_KEY } from './common/keys'; -export { SheetCanvasPopManagerService, type ICanvasPopup } from './services/canvas-pop-manager.service'; -export { mergeSetRangeValues } from './services/clipboard/utils'; -export type { IAutoFillLocation } from './services/auto-fill/type'; -export type { IDiscreteRange } from './controllers/utils/range-tools'; -export { virtualizeDiscreteRanges, rangeToDiscreteRange } from './controllers/utils/range-tools'; -export { type IHoverCellPosition } from './services/hover-manager.service'; -export { AutoHeightController, AFFECT_LAYOUT_STYLES } from './controllers/auto-height.controller'; -export { type IDragCellPosition } from './services/drag-manager.service'; -export { SheetMenuPosition } from './controllers/menu/menu'; -export { useHighlightRange } from './hooks/useHighlightRange'; -export { HeaderMoveRenderController } from './controllers/render-controllers/header-move.render-controller'; -export { HeaderResizeRenderController } from './controllers/render-controllers/header-resize.render-controller'; -export { HeaderFreezeRenderController } from './controllers/render-controllers/freeze.render-controller'; -export { FormulaEditorController } from './controllers/editor/formula-editor.controller'; -export { StatusBarController } from './controllers/status-bar.controller'; -export { SheetPermissionInterceptorBaseController } from './controllers/permission/sheet-permission-interceptor-base.controller'; -export type { IRangeProtectionRenderCellData } from './views/permission/extensions/range-protection.render'; -export { RenderSheetFooter, RenderSheetHeader, RenderSheetContent } from './views/sheet-container/SheetContainer'; -export { SheetBar } from './views/sheet-bar/SheetBar'; -export { SheetPrintInterceptorService } from './services/print-interceptor.service'; -export { UniverSheetsMobileUIPlugin } from './mobile-sheets-ui-plugin'; -export { MobileSheetBar } from './views/mobile/sheet-bar/MobileSheetBar'; -export { SheetPermissionInitController } from './controllers/permission/sheet-permission-init.controller'; - -export { IFormatPainterService } from './services/format-painter/format-painter.service'; -export type { IFormatPainterBeforeApplyHookParams, IFormatPainterHook } from './services/format-painter/format-painter.service'; - -export { menuSchema } from './controllers/menu.schema'; - -// #region - all commands - -export { AddWorksheetMergeCommand, AddWorksheetMergeAllCommand, AddWorksheetMergeVerticalCommand, AddWorksheetMergeHorizontalCommand } from './commands/commands/add-worksheet-merge.command'; -export { AutoFillCommand, AutoClearContentCommand } from './commands/commands/auto-fill.command'; +export { AddWorksheetMergeAllCommand, AddWorksheetMergeCommand, AddWorksheetMergeHorizontalCommand, AddWorksheetMergeVerticalCommand } from './commands/commands/add-worksheet-merge.command'; +export { AutoClearContentCommand, AutoFillCommand } from './commands/commands/auto-fill.command'; export { + type ISheetPasteParams, SheetCopyCommand, SheetCutCommand, - SheetPasteCommand, - SheetPasteValueCommand, - SheetPasteShortKeyCommand, + SheetPasteBesidesBorderCommand, SheetPasteColWidthCommand, + SheetPasteCommand, SheetPasteFormatCommand, - SheetPasteBesidesBorderCommand, - type ISheetPasteParams, + SheetPasteShortKeyCommand, + SheetPasteValueCommand, } from './commands/commands/clipboard.command'; export { DeleteRangeMoveLeftConfirmCommand } from './commands/commands/delete-range-move-left-confirm.command'; export { DeleteRangeMoveUpConfirmCommand } from './commands/commands/delete-range-move-up-confirm.command'; -export { HideRowConfirmCommand, HideColConfirmCommand } from './commands/commands/hide-row-col-confirm.command'; + +export { HideColConfirmCommand, HideRowConfirmCommand } from './commands/commands/hide-row-col-confirm.command'; export { SetRangeBoldCommand, + SetRangeFontFamilyCommand, + SetRangeFontSizeCommand, SetRangeItalicCommand, - SetRangeUnderlineCommand, SetRangeStrickThroughCommand, SetRangeSubscriptCommand, SetRangeSuperscriptCommand, - SetRangeFontSizeCommand, - SetRangeFontFamilyCommand, SetRangeTextColorCommand, + SetRangeUnderlineCommand, } from './commands/commands/inline-format.command'; export { InsertRangeMoveDownConfirmCommand } from './commands/commands/insert-range-move-down-confirm.command'; export { InsertRangeMoveRightConfirmCommand } from './commands/commands/insert-range-move-right-confirm.command'; export { - AddRangeProtectionFromToolbarCommand, + AddRangeProtectionCommand, AddRangeProtectionFromContextMenuCommand, - ViewSheetPermissionFromContextMenuCommand, AddRangeProtectionFromSheetBarCommand, - ViewSheetPermissionFromSheetBarCommand, - AddRangeProtectionCommand, + AddRangeProtectionFromToolbarCommand, + DeleteRangeProtectionFromContextMenuCommand, DeleteRangeSelectionCommand, + SetProtectionCommand, SetRangeProtectionCommand, - DeleteRangeProtectionFromContextMenuCommand, SetRangeProtectionFromContextMenuCommand, - SetProtectionCommand, + ViewSheetPermissionFromContextMenuCommand, + ViewSheetPermissionFromSheetBarCommand, } from './commands/commands/range-protection.command'; export { RefillCommand } from './commands/commands/refill.command'; -export { RemoveRowConfirmCommand, RemoveColConfirmCommand } from './commands/commands/remove-row-col-confirm.command'; +export { RemoveColConfirmCommand, RemoveRowConfirmCommand } from './commands/commands/remove-row-col-confirm.command'; export { RemoveSheetConfirmCommand } from './commands/commands/remove-sheet-confirm.command'; -export { SetInfiniteFormatPainterCommand, SetOnceFormatPainterCommand, ApplyFormatPainterCommand } from './commands/commands/set-format-painter.command'; -export { SetSelectionFrozenCommand, SetRowFrozenCommand, SetColumnFrozenCommand, CancelFrozenCommand } from './commands/commands/set-frozen.command'; +export { ApplyFormatPainterCommand, SetInfiniteFormatPainterCommand, SetOnceFormatPainterCommand } from './commands/commands/set-format-painter.command'; +export { CancelFrozenCommand, SetColumnFrozenCommand, SetRowFrozenCommand, SetSelectionFrozenCommand } from './commands/commands/set-frozen.command'; export { + type IScrollCommandParams, + type IScrollToCellCommandParams, + type ISetScrollRelativeCommandParams, ResetScrollCommand, ScrollCommand, ScrollToCellCommand, SetScrollRelativeCommand, - type IScrollCommandParams, - type IScrollToCellCommandParams, - type ISetScrollRelativeCommandParams, } from './commands/commands/set-scroll.command'; -export { JumpOver, MoveSelectionCommand, MoveSelectionEnterAndTabCommand, ExpandSelectionCommand, SelectAllCommand } from './commands/commands/set-selection.command'; +export { ExpandSelectionCommand, JumpOver, MoveSelectionCommand, MoveSelectionEnterAndTabCommand, SelectAllCommand } from './commands/commands/set-selection.command'; export { ChangeZoomRatioCommand, SetZoomRatioCommand } from './commands/commands/set-zoom-ratio.command'; export { ShowMenuListCommand } from './commands/commands/unhide.command'; -export { AddWorksheetProtectionCommand, DeleteWorksheetProtectionCommand, SetWorksheetProtectionCommand, DeleteWorksheetProtectionFormSheetBarCommand, ChangeSheetProtectionFromSheetBarCommand } from './commands/commands/worksheet-protection.command'; - +export { AddWorksheetProtectionCommand, ChangeSheetProtectionFromSheetBarCommand, DeleteWorksheetProtectionCommand, DeleteWorksheetProtectionFormSheetBarCommand, SetWorksheetProtectionCommand } from './commands/commands/worksheet-protection.command'; export { SetActivateCellEditOperation } from './commands/operations/activate-cell-edit.operation'; -export { SetCellEditVisibleOperation, SetCellEditVisibleWithF2Operation, SetCellEditVisibleArrowOperation } from './commands/operations/cell-edit.operation'; +export { SetCellEditVisibleArrowOperation, SetCellEditVisibleOperation, SetCellEditVisibleWithF2Operation } from './commands/operations/cell-edit.operation'; export { RenameSheetOperation } from './commands/operations/rename-sheet.operation'; -export { ScrollToRangeOperation } from './commands/operations/scroll-to-range.operation'; export { SetScrollOperation } from './commands/operations/scroll.operation'; +export { ScrollToRangeOperation } from './commands/operations/scroll-to-range.operation'; export { SetFormatPainterOperation } from './commands/operations/set-format-painter.operation'; export { SetZoomRatioOperation } from './commands/operations/set-zoom-ratio.operation'; export { SheetPermissionOpenDialogOperation } from './commands/operations/sheet-permission-open-dialog.operation'; export { SheetPermissionOpenPanelOperation } from './commands/operations/sheet-permission-open-panel.operation'; export { SidebarDefinedNameOperation } from './commands/operations/sidebar-defined-name.operation'; -export { type IBaseSheetBarProps } from './views/sheet-bar/sheet-bar-tabs/SheetBarItem'; +export { SHEET_VIEWPORT_KEY as VIEWPORT_KEY } from './common/keys'; +export { SHEET_VIEW_KEY } from './common/keys'; export { FONT_FAMILY_COMPONENT, FONT_FAMILY_ITEM_COMPONENT } from './components/font-family/interface'; export { FONT_SIZE_COMPONENT } from './components/font-size/interface'; -export { attachSelectionWithCoord, attachPrimaryWithCoord } from './services/selection/util'; +export { useActiveWorkbook, useActiveWorksheet, useWorkbooks } from './components/hook'; +export { SHEET_UI_PLUGIN_NAME } from './consts/plugin-name'; +export { SheetsUIPart } from './consts/ui-name'; +export { AutoFillController } from './controllers/auto-fill.controller'; +export { AFFECT_LAYOUT_STYLES, AutoHeightController } from './controllers/auto-height.controller'; +export { CellCustomRenderController } from './controllers/cell-custom-render.controller'; +export { DragRenderController } from './controllers/drag-render.controller'; +export { FormulaEditorController } from './controllers/editor/formula-editor.controller'; +export { HoverRenderController } from './controllers/hover-render.controller'; +export { menuSchema } from './controllers/menu.schema'; +export { PASTE_SPECIAL_MENU_ID } from './controllers/menu/menu'; +export { SheetMenuPosition } from './controllers/menu/menu'; +export { deriveStateFromActiveSheet$, getCurrentExclusiveRangeInterest$, getCurrentRangeDisable$, getObservableWithExclusiveRange$ } from './controllers/menu/menu-util'; +export { SheetPermissionInitController } from './controllers/permission/sheet-permission-init.controller'; +export { SheetPermissionInterceptorBaseController } from './controllers/permission/sheet-permission-interceptor-base.controller'; +export { HeaderFreezeRenderController } from './controllers/render-controllers/freeze.render-controller'; +export { HeaderMoveRenderController } from './controllers/render-controllers/header-move.render-controller'; +export { HeaderResizeRenderController } from './controllers/render-controllers/header-resize.render-controller'; +export { SheetsScrollRenderController } from './controllers/render-controllers/scroll.render-controller'; +export { SheetRenderController } from './controllers/render-controllers/sheet.render-controller'; +export { SheetUIController } from './controllers/sheet-ui.controller'; +export { whenFormulaEditorActivated } from './controllers/shortcuts/utils'; +export { whenSheetEditorFocused } from './controllers/shortcuts/utils'; +export { StatusBarController } from './controllers/status-bar.controller'; +export { + getCoordByCell, + getCoordByOffset, + getSheetObject, + getTransformCoord, +} from './controllers/utils/component-tools'; +export type { IDiscreteRange } from './controllers/utils/range-tools'; +export { rangeToDiscreteRange, virtualizeDiscreteRanges } from './controllers/utils/range-tools'; +export { matchedSelectionByRowColIndex as checkInHeaderRanges } from './controllers/utils/selections-tools'; +export { useHighlightRange } from './hooks/useHighlightRange'; +export { UniverSheetsMobileUIPlugin } from './mobile-sheets-ui-plugin'; +export { AutoFillService, IAutoFillService } from './services/auto-fill/auto-fill.service'; +export { getAutoFillRepeatRange } from './services/auto-fill/tools'; +export type { ICopyDataPiece, ISheetAutoFillHook } from './services/auto-fill/type'; + +export { APPLY_TYPE, DATA_TYPE, type IAutoFillRule } from './services/auto-fill/type'; +export { type ICopyDataInTypeIndexInfo } from './services/auto-fill/type'; + +export type { IAutoFillLocation } from './services/auto-fill/type'; + +// #region - all commands + +export { type ICanvasPopup, SheetCanvasPopManagerService } from './services/canvas-pop-manager.service'; +export { CellAlertManagerService, CellAlertType, type ICellAlert } from './services/cell-alert-manager.service'; +export { + ISheetClipboardService, + PREDEFINED_HOOK_NAME, + SheetClipboardService, +} from './services/clipboard/clipboard.service'; +export type { ICellDataWithSpanInfo, ICopyPastePayload, ISheetClipboardHook, ISheetDiscreteRangeLocation } from './services/clipboard/type'; +export { COPY_TYPE } from './services/clipboard/type'; +export { getRepeatRange } from './services/clipboard/utils'; +export { mergeSetRangeValues } from './services/clipboard/utils'; +export { DragManagerService } from './services/drag-manager.service'; +export { type IDragCellPosition } from './services/drag-manager.service'; +export { CellEditorManagerService, ICellEditorManagerService } from './services/editor/cell-editor-manager.service'; +export { IFormulaEditorManagerService } from './services/editor/formula-editor-manager.service'; +export type { IEditorBridgeServiceParam } from './services/editor-bridge.service'; +export { + EditorBridgeService, + IEditorBridgeService, + type IEditorBridgeServiceVisibleParam, +} from './services/editor-bridge.service'; +export { FormatPainterStatus, IFormatPainterService } from './services/format-painter/format-painter.service'; +export type { IFormatPainterBeforeApplyHookParams, IFormatPainterHook } from './services/format-painter/format-painter.service'; +export { HoverManagerService } from './services/hover-manager.service'; +export { type IHoverCellPosition } from './services/hover-manager.service'; +export { MarkSelectionService } from './services/mark-selection/mark-selection.service'; +export { IMarkSelectionService } from './services/mark-selection/mark-selection.service'; +export { SheetPrintInterceptorService } from './services/print-interceptor.service'; + +export { getAllSelection, getTopLeftSelection } from './services/selection/base-selection-render.service'; +export { BaseSelectionRenderService, ISheetSelectionRenderService } from './services/selection/base-selection-render.service'; export { SELECTION_SHAPE_DEPTH } from './services/selection/const'; +export { SheetSelectionRenderService } from './services/selection/selection-render.service'; +export { SelectionControl as SelectionShape } from './services/selection/selection-shape'; +export { attachPrimaryWithCoord, attachSelectionWithCoord } from './services/selection/util'; +export type { ISheetSkeletonManagerParam } from './services/sheet-skeleton-manager.service'; +export { attachRangeWithCoord, SheetSkeletonManagerService } from './services/sheet-skeleton-manager.service'; +export { SheetsRenderService } from './services/sheets-render.service'; +export { UniverSheetsUIPlugin } from './sheets-ui-plugin'; +export { MobileSheetBar } from './views/mobile/sheet-bar/MobileSheetBar'; +export type { IRangeProtectionRenderCellData } from './views/permission/extensions/range-protection.render'; +export { type IBaseSheetBarProps } from './views/sheet-bar/sheet-bar-tabs/SheetBarItem'; +export { SheetBar } from './views/sheet-bar/SheetBar'; +export { RenderSheetContent, RenderSheetFooter, RenderSheetHeader } from './views/sheet-container/SheetContainer'; // #endregion diff --git a/packages/sheets-ui/src/services/clipboard/utils.ts b/packages/sheets-ui/src/services/clipboard/utils.ts index 064b50c4a461..b2b03e26f5d8 100644 --- a/packages/sheets-ui/src/services/clipboard/utils.ts +++ b/packages/sheets-ui/src/services/clipboard/utils.ts @@ -15,32 +15,32 @@ */ import { ObjectMatrix } from '@univerjs/core'; +import { SetRangeValuesMutation } from '@univerjs/sheets'; import type { ICellData, IMutationInfo, IObjectMatrixPrimitiveType, IRange, Nullable } from '@univerjs/core'; import type { ISetRangeValuesMutationParams } from '@univerjs/sheets'; -import { SetRangeValuesMutation } from '@univerjs/sheets'; import type { IDiscreteRange } from '../../controllers/utils/range-tools'; /** * * * @param {IRange} sourceRange - * @param {IRange} targetRang + * @param {IRange} targetRange * @param {boolean} [isStrictMode] if is true,the remainder of the row and column must all be 0 to be repeated * @return {*} */ -export const getRepeatRange = (sourceRange: IRange, targetRang: IRange, isStrictMode = false) => { +export const getRepeatRange = (sourceRange: IRange, targetRange: IRange, isStrictMode = false) => { const getRowLength = (range: IRange) => range.endRow - range.startRow + 1; const getColLength = (range: IRange) => range.endColumn - range.startColumn + 1; - const rowMod = getRowLength(targetRang) % getRowLength(sourceRange); - const colMod = getColLength(targetRang) % getColLength(sourceRange); + const rowMod = getRowLength(targetRange) % getRowLength(sourceRange); + const colMod = getColLength(targetRange) % getColLength(sourceRange); const repeatRelativeRange: IRange = { startRow: 0, endRow: getRowLength(sourceRange) - 1, startColumn: 0, endColumn: getColLength(sourceRange) - 1, }; - const repeatRow = Math.floor(getRowLength(targetRang) / getRowLength(sourceRange)); - const repeatCol = Math.floor(getColLength(targetRang) / getColLength(sourceRange)); + const repeatRow = Math.floor(getRowLength(targetRange) / getRowLength(sourceRange)); + const repeatCol = Math.floor(getColLength(targetRange) / getColLength(sourceRange)); const repeatList: Array<{ startRange: IRange; repeatRelativeRange: IRange }> = []; if (!rowMod && !colMod) { for (let countRow = 1; countRow <= repeatRow; countRow++) { @@ -48,10 +48,10 @@ export const getRepeatRange = (sourceRange: IRange, targetRang: IRange, isStrict const row = getRowLength(sourceRange) * (countRow - 1); const col = getColLength(sourceRange) * (countCol - 1); const startRange: IRange = { - startRow: row + targetRang.startRow, - endRow: row + targetRang.startRow, - startColumn: col + targetRang.startColumn, - endColumn: col + targetRang.startColumn, + startRow: row + targetRange.startRow, + endRow: row + targetRange.startRow, + startColumn: col + targetRange.startColumn, + endColumn: col + targetRange.startColumn, }; repeatList.push({ repeatRelativeRange, startRange }); @@ -62,10 +62,10 @@ export const getRepeatRange = (sourceRange: IRange, targetRang: IRange, isStrict const row = getRowLength(sourceRange) * (countRow - 1); const col = 0; const startRange: IRange = { - startRow: row + targetRang.startRow, - endRow: row + targetRang.startRow, - startColumn: col + targetRang.startColumn, - endColumn: col + targetRang.startColumn, + startRow: row + targetRange.startRow, + endRow: row + targetRange.startRow, + startColumn: col + targetRange.startColumn, + endColumn: col + targetRange.startColumn, }; repeatList.push({ repeatRelativeRange, startRange }); @@ -75,20 +75,20 @@ export const getRepeatRange = (sourceRange: IRange, targetRang: IRange, isStrict const row = 0; const col = getColLength(sourceRange) * (countCol - 1); const startRange: IRange = { - startRow: row + targetRang.startRow, - endRow: row + targetRang.startRow, - startColumn: col + targetRang.startColumn, - endColumn: col + targetRang.startColumn, + startRow: row + targetRange.startRow, + endRow: row + targetRange.startRow, + startColumn: col + targetRange.startColumn, + endColumn: col + targetRange.startColumn, }; repeatList.push({ repeatRelativeRange, startRange }); } } else { const startRange: IRange = { - startRow: targetRang.startRow, - endRow: targetRang.startRow, - startColumn: targetRang.startColumn, - endColumn: targetRang.startColumn, + startRow: targetRange.startRow, + endRow: targetRange.startRow, + startColumn: targetRange.startColumn, + endColumn: targetRange.startColumn, }; repeatList.push({ startRange, repeatRelativeRange }); }