pivot-grid-field-chooser.js 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466
  1. "use strict";
  2. var __extends = (this && this.__extends) || (function () {
  3. var extendStatics = Object.setPrototypeOf ||
  4. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  5. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  6. return function (d, b) {
  7. extendStatics(d, b);
  8. function __() { this.constructor = d; }
  9. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  10. };
  11. })();
  12. /*!
  13. * devextreme-angular
  14. * Version: 19.1.16
  15. * Build date: Tue Oct 18 2022
  16. *
  17. * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED
  18. *
  19. * This software may be modified and distributed under the terms
  20. * of the MIT license. See the LICENSE file in the root of the project for details.
  21. *
  22. * https://github.com/DevExpress/devextreme-angular
  23. */
  24. Object.defineProperty(exports, "__esModule", { value: true });
  25. var platform_browser_1 = require("@angular/platform-browser");
  26. var platform_browser_2 = require("@angular/platform-browser");
  27. var core_1 = require("@angular/core");
  28. var pivot_grid_field_chooser_1 = require("devextreme/ui/pivot_grid_field_chooser");
  29. var component_1 = require("../core/component");
  30. var template_host_1 = require("../core/template-host");
  31. var integration_1 = require("../core/integration");
  32. var template_1 = require("../core/template");
  33. var nested_option_1 = require("../core/nested-option");
  34. var watcher_helper_1 = require("../core/watcher-helper");
  35. var iterable_differ_helper_1 = require("../core/iterable-differ-helper");
  36. var header_filter_1 = require("./nested/header-filter");
  37. var texts_1 = require("./nested/texts");
  38. /**
  39. * 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.
  40. */
  41. var DxPivotGridFieldChooserComponent = (function (_super) {
  42. __extends(DxPivotGridFieldChooserComponent, _super);
  43. function DxPivotGridFieldChooserComponent(elementRef, ngZone, templateHost, _watcherHelper, _idh, optionHost, transferState, platformId) {
  44. var _this = _super.call(this, elementRef, ngZone, templateHost, _watcherHelper, transferState, platformId) || this;
  45. _this._watcherHelper = _watcherHelper;
  46. _this._idh = _idh;
  47. _this._createEventEmitters([
  48. { subscribe: 'contentReady', emit: 'onContentReady' },
  49. { subscribe: 'contextMenuPreparing', emit: 'onContextMenuPreparing' },
  50. { subscribe: 'disposing', emit: 'onDisposing' },
  51. { subscribe: 'initialized', emit: 'onInitialized' },
  52. { subscribe: 'optionChanged', emit: 'onOptionChanged' },
  53. { emit: 'accessKeyChange' },
  54. { emit: 'activeStateEnabledChange' },
  55. { emit: 'allowSearchChange' },
  56. { emit: 'applyChangesModeChange' },
  57. { emit: 'dataSourceChange' },
  58. { emit: 'disabledChange' },
  59. { emit: 'elementAttrChange' },
  60. { emit: 'focusStateEnabledChange' },
  61. { emit: 'headerFilterChange' },
  62. { emit: 'heightChange' },
  63. { emit: 'hintChange' },
  64. { emit: 'hoverStateEnabledChange' },
  65. { emit: 'layoutChange' },
  66. { emit: 'rtlEnabledChange' },
  67. { emit: 'searchTimeoutChange' },
  68. { emit: 'stateChange' },
  69. { emit: 'tabIndexChange' },
  70. { emit: 'textsChange' },
  71. { emit: 'visibleChange' },
  72. { emit: 'widthChange' }
  73. ]);
  74. _this._idh.setHost(_this);
  75. optionHost.setHost(_this);
  76. return _this;
  77. }
  78. Object.defineProperty(DxPivotGridFieldChooserComponent.prototype, "accessKey", {
  79. get: /**
  80. * Specifies the shortcut key that sets focus on the widget.
  81. */
  82. function () {
  83. return this._getOption('accessKey');
  84. },
  85. set: function (value) {
  86. this._setOption('accessKey', value);
  87. },
  88. enumerable: true,
  89. configurable: true
  90. });
  91. Object.defineProperty(DxPivotGridFieldChooserComponent.prototype, "activeStateEnabled", {
  92. get: /**
  93. * Specifies whether or not the widget changes its state when interacting with a user.
  94. */
  95. function () {
  96. return this._getOption('activeStateEnabled');
  97. },
  98. set: function (value) {
  99. this._setOption('activeStateEnabled', value);
  100. },
  101. enumerable: true,
  102. configurable: true
  103. });
  104. Object.defineProperty(DxPivotGridFieldChooserComponent.prototype, "allowSearch", {
  105. get: /**
  106. * Specifies whether the field chooser allows searching in the "All Fields" section.
  107. */
  108. function () {
  109. return this._getOption('allowSearch');
  110. },
  111. set: function (value) {
  112. this._setOption('allowSearch', value);
  113. },
  114. enumerable: true,
  115. configurable: true
  116. });
  117. Object.defineProperty(DxPivotGridFieldChooserComponent.prototype, "applyChangesMode", {
  118. get: /**
  119. * Specifies when to apply changes made in the widget to the PivotGrid.
  120. */
  121. function () {
  122. return this._getOption('applyChangesMode');
  123. },
  124. set: function (value) {
  125. this._setOption('applyChangesMode', value);
  126. },
  127. enumerable: true,
  128. configurable: true
  129. });
  130. Object.defineProperty(DxPivotGridFieldChooserComponent.prototype, "dataSource", {
  131. get: /**
  132. * The data source of a PivotGrid widget.
  133. */
  134. function () {
  135. return this._getOption('dataSource');
  136. },
  137. set: function (value) {
  138. this._setOption('dataSource', value);
  139. },
  140. enumerable: true,
  141. configurable: true
  142. });
  143. Object.defineProperty(DxPivotGridFieldChooserComponent.prototype, "disabled", {
  144. get: /**
  145. * Specifies whether the widget responds to user interaction.
  146. */
  147. function () {
  148. return this._getOption('disabled');
  149. },
  150. set: function (value) {
  151. this._setOption('disabled', value);
  152. },
  153. enumerable: true,
  154. configurable: true
  155. });
  156. Object.defineProperty(DxPivotGridFieldChooserComponent.prototype, "elementAttr", {
  157. get: /**
  158. * Specifies the attributes to be attached to the widget's root element.
  159. */
  160. function () {
  161. return this._getOption('elementAttr');
  162. },
  163. set: function (value) {
  164. this._setOption('elementAttr', value);
  165. },
  166. enumerable: true,
  167. configurable: true
  168. });
  169. Object.defineProperty(DxPivotGridFieldChooserComponent.prototype, "focusStateEnabled", {
  170. get: /**
  171. * Specifies whether the widget can be focused using keyboard navigation.
  172. */
  173. function () {
  174. return this._getOption('focusStateEnabled');
  175. },
  176. set: function (value) {
  177. this._setOption('focusStateEnabled', value);
  178. },
  179. enumerable: true,
  180. configurable: true
  181. });
  182. Object.defineProperty(DxPivotGridFieldChooserComponent.prototype, "headerFilter", {
  183. get: /**
  184. * Configures the header filter feature.
  185. */
  186. function () {
  187. return this._getOption('headerFilter');
  188. },
  189. set: function (value) {
  190. this._setOption('headerFilter', value);
  191. },
  192. enumerable: true,
  193. configurable: true
  194. });
  195. Object.defineProperty(DxPivotGridFieldChooserComponent.prototype, "height", {
  196. get: /**
  197. * Specifies the widget's height.
  198. */
  199. function () {
  200. return this._getOption('height');
  201. },
  202. set: function (value) {
  203. this._setOption('height', value);
  204. },
  205. enumerable: true,
  206. configurable: true
  207. });
  208. Object.defineProperty(DxPivotGridFieldChooserComponent.prototype, "hint", {
  209. get: /**
  210. * Specifies text for a hint that appears when a user pauses on the widget.
  211. */
  212. function () {
  213. return this._getOption('hint');
  214. },
  215. set: function (value) {
  216. this._setOption('hint', value);
  217. },
  218. enumerable: true,
  219. configurable: true
  220. });
  221. Object.defineProperty(DxPivotGridFieldChooserComponent.prototype, "hoverStateEnabled", {
  222. get: /**
  223. * Specifies whether the widget changes its state when a user pauses on it.
  224. */
  225. function () {
  226. return this._getOption('hoverStateEnabled');
  227. },
  228. set: function (value) {
  229. this._setOption('hoverStateEnabled', value);
  230. },
  231. enumerable: true,
  232. configurable: true
  233. });
  234. Object.defineProperty(DxPivotGridFieldChooserComponent.prototype, "layout", {
  235. get: /**
  236. * Specifies the field chooser layout.
  237. */
  238. function () {
  239. return this._getOption('layout');
  240. },
  241. set: function (value) {
  242. this._setOption('layout', value);
  243. },
  244. enumerable: true,
  245. configurable: true
  246. });
  247. Object.defineProperty(DxPivotGridFieldChooserComponent.prototype, "rtlEnabled", {
  248. get: /**
  249. * Switches the widget to a right-to-left representation.
  250. */
  251. function () {
  252. return this._getOption('rtlEnabled');
  253. },
  254. set: function (value) {
  255. this._setOption('rtlEnabled', value);
  256. },
  257. enumerable: true,
  258. configurable: true
  259. });
  260. Object.defineProperty(DxPivotGridFieldChooserComponent.prototype, "searchTimeout", {
  261. get: /**
  262. * Specifies a delay in milliseconds between when a user finishes typing in the field chooser's search panel, and when the search is executed.
  263. */
  264. function () {
  265. return this._getOption('searchTimeout');
  266. },
  267. set: function (value) {
  268. this._setOption('searchTimeout', value);
  269. },
  270. enumerable: true,
  271. configurable: true
  272. });
  273. Object.defineProperty(DxPivotGridFieldChooserComponent.prototype, "state", {
  274. get: /**
  275. * The widget's state.
  276. */
  277. function () {
  278. return this._getOption('state');
  279. },
  280. set: function (value) {
  281. this._setOption('state', value);
  282. },
  283. enumerable: true,
  284. configurable: true
  285. });
  286. Object.defineProperty(DxPivotGridFieldChooserComponent.prototype, "tabIndex", {
  287. get: /**
  288. * Specifies the number of the element when the Tab key is used for navigating.
  289. */
  290. function () {
  291. return this._getOption('tabIndex');
  292. },
  293. set: function (value) {
  294. this._setOption('tabIndex', value);
  295. },
  296. enumerable: true,
  297. configurable: true
  298. });
  299. Object.defineProperty(DxPivotGridFieldChooserComponent.prototype, "texts", {
  300. get: /**
  301. * Strings that can be changed or localized in the PivotGridFieldChooser widget.
  302. */
  303. function () {
  304. return this._getOption('texts');
  305. },
  306. set: function (value) {
  307. this._setOption('texts', value);
  308. },
  309. enumerable: true,
  310. configurable: true
  311. });
  312. Object.defineProperty(DxPivotGridFieldChooserComponent.prototype, "visible", {
  313. get: /**
  314. * Specifies whether the widget is visible.
  315. */
  316. function () {
  317. return this._getOption('visible');
  318. },
  319. set: function (value) {
  320. this._setOption('visible', value);
  321. },
  322. enumerable: true,
  323. configurable: true
  324. });
  325. Object.defineProperty(DxPivotGridFieldChooserComponent.prototype, "width", {
  326. get: /**
  327. * Specifies the widget's width.
  328. */
  329. function () {
  330. return this._getOption('width');
  331. },
  332. set: function (value) {
  333. this._setOption('width', value);
  334. },
  335. enumerable: true,
  336. configurable: true
  337. });
  338. DxPivotGridFieldChooserComponent.prototype._createInstance = function (element, options) {
  339. return new pivot_grid_field_chooser_1.default(element, options);
  340. };
  341. DxPivotGridFieldChooserComponent.prototype.ngOnDestroy = function () {
  342. this._destroyWidget();
  343. };
  344. DxPivotGridFieldChooserComponent.prototype.ngOnChanges = function (changes) {
  345. _super.prototype.ngOnChanges.call(this, changes);
  346. this.setupChanges('dataSource', changes);
  347. };
  348. DxPivotGridFieldChooserComponent.prototype.setupChanges = function (prop, changes) {
  349. if (!(prop in this._optionsToUpdate)) {
  350. this._idh.setup(prop, changes);
  351. }
  352. };
  353. DxPivotGridFieldChooserComponent.prototype.ngDoCheck = function () {
  354. this._idh.doCheck('dataSource');
  355. this._watcherHelper.checkWatchers();
  356. _super.prototype.ngDoCheck.call(this);
  357. _super.prototype.clearChangedOptions.call(this);
  358. };
  359. DxPivotGridFieldChooserComponent.prototype._setOption = function (name, value) {
  360. var isSetup = this._idh.setupSingle(name, value);
  361. var isChanged = this._idh.getChanges(name, value) !== null;
  362. if (isSetup || isChanged) {
  363. _super.prototype._setOption.call(this, name, value);
  364. }
  365. };
  366. DxPivotGridFieldChooserComponent.decorators = [
  367. { type: core_1.Component, args: [{
  368. selector: 'dx-pivot-grid-field-chooser',
  369. template: '',
  370. providers: [
  371. template_host_1.DxTemplateHost,
  372. watcher_helper_1.WatcherHelper,
  373. nested_option_1.NestedOptionHost,
  374. iterable_differ_helper_1.IterableDifferHelper
  375. ]
  376. },] },
  377. ];
  378. /** @nocollapse */
  379. DxPivotGridFieldChooserComponent.ctorParameters = function () { return [
  380. { type: core_1.ElementRef, },
  381. { type: core_1.NgZone, },
  382. { type: template_host_1.DxTemplateHost, },
  383. { type: watcher_helper_1.WatcherHelper, },
  384. { type: iterable_differ_helper_1.IterableDifferHelper, },
  385. { type: nested_option_1.NestedOptionHost, },
  386. { type: platform_browser_2.TransferState, },
  387. { type: undefined, decorators: [{ type: core_1.Inject, args: [core_1.PLATFORM_ID,] },] },
  388. ]; };
  389. DxPivotGridFieldChooserComponent.propDecorators = {
  390. "accessKey": [{ type: core_1.Input },],
  391. "activeStateEnabled": [{ type: core_1.Input },],
  392. "allowSearch": [{ type: core_1.Input },],
  393. "applyChangesMode": [{ type: core_1.Input },],
  394. "dataSource": [{ type: core_1.Input },],
  395. "disabled": [{ type: core_1.Input },],
  396. "elementAttr": [{ type: core_1.Input },],
  397. "focusStateEnabled": [{ type: core_1.Input },],
  398. "headerFilter": [{ type: core_1.Input },],
  399. "height": [{ type: core_1.Input },],
  400. "hint": [{ type: core_1.Input },],
  401. "hoverStateEnabled": [{ type: core_1.Input },],
  402. "layout": [{ type: core_1.Input },],
  403. "rtlEnabled": [{ type: core_1.Input },],
  404. "searchTimeout": [{ type: core_1.Input },],
  405. "state": [{ type: core_1.Input },],
  406. "tabIndex": [{ type: core_1.Input },],
  407. "texts": [{ type: core_1.Input },],
  408. "visible": [{ type: core_1.Input },],
  409. "width": [{ type: core_1.Input },],
  410. "onContentReady": [{ type: core_1.Output },],
  411. "onContextMenuPreparing": [{ type: core_1.Output },],
  412. "onDisposing": [{ type: core_1.Output },],
  413. "onInitialized": [{ type: core_1.Output },],
  414. "onOptionChanged": [{ type: core_1.Output },],
  415. "accessKeyChange": [{ type: core_1.Output },],
  416. "activeStateEnabledChange": [{ type: core_1.Output },],
  417. "allowSearchChange": [{ type: core_1.Output },],
  418. "applyChangesModeChange": [{ type: core_1.Output },],
  419. "dataSourceChange": [{ type: core_1.Output },],
  420. "disabledChange": [{ type: core_1.Output },],
  421. "elementAttrChange": [{ type: core_1.Output },],
  422. "focusStateEnabledChange": [{ type: core_1.Output },],
  423. "headerFilterChange": [{ type: core_1.Output },],
  424. "heightChange": [{ type: core_1.Output },],
  425. "hintChange": [{ type: core_1.Output },],
  426. "hoverStateEnabledChange": [{ type: core_1.Output },],
  427. "layoutChange": [{ type: core_1.Output },],
  428. "rtlEnabledChange": [{ type: core_1.Output },],
  429. "searchTimeoutChange": [{ type: core_1.Output },],
  430. "stateChange": [{ type: core_1.Output },],
  431. "tabIndexChange": [{ type: core_1.Output },],
  432. "textsChange": [{ type: core_1.Output },],
  433. "visibleChange": [{ type: core_1.Output },],
  434. "widthChange": [{ type: core_1.Output },],
  435. };
  436. return DxPivotGridFieldChooserComponent;
  437. }(component_1.DxComponent));
  438. exports.DxPivotGridFieldChooserComponent = DxPivotGridFieldChooserComponent;
  439. var DxPivotGridFieldChooserModule = (function () {
  440. function DxPivotGridFieldChooserModule() {
  441. }
  442. DxPivotGridFieldChooserModule.decorators = [
  443. { type: core_1.NgModule, args: [{
  444. imports: [
  445. header_filter_1.DxoHeaderFilterModule,
  446. texts_1.DxoTextsModule,
  447. integration_1.DxIntegrationModule,
  448. template_1.DxTemplateModule,
  449. platform_browser_1.BrowserTransferStateModule
  450. ],
  451. declarations: [
  452. DxPivotGridFieldChooserComponent
  453. ],
  454. exports: [
  455. DxPivotGridFieldChooserComponent,
  456. header_filter_1.DxoHeaderFilterModule,
  457. texts_1.DxoTextsModule,
  458. template_1.DxTemplateModule
  459. ]
  460. },] },
  461. ];
  462. return DxPivotGridFieldChooserModule;
  463. }());
  464. exports.DxPivotGridFieldChooserModule = DxPivotGridFieldChooserModule;
  465. //# sourceMappingURL=pivot-grid-field-chooser.js.map