Files
railwaysystem/RuoYi-Vue/ruoyi-ui/node_modules2/hyperformula/es/parser/RelativeDependency.js
T
2026-09-10 15:40:10 +08:00

52 lines
1.4 KiB
JavaScript

/**
* @license
* Copyright (c) 2024 Handsoncode. All rights reserved.
*/
import { AbsoluteCellRange, AbsoluteColumnRange, AbsoluteRowRange } from '../AbsoluteCellRange';
export class AddressDependency {
constructor(dependency) {
this.dependency = dependency;
}
absolutize(baseAddress) {
return this.dependency.toSimpleCellAddress(baseAddress);
}
}
export class CellRangeDependency {
constructor(start, end) {
this.start = start;
this.end = end;
}
absolutize(baseAddress) {
return new AbsoluteCellRange(this.start.toSimpleCellAddress(baseAddress), this.end.toSimpleCellAddress(baseAddress));
}
}
export class ColumnRangeDependency {
constructor(start, end) {
this.start = start;
this.end = end;
}
absolutize(baseAddress) {
const start = this.start.toSimpleColumnAddress(baseAddress);
const end = this.end.toSimpleColumnAddress(baseAddress);
return new AbsoluteColumnRange(start.sheet, start.col, end.col);
}
}
export class RowRangeDependency {
constructor(start, end) {
this.start = start;
this.end = end;
}
absolutize(baseAddress) {
const start = this.start.toSimpleRowAddress(baseAddress);
const end = this.end.toSimpleRowAddress(baseAddress);
return new AbsoluteRowRange(start.sheet, start.row, end.row);
}
}
export class NamedExpressionDependency {
constructor(name) {
this.name = name;
}
absolutize(_baseAddress) {
return this;
}
}