1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | "use strict";
|
8 | Object.defineProperty(exports, "__esModule", { value: true });
|
9 | var utils_1 = require("../utils");
|
10 | var gridRow_1 = require("./gridRow");
|
11 | var GridCell = (function () {
|
12 | function GridCell(gridCellDef) {
|
13 | this.rowIndex = gridCellDef.rowIndex;
|
14 | this.column = gridCellDef.column;
|
15 | this.floating = utils_1.Utils.makeNull(gridCellDef.floating);
|
16 | }
|
17 | GridCell.prototype.getGridCellDef = function () {
|
18 | return {
|
19 | rowIndex: this.rowIndex,
|
20 | column: this.column,
|
21 | floating: this.floating
|
22 | };
|
23 | };
|
24 | GridCell.prototype.getGridRow = function () {
|
25 | return new gridRow_1.GridRow(this.rowIndex, this.floating);
|
26 | };
|
27 | GridCell.prototype.toString = function () {
|
28 | return "rowIndex = " + this.rowIndex + ", floating = " + this.floating + ", column = " + (this.column ? this.column.getId() : null);
|
29 | };
|
30 | GridCell.prototype.createId = function () {
|
31 | return this.rowIndex + "." + this.floating + "." + this.column.getId();
|
32 | };
|
33 | GridCell.prototype.equals = function (other) {
|
34 | var colsMatch = this.column === other.column;
|
35 | var floatingMatch = this.floating === other.floating;
|
36 | var indexMatch = this.rowIndex === other.rowIndex;
|
37 | return colsMatch && floatingMatch && indexMatch;
|
38 | };
|
39 | return GridCell;
|
40 | }());
|
41 | exports.GridCell = GridCell;
|