UNPKG

igniteui-react-grids

Version:

Ignite UI React grid components.

149 lines (148 loc) 5.64 kB
import { IgrDataGrid } from './igr-data-grid'; import { DataGridCellEventArgs as DataGridCellEventArgs_internal } from "./DataGridCellEventArgs"; import { IgrDateTimeCellInfo } from "./igr-date-time-cell-info"; import { IgrImageCellInfo } from "./igr-image-cell-info"; import { IgrNumericCellInfo } from "./igr-numeric-cell-info"; import { IgrRowSeparatorInfo } from "./igr-row-separator-info"; import { IgrSectionHeaderCellInfo } from "./igr-section-header-cell-info"; import { IgrTemplateCellInfo } from "./igr-template-cell-info"; import { IgrTemplateHeaderCellInfo } from "./igr-template-header-cell-info"; import { IgrTemplateSectionHeaderCellInfo } from "./igr-template-section-header-cell-info"; import { IgrTextCellInfo } from "./igr-text-cell-info"; import { IgrTextHeaderCellInfo } from "./igr-text-header-cell-info"; import { MouseButton_$type } from "igniteui-react-core"; import { ensureBool, ensureEnum } from "igniteui-react-core"; /** * Information about the cell in context. */ var IgrDataGridCellEventArgs = /** @class */ /*@__PURE__*/ (function () { function IgrDataGridCellEventArgs() { this._implementation = this.createImplementation(); this._implementation.externalObject = this; this.onImplementationCreated(); } IgrDataGridCellEventArgs.prototype.createImplementation = function () { return new DataGridCellEventArgs_internal(); }; Object.defineProperty(IgrDataGridCellEventArgs.prototype, "i", { get: function () { return this._implementation; }, enumerable: false, configurable: true }); IgrDataGridCellEventArgs.prototype.onImplementationCreated = function () { }; IgrDataGridCellEventArgs.prototype._provideImplementation = function (i) { this._implementation = i; this._implementation.externalObject = this; this.onImplementationCreated(); }; Object.defineProperty(IgrDataGridCellEventArgs.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 IgrDateTimeCellInfo(); break; case "ImageCellModel": ext = new IgrImageCellInfo(); break; case "NumericCellModel": ext = new IgrNumericCellInfo(); break; case "RowSeparatorModel": ext = new IgrRowSeparatorInfo(); break; case "SectionHeaderCellModel": ext = new IgrSectionHeaderCellInfo(); break; case "TemplateCellModel": ext = new IgrTemplateCellInfo(); break; case "TemplateHeaderCellModel": ext = new IgrTemplateHeaderCellInfo(); break; case "TemplateSectionHeaderCellModel": ext = new IgrTemplateSectionHeaderCellInfo(); break; case "TextCellModel": ext = new IgrTextCellInfo(); break; case "TextHeaderCellModel": ext = new IgrTextHeaderCellInfo(); break; } ext._implementation = this.i.cellInfo; this.i.cellInfo.externalObject = ext; } return this.i.cellInfo.externalObject; }, enumerable: false, configurable: true }); Object.defineProperty(IgrDataGridCellEventArgs.prototype, "grid", { /** * Gets the grid owning the cell. */ get: function () { var r = this.i.grid; if (r == null) { return null; } if (!r.externalObject) { var e = new IgrDataGrid({}); if (r.$type) { e._implementation = r; } else { if (e.i.setNativeElement) { e.i.setNativeElement(r); } } r.externalObject = e; } return r.externalObject; }, set: function (v) { v == null ? this.i.grid = null : this.i.grid = v.i; }, enumerable: false, configurable: true }); Object.defineProperty(IgrDataGridCellEventArgs.prototype, "button", { /** * Gets which click type it is. */ get: function () { return this.i.button; }, set: function (v) { this.i.button = ensureEnum(MouseButton_$type, v); }, enumerable: false, configurable: true }); Object.defineProperty(IgrDataGridCellEventArgs.prototype, "isDoubleClick", { /** * Is this a double click? */ get: function () { return this.i.isDoubleClick; }, set: function (v) { this.i.isDoubleClick = ensureBool(v); }, enumerable: false, configurable: true }); return IgrDataGridCellEventArgs; }()); export { IgrDataGridCellEventArgs };