import { IgcColumnComponent } from './igc-column-component';
import { GridCellValueChangingEventArgs as GridCellValueChangingEventArgs_internal } from "./GridCellValueChangingEventArgs";
import { IgcDateTimeCellInfo } from "./igc-date-time-cell-info";
import { IgcImageCellInfo } from "./igc-image-cell-info";
import { IgcNumericCellInfo } from "./igc-numeric-cell-info";
import { IgcRowSeparatorInfo } from "./igc-row-separator-info";
import { IgcSectionHeaderCellInfo } from "./igc-section-header-cell-info";
import { IgcTemplateCellInfo } from "./igc-template-cell-info";
import { IgcTemplateHeaderCellInfo } from "./igc-template-header-cell-info";
import { IgcTemplateSectionHeaderCellInfo } from "./igc-template-section-header-cell-info";
import { IgcTextCellInfo } from "./igc-text-cell-info";
import { IgcTextHeaderCellInfo } from "./igc-text-header-cell-info";
/**
 * Event arguments for the CellValueChanging event
*/
var IgcGridCellValueChangingEventArgs = /** @class */ /*@__PURE__*/ (function () {
    function IgcGridCellValueChangingEventArgs() {
        this._implementation = this.createImplementation();
        this._implementation.externalObject = this;
        this.onImplementationCreated();
    }
    IgcGridCellValueChangingEventArgs.prototype.createImplementation = function () {
        return new GridCellValueChangingEventArgs_internal();
    };
    Object.defineProperty(IgcGridCellValueChangingEventArgs.prototype, "i", {
        get: function () {
            return this._implementation;
        },
        enumerable: true,
        configurable: true
    });
    IgcGridCellValueChangingEventArgs.prototype.onImplementationCreated = function () {
    };
    IgcGridCellValueChangingEventArgs.prototype._provideImplementation = function (i) {
        this._implementation = i;
        this._implementation.externalObject = this;
        this.onImplementationCreated();
    };
    Object.defineProperty(IgcGridCellValueChangingEventArgs.prototype, "cellInfo", {
        /**
         * The backing information for the current cell.
        */
        get: function () {
            if (this.i.cellInfo == null) {
                return null;
            }
            if (!this.i.cellInfo.externalObject) {
                var ext = null;
                switch (this.i.cellInfo.$type.name) {
                    case "DateTimeCellModel":
                        ext = new IgcDateTimeCellInfo();
                        break;
                    case "ImageCellModel":
                        ext = new IgcImageCellInfo();
                        break;
                    case "NumericCellModel":
                        ext = new IgcNumericCellInfo();
                        break;
                    case "RowSeparatorModel":
                        ext = new IgcRowSeparatorInfo();
                        break;
                    case "SectionHeaderCellModel":
                        ext = new IgcSectionHeaderCellInfo();
                        break;
                    case "TemplateCellModel":
                        ext = new IgcTemplateCellInfo();
                        break;
                    case "TemplateHeaderCellModel":
                        ext = new IgcTemplateHeaderCellInfo();
                        break;
                    case "TemplateSectionHeaderCellModel":
                        ext = new IgcTemplateSectionHeaderCellInfo();
                        break;
                    case "TextCellModel":
                        ext = new IgcTextCellInfo();
                        break;
                    case "TextHeaderCellModel":
                        ext = new IgcTextHeaderCellInfo();
                        break;
                }
                ext._implementation = this.i.cellInfo;
                this.i.cellInfo.externalObject = ext;
            }
            return this.i.cellInfo.externalObject;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridCellValueChangingEventArgs.prototype, "editID", {
        /**
     * Gets the edit ID for this value change.
    */
        get: function () {
            return this.i.c;
        },
        set: function (v) {
            this.i.c = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridCellValueChangingEventArgs.prototype, "column", {
        /**
         * Gets the column the cell belongs to.
        */
        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;
        },
        set: function (v) {
            v == null ? this.i.b = null : this.i.b = v.i;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridCellValueChangingEventArgs.prototype, "item", {
        /**
         * Gets the row item associated with the change.
        */
        get: function () {
            return this.i.item;
        },
        set: function (v) {
            this.i.item = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridCellValueChangingEventArgs.prototype, "oldValue", {
        /**
         * Gets the old cell value.
        */
        get: function () {
            return this.i.f;
        },
        set: function (v) {
            this.i.f = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridCellValueChangingEventArgs.prototype, "newValue", {
        /**
         * Gets the new cell value.
        */
        get: function () {
            return this.i.e;
        },
        set: function (v) {
            this.i.e = v;
        },
        enumerable: true,
        configurable: true
    });
    return IgcGridCellValueChangingEventArgs;
}());
export { IgcGridCellValueChangingEventArgs };
//# sourceMappingURL=igc-grid-cell-value-changing-event-args.js.map
