UNPKG

igniteui-react-grids

Version:

Ignite UI React grid components.

190 lines (189 loc) 7.17 kB
import { delegateCombine, delegateRemove } from "igniteui-react-core"; import { IgrBaseEventArgs } from "./igr-base-event-args"; import { IgrRowExportingEventArgs } from "./igr-row-exporting-event-args"; import { IgrColumnExportingEventArgs } from "./igr-column-exporting-event-args"; import { TypeRegistrar } from "igniteui-react-core"; var IgrBaseExporter = /** @class */ /*@__PURE__*/ (function () { function IgrBaseExporter() { this.mounted = false; this._exportEnded = null; this._exportEnded_wrapped = null; this._rowExporting = null; this._rowExporting_wrapped = null; this._columnExporting = null; this._columnExporting_wrapped = null; this._implementation = this.createImplementation(); this._implementation.externalObject = this; this.onImplementationCreated(); if (this._initializeAdapters) { this._initializeAdapters(); } } IgrBaseExporter.prototype.createImplementation = function () { return null; }; Object.defineProperty(IgrBaseExporter.prototype, "nativeElement", { get: function () { return this._implementation.nativeElement; }, enumerable: false, configurable: true }); Object.defineProperty(IgrBaseExporter.prototype, "i", { /** * @hidden */ get: function () { return this._implementation; } /** * @hidden */, enumerable: false, configurable: true }); IgrBaseExporter._createFromInternal = function (internal) { if (!internal) { return null; } if (!internal.$type) { return null; } var name = internal.$type.name; var externalName = "Igr" + name; if (!TypeRegistrar.isRegistered(externalName)) { return null; } return TypeRegistrar.create(externalName); }; IgrBaseExporter.prototype.onImplementationCreated = function () { }; IgrBaseExporter.prototype._provideImplementation = function (i) { this._implementation = i; this._implementation.externalObject = this; this.onImplementationCreated(); if (this._initializeAdapters) { this._initializeAdapters(); } }; IgrBaseExporter.prototype.findByName = function (name) { if (this.findEphemera) { if (name && name.indexOf("@@e:") == 0) { return this.findEphemera(name); } } return null; }; IgrBaseExporter.prototype.setNativeElement = function (element) { this.i.setNativeElement(element); }; IgrBaseExporter.prototype.exportGrid = function (grid, options) { this.i.k(grid, (options == null ? null : options.i)); }; IgrBaseExporter.prototype.exportData = function (data, options) { this.i.i(data, (options == null ? null : options.i)); }; Object.defineProperty(IgrBaseExporter.prototype, "exportEnded", { get: function () { return this._exportEnded; }, set: function (ev) { var _this = this; if (this._exportEnded_wrapped !== null) { this.i.exportEnded = delegateRemove(this.i.exportEnded, this._exportEnded_wrapped); this._exportEnded_wrapped = null; this._exportEnded = null; } this._exportEnded = ev; this._exportEnded_wrapped = function (o, e) { var outerArgs = new IgrBaseEventArgs(); outerArgs._provideImplementation(e); if (_this.beforeExportEnded) { _this.beforeExportEnded(_this, outerArgs); } if (_this._exportEnded) { _this._exportEnded(_this, outerArgs); } }; this.i.exportEnded = delegateCombine(this.i.exportEnded, this._exportEnded_wrapped); ; }, enumerable: false, configurable: true }); Object.defineProperty(IgrBaseExporter.prototype, "rowExporting", { /** * This event is emitted when a row is exported. * ```typescript * this.exporterService.rowExporting.subscribe((args: IRowExportingEventArgs) => { * // put event handler code here * }); * ``` * @memberof IgxBaseExporter */ get: function () { return this._rowExporting; }, set: function (ev) { var _this = this; if (this._rowExporting_wrapped !== null) { this.i.rowExporting = delegateRemove(this.i.rowExporting, this._rowExporting_wrapped); this._rowExporting_wrapped = null; this._rowExporting = null; } this._rowExporting = ev; this._rowExporting_wrapped = function (o, e) { var outerArgs = new IgrRowExportingEventArgs(); outerArgs._provideImplementation(e); if (_this.beforeRowExporting) { _this.beforeRowExporting(_this, outerArgs); } if (_this._rowExporting) { _this._rowExporting(_this, outerArgs); } }; this.i.rowExporting = delegateCombine(this.i.rowExporting, this._rowExporting_wrapped); ; }, enumerable: false, configurable: true }); Object.defineProperty(IgrBaseExporter.prototype, "columnExporting", { /** * This event is emitted when a column is exported. * ```typescript * this.exporterService.columnExporting.subscribe((args: IColumnExportingEventArgs) => { * // put event handler code here * }); * ``` * @memberof IgxBaseExporter */ get: function () { return this._columnExporting; }, set: function (ev) { var _this = this; if (this._columnExporting_wrapped !== null) { this.i.columnExporting = delegateRemove(this.i.columnExporting, this._columnExporting_wrapped); this._columnExporting_wrapped = null; this._columnExporting = null; } this._columnExporting = ev; this._columnExporting_wrapped = function (o, e) { var outerArgs = new IgrColumnExportingEventArgs(); outerArgs._provideImplementation(e); if (_this.beforeColumnExporting) { _this.beforeColumnExporting(_this, outerArgs); } if (_this._columnExporting) { _this._columnExporting(_this, outerArgs); } }; this.i.columnExporting = delegateCombine(this.i.columnExporting, this._columnExporting_wrapped); ; }, enumerable: false, configurable: true }); return IgrBaseExporter; }()); export { IgrBaseExporter };