UNPKG

@true-directive/base

Version:

The set of base classes for the TrueDirective Grid

32 lines (31 loc) 1.48 kB
/** * Позиция ячейки в гриде. * Строка и индекс строки нужны вместе, чтобы при сортировке или фильтрации * мы могли перезадать индекс. * Просто строкой довольствоваться не удобно, т.к. постоянно придется * использовать indexOf. */ var CellPosition = /** @class */ (function () { function CellPosition(row, // Строка, в которой находится ячейка rowIndex, // Индекс этой строки fieldName, // Наименование поля keyValue) { if (keyValue === void 0) { keyValue = null; } this.row = row; this.rowIndex = rowIndex; this.fieldName = fieldName; this.keyValue = keyValue; } CellPosition.prototype.clone = function () { return new CellPosition(this.row, this.rowIndex, this.fieldName, this.keyValue); }; CellPosition.prototype.equals = function (cp) { if (cp === null) { return false; } // Ключевое значение однозначно может указать на равенство строк return (this.keyValue !== null && this.keyValue === cp.keyValue || this.row === cp.row) && this.fieldName === cp.fieldName; }; return CellPosition; }()); export { CellPosition };