mirror of
https://github.com/nocodb/nocodb.git
synced 2026-04-30 14:46:49 +00:00
fix multiselect
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
export interface Cell {
|
||||
row: number | null
|
||||
col: number | null
|
||||
row: number
|
||||
col: number
|
||||
}
|
||||
|
||||
export class CellRange {
|
||||
@@ -12,14 +12,22 @@ export class CellRange {
|
||||
this._end = end ?? this._start
|
||||
}
|
||||
|
||||
get start() {
|
||||
isEmpty() {
|
||||
return this._start == null || this._end == null
|
||||
}
|
||||
|
||||
isSingleCell() {
|
||||
return !this.isEmpty() && this._start?.col === this._end?.col && this._start?.row === this._end?.row
|
||||
}
|
||||
|
||||
get start(): Cell {
|
||||
return {
|
||||
row: Math.min(this._start?.row ?? NaN, this._end?.row ?? NaN),
|
||||
col: Math.min(this._start?.col ?? NaN, this._end?.col ?? NaN),
|
||||
}
|
||||
}
|
||||
|
||||
get end() {
|
||||
get end(): Cell {
|
||||
return {
|
||||
row: Math.max(this._start?.row ?? NaN, this._end?.row ?? NaN),
|
||||
col: Math.max(this._start?.col ?? NaN, this._end?.col ?? NaN),
|
||||
@@ -27,19 +35,11 @@ export class CellRange {
|
||||
}
|
||||
|
||||
startRange(value: Cell) {
|
||||
if (value == null) {
|
||||
return
|
||||
}
|
||||
|
||||
this._start = value
|
||||
this._end = value
|
||||
}
|
||||
|
||||
endRange(value: Cell) {
|
||||
if (value == null) {
|
||||
return
|
||||
}
|
||||
|
||||
this._end = value
|
||||
}
|
||||
|
||||
@@ -47,8 +47,4 @@ export class CellRange {
|
||||
this._start = null
|
||||
this._end = null
|
||||
}
|
||||
|
||||
isEmpty() {
|
||||
return this._start == null || this._end == null
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user