devextreme-angular
Version:
Angular UI and visualization components based on DevExtreme widgets
706 lines (669 loc) • 25.8 kB
JavaScript
import * as i2 from '@angular/platform-browser';
import { BrowserTransferStateModule } from '@angular/platform-browser';
import * as i0 from '@angular/core';
import { PLATFORM_ID, Component, Inject, Input, Output, NgModule } from '@angular/core';
import DxPivotGrid from 'devextreme/ui/pivot_grid';
import * as i1 from 'devextreme-angular/core';
import { DxComponent, DxTemplateHost, WatcherHelper, NestedOptionHost, IterableDifferHelper, DxIntegrationModule, DxTemplateModule } from 'devextreme-angular/core';
import { DxoDataSourceModule, DxiFieldModule, DxoFormatModule, DxoHeaderFilterModule, DxoStoreModule, DxoExportModule, DxoFieldChooserModule, DxoTextsModule, DxoFieldPanelModule, DxoLoadPanelModule, DxoScrollingModule, DxoStateStoringModule } from 'devextreme-angular/ui/nested';
/*!
* devextreme-angular
* Version: 22.1.14
* Build date: Mon Apr 29 2024
*
* Copyright (c) 2012 - 2024 Developer Express Inc. ALL RIGHTS RESERVED
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file in the root of the project for details.
*
* https://github.com/DevExpress/devextreme-angular
*/
/**
* The PivotGrid is a UI component that allows you to display and analyze multi-dimensional data from a local storage or an OLAP cube.
*/
class DxPivotGridComponent extends DxComponent {
constructor(elementRef, ngZone, templateHost, _watcherHelper, _idh, optionHost, transferState, platformId) {
super(elementRef, ngZone, templateHost, _watcherHelper, transferState, platformId);
this._watcherHelper = _watcherHelper;
this._idh = _idh;
this._createEventEmitters([
{ subscribe: 'cellClick', emit: 'onCellClick' },
{ subscribe: 'cellPrepared', emit: 'onCellPrepared' },
{ subscribe: 'contentReady', emit: 'onContentReady' },
{ subscribe: 'contextMenuPreparing', emit: 'onContextMenuPreparing' },
{ subscribe: 'disposing', emit: 'onDisposing' },
{ subscribe: 'exported', emit: 'onExported' },
{ subscribe: 'exporting', emit: 'onExporting' },
{ subscribe: 'fileSaving', emit: 'onFileSaving' },
{ subscribe: 'initialized', emit: 'onInitialized' },
{ subscribe: 'optionChanged', emit: 'onOptionChanged' },
{ emit: 'allowExpandAllChange' },
{ emit: 'allowFilteringChange' },
{ emit: 'allowSortingChange' },
{ emit: 'allowSortingBySummaryChange' },
{ emit: 'dataFieldAreaChange' },
{ emit: 'dataSourceChange' },
{ emit: 'disabledChange' },
{ emit: 'elementAttrChange' },
{ emit: 'encodeHtmlChange' },
{ emit: 'exportChange' },
{ emit: 'fieldChooserChange' },
{ emit: 'fieldPanelChange' },
{ emit: 'headerFilterChange' },
{ emit: 'heightChange' },
{ emit: 'hideEmptySummaryCellsChange' },
{ emit: 'hintChange' },
{ emit: 'loadPanelChange' },
{ emit: 'rowHeaderLayoutChange' },
{ emit: 'rtlEnabledChange' },
{ emit: 'scrollingChange' },
{ emit: 'showBordersChange' },
{ emit: 'showColumnGrandTotalsChange' },
{ emit: 'showColumnTotalsChange' },
{ emit: 'showRowGrandTotalsChange' },
{ emit: 'showRowTotalsChange' },
{ emit: 'showTotalsPriorChange' },
{ emit: 'stateStoringChange' },
{ emit: 'tabIndexChange' },
{ emit: 'textsChange' },
{ emit: 'visibleChange' },
{ emit: 'widthChange' },
{ emit: 'wordWrapEnabledChange' }
]);
this._idh.setHost(this);
optionHost.setHost(this);
}
/**
* Allows users to expand/collapse all header items within the same header level. Ignored if the PivotGridDataSource's paginate property is true.
*/
get allowExpandAll() {
return this._getOption('allowExpandAll');
}
set allowExpandAll(value) {
this._setOption('allowExpandAll', value);
}
/**
* Allows a user to filter fields by selecting or deselecting values in the popup menu.
*/
get allowFiltering() {
return this._getOption('allowFiltering');
}
set allowFiltering(value) {
this._setOption('allowFiltering', value);
}
/**
* Allows an end user to change sorting properties.
*/
get allowSorting() {
return this._getOption('allowSorting');
}
set allowSorting(value) {
this._setOption('allowSorting', value);
}
/**
* Allows users to sort the pivot grid by summary values instead of field values. Ignored if the PivotGridDataSource's paginate property is true.
*/
get allowSortingBySummary() {
return this._getOption('allowSortingBySummary');
}
set allowSortingBySummary(value) {
this._setOption('allowSortingBySummary', value);
}
/**
* Specifies the area to which data field headers must belong.
*/
get dataFieldArea() {
return this._getOption('dataFieldArea');
}
set dataFieldArea(value) {
this._setOption('dataFieldArea', value);
}
/**
* Binds the UI component to data.
*/
get dataSource() {
return this._getOption('dataSource');
}
set dataSource(value) {
this._setOption('dataSource', value);
}
/**
* Specifies whether the UI component responds to user interaction.
*/
get disabled() {
return this._getOption('disabled');
}
set disabled(value) {
this._setOption('disabled', value);
}
/**
* Specifies the global attributes to be attached to the UI component's container element.
*/
get elementAttr() {
return this._getOption('elementAttr');
}
set elementAttr(value) {
this._setOption('elementAttr', value);
}
/**
* Specifies whether HTML tags are displayed as plain text or applied to cell values.
*/
get encodeHtml() {
return this._getOption('encodeHtml');
}
set encodeHtml(value) {
this._setOption('encodeHtml', value);
}
/**
* Configures client-side exporting.
*/
get export() {
return this._getOption('export');
}
set export(value) {
this._setOption('export', value);
}
/**
* The Field Chooser configuration properties.
*/
get fieldChooser() {
return this._getOption('fieldChooser');
}
set fieldChooser(value) {
this._setOption('fieldChooser', value);
}
/**
* Configures the field panel.
*/
get fieldPanel() {
return this._getOption('fieldPanel');
}
set fieldPanel(value) {
this._setOption('fieldPanel', value);
}
/**
* Configures the header filter feature.
*/
get headerFilter() {
return this._getOption('headerFilter');
}
set headerFilter(value) {
this._setOption('headerFilter', value);
}
/**
* Specifies the UI component's height.
*/
get height() {
return this._getOption('height');
}
set height(value) {
this._setOption('height', value);
}
/**
* Specifies whether or not to hide rows and columns with no data.
*/
get hideEmptySummaryCells() {
return this._getOption('hideEmptySummaryCells');
}
set hideEmptySummaryCells(value) {
this._setOption('hideEmptySummaryCells', value);
}
/**
* Specifies text for a hint that appears when a user pauses on the UI component.
*/
get hint() {
return this._getOption('hint');
}
set hint(value) {
this._setOption('hint', value);
}
/**
* Specifies properties configuring the load panel.
*/
get loadPanel() {
return this._getOption('loadPanel');
}
set loadPanel(value) {
this._setOption('loadPanel', value);
}
/**
* Specifies the layout of items in the row header.
*/
get rowHeaderLayout() {
return this._getOption('rowHeaderLayout');
}
set rowHeaderLayout(value) {
this._setOption('rowHeaderLayout', value);
}
/**
* Switches the UI component to a right-to-left representation.
*/
get rtlEnabled() {
return this._getOption('rtlEnabled');
}
set rtlEnabled(value) {
this._setOption('rtlEnabled', value);
}
/**
* A configuration object specifying scrolling properties.
*/
get scrolling() {
return this._getOption('scrolling');
}
set scrolling(value) {
this._setOption('scrolling', value);
}
/**
* Specifies whether the outer borders of the grid are visible or not.
*/
get showBorders() {
return this._getOption('showBorders');
}
set showBorders(value) {
this._setOption('showBorders', value);
}
/**
* Specifies whether to display the Grand Total column.
*/
get showColumnGrandTotals() {
return this._getOption('showColumnGrandTotals');
}
set showColumnGrandTotals(value) {
this._setOption('showColumnGrandTotals', value);
}
/**
* Specifies whether to display the Total columns.
*/
get showColumnTotals() {
return this._getOption('showColumnTotals');
}
set showColumnTotals(value) {
this._setOption('showColumnTotals', value);
}
/**
* Specifies whether to display the Grand Total row.
*/
get showRowGrandTotals() {
return this._getOption('showRowGrandTotals');
}
set showRowGrandTotals(value) {
this._setOption('showRowGrandTotals', value);
}
/**
* Specifies whether to display the Total rows. Applies only if rowHeaderLayout is 'standard'.
*/
get showRowTotals() {
return this._getOption('showRowTotals');
}
set showRowTotals(value) {
this._setOption('showRowTotals', value);
}
/**
* Specifies where to show the total rows or columns.
*/
get showTotalsPrior() {
return this._getOption('showTotalsPrior');
}
set showTotalsPrior(value) {
this._setOption('showTotalsPrior', value);
}
/**
* A configuration object specifying properties related to state storing.
*/
get stateStoring() {
return this._getOption('stateStoring');
}
set stateStoring(value) {
this._setOption('stateStoring', value);
}
/**
* Specifies the number of the element when the Tab key is used for navigating.
*/
get tabIndex() {
return this._getOption('tabIndex');
}
set tabIndex(value) {
this._setOption('tabIndex', value);
}
/**
* Strings that can be changed or localized in the PivotGrid UI component.
*/
get texts() {
return this._getOption('texts');
}
set texts(value) {
this._setOption('texts', value);
}
/**
* Specifies whether the UI component is visible.
*/
get visible() {
return this._getOption('visible');
}
set visible(value) {
this._setOption('visible', value);
}
/**
* Specifies the UI component's width.
*/
get width() {
return this._getOption('width');
}
set width(value) {
this._setOption('width', value);
}
/**
* Specifies whether long text in header items should be wrapped.
*/
get wordWrapEnabled() {
return this._getOption('wordWrapEnabled');
}
set wordWrapEnabled(value) {
this._setOption('wordWrapEnabled', value);
}
_createInstance(element, options) {
return new DxPivotGrid(element, options);
}
ngOnDestroy() {
this._destroyWidget();
}
ngOnChanges(changes) {
super.ngOnChanges(changes);
this.setupChanges('dataSource', changes);
}
setupChanges(prop, changes) {
if (!(prop in this._optionsToUpdate)) {
this._idh.setup(prop, changes);
}
}
ngDoCheck() {
this._idh.doCheck('dataSource');
this._watcherHelper.checkWatchers();
super.ngDoCheck();
super.clearChangedOptions();
}
_setOption(name, value) {
let isSetup = this._idh.setupSingle(name, value);
let isChanged = this._idh.getChanges(name, value) !== null;
if (isSetup || isChanged) {
super._setOption(name, value);
}
}
}
/** @nocollapse */ DxPivotGridComponent.ɵfac = function DxPivotGridComponent_Factory(t) { return new (t || DxPivotGridComponent)(i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i0.NgZone), i0.ɵɵdirectiveInject(i1.DxTemplateHost), i0.ɵɵdirectiveInject(i1.WatcherHelper), i0.ɵɵdirectiveInject(i1.IterableDifferHelper), i0.ɵɵdirectiveInject(i1.NestedOptionHost), i0.ɵɵdirectiveInject(i2.TransferState), i0.ɵɵdirectiveInject(PLATFORM_ID)); };
/** @nocollapse */ DxPivotGridComponent.ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: DxPivotGridComponent, selectors: [["dx-pivot-grid"]], inputs: { allowExpandAll: "allowExpandAll", allowFiltering: "allowFiltering", allowSorting: "allowSorting", allowSortingBySummary: "allowSortingBySummary", dataFieldArea: "dataFieldArea", dataSource: "dataSource", disabled: "disabled", elementAttr: "elementAttr", encodeHtml: "encodeHtml", export: "export", fieldChooser: "fieldChooser", fieldPanel: "fieldPanel", headerFilter: "headerFilter", height: "height", hideEmptySummaryCells: "hideEmptySummaryCells", hint: "hint", loadPanel: "loadPanel", rowHeaderLayout: "rowHeaderLayout", rtlEnabled: "rtlEnabled", scrolling: "scrolling", showBorders: "showBorders", showColumnGrandTotals: "showColumnGrandTotals", showColumnTotals: "showColumnTotals", showRowGrandTotals: "showRowGrandTotals", showRowTotals: "showRowTotals", showTotalsPrior: "showTotalsPrior", stateStoring: "stateStoring", tabIndex: "tabIndex", texts: "texts", visible: "visible", width: "width", wordWrapEnabled: "wordWrapEnabled" }, outputs: { onCellClick: "onCellClick", onCellPrepared: "onCellPrepared", onContentReady: "onContentReady", onContextMenuPreparing: "onContextMenuPreparing", onDisposing: "onDisposing", onExported: "onExported", onExporting: "onExporting", onFileSaving: "onFileSaving", onInitialized: "onInitialized", onOptionChanged: "onOptionChanged", allowExpandAllChange: "allowExpandAllChange", allowFilteringChange: "allowFilteringChange", allowSortingChange: "allowSortingChange", allowSortingBySummaryChange: "allowSortingBySummaryChange", dataFieldAreaChange: "dataFieldAreaChange", dataSourceChange: "dataSourceChange", disabledChange: "disabledChange", elementAttrChange: "elementAttrChange", encodeHtmlChange: "encodeHtmlChange", exportChange: "exportChange", fieldChooserChange: "fieldChooserChange", fieldPanelChange: "fieldPanelChange", headerFilterChange: "headerFilterChange", heightChange: "heightChange", hideEmptySummaryCellsChange: "hideEmptySummaryCellsChange", hintChange: "hintChange", loadPanelChange: "loadPanelChange", rowHeaderLayoutChange: "rowHeaderLayoutChange", rtlEnabledChange: "rtlEnabledChange", scrollingChange: "scrollingChange", showBordersChange: "showBordersChange", showColumnGrandTotalsChange: "showColumnGrandTotalsChange", showColumnTotalsChange: "showColumnTotalsChange", showRowGrandTotalsChange: "showRowGrandTotalsChange", showRowTotalsChange: "showRowTotalsChange", showTotalsPriorChange: "showTotalsPriorChange", stateStoringChange: "stateStoringChange", tabIndexChange: "tabIndexChange", textsChange: "textsChange", visibleChange: "visibleChange", widthChange: "widthChange", wordWrapEnabledChange: "wordWrapEnabledChange" }, features: [i0.ɵɵProvidersFeature([
DxTemplateHost,
WatcherHelper,
NestedOptionHost,
IterableDifferHelper
]), i0.ɵɵInheritDefinitionFeature, i0.ɵɵNgOnChangesFeature], decls: 0, vars: 0, template: function DxPivotGridComponent_Template(rf, ctx) { }, encapsulation: 2 });
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DxPivotGridComponent, [{
type: Component,
args: [{
selector: 'dx-pivot-grid',
template: '',
providers: [
DxTemplateHost,
WatcherHelper,
NestedOptionHost,
IterableDifferHelper
]
}]
}], function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: i1.DxTemplateHost }, { type: i1.WatcherHelper }, { type: i1.IterableDifferHelper }, { type: i1.NestedOptionHost }, { type: i2.TransferState }, { type: undefined, decorators: [{
type: Inject,
args: [PLATFORM_ID]
}] }]; }, { allowExpandAll: [{
type: Input
}], allowFiltering: [{
type: Input
}], allowSorting: [{
type: Input
}], allowSortingBySummary: [{
type: Input
}], dataFieldArea: [{
type: Input
}], dataSource: [{
type: Input
}], disabled: [{
type: Input
}], elementAttr: [{
type: Input
}], encodeHtml: [{
type: Input
}], export: [{
type: Input
}], fieldChooser: [{
type: Input
}], fieldPanel: [{
type: Input
}], headerFilter: [{
type: Input
}], height: [{
type: Input
}], hideEmptySummaryCells: [{
type: Input
}], hint: [{
type: Input
}], loadPanel: [{
type: Input
}], rowHeaderLayout: [{
type: Input
}], rtlEnabled: [{
type: Input
}], scrolling: [{
type: Input
}], showBorders: [{
type: Input
}], showColumnGrandTotals: [{
type: Input
}], showColumnTotals: [{
type: Input
}], showRowGrandTotals: [{
type: Input
}], showRowTotals: [{
type: Input
}], showTotalsPrior: [{
type: Input
}], stateStoring: [{
type: Input
}], tabIndex: [{
type: Input
}], texts: [{
type: Input
}], visible: [{
type: Input
}], width: [{
type: Input
}], wordWrapEnabled: [{
type: Input
}], onCellClick: [{
type: Output
}], onCellPrepared: [{
type: Output
}], onContentReady: [{
type: Output
}], onContextMenuPreparing: [{
type: Output
}], onDisposing: [{
type: Output
}], onExported: [{
type: Output
}], onExporting: [{
type: Output
}], onFileSaving: [{
type: Output
}], onInitialized: [{
type: Output
}], onOptionChanged: [{
type: Output
}], allowExpandAllChange: [{
type: Output
}], allowFilteringChange: [{
type: Output
}], allowSortingChange: [{
type: Output
}], allowSortingBySummaryChange: [{
type: Output
}], dataFieldAreaChange: [{
type: Output
}], dataSourceChange: [{
type: Output
}], disabledChange: [{
type: Output
}], elementAttrChange: [{
type: Output
}], encodeHtmlChange: [{
type: Output
}], exportChange: [{
type: Output
}], fieldChooserChange: [{
type: Output
}], fieldPanelChange: [{
type: Output
}], headerFilterChange: [{
type: Output
}], heightChange: [{
type: Output
}], hideEmptySummaryCellsChange: [{
type: Output
}], hintChange: [{
type: Output
}], loadPanelChange: [{
type: Output
}], rowHeaderLayoutChange: [{
type: Output
}], rtlEnabledChange: [{
type: Output
}], scrollingChange: [{
type: Output
}], showBordersChange: [{
type: Output
}], showColumnGrandTotalsChange: [{
type: Output
}], showColumnTotalsChange: [{
type: Output
}], showRowGrandTotalsChange: [{
type: Output
}], showRowTotalsChange: [{
type: Output
}], showTotalsPriorChange: [{
type: Output
}], stateStoringChange: [{
type: Output
}], tabIndexChange: [{
type: Output
}], textsChange: [{
type: Output
}], visibleChange: [{
type: Output
}], widthChange: [{
type: Output
}], wordWrapEnabledChange: [{
type: Output
}] }); })();
class DxPivotGridModule {
}
/** @nocollapse */ DxPivotGridModule.ɵfac = function DxPivotGridModule_Factory(t) { return new (t || DxPivotGridModule)(); };
/** @nocollapse */ DxPivotGridModule.ɵmod = /** @pureOrBreakMyCode */ i0.ɵɵdefineNgModule({ type: DxPivotGridModule });
/** @nocollapse */ DxPivotGridModule.ɵinj = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjector({ imports: [[
DxoDataSourceModule,
DxiFieldModule,
DxoFormatModule,
DxoHeaderFilterModule,
DxoStoreModule,
DxoExportModule,
DxoFieldChooserModule,
DxoTextsModule,
DxoFieldPanelModule,
DxoLoadPanelModule,
DxoScrollingModule,
DxoStateStoringModule,
DxIntegrationModule,
DxTemplateModule,
BrowserTransferStateModule
], DxoDataSourceModule,
DxiFieldModule,
DxoFormatModule,
DxoHeaderFilterModule,
DxoStoreModule,
DxoExportModule,
DxoFieldChooserModule,
DxoTextsModule,
DxoFieldPanelModule,
DxoLoadPanelModule,
DxoScrollingModule,
DxoStateStoringModule,
DxTemplateModule] });
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DxPivotGridModule, [{
type: NgModule,
args: [{
imports: [
DxoDataSourceModule,
DxiFieldModule,
DxoFormatModule,
DxoHeaderFilterModule,
DxoStoreModule,
DxoExportModule,
DxoFieldChooserModule,
DxoTextsModule,
DxoFieldPanelModule,
DxoLoadPanelModule,
DxoScrollingModule,
DxoStateStoringModule,
DxIntegrationModule,
DxTemplateModule,
BrowserTransferStateModule
],
declarations: [
DxPivotGridComponent
],
exports: [
DxPivotGridComponent,
DxoDataSourceModule,
DxiFieldModule,
DxoFormatModule,
DxoHeaderFilterModule,
DxoStoreModule,
DxoExportModule,
DxoFieldChooserModule,
DxoTextsModule,
DxoFieldPanelModule,
DxoLoadPanelModule,
DxoScrollingModule,
DxoStateStoringModule,
DxTemplateModule
]
}]
}], null, null); })();
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(DxPivotGridModule, { declarations: [DxPivotGridComponent], imports: [DxoDataSourceModule,
DxiFieldModule,
DxoFormatModule,
DxoHeaderFilterModule,
DxoStoreModule,
DxoExportModule,
DxoFieldChooserModule,
DxoTextsModule,
DxoFieldPanelModule,
DxoLoadPanelModule,
DxoScrollingModule,
DxoStateStoringModule,
DxIntegrationModule,
DxTemplateModule,
BrowserTransferStateModule], exports: [DxPivotGridComponent, DxoDataSourceModule,
DxiFieldModule,
DxoFormatModule,
DxoHeaderFilterModule,
DxoStoreModule,
DxoExportModule,
DxoFieldChooserModule,
DxoTextsModule,
DxoFieldPanelModule,
DxoLoadPanelModule,
DxoScrollingModule,
DxoStateStoringModule,
DxTemplateModule] }); })();
/**
* Generated bundle index. Do not edit.
*/
export { DxPivotGridComponent, DxPivotGridModule };
//# sourceMappingURL=devextreme-angular-ui-pivot-grid.js.map