text: "use strict";
  var __extends = (this && this.__extends) || (function () {
      var extendStatics = Object.setPrototypeOf ||
          ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
          function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
      return function (d, b) {
          extendStatics(d, b);
          function __() { this.constructor = d; }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
  })();
  /*!
   * devextreme-angular
   * Version: 18.2.3
   * Build date: Thu Nov 08 2018
   *
   * Copyright (c) 2012 - 2018 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
   */
  Object.defineProperty(exports, "__esModule", { value: true });
  var platform_browser_1 = require("@angular/platform-browser");
  var platform_browser_2 = require("@angular/platform-browser");
  var core_1 = require("@angular/core");
  
  var pivot_grid_field_chooser_1 = require("devextreme/ui/pivot_grid_field_chooser");
  var component_1 = require("../core/component");
  var template_host_1 = require("../core/template-host");
  var integration_1 = require("../core/integration");
  var template_1 = require("../core/template");
  var nested_option_1 = require("../core/nested-option");
  var watcher_helper_1 = require("../core/watcher-helper");
  var iterable_differ_helper_1 = require("../core/iterable-differ-helper");
  var header_filter_1 = require("./nested/header-filter");
  var texts_1 = require("./nested/texts");
  /**
   * A complementary widget for the PivotGrid that allows you to manage data displayed in the PivotGrid. The field chooser is already integrated in the PivotGrid and can be invoked using the context menu. If you need to continuously display the field chooser near the PivotGrid widget, use the PivotGridFieldChooser widget.
   */
  var DxPivotGridFieldChooserComponent = (function (_super) {
      __extends(DxPivotGridFieldChooserComponent, _super);
      function DxPivotGridFieldChooserComponent(elementRef, ngZone, templateHost, _watcherHelper, _idh, optionHost, transferState, platformId) {
          var _this = _super.call(this, elementRef, ngZone, templateHost, _watcherHelper, transferState, platformId) || this;
          _this._watcherHelper = _watcherHelper;
          _this._idh = _idh;
          _this._createEventEmitters([
              { subscribe: 'contentReady', emit: 'onContentReady' },
              { subscribe: 'contextMenuPreparing', emit: 'onContextMenuPreparing' },
              { subscribe: 'disposing', emit: 'onDisposing' },
              { subscribe: 'initialized', emit: 'onInitialized' },
              { subscribe: 'optionChanged', emit: 'onOptionChanged' },
              { emit: 'accessKeyChange' },
              { emit: 'activeStateEnabledChange' },
              { emit: 'allowSearchChange' },
              { emit: 'applyChangesModeChange' },
              { emit: 'dataSourceChange' },
              { emit: 'disabledChange' },
              { emit: 'elementAttrChange' },
              { emit: 'focusStateEnabledChange' },
              { emit: 'headerFilterChange' },
              { emit: 'heightChange' },
              { emit: 'hintChange' },
              { emit: 'hoverStateEnabledChange' },
              { emit: 'layoutChange' },
              { emit: 'rtlEnabledChange' },
              { emit: 'searchTimeoutChange' },
              { emit: 'stateChange' },
              { emit: 'tabIndexChange' },
              { emit: 'textsChange' },
              { emit: 'visibleChange' },
              { emit: 'widthChange' }
          ]);
          _this._idh.setHost(_this);
          optionHost.setHost(_this);
          return _this;
      }
      Object.defineProperty(DxPivotGridFieldChooserComponent.prototype, "accessKey", {
          get: /**
               * Specifies the shortcut key that sets focus on the widget.
               */
          function () {
              return this._getOption('accessKey');
          },
          set: function (value) {
              this._setOption('accessKey', value);
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(DxPivotGridFieldChooserComponent.prototype, "activeStateEnabled", {
          get: /**
               * Specifies whether or not the widget changes its state when interacting with a user.
               */
          function () {
              return this._getOption('activeStateEnabled');
          },
          set: function (value) {
              this._setOption('activeStateEnabled', value);
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(DxPivotGridFieldChooserComponent.prototype, "allowSearch", {
          get: /**
               * Specifies whether the field chooser allows searching in the "All Fields" section.
               */
          function () {
              return this._getOption('allowSearch');
          },
          set: function (value) {
              this._setOption('allowSearch', value);
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(DxPivotGridFieldChooserComponent.prototype, "applyChangesMode", {
          get: /**
               * Specifies when to apply changes made in the widget to the PivotGrid.
               */
          function () {
              return this._getOption('applyChangesMode');
          },
          set: function (value) {
              this._setOption('applyChangesMode', value);
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(DxPivotGridFieldChooserComponent.prototype, "dataSource", {
          get: /**
               * The data source of a PivotGrid widget.
               */
          function () {
              return this._getOption('dataSource');
          },
          set: function (value) {
              this._setOption('dataSource', value);
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(DxPivotGridFieldChooserComponent.prototype, "disabled", {
          get: /**
               * Specifies whether the widget responds to user interaction.
               */
          function () {
              return this._getOption('disabled');
          },
          set: function (value) {
              this._setOption('disabled', value);
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(DxPivotGridFieldChooserComponent.prototype, "elementAttr", {
          get: /**
               * Specifies the attributes to be attached to the widget's root element.
               */
          function () {
              return this._getOption('elementAttr');
          },
          set: function (value) {
              this._setOption('elementAttr', value);
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(DxPivotGridFieldChooserComponent.prototype, "focusStateEnabled", {
          get: /**
               * Specifies whether the widget can be focused using keyboard navigation.
               */
          function () {
              return this._getOption('focusStateEnabled');
          },
          set: function (value) {
              this._setOption('focusStateEnabled', value);
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(DxPivotGridFieldChooserComponent.prototype, "headerFilter", {
          get: /**
               * Configures the header filter feature.
               */
          function () {
              return this._getOption('headerFilter');
          },
          set: function (value) {
              this._setOption('headerFilter', value);
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(DxPivotGridFieldChooserComponent.prototype, "height", {
          get: /**
               * Specifies the widget's height.
               */
          function () {
              return this._getOption('height');
          },
          set: function (value) {
              this._setOption('height', value);
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(DxPivotGridFieldChooserComponent.prototype, "hint", {
          get: /**
               * Specifies text for a hint that appears when a user pauses on the widget.
               */
          function () {
              return this._getOption('hint');
          },
          set: function (value) {
              this._setOption('hint', value);
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(DxPivotGridFieldChooserComponent.prototype, "hoverStateEnabled", {
          get: /**
               * Specifies whether the widget changes its state when a user pauses on it.
               */
          function () {
              return this._getOption('hoverStateEnabled');
          },
          set: function (value) {
              this._setOption('hoverStateEnabled', value);
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(DxPivotGridFieldChooserComponent.prototype, "layout", {
          get: /**
               * Specifies the field chooser layout.
               */
          function () {
              return this._getOption('layout');
          },
          set: function (value) {
              this._setOption('layout', value);
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(DxPivotGridFieldChooserComponent.prototype, "rtlEnabled", {
          get: /**
               * Switches the widget to a right-to-left representation.
               */
          function () {
              return this._getOption('rtlEnabled');
          },
          set: function (value) {
              this._setOption('rtlEnabled', value);
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(DxPivotGridFieldChooserComponent.prototype, "searchTimeout", {
          get: /**
               * Specifies a delay in milliseconds between when a user finishes typing in the field chooser's search panel, and when the search is executed.
               */
          function () {
              return this._getOption('searchTimeout');
          },
          set: function (value) {
              this._setOption('searchTimeout', value);
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(DxPivotGridFieldChooserComponent.prototype, "state", {
          get: /**
               * The widget's state.
               */
          function () {
              return this._getOption('state');
          },
          set: function (value) {
              this._setOption('state', value);
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(DxPivotGridFieldChooserComponent.prototype, "tabIndex", {
          get: /**
               * Specifies the number of the element when the Tab key is used for navigating.
               */
          function () {
              return this._getOption('tabIndex');
          },
          set: function (value) {
              this._setOption('tabIndex', value);
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(DxPivotGridFieldChooserComponent.prototype, "texts", {
          get: /**
               * Strings that can be changed or localized in the PivotGridFieldChooser widget.
               */
          function () {
              return this._getOption('texts');
          },
          set: function (value) {
              this._setOption('texts', value);
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(DxPivotGridFieldChooserComponent.prototype, "visible", {
          get: /**
               * Specifies whether the widget is visible.
               */
          function () {
              return this._getOption('visible');
          },
          set: function (value) {
              this._setOption('visible', value);
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(DxPivotGridFieldChooserComponent.prototype, "width", {
          get: /**
               * Specifies the widget's width.
               */
          function () {
              return this._getOption('width');
          },
          set: function (value) {
              this._setOption('width', value);
          },
          enumerable: true,
          configurable: true
      });
      DxPivotGridFieldChooserComponent.prototype._createInstance = function (element, options) {
          return new pivot_grid_field_chooser_1.default(element, options);
      };
      DxPivotGridFieldChooserComponent.prototype.ngOnDestroy = function () {
          this._destroyWidget();
      };
      DxPivotGridFieldChooserComponent.prototype.ngOnChanges = function (changes) {
          _super.prototype.ngOnChanges.call(this, changes);
          this.setupChanges('dataSource', changes);
      };
      DxPivotGridFieldChooserComponent.prototype.setupChanges = function (prop, changes) {
          if (!(prop in this._optionsToUpdate)) {
              this._idh.setup(prop, changes);
          }
      };
      DxPivotGridFieldChooserComponent.prototype.ngDoCheck = function () {
          this._idh.doCheck('dataSource');
          this._watcherHelper.checkWatchers();
          _super.prototype.ngDoCheck.call(this);
          _super.prototype.clearChangedOptions.call(this);
      };
      DxPivotGridFieldChooserComponent.prototype._setOption = function (name, value) {
          var isSetup = this._idh.setupSingle(name, value);
          var isChanged = this._idh.getChanges(name, value) !== null;
          if (isSetup || isChanged) {
              _super.prototype._setOption.call(this, name, value);
          }
      };
      DxPivotGridFieldChooserComponent.decorators = [
          { type: core_1.Component, args: [{
                      selector: 'dx-pivot-grid-field-chooser',
                      template: '',
                      providers: [
                          template_host_1.DxTemplateHost,
                          watcher_helper_1.WatcherHelper,
                          nested_option_1.NestedOptionHost,
                          iterable_differ_helper_1.IterableDifferHelper
                      ]
                  },] },
      ];
      /** @nocollapse */
      DxPivotGridFieldChooserComponent.ctorParameters = function () { return [
          { type: core_1.ElementRef, },
          { type: core_1.NgZone, },
          { type: template_host_1.DxTemplateHost, },
          { type: watcher_helper_1.WatcherHelper, },
          { type: iterable_differ_helper_1.IterableDifferHelper, },
          { type: nested_option_1.NestedOptionHost, },
          { type: platform_browser_2.TransferState, },
          { type: undefined, decorators: [{ type: core_1.Inject, args: [core_1.PLATFORM_ID,] },] },
      ]; };
      DxPivotGridFieldChooserComponent.propDecorators = {
          "accessKey": [{ type: core_1.Input },],
          "activeStateEnabled": [{ type: core_1.Input },],
          "allowSearch": [{ type: core_1.Input },],
          "applyChangesMode": [{ type: core_1.Input },],
          "dataSource": [{ type: core_1.Input },],
          "disabled": [{ type: core_1.Input },],
          "elementAttr": [{ type: core_1.Input },],
          "focusStateEnabled": [{ type: core_1.Input },],
          "headerFilter": [{ type: core_1.Input },],
          "height": [{ type: core_1.Input },],
          "hint": [{ type: core_1.Input },],
          "hoverStateEnabled": [{ type: core_1.Input },],
          "layout": [{ type: core_1.Input },],
          "rtlEnabled": [{ type: core_1.Input },],
          "searchTimeout": [{ type: core_1.Input },],
          "state": [{ type: core_1.Input },],
          "tabIndex": [{ type: core_1.Input },],
          "texts": [{ type: core_1.Input },],
          "visible": [{ type: core_1.Input },],
          "width": [{ type: core_1.Input },],
          "onContentReady": [{ type: core_1.Output },],
          "onContextMenuPreparing": [{ type: core_1.Output },],
          "onDisposing": [{ type: core_1.Output },],
          "onInitialized": [{ type: core_1.Output },],
          "onOptionChanged": [{ type: core_1.Output },],
          "accessKeyChange": [{ type: core_1.Output },],
          "activeStateEnabledChange": [{ type: core_1.Output },],
          "allowSearchChange": [{ type: core_1.Output },],
          "applyChangesModeChange": [{ type: core_1.Output },],
          "dataSourceChange": [{ type: core_1.Output },],
          "disabledChange": [{ type: core_1.Output },],
          "elementAttrChange": [{ type: core_1.Output },],
          "focusStateEnabledChange": [{ type: core_1.Output },],
          "headerFilterChange": [{ type: core_1.Output },],
          "heightChange": [{ type: core_1.Output },],
          "hintChange": [{ type: core_1.Output },],
          "hoverStateEnabledChange": [{ type: core_1.Output },],
          "layoutChange": [{ type: core_1.Output },],
          "rtlEnabledChange": [{ type: core_1.Output },],
          "searchTimeoutChange": [{ type: core_1.Output },],
          "stateChange": [{ type: core_1.Output },],
          "tabIndexChange": [{ type: core_1.Output },],
          "textsChange": [{ type: core_1.Output },],
          "visibleChange": [{ type: core_1.Output },],
          "widthChange": [{ type: core_1.Output },],
      };
      return DxPivotGridFieldChooserComponent;
  }(component_1.DxComponent));
  exports.DxPivotGridFieldChooserComponent = DxPivotGridFieldChooserComponent;
  var DxPivotGridFieldChooserModule = (function () {
      function DxPivotGridFieldChooserModule() {
      }
      DxPivotGridFieldChooserModule.decorators = [
          { type: core_1.NgModule, args: [{
                      imports: [
                          header_filter_1.DxoHeaderFilterModule,
                          texts_1.DxoTextsModule,
                          integration_1.DxIntegrationModule,
                          template_1.DxTemplateModule,
                          platform_browser_1.BrowserTransferStateModule
                      ],
                      declarations: [
                          DxPivotGridFieldChooserComponent
                      ],
                      exports: [
                          DxPivotGridFieldChooserComponent,
                          header_filter_1.DxoHeaderFilterModule,
                          texts_1.DxoTextsModule,
                          template_1.DxTemplateModule
                      ]
                  },] },
      ];
      return DxPivotGridFieldChooserModule;
  }());
  exports.DxPivotGridFieldChooserModule = DxPivotGridFieldChooserModule;
  //# sourceMappingURL=pivot-grid-field-chooser.js.map