Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(sheets): bugfix for data-validation and hyper-link #2527

Merged
merged 6 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
feat: update
  • Loading branch information
weird94 committed Jun 17, 2024
commit 2612d4157c7fb2be7b2cb2f3eb425504cf60e34e
6 changes: 5 additions & 1 deletion packages/core/src/shared/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
WrapStrategy,
} from '../types/enum';
import { type IRange, RANGE_TYPE } from '../types/interfaces';
import type { ICellData } from '../types/interfaces/i-cell-data';
import type { ICellData, ICellDataForSheetInterceptor } from '../types/interfaces/i-cell-data';
import type { IDocumentData } from '../types/interfaces/i-document-data';
import type { IRangeWithCoord, ISelectionCell, ISelectionCellWithCoord } from '../types/interfaces/i-selection-data';
import type { IColorStyle, IStyleData } from '../types/interfaces/i-style-data';
Expand Down Expand Up @@ -132,6 +132,10 @@ export function isEmptyCell(cell: Nullable<ICellData>) {
return false;
}

export function isCellCoverable(cell: Nullable<ICellDataForSheetInterceptor>) {
return isEmptyCell(cell) && cell?.coverable !== false;
}

export function getColorStyle(color: Nullable<IColorStyle>): Nullable<string> {
if (color) {
if (color.rgb) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
getColorStyle,
HorizontalAlign,
IContextService,
isEmptyCell,
isCellCoverable,
isNullCell,
isWhiteColor,
LocaleService,
Expand Down Expand Up @@ -1508,7 +1508,6 @@ export class SpreadsheetSkeleton extends Skeleton {
};
}

// eslint-disable-next-line complexity
private _getOverflowBound(
row: number,
startColumn: number,
Expand All @@ -1522,7 +1521,7 @@ export class SpreadsheetSkeleton extends Skeleton {
for (let i = startColumn; i >= endColumn; i--) {
const column = i;
const cell = this._worksheet?.getCell(row, column);
if (((!isEmptyCell(cell) || cell?.coverable === false) && column !== startColumn) || this.intersectMergeRange(row, column)) {
if ((!isCellCoverable(cell) && column !== startColumn) || this.intersectMergeRange(row, column)) {
if (column === startColumn) {
return column;
}
Expand Down Expand Up @@ -1551,7 +1550,7 @@ export class SpreadsheetSkeleton extends Skeleton {
for (let i = startColumn; i <= endColumn; i++) {
const column = i;
const cell = this._worksheet?.getCell(row, column);
if (((!isEmptyCell(cell) || cell?.coverable === false) && column !== startColumn) || this.intersectMergeRange(row, column)) {
if ((!isCellCoverable(cell) && column !== startColumn) || this.intersectMergeRange(row, column)) {
if (column === startColumn) {
return column;
}
Expand Down
Loading