UNPKG

igniteui-react-grids

Version:

Ignite UI React grid components.

204 lines (203 loc) 5.98 kB
import { TypeRegistrar } from "igniteui-react-core"; import { ensureBool } from "igniteui-react-core"; export class IgrExporterOptionsBase { createImplementation() { return null; } get nativeElement() { return this._implementation.nativeElement; } /** * @hidden */ get i() { return this._implementation; } /** * @hidden */ static _createFromInternal(internal) { if (!internal) { return null; } if (!internal.$type) { return null; } let name = internal.$type.name; let externalName = "Igr" + name; if (!TypeRegistrar.isRegistered(externalName)) { return null; } return TypeRegistrar.create(externalName); } onImplementationCreated() { } constructor() { this.mounted = false; this._implementation = this.createImplementation(); this._implementation.externalObject = this; this.onImplementationCreated(); if (this._initializeAdapters) { this._initializeAdapters(); } } _provideImplementation(i) { this._implementation = i; this._implementation.externalObject = this; this.onImplementationCreated(); if (this._initializeAdapters) { this._initializeAdapters(); } } /** * Specifies whether hidden columns should be exported. * ```typescript * let ignoreColumnsVisibility = this.exportOptions.ignoreColumnsVisibility; * this.exportOptions.ignoreColumnsVisibility = true; * ``` * @memberof IgxExporterOptionsBase */ get ignoreColumnsVisibility() { return this.i.g; } set ignoreColumnsVisibility(v) { this.i.g = ensureBool(v); } /** * Specifies whether filtered out rows should be exported. * ```typescript * let ignoreFiltering = this.exportOptions.ignoreFiltering; * this.exportOptions.ignoreFiltering = true; * ``` * @memberof IgxExporterOptionsBase */ get ignoreFiltering() { return this.i.h; } set ignoreFiltering(v) { this.i.h = ensureBool(v); } /** * Specifies if the exporter should ignore the current column order in the IgxGrid. * ```typescript * let ignoreColumnsOrder = this.exportOptions.ignoreColumnsOrder; * this.exportOptions.ignoreColumnsOrder = true; * ``` * @memberof IgxExporterOptionsBase */ get ignoreColumnsOrder() { return this.i.f; } set ignoreColumnsOrder(v) { this.i.f = ensureBool(v); } /** * Specifies whether the exported data should be sorted as in the provided IgxGrid. * When you export grouped data, setting ignoreSorting to true will cause * the grouping to fail because it relies on the sorting of the records. * ```typescript * let ignoreSorting = this.exportOptions.ignoreSorting; * this.exportOptions.ignoreSorting = true; * ``` * @memberof IgxExporterOptionsBase */ get ignoreSorting() { return this.i.k; } set ignoreSorting(v) { this.i.k = ensureBool(v); } /** * Specifies whether the exported data should be grouped as in the provided IgxGrid. * ```typescript * let ignoreGrouping = this.exportOptions.ignoreGrouping; * this.exportOptions.ignoreGrouping = true; * ``` * @memberof IgxExporterOptionsBase */ get ignoreGrouping() { return this.i.i; } set ignoreGrouping(v) { this.i.i = ensureBool(v); } /** * Specifies whether the exported data should include multi column headers as in the provided IgxGrid. * ```typescript * let ignoreMultiColumnHeaders = this.exportOptions.ignoreMultiColumnHeaders; * this.exportOptions.ignoreMultiColumnHeaders = true; * ``` * @memberof IgxExporterOptionsBase */ get ignoreMultiColumnHeaders() { return this.i.j; } set ignoreMultiColumnHeaders(v) { this.i.j = ensureBool(v); } /** * Specifies whether the exported data should include column summaries. * ```typescript * let exportSummaries = this.exportOptions.exportSummaries; * this.exportOptions.exportSummaries = true; * ``` * @memberof IgxExporterOptionsBase */ get exportSummaries() { return this.i.d; } set exportSummaries(v) { this.i.d = ensureBool(v); } /** * Specifies whether the exported data should have frozen headers. * ```typescript * let freezeHeaders = this.exportOptions.freezeHeaders; * this.exportOptions.freezeHeaders = true; * ``` * @memberof IgxExporterOptionsBase */ get freezeHeaders() { return this.i.e; } set freezeHeaders(v) { this.i.e = ensureBool(v); } /** * Specifies whether the headers should be exported if there is no data. * ```typescript * let alwaysExportHeaders = this.exportOptions.alwaysExportHeaders; * this.exportOptions.alwaysExportHeaders = false; * ``` * @memberof IgxExporterOptionsBase */ get alwaysExportHeaders() { return this.i.c; } set alwaysExportHeaders(v) { this.i.c = ensureBool(v); } /** * Gets the file name which will be used for the exporting operation. * ```typescript * let fileName = this.exportOptions.fileName; * ``` * @memberof IgxExporterOptionsBase */ get fileName() { return this.i.n; } set fileName(v) { this.i.n = v; } findByName(name) { if (this.findEphemera) { if (name && name.indexOf("@@e:") == 0) { return this.findEphemera(name); } } return null; } setNativeElement(element) { this.i.setNativeElement(element); } }