tree-view.js 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904
  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 tree_view_1 = require("devextreme/ui/tree_view");
  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 item_dxi_1 = require("./nested/item-dxi");
  37. var search_editor_options_1 = require("./nested/search-editor-options");
  38. var button_dxi_1 = require("./nested/button-dxi");
  39. var options_1 = require("./nested/options");
  40. var item_dxi_2 = require("./nested/item-dxi");
  41. /**
  42. * The TreeView widget is a tree-like representation of textual data.
  43. */
  44. var DxTreeViewComponent = (function (_super) {
  45. __extends(DxTreeViewComponent, _super);
  46. function DxTreeViewComponent(elementRef, ngZone, templateHost, _watcherHelper, _idh, optionHost, transferState, platformId) {
  47. var _this = _super.call(this, elementRef, ngZone, templateHost, _watcherHelper, transferState, platformId) || this;
  48. _this._watcherHelper = _watcherHelper;
  49. _this._idh = _idh;
  50. _this._createEventEmitters([
  51. { subscribe: 'contentReady', emit: 'onContentReady' },
  52. { subscribe: 'disposing', emit: 'onDisposing' },
  53. { subscribe: 'initialized', emit: 'onInitialized' },
  54. { subscribe: 'itemClick', emit: 'onItemClick' },
  55. { subscribe: 'itemCollapsed', emit: 'onItemCollapsed' },
  56. { subscribe: 'itemContextMenu', emit: 'onItemContextMenu' },
  57. { subscribe: 'itemExpanded', emit: 'onItemExpanded' },
  58. { subscribe: 'itemHold', emit: 'onItemHold' },
  59. { subscribe: 'itemRendered', emit: 'onItemRendered' },
  60. { subscribe: 'itemSelectionChanged', emit: 'onItemSelectionChanged' },
  61. { subscribe: 'optionChanged', emit: 'onOptionChanged' },
  62. { subscribe: 'selectAllValueChanged', emit: 'onSelectAllValueChanged' },
  63. { subscribe: 'selectionChanged', emit: 'onSelectionChanged' },
  64. { emit: 'accessKeyChange' },
  65. { emit: 'activeStateEnabledChange' },
  66. { emit: 'animationEnabledChange' },
  67. { emit: 'createChildrenChange' },
  68. { emit: 'dataSourceChange' },
  69. { emit: 'dataStructureChange' },
  70. { emit: 'disabledChange' },
  71. { emit: 'disabledExprChange' },
  72. { emit: 'displayExprChange' },
  73. { emit: 'elementAttrChange' },
  74. { emit: 'expandAllEnabledChange' },
  75. { emit: 'expandedExprChange' },
  76. { emit: 'expandEventChange' },
  77. { emit: 'expandNodesRecursiveChange' },
  78. { emit: 'focusStateEnabledChange' },
  79. { emit: 'hasItemsExprChange' },
  80. { emit: 'heightChange' },
  81. { emit: 'hintChange' },
  82. { emit: 'hoverStateEnabledChange' },
  83. { emit: 'itemHoldTimeoutChange' },
  84. { emit: 'itemsChange' },
  85. { emit: 'itemsExprChange' },
  86. { emit: 'itemTemplateChange' },
  87. { emit: 'keyExprChange' },
  88. { emit: 'noDataTextChange' },
  89. { emit: 'parentIdExprChange' },
  90. { emit: 'rootValueChange' },
  91. { emit: 'rtlEnabledChange' },
  92. { emit: 'scrollDirectionChange' },
  93. { emit: 'searchEditorOptionsChange' },
  94. { emit: 'searchEnabledChange' },
  95. { emit: 'searchExprChange' },
  96. { emit: 'searchModeChange' },
  97. { emit: 'searchTimeoutChange' },
  98. { emit: 'searchValueChange' },
  99. { emit: 'selectAllTextChange' },
  100. { emit: 'selectByClickChange' },
  101. { emit: 'selectedExprChange' },
  102. { emit: 'selectionModeChange' },
  103. { emit: 'selectNodesRecursiveChange' },
  104. { emit: 'showCheckBoxesModeChange' },
  105. { emit: 'tabIndexChange' },
  106. { emit: 'virtualModeEnabledChange' },
  107. { emit: 'visibleChange' },
  108. { emit: 'widthChange' }
  109. ]);
  110. _this._idh.setHost(_this);
  111. optionHost.setHost(_this);
  112. return _this;
  113. }
  114. Object.defineProperty(DxTreeViewComponent.prototype, "accessKey", {
  115. get: /**
  116. * Specifies the shortcut key that sets focus on the widget.
  117. */
  118. function () {
  119. return this._getOption('accessKey');
  120. },
  121. set: function (value) {
  122. this._setOption('accessKey', value);
  123. },
  124. enumerable: true,
  125. configurable: true
  126. });
  127. Object.defineProperty(DxTreeViewComponent.prototype, "activeStateEnabled", {
  128. get: /**
  129. * Specifies whether or not the widget changes its state when interacting with a user.
  130. */
  131. function () {
  132. return this._getOption('activeStateEnabled');
  133. },
  134. set: function (value) {
  135. this._setOption('activeStateEnabled', value);
  136. },
  137. enumerable: true,
  138. configurable: true
  139. });
  140. Object.defineProperty(DxTreeViewComponent.prototype, "animationEnabled", {
  141. get: /**
  142. * Specifies whether or not to animate item collapsing and expanding.
  143. */
  144. function () {
  145. return this._getOption('animationEnabled');
  146. },
  147. set: function (value) {
  148. this._setOption('animationEnabled', value);
  149. },
  150. enumerable: true,
  151. configurable: true
  152. });
  153. Object.defineProperty(DxTreeViewComponent.prototype, "createChildren", {
  154. get: /**
  155. * Allows you to load nodes on demand.
  156. */
  157. function () {
  158. return this._getOption('createChildren');
  159. },
  160. set: function (value) {
  161. this._setOption('createChildren', value);
  162. },
  163. enumerable: true,
  164. configurable: true
  165. });
  166. Object.defineProperty(DxTreeViewComponent.prototype, "dataSource", {
  167. get: /**
  168. * Binds the widget to data.
  169. */
  170. function () {
  171. return this._getOption('dataSource');
  172. },
  173. set: function (value) {
  174. this._setOption('dataSource', value);
  175. },
  176. enumerable: true,
  177. configurable: true
  178. });
  179. Object.defineProperty(DxTreeViewComponent.prototype, "dataStructure", {
  180. get: /**
  181. * Notifies the widget of the used data structure.
  182. */
  183. function () {
  184. return this._getOption('dataStructure');
  185. },
  186. set: function (value) {
  187. this._setOption('dataStructure', value);
  188. },
  189. enumerable: true,
  190. configurable: true
  191. });
  192. Object.defineProperty(DxTreeViewComponent.prototype, "disabled", {
  193. get: /**
  194. * Specifies whether the widget responds to user interaction.
  195. */
  196. function () {
  197. return this._getOption('disabled');
  198. },
  199. set: function (value) {
  200. this._setOption('disabled', value);
  201. },
  202. enumerable: true,
  203. configurable: true
  204. });
  205. Object.defineProperty(DxTreeViewComponent.prototype, "disabledExpr", {
  206. get: /**
  207. * Specifies the name of the data source item field whose value defines whether or not the corresponding widget item is disabled.
  208. */
  209. function () {
  210. return this._getOption('disabledExpr');
  211. },
  212. set: function (value) {
  213. this._setOption('disabledExpr', value);
  214. },
  215. enumerable: true,
  216. configurable: true
  217. });
  218. Object.defineProperty(DxTreeViewComponent.prototype, "displayExpr", {
  219. get: /**
  220. * Specifies the data field whose values should be displayed.
  221. */
  222. function () {
  223. return this._getOption('displayExpr');
  224. },
  225. set: function (value) {
  226. this._setOption('displayExpr', value);
  227. },
  228. enumerable: true,
  229. configurable: true
  230. });
  231. Object.defineProperty(DxTreeViewComponent.prototype, "elementAttr", {
  232. get: /**
  233. * Specifies the attributes to be attached to the widget's root element.
  234. */
  235. function () {
  236. return this._getOption('elementAttr');
  237. },
  238. set: function (value) {
  239. this._setOption('elementAttr', value);
  240. },
  241. enumerable: true,
  242. configurable: true
  243. });
  244. Object.defineProperty(DxTreeViewComponent.prototype, "expandAllEnabled", {
  245. get: /**
  246. * Specifies whether or not a user can expand all tree view items by the "*" hot key.
  247. */
  248. function () {
  249. return this._getOption('expandAllEnabled');
  250. },
  251. set: function (value) {
  252. this._setOption('expandAllEnabled', value);
  253. },
  254. enumerable: true,
  255. configurable: true
  256. });
  257. Object.defineProperty(DxTreeViewComponent.prototype, "expandedExpr", {
  258. get: /**
  259. * Specifies which data source field specifies whether an item is expanded.
  260. */
  261. function () {
  262. return this._getOption('expandedExpr');
  263. },
  264. set: function (value) {
  265. this._setOption('expandedExpr', value);
  266. },
  267. enumerable: true,
  268. configurable: true
  269. });
  270. Object.defineProperty(DxTreeViewComponent.prototype, "expandEvent", {
  271. get: /**
  272. * Specifies the event on which to expand/collapse a node.
  273. */
  274. function () {
  275. return this._getOption('expandEvent');
  276. },
  277. set: function (value) {
  278. this._setOption('expandEvent', value);
  279. },
  280. enumerable: true,
  281. configurable: true
  282. });
  283. Object.defineProperty(DxTreeViewComponent.prototype, "expandNodesRecursive", {
  284. get: /**
  285. * Specifies whether or not all parent nodes of an initially expanded node are displayed expanded.
  286. */
  287. function () {
  288. return this._getOption('expandNodesRecursive');
  289. },
  290. set: function (value) {
  291. this._setOption('expandNodesRecursive', value);
  292. },
  293. enumerable: true,
  294. configurable: true
  295. });
  296. Object.defineProperty(DxTreeViewComponent.prototype, "focusStateEnabled", {
  297. get: /**
  298. * Specifies whether the widget can be focused using keyboard navigation.
  299. */
  300. function () {
  301. return this._getOption('focusStateEnabled');
  302. },
  303. set: function (value) {
  304. this._setOption('focusStateEnabled', value);
  305. },
  306. enumerable: true,
  307. configurable: true
  308. });
  309. Object.defineProperty(DxTreeViewComponent.prototype, "hasItemsExpr", {
  310. get: /**
  311. * Specifies the name of the data source item field whose value defines whether or not the corresponding node includes child nodes.
  312. */
  313. function () {
  314. return this._getOption('hasItemsExpr');
  315. },
  316. set: function (value) {
  317. this._setOption('hasItemsExpr', value);
  318. },
  319. enumerable: true,
  320. configurable: true
  321. });
  322. Object.defineProperty(DxTreeViewComponent.prototype, "height", {
  323. get: /**
  324. * Specifies the widget's height.
  325. */
  326. function () {
  327. return this._getOption('height');
  328. },
  329. set: function (value) {
  330. this._setOption('height', value);
  331. },
  332. enumerable: true,
  333. configurable: true
  334. });
  335. Object.defineProperty(DxTreeViewComponent.prototype, "hint", {
  336. get: /**
  337. * Specifies text for a hint that appears when a user pauses on the widget.
  338. */
  339. function () {
  340. return this._getOption('hint');
  341. },
  342. set: function (value) {
  343. this._setOption('hint', value);
  344. },
  345. enumerable: true,
  346. configurable: true
  347. });
  348. Object.defineProperty(DxTreeViewComponent.prototype, "hoverStateEnabled", {
  349. get: /**
  350. * Specifies whether the widget changes its state when a user pauses on it.
  351. */
  352. function () {
  353. return this._getOption('hoverStateEnabled');
  354. },
  355. set: function (value) {
  356. this._setOption('hoverStateEnabled', value);
  357. },
  358. enumerable: true,
  359. configurable: true
  360. });
  361. Object.defineProperty(DxTreeViewComponent.prototype, "itemHoldTimeout", {
  362. get: /**
  363. * The time period in milliseconds before the onItemHold event is raised.
  364. */
  365. function () {
  366. return this._getOption('itemHoldTimeout');
  367. },
  368. set: function (value) {
  369. this._setOption('itemHoldTimeout', value);
  370. },
  371. enumerable: true,
  372. configurable: true
  373. });
  374. Object.defineProperty(DxTreeViewComponent.prototype, "items", {
  375. get: /**
  376. * An array of items displayed by the widget.
  377. */
  378. function () {
  379. return this._getOption('items');
  380. },
  381. set: function (value) {
  382. this._setOption('items', value);
  383. },
  384. enumerable: true,
  385. configurable: true
  386. });
  387. Object.defineProperty(DxTreeViewComponent.prototype, "itemsExpr", {
  388. get: /**
  389. * Specifies which data field contains nested items.
  390. */
  391. function () {
  392. return this._getOption('itemsExpr');
  393. },
  394. set: function (value) {
  395. this._setOption('itemsExpr', value);
  396. },
  397. enumerable: true,
  398. configurable: true
  399. });
  400. Object.defineProperty(DxTreeViewComponent.prototype, "itemTemplate", {
  401. get: /**
  402. * Specifies a custom template for items.
  403. */
  404. function () {
  405. return this._getOption('itemTemplate');
  406. },
  407. set: function (value) {
  408. this._setOption('itemTemplate', value);
  409. },
  410. enumerable: true,
  411. configurable: true
  412. });
  413. Object.defineProperty(DxTreeViewComponent.prototype, "keyExpr", {
  414. get: /**
  415. * Specifies which data field provides keys for TreeView items.
  416. */
  417. function () {
  418. return this._getOption('keyExpr');
  419. },
  420. set: function (value) {
  421. this._setOption('keyExpr', value);
  422. },
  423. enumerable: true,
  424. configurable: true
  425. });
  426. Object.defineProperty(DxTreeViewComponent.prototype, "noDataText", {
  427. get: /**
  428. * The text or HTML markup displayed by the widget if the item collection is empty.
  429. */
  430. function () {
  431. return this._getOption('noDataText');
  432. },
  433. set: function (value) {
  434. this._setOption('noDataText', value);
  435. },
  436. enumerable: true,
  437. configurable: true
  438. });
  439. Object.defineProperty(DxTreeViewComponent.prototype, "parentIdExpr", {
  440. get: /**
  441. * Specifies the name of the data source item field for holding the parent key of the corresponding node.
  442. */
  443. function () {
  444. return this._getOption('parentIdExpr');
  445. },
  446. set: function (value) {
  447. this._setOption('parentIdExpr', value);
  448. },
  449. enumerable: true,
  450. configurable: true
  451. });
  452. Object.defineProperty(DxTreeViewComponent.prototype, "rootValue", {
  453. get: /**
  454. * Specifies the parent ID value of the root item.
  455. */
  456. function () {
  457. return this._getOption('rootValue');
  458. },
  459. set: function (value) {
  460. this._setOption('rootValue', value);
  461. },
  462. enumerable: true,
  463. configurable: true
  464. });
  465. Object.defineProperty(DxTreeViewComponent.prototype, "rtlEnabled", {
  466. get: /**
  467. * Switches the widget to a right-to-left representation.
  468. */
  469. function () {
  470. return this._getOption('rtlEnabled');
  471. },
  472. set: function (value) {
  473. this._setOption('rtlEnabled', value);
  474. },
  475. enumerable: true,
  476. configurable: true
  477. });
  478. Object.defineProperty(DxTreeViewComponent.prototype, "scrollDirection", {
  479. get: /**
  480. * A string value specifying available scrolling directions.
  481. */
  482. function () {
  483. return this._getOption('scrollDirection');
  484. },
  485. set: function (value) {
  486. this._setOption('scrollDirection', value);
  487. },
  488. enumerable: true,
  489. configurable: true
  490. });
  491. Object.defineProperty(DxTreeViewComponent.prototype, "searchEditorOptions", {
  492. get: /**
  493. * Configures the search panel.
  494. */
  495. function () {
  496. return this._getOption('searchEditorOptions');
  497. },
  498. set: function (value) {
  499. this._setOption('searchEditorOptions', value);
  500. },
  501. enumerable: true,
  502. configurable: true
  503. });
  504. Object.defineProperty(DxTreeViewComponent.prototype, "searchEnabled", {
  505. get: /**
  506. * Specifies whether the search panel is visible.
  507. */
  508. function () {
  509. return this._getOption('searchEnabled');
  510. },
  511. set: function (value) {
  512. this._setOption('searchEnabled', value);
  513. },
  514. enumerable: true,
  515. configurable: true
  516. });
  517. Object.defineProperty(DxTreeViewComponent.prototype, "searchExpr", {
  518. get: /**
  519. * Specifies a data object's field name or an expression whose value is compared to the search string.
  520. */
  521. function () {
  522. return this._getOption('searchExpr');
  523. },
  524. set: function (value) {
  525. this._setOption('searchExpr', value);
  526. },
  527. enumerable: true,
  528. configurable: true
  529. });
  530. Object.defineProperty(DxTreeViewComponent.prototype, "searchMode", {
  531. get: /**
  532. * Specifies a comparison operation used to search widget items.
  533. */
  534. function () {
  535. return this._getOption('searchMode');
  536. },
  537. set: function (value) {
  538. this._setOption('searchMode', value);
  539. },
  540. enumerable: true,
  541. configurable: true
  542. });
  543. Object.defineProperty(DxTreeViewComponent.prototype, "searchTimeout", {
  544. get: /**
  545. * Specifies a delay in milliseconds between when a user finishes typing, and the search is executed.
  546. */
  547. function () {
  548. return this._getOption('searchTimeout');
  549. },
  550. set: function (value) {
  551. this._setOption('searchTimeout', value);
  552. },
  553. enumerable: true,
  554. configurable: true
  555. });
  556. Object.defineProperty(DxTreeViewComponent.prototype, "searchValue", {
  557. get: /**
  558. * Specifies the current search string.
  559. */
  560. function () {
  561. return this._getOption('searchValue');
  562. },
  563. set: function (value) {
  564. this._setOption('searchValue', value);
  565. },
  566. enumerable: true,
  567. configurable: true
  568. });
  569. Object.defineProperty(DxTreeViewComponent.prototype, "selectAllText", {
  570. get: /**
  571. * Specifies the text displayed at the "Select All" check box.
  572. */
  573. function () {
  574. return this._getOption('selectAllText');
  575. },
  576. set: function (value) {
  577. this._setOption('selectAllText', value);
  578. },
  579. enumerable: true,
  580. configurable: true
  581. });
  582. Object.defineProperty(DxTreeViewComponent.prototype, "selectByClick", {
  583. get: /**
  584. * Specifies whether or not an item becomes selected if a user clicks it.
  585. */
  586. function () {
  587. return this._getOption('selectByClick');
  588. },
  589. set: function (value) {
  590. this._setOption('selectByClick', value);
  591. },
  592. enumerable: true,
  593. configurable: true
  594. });
  595. Object.defineProperty(DxTreeViewComponent.prototype, "selectedExpr", {
  596. get: /**
  597. * Specifies the name of the data source item field whose value defines whether or not the corresponding widget items is selected.
  598. */
  599. function () {
  600. return this._getOption('selectedExpr');
  601. },
  602. set: function (value) {
  603. this._setOption('selectedExpr', value);
  604. },
  605. enumerable: true,
  606. configurable: true
  607. });
  608. Object.defineProperty(DxTreeViewComponent.prototype, "selectionMode", {
  609. get: /**
  610. * Specifies item selection mode.
  611. */
  612. function () {
  613. return this._getOption('selectionMode');
  614. },
  615. set: function (value) {
  616. this._setOption('selectionMode', value);
  617. },
  618. enumerable: true,
  619. configurable: true
  620. });
  621. Object.defineProperty(DxTreeViewComponent.prototype, "selectNodesRecursive", {
  622. get: /**
  623. * Specifies whether or not to select nodes recursively.
  624. */
  625. function () {
  626. return this._getOption('selectNodesRecursive');
  627. },
  628. set: function (value) {
  629. this._setOption('selectNodesRecursive', value);
  630. },
  631. enumerable: true,
  632. configurable: true
  633. });
  634. Object.defineProperty(DxTreeViewComponent.prototype, "showCheckBoxesMode", {
  635. get: /**
  636. * Specifies the current check boxes display mode.
  637. */
  638. function () {
  639. return this._getOption('showCheckBoxesMode');
  640. },
  641. set: function (value) {
  642. this._setOption('showCheckBoxesMode', value);
  643. },
  644. enumerable: true,
  645. configurable: true
  646. });
  647. Object.defineProperty(DxTreeViewComponent.prototype, "tabIndex", {
  648. get: /**
  649. * Specifies the number of the element when the Tab key is used for navigating.
  650. */
  651. function () {
  652. return this._getOption('tabIndex');
  653. },
  654. set: function (value) {
  655. this._setOption('tabIndex', value);
  656. },
  657. enumerable: true,
  658. configurable: true
  659. });
  660. Object.defineProperty(DxTreeViewComponent.prototype, "virtualModeEnabled", {
  661. get: /**
  662. * Enables the virtual mode in which nodes are loaded on demand. Use it to enhance the performance on large datasets.
  663. */
  664. function () {
  665. return this._getOption('virtualModeEnabled');
  666. },
  667. set: function (value) {
  668. this._setOption('virtualModeEnabled', value);
  669. },
  670. enumerable: true,
  671. configurable: true
  672. });
  673. Object.defineProperty(DxTreeViewComponent.prototype, "visible", {
  674. get: /**
  675. * Specifies whether the widget is visible.
  676. */
  677. function () {
  678. return this._getOption('visible');
  679. },
  680. set: function (value) {
  681. this._setOption('visible', value);
  682. },
  683. enumerable: true,
  684. configurable: true
  685. });
  686. Object.defineProperty(DxTreeViewComponent.prototype, "width", {
  687. get: /**
  688. * Specifies the widget's width.
  689. */
  690. function () {
  691. return this._getOption('width');
  692. },
  693. set: function (value) {
  694. this._setOption('width', value);
  695. },
  696. enumerable: true,
  697. configurable: true
  698. });
  699. Object.defineProperty(DxTreeViewComponent.prototype, "itemsChildren", {
  700. get: function () {
  701. return this._getOption('items');
  702. },
  703. set: function (value) {
  704. this.setChildren('items', value);
  705. },
  706. enumerable: true,
  707. configurable: true
  708. });
  709. DxTreeViewComponent.prototype._createInstance = function (element, options) {
  710. return new tree_view_1.default(element, options);
  711. };
  712. DxTreeViewComponent.prototype.ngOnDestroy = function () {
  713. this._destroyWidget();
  714. };
  715. DxTreeViewComponent.prototype.ngOnChanges = function (changes) {
  716. _super.prototype.ngOnChanges.call(this, changes);
  717. this.setupChanges('dataSource', changes);
  718. this.setupChanges('items', changes);
  719. this.setupChanges('searchExpr', changes);
  720. };
  721. DxTreeViewComponent.prototype.setupChanges = function (prop, changes) {
  722. if (!(prop in this._optionsToUpdate)) {
  723. this._idh.setup(prop, changes);
  724. }
  725. };
  726. DxTreeViewComponent.prototype.ngDoCheck = function () {
  727. this._idh.doCheck('dataSource');
  728. this._idh.doCheck('items');
  729. this._idh.doCheck('searchExpr');
  730. this._watcherHelper.checkWatchers();
  731. _super.prototype.ngDoCheck.call(this);
  732. _super.prototype.clearChangedOptions.call(this);
  733. };
  734. DxTreeViewComponent.prototype._setOption = function (name, value) {
  735. var isSetup = this._idh.setupSingle(name, value);
  736. var isChanged = this._idh.getChanges(name, value) !== null;
  737. if (isSetup || isChanged) {
  738. _super.prototype._setOption.call(this, name, value);
  739. }
  740. };
  741. DxTreeViewComponent.decorators = [
  742. { type: core_1.Component, args: [{
  743. selector: 'dx-tree-view',
  744. template: '',
  745. providers: [
  746. template_host_1.DxTemplateHost,
  747. watcher_helper_1.WatcherHelper,
  748. nested_option_1.NestedOptionHost,
  749. iterable_differ_helper_1.IterableDifferHelper
  750. ]
  751. },] },
  752. ];
  753. /** @nocollapse */
  754. DxTreeViewComponent.ctorParameters = function () { return [
  755. { type: core_1.ElementRef, },
  756. { type: core_1.NgZone, },
  757. { type: template_host_1.DxTemplateHost, },
  758. { type: watcher_helper_1.WatcherHelper, },
  759. { type: iterable_differ_helper_1.IterableDifferHelper, },
  760. { type: nested_option_1.NestedOptionHost, },
  761. { type: platform_browser_2.TransferState, },
  762. { type: undefined, decorators: [{ type: core_1.Inject, args: [core_1.PLATFORM_ID,] },] },
  763. ]; };
  764. DxTreeViewComponent.propDecorators = {
  765. "accessKey": [{ type: core_1.Input },],
  766. "activeStateEnabled": [{ type: core_1.Input },],
  767. "animationEnabled": [{ type: core_1.Input },],
  768. "createChildren": [{ type: core_1.Input },],
  769. "dataSource": [{ type: core_1.Input },],
  770. "dataStructure": [{ type: core_1.Input },],
  771. "disabled": [{ type: core_1.Input },],
  772. "disabledExpr": [{ type: core_1.Input },],
  773. "displayExpr": [{ type: core_1.Input },],
  774. "elementAttr": [{ type: core_1.Input },],
  775. "expandAllEnabled": [{ type: core_1.Input },],
  776. "expandedExpr": [{ type: core_1.Input },],
  777. "expandEvent": [{ type: core_1.Input },],
  778. "expandNodesRecursive": [{ type: core_1.Input },],
  779. "focusStateEnabled": [{ type: core_1.Input },],
  780. "hasItemsExpr": [{ type: core_1.Input },],
  781. "height": [{ type: core_1.Input },],
  782. "hint": [{ type: core_1.Input },],
  783. "hoverStateEnabled": [{ type: core_1.Input },],
  784. "itemHoldTimeout": [{ type: core_1.Input },],
  785. "items": [{ type: core_1.Input },],
  786. "itemsExpr": [{ type: core_1.Input },],
  787. "itemTemplate": [{ type: core_1.Input },],
  788. "keyExpr": [{ type: core_1.Input },],
  789. "noDataText": [{ type: core_1.Input },],
  790. "parentIdExpr": [{ type: core_1.Input },],
  791. "rootValue": [{ type: core_1.Input },],
  792. "rtlEnabled": [{ type: core_1.Input },],
  793. "scrollDirection": [{ type: core_1.Input },],
  794. "searchEditorOptions": [{ type: core_1.Input },],
  795. "searchEnabled": [{ type: core_1.Input },],
  796. "searchExpr": [{ type: core_1.Input },],
  797. "searchMode": [{ type: core_1.Input },],
  798. "searchTimeout": [{ type: core_1.Input },],
  799. "searchValue": [{ type: core_1.Input },],
  800. "selectAllText": [{ type: core_1.Input },],
  801. "selectByClick": [{ type: core_1.Input },],
  802. "selectedExpr": [{ type: core_1.Input },],
  803. "selectionMode": [{ type: core_1.Input },],
  804. "selectNodesRecursive": [{ type: core_1.Input },],
  805. "showCheckBoxesMode": [{ type: core_1.Input },],
  806. "tabIndex": [{ type: core_1.Input },],
  807. "virtualModeEnabled": [{ type: core_1.Input },],
  808. "visible": [{ type: core_1.Input },],
  809. "width": [{ type: core_1.Input },],
  810. "onContentReady": [{ type: core_1.Output },],
  811. "onDisposing": [{ type: core_1.Output },],
  812. "onInitialized": [{ type: core_1.Output },],
  813. "onItemClick": [{ type: core_1.Output },],
  814. "onItemCollapsed": [{ type: core_1.Output },],
  815. "onItemContextMenu": [{ type: core_1.Output },],
  816. "onItemExpanded": [{ type: core_1.Output },],
  817. "onItemHold": [{ type: core_1.Output },],
  818. "onItemRendered": [{ type: core_1.Output },],
  819. "onItemSelectionChanged": [{ type: core_1.Output },],
  820. "onOptionChanged": [{ type: core_1.Output },],
  821. "onSelectAllValueChanged": [{ type: core_1.Output },],
  822. "onSelectionChanged": [{ type: core_1.Output },],
  823. "accessKeyChange": [{ type: core_1.Output },],
  824. "activeStateEnabledChange": [{ type: core_1.Output },],
  825. "animationEnabledChange": [{ type: core_1.Output },],
  826. "createChildrenChange": [{ type: core_1.Output },],
  827. "dataSourceChange": [{ type: core_1.Output },],
  828. "dataStructureChange": [{ type: core_1.Output },],
  829. "disabledChange": [{ type: core_1.Output },],
  830. "disabledExprChange": [{ type: core_1.Output },],
  831. "displayExprChange": [{ type: core_1.Output },],
  832. "elementAttrChange": [{ type: core_1.Output },],
  833. "expandAllEnabledChange": [{ type: core_1.Output },],
  834. "expandedExprChange": [{ type: core_1.Output },],
  835. "expandEventChange": [{ type: core_1.Output },],
  836. "expandNodesRecursiveChange": [{ type: core_1.Output },],
  837. "focusStateEnabledChange": [{ type: core_1.Output },],
  838. "hasItemsExprChange": [{ type: core_1.Output },],
  839. "heightChange": [{ type: core_1.Output },],
  840. "hintChange": [{ type: core_1.Output },],
  841. "hoverStateEnabledChange": [{ type: core_1.Output },],
  842. "itemHoldTimeoutChange": [{ type: core_1.Output },],
  843. "itemsChange": [{ type: core_1.Output },],
  844. "itemsExprChange": [{ type: core_1.Output },],
  845. "itemTemplateChange": [{ type: core_1.Output },],
  846. "keyExprChange": [{ type: core_1.Output },],
  847. "noDataTextChange": [{ type: core_1.Output },],
  848. "parentIdExprChange": [{ type: core_1.Output },],
  849. "rootValueChange": [{ type: core_1.Output },],
  850. "rtlEnabledChange": [{ type: core_1.Output },],
  851. "scrollDirectionChange": [{ type: core_1.Output },],
  852. "searchEditorOptionsChange": [{ type: core_1.Output },],
  853. "searchEnabledChange": [{ type: core_1.Output },],
  854. "searchExprChange": [{ type: core_1.Output },],
  855. "searchModeChange": [{ type: core_1.Output },],
  856. "searchTimeoutChange": [{ type: core_1.Output },],
  857. "searchValueChange": [{ type: core_1.Output },],
  858. "selectAllTextChange": [{ type: core_1.Output },],
  859. "selectByClickChange": [{ type: core_1.Output },],
  860. "selectedExprChange": [{ type: core_1.Output },],
  861. "selectionModeChange": [{ type: core_1.Output },],
  862. "selectNodesRecursiveChange": [{ type: core_1.Output },],
  863. "showCheckBoxesModeChange": [{ type: core_1.Output },],
  864. "tabIndexChange": [{ type: core_1.Output },],
  865. "virtualModeEnabledChange": [{ type: core_1.Output },],
  866. "visibleChange": [{ type: core_1.Output },],
  867. "widthChange": [{ type: core_1.Output },],
  868. "itemsChildren": [{ type: core_1.ContentChildren, args: [item_dxi_2.DxiItemComponent,] },],
  869. };
  870. return DxTreeViewComponent;
  871. }(component_1.DxComponent));
  872. exports.DxTreeViewComponent = DxTreeViewComponent;
  873. var DxTreeViewModule = (function () {
  874. function DxTreeViewModule() {
  875. }
  876. DxTreeViewModule.decorators = [
  877. { type: core_1.NgModule, args: [{
  878. imports: [
  879. item_dxi_1.DxiItemModule,
  880. search_editor_options_1.DxoSearchEditorOptionsModule,
  881. button_dxi_1.DxiButtonModule,
  882. options_1.DxoOptionsModule,
  883. integration_1.DxIntegrationModule,
  884. template_1.DxTemplateModule,
  885. platform_browser_1.BrowserTransferStateModule
  886. ],
  887. declarations: [
  888. DxTreeViewComponent
  889. ],
  890. exports: [
  891. DxTreeViewComponent,
  892. item_dxi_1.DxiItemModule,
  893. search_editor_options_1.DxoSearchEditorOptionsModule,
  894. button_dxi_1.DxiButtonModule,
  895. options_1.DxoOptionsModule,
  896. template_1.DxTemplateModule
  897. ]
  898. },] },
  899. ];
  900. return DxTreeViewModule;
  901. }());
  902. exports.DxTreeViewModule = DxTreeViewModule;
  903. //# sourceMappingURL=tree-view.js.map