UNPKG

1.56 kBJavaScriptView Raw
1/**
2 * ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
3 * @version v18.1.2
4 * @link http://www.ag-grid.com/
5 * @license MIT
6 */
7"use strict";
8Object.defineProperty(exports, "__esModule", { value: true });
9var utils_1 = require("../utils");
10var gridRow_1 = require("./gridRow");
11var 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}());
41exports.GridCell = GridCell;