import { CellKey as CellKey_internal } from "./CellKey";
import { IgcPrimaryKeyValue } from './igc-primary-key-value';
import { IgcColumnComponent } from './igc-column-component';
/**
 * An indentifier for a specific cell in the grid.
*/
var IgcCellKey = /** @class */ /*@__PURE__*/ (function () {
    function IgcCellKey() {
        this._implementation = new CellKey_internal();
        this._implementation.externalObject = this;
    }
    Object.defineProperty(IgcCellKey.prototype, "i", {
        get: function () {
            return this._implementation;
        },
        enumerable: true,
        configurable: true
    });
    IgcCellKey.prototype.onImplementationCreated = function () {
    };
    IgcCellKey.prototype._provideImplementation = function (i) {
        this._implementation = i;
        this._implementation.externalObject = this;
        this.onImplementationCreated();
    };
    Object.defineProperty(IgcCellKey.prototype, "primaryKey", {
        /**
         * Gets or sets the primary key of the row associated with the cell.
        */
        get: function () {
            if (this.i.primaryKey == null) {
                return null;
            }
            if (!this._primaryKey) {
                this._primaryKey = new IgcPrimaryKeyValue(this.i.primaryKey.key, this.i.primaryKey.value);
            }
            return this._primaryKey;
        },
        set: function (v) {
            this.i.primaryKey = v.i;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcCellKey.prototype, "rowItem", {
        /**
     * Gets or sets the row data object associated with the cell.
    */
        get: function () {
            return this.i.h;
        },
        set: function (v) {
            this.i.h = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcCellKey.prototype, "columnUniqueKey", {
        /**
         * Gets or sets the column name associated with the cell.
         * All columns in the grid must have a unique name. That unique name is what is used for this property.
        */
        get: function () {
            return this.i.j;
        },
        set: function (v) {
            this.i.j = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcCellKey.prototype, "resolvedColumn", {
        /**
         * Gets or sets the resolved column object associated with this cell.
        */
        get: function () {
            if (this.i.b == null) {
                return null;
            }
            if (!this.i.b.externalObject) {
                var e = IgcColumnComponent._createFromInternal(this.i.b);
                if (e) {
                    e._implementation = this.i.b;
                }
                this.i.b.externalObject = e;
            }
            return this.i.b.externalObject;
        },
        enumerable: true,
        configurable: true
    });
    IgcCellKey.prototype.findByName = function (name) {
        if (this.primaryKey && this.primaryKey.name && this.primaryKey.name == name) {
            return this.primaryKey;
        }
        return null;
    };
    return IgcCellKey;
}());
export { IgcCellKey };
//# sourceMappingURL=igc-cell-key.js.map
