/services/dashboard/assets-dev/js/vendor/ag-grid/dist/lib/gridApi.js

https://github.com/mehrdadrad/mylg · JavaScript · 640 lines · 629 code · 0 blank · 11 comment · 84 complexity · e58b2ad22ebeacf48a0509908d24102a MD5 · raw file

  1. /**
  2. * ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  3. * @version v6.2.1
  4. * @link http://www.ag-grid.com/
  5. * @license MIT
  6. */
  7. var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
  8. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  9. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  10. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  11. return c > 3 && r && Object.defineProperty(target, key, r), r;
  12. };
  13. var __metadata = (this && this.__metadata) || function (k, v) {
  14. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
  15. };
  16. var csvCreator_1 = require("./csvCreator");
  17. var rowRenderer_1 = require("./rendering/rowRenderer");
  18. var headerRenderer_1 = require("./headerRendering/headerRenderer");
  19. var filterManager_1 = require("./filter/filterManager");
  20. var columnController_1 = require("./columnController/columnController");
  21. var selectionController_1 = require("./selectionController");
  22. var gridOptionsWrapper_1 = require("./gridOptionsWrapper");
  23. var gridPanel_1 = require("./gridPanel/gridPanel");
  24. var valueService_1 = require("./valueService");
  25. var masterSlaveService_1 = require("./masterSlaveService");
  26. var eventService_1 = require("./eventService");
  27. var floatingRowModel_1 = require("./rowControllers/floatingRowModel");
  28. var constants_1 = require("./constants");
  29. var context_1 = require("./context/context");
  30. var gridCore_1 = require("./gridCore");
  31. var sortController_1 = require("./sortController");
  32. var paginationController_1 = require("./rowControllers/paginationController");
  33. var focusedCellController_1 = require("./focusedCellController");
  34. var gridCell_1 = require("./entities/gridCell");
  35. var utils_1 = require("./utils");
  36. var cellRendererFactory_1 = require("./rendering/cellRendererFactory");
  37. var cellEditorFactory_1 = require("./rendering/cellEditorFactory");
  38. var GridApi = (function () {
  39. function GridApi() {
  40. }
  41. GridApi.prototype.init = function () {
  42. switch (this.rowModel.getType()) {
  43. case constants_1.Constants.ROW_MODEL_TYPE_NORMAL:
  44. case constants_1.Constants.ROW_MODEL_TYPE_PAGINATION:
  45. this.inMemoryRowModel = this.rowModel;
  46. break;
  47. case constants_1.Constants.ROW_MODEL_TYPE_VIRTUAL:
  48. this.virtualPageRowModel = this.rowModel;
  49. break;
  50. }
  51. };
  52. /** Used internally by grid. Not intended to be used by the client. Interface may change between releases. */
  53. GridApi.prototype.__getMasterSlaveService = function () {
  54. return this.masterSlaveService;
  55. };
  56. GridApi.prototype.getFirstRenderedRow = function () {
  57. return this.rowRenderer.getFirstVirtualRenderedRow();
  58. };
  59. GridApi.prototype.getLastRenderedRow = function () {
  60. return this.rowRenderer.getLastVirtualRenderedRow();
  61. };
  62. GridApi.prototype.getDataAsCsv = function (params) {
  63. return this.csvCreator.getDataAsCsv(params);
  64. };
  65. GridApi.prototype.exportDataAsCsv = function (params) {
  66. this.csvCreator.exportDataAsCsv(params);
  67. };
  68. GridApi.prototype.setDatasource = function (datasource) {
  69. if (this.gridOptionsWrapper.isRowModelPagination()) {
  70. this.paginationController.setDatasource(datasource);
  71. }
  72. else if (this.gridOptionsWrapper.isRowModelVirtual()) {
  73. this.rowModel.setDatasource(datasource);
  74. }
  75. else {
  76. console.warn("ag-Grid: you can only use a datasource when gridOptions.rowModelType is '" + constants_1.Constants.ROW_MODEL_TYPE_VIRTUAL + "' or '" + constants_1.Constants.ROW_MODEL_TYPE_PAGINATION + "'");
  77. }
  78. };
  79. GridApi.prototype.setViewportDatasource = function (viewportDatasource) {
  80. if (this.gridOptionsWrapper.isRowModelViewport()) {
  81. // this is bad coding, because it's using an interface that's exposed in the enterprise.
  82. // really we should create an interface in the core for viewportDatasource and let
  83. // the enterprise implement it, rather than casting to 'any' here
  84. this.rowModel.setViewportDatasource(viewportDatasource);
  85. }
  86. else {
  87. console.warn("ag-Grid: you can only use a datasource when gridOptions.rowModelType is '" + constants_1.Constants.ROW_MODEL_TYPE_VIEWPORT + "'");
  88. }
  89. };
  90. GridApi.prototype.setRowData = function (rowData) {
  91. if (this.gridOptionsWrapper.isRowModelDefault()) {
  92. this.selectionController.reset();
  93. this.inMemoryRowModel.setRowData(rowData, true);
  94. }
  95. else {
  96. console.log('cannot call setRowData unless using normal row model');
  97. }
  98. };
  99. GridApi.prototype.setFloatingTopRowData = function (rows) {
  100. this.floatingRowModel.setFloatingTopRowData(rows);
  101. };
  102. GridApi.prototype.setFloatingBottomRowData = function (rows) {
  103. this.floatingRowModel.setFloatingBottomRowData(rows);
  104. };
  105. GridApi.prototype.getFloatingTopRowCount = function () {
  106. return this.floatingRowModel.getFloatingTopRowCount();
  107. };
  108. GridApi.prototype.getFloatingBottomRowCount = function () {
  109. return this.floatingRowModel.getFloatingBottomRowCount();
  110. };
  111. GridApi.prototype.getFloatingTopRow = function (index) {
  112. return this.floatingRowModel.getFloatingTopRow(index);
  113. };
  114. GridApi.prototype.getFloatingBottomRow = function (index) {
  115. return this.floatingRowModel.getFloatingBottomRow(index);
  116. };
  117. GridApi.prototype.setColumnDefs = function (colDefs) {
  118. this.columnController.setColumnDefs(colDefs);
  119. };
  120. GridApi.prototype.refreshRows = function (rowNodes) {
  121. this.rowRenderer.refreshRows(rowNodes);
  122. };
  123. GridApi.prototype.refreshCells = function (rowNodes, colIds, animate) {
  124. if (animate === void 0) { animate = false; }
  125. this.rowRenderer.refreshCells(rowNodes, colIds, animate);
  126. };
  127. GridApi.prototype.rowDataChanged = function (rows) {
  128. this.rowRenderer.rowDataChanged(rows);
  129. };
  130. GridApi.prototype.refreshView = function () {
  131. this.rowRenderer.refreshView();
  132. };
  133. GridApi.prototype.setFunctionsReadOnly = function (readOnly) {
  134. this.gridOptionsWrapper.setProperty('functionsReadOnly', readOnly);
  135. };
  136. GridApi.prototype.softRefreshView = function () {
  137. this.rowRenderer.softRefreshView();
  138. };
  139. GridApi.prototype.refreshGroupRows = function () {
  140. this.rowRenderer.refreshGroupRows();
  141. };
  142. GridApi.prototype.refreshHeader = function () {
  143. // need to review this - the refreshHeader should also refresh all icons in the header
  144. this.headerRenderer.refreshHeader();
  145. };
  146. GridApi.prototype.isAnyFilterPresent = function () {
  147. return this.filterManager.isAnyFilterPresent();
  148. };
  149. GridApi.prototype.isAdvancedFilterPresent = function () {
  150. return this.filterManager.isAdvancedFilterPresent();
  151. };
  152. GridApi.prototype.isQuickFilterPresent = function () {
  153. return this.filterManager.isQuickFilterPresent();
  154. };
  155. GridApi.prototype.getModel = function () {
  156. return this.rowModel;
  157. };
  158. GridApi.prototype.onGroupExpandedOrCollapsed = function (refreshFromIndex) {
  159. if (utils_1.Utils.missing(this.inMemoryRowModel)) {
  160. console.log('cannot call onGroupExpandedOrCollapsed unless using normal row model');
  161. }
  162. this.inMemoryRowModel.refreshModel(constants_1.Constants.STEP_MAP, refreshFromIndex);
  163. };
  164. GridApi.prototype.refreshInMemoryRowModel = function () {
  165. if (utils_1.Utils.missing(this.inMemoryRowModel)) {
  166. console.log('cannot call refreshInMemoryRowModel unless using normal row model');
  167. }
  168. this.inMemoryRowModel.refreshModel(constants_1.Constants.STEP_EVERYTHING);
  169. };
  170. GridApi.prototype.expandAll = function () {
  171. if (utils_1.Utils.missing(this.inMemoryRowModel)) {
  172. console.log('cannot call expandAll unless using normal row model');
  173. }
  174. this.inMemoryRowModel.expandOrCollapseAll(true);
  175. };
  176. GridApi.prototype.collapseAll = function () {
  177. if (utils_1.Utils.missing(this.inMemoryRowModel)) {
  178. console.log('cannot call collapseAll unless using normal row model');
  179. }
  180. this.inMemoryRowModel.expandOrCollapseAll(false);
  181. };
  182. GridApi.prototype.addVirtualRowListener = function (eventName, rowIndex, callback) {
  183. if (typeof eventName !== 'string') {
  184. console.log('ag-Grid: addVirtualRowListener is deprecated, please use addRenderedRowListener.');
  185. }
  186. this.addRenderedRowListener(eventName, rowIndex, callback);
  187. };
  188. GridApi.prototype.addRenderedRowListener = function (eventName, rowIndex, callback) {
  189. if (eventName === 'virtualRowRemoved') {
  190. console.log('ag-Grid: event virtualRowRemoved is deprecated, now called renderedRowRemoved');
  191. eventName = '' +
  192. '';
  193. }
  194. if (eventName === 'virtualRowSelected') {
  195. console.log('ag-Grid: event virtualRowSelected is deprecated, to register for individual row ' +
  196. 'selection events, add a listener directly to the row node.');
  197. }
  198. this.rowRenderer.addRenderedRowListener(eventName, rowIndex, callback);
  199. };
  200. GridApi.prototype.setQuickFilter = function (newFilter) {
  201. this.filterManager.setQuickFilter(newFilter);
  202. };
  203. GridApi.prototype.selectIndex = function (index, tryMulti, suppressEvents) {
  204. console.log('ag-Grid: do not use api for selection, call node.setSelected(value) instead');
  205. if (suppressEvents) {
  206. console.log('ag-Grid: suppressEvents is no longer supported, stop listening for the event if you no longer want it');
  207. }
  208. this.selectionController.selectIndex(index, tryMulti);
  209. };
  210. GridApi.prototype.deselectIndex = function (index, suppressEvents) {
  211. if (suppressEvents === void 0) { suppressEvents = false; }
  212. console.log('ag-Grid: do not use api for selection, call node.setSelected(value) instead');
  213. if (suppressEvents) {
  214. console.log('ag-Grid: suppressEvents is no longer supported, stop listening for the event if you no longer want it');
  215. }
  216. this.selectionController.deselectIndex(index);
  217. };
  218. GridApi.prototype.selectNode = function (node, tryMulti, suppressEvents) {
  219. if (tryMulti === void 0) { tryMulti = false; }
  220. if (suppressEvents === void 0) { suppressEvents = false; }
  221. console.log('ag-Grid: API for selection is deprecated, call node.setSelected(value) instead');
  222. if (suppressEvents) {
  223. console.log('ag-Grid: suppressEvents is no longer supported, stop listening for the event if you no longer want it');
  224. }
  225. node.setSelectedParams({ newValue: true, clearSelection: !tryMulti });
  226. };
  227. GridApi.prototype.deselectNode = function (node, suppressEvents) {
  228. if (suppressEvents === void 0) { suppressEvents = false; }
  229. console.log('ag-Grid: API for selection is deprecated, call node.setSelected(value) instead');
  230. if (suppressEvents) {
  231. console.log('ag-Grid: suppressEvents is no longer supported, stop listening for the event if you no longer want it');
  232. }
  233. node.setSelectedParams({ newValue: false });
  234. };
  235. GridApi.prototype.selectAll = function () {
  236. this.selectionController.selectAllRowNodes();
  237. };
  238. GridApi.prototype.deselectAll = function () {
  239. this.selectionController.deselectAllRowNodes();
  240. };
  241. GridApi.prototype.recomputeAggregates = function () {
  242. if (utils_1.Utils.missing(this.inMemoryRowModel)) {
  243. console.log('cannot call recomputeAggregates unless using normal row model');
  244. }
  245. this.inMemoryRowModel.refreshModel(constants_1.Constants.STEP_AGGREGATE);
  246. };
  247. GridApi.prototype.sizeColumnsToFit = function () {
  248. if (this.gridOptionsWrapper.isForPrint()) {
  249. console.warn('ag-grid: sizeColumnsToFit does not work when forPrint=true');
  250. return;
  251. }
  252. this.gridPanel.sizeColumnsToFit();
  253. };
  254. GridApi.prototype.showLoadingOverlay = function () {
  255. this.gridPanel.showLoadingOverlay();
  256. };
  257. GridApi.prototype.showNoRowsOverlay = function () {
  258. this.gridPanel.showNoRowsOverlay();
  259. };
  260. GridApi.prototype.hideOverlay = function () {
  261. this.gridPanel.hideOverlay();
  262. };
  263. GridApi.prototype.isNodeSelected = function (node) {
  264. console.log('ag-Grid: no need to call api.isNodeSelected(), just call node.isSelected() instead');
  265. return node.isSelected();
  266. };
  267. GridApi.prototype.getSelectedNodesById = function () {
  268. console.error('ag-Grid: since version 3.4, getSelectedNodesById no longer exists, use getSelectedNodes() instead');
  269. return null;
  270. };
  271. GridApi.prototype.getSelectedNodes = function () {
  272. return this.selectionController.getSelectedNodes();
  273. };
  274. GridApi.prototype.getSelectedRows = function () {
  275. return this.selectionController.getSelectedRows();
  276. };
  277. GridApi.prototype.getBestCostNodeSelection = function () {
  278. return this.selectionController.getBestCostNodeSelection();
  279. };
  280. GridApi.prototype.getRenderedNodes = function () {
  281. return this.rowRenderer.getRenderedNodes();
  282. };
  283. GridApi.prototype.ensureColIndexVisible = function (index) {
  284. console.warn('ag-Grid: ensureColIndexVisible(index) no longer supported, use ensureColumnVisible(colKey) instead.');
  285. };
  286. GridApi.prototype.ensureColumnVisible = function (key) {
  287. this.gridPanel.ensureColumnVisible(key);
  288. };
  289. GridApi.prototype.ensureIndexVisible = function (index) {
  290. this.gridPanel.ensureIndexVisible(index);
  291. };
  292. GridApi.prototype.ensureNodeVisible = function (comparator) {
  293. this.gridCore.ensureNodeVisible(comparator);
  294. };
  295. GridApi.prototype.forEachLeafNode = function (callback) {
  296. if (utils_1.Utils.missing(this.inMemoryRowModel)) {
  297. console.log('cannot call forEachNodeAfterFilter unless using normal row model');
  298. }
  299. this.inMemoryRowModel.forEachLeafNode(callback);
  300. };
  301. GridApi.prototype.forEachNode = function (callback) {
  302. this.rowModel.forEachNode(callback);
  303. };
  304. GridApi.prototype.forEachNodeAfterFilter = function (callback) {
  305. if (utils_1.Utils.missing(this.inMemoryRowModel)) {
  306. console.log('cannot call forEachNodeAfterFilter unless using normal row model');
  307. }
  308. this.inMemoryRowModel.forEachNodeAfterFilter(callback);
  309. };
  310. GridApi.prototype.forEachNodeAfterFilterAndSort = function (callback) {
  311. if (utils_1.Utils.missing(this.inMemoryRowModel)) {
  312. console.log('cannot call forEachNodeAfterFilterAndSort unless using normal row model');
  313. }
  314. this.inMemoryRowModel.forEachNodeAfterFilterAndSort(callback);
  315. };
  316. GridApi.prototype.getFilterApiForColDef = function (colDef) {
  317. console.warn('ag-grid API method getFilterApiForColDef deprecated, use getFilterApi instead');
  318. return this.getFilterInstance(colDef);
  319. };
  320. GridApi.prototype.getFilterInstance = function (key) {
  321. var column = this.columnController.getPrimaryColumn(key);
  322. if (column) {
  323. return this.filterManager.getFilterComponent(column);
  324. }
  325. };
  326. GridApi.prototype.getFilterApi = function (key) {
  327. console.warn('ag-Grid: getFilterApi is deprecated, use getFilterComponent instead');
  328. return this.getFilterInstance(key);
  329. };
  330. GridApi.prototype.destroyFilter = function (key) {
  331. var column = this.columnController.getPrimaryColumn(key);
  332. if (column) {
  333. return this.filterManager.destroyFilter(column);
  334. }
  335. };
  336. GridApi.prototype.getColumnDef = function (key) {
  337. var column = this.columnController.getPrimaryColumn(key);
  338. if (column) {
  339. return column.getColDef();
  340. }
  341. else {
  342. return null;
  343. }
  344. };
  345. GridApi.prototype.onFilterChanged = function () {
  346. this.filterManager.onFilterChanged();
  347. };
  348. GridApi.prototype.setSortModel = function (sortModel) {
  349. this.sortController.setSortModel(sortModel);
  350. };
  351. GridApi.prototype.getSortModel = function () {
  352. return this.sortController.getSortModel();
  353. };
  354. GridApi.prototype.setFilterModel = function (model) {
  355. this.filterManager.setFilterModel(model);
  356. };
  357. GridApi.prototype.getFilterModel = function () {
  358. return this.filterManager.getFilterModel();
  359. };
  360. GridApi.prototype.getFocusedCell = function () {
  361. return this.focusedCellController.getFocusedCell();
  362. };
  363. GridApi.prototype.setFocusedCell = function (rowIndex, colKey, floating) {
  364. this.focusedCellController.setFocusedCell(rowIndex, colKey, floating, true);
  365. };
  366. GridApi.prototype.setHeaderHeight = function (headerHeight) {
  367. this.gridOptionsWrapper.setProperty(gridOptionsWrapper_1.GridOptionsWrapper.PROP_HEADER_HEIGHT, headerHeight);
  368. };
  369. GridApi.prototype.showToolPanel = function (show) {
  370. this.gridCore.showToolPanel(show);
  371. };
  372. GridApi.prototype.isToolPanelShowing = function () {
  373. return this.gridCore.isToolPanelShowing();
  374. };
  375. GridApi.prototype.doLayout = function () {
  376. this.gridCore.doLayout();
  377. };
  378. GridApi.prototype.getValue = function (colKey, rowNode) {
  379. var column = this.columnController.getPrimaryColumn(colKey);
  380. return this.valueService.getValue(column, rowNode);
  381. };
  382. GridApi.prototype.addEventListener = function (eventType, listener) {
  383. this.eventService.addEventListener(eventType, listener);
  384. };
  385. GridApi.prototype.addGlobalListener = function (listener) {
  386. this.eventService.addGlobalListener(listener);
  387. };
  388. GridApi.prototype.removeEventListener = function (eventType, listener) {
  389. this.eventService.removeEventListener(eventType, listener);
  390. };
  391. GridApi.prototype.removeGlobalListener = function (listener) {
  392. this.eventService.removeGlobalListener(listener);
  393. };
  394. GridApi.prototype.dispatchEvent = function (eventType, event) {
  395. this.eventService.dispatchEvent(eventType, event);
  396. };
  397. GridApi.prototype.destroy = function () {
  398. this.context.destroy();
  399. };
  400. GridApi.prototype.resetQuickFilter = function () {
  401. this.rowModel.forEachNode(function (node) { return node.quickFilterAggregateText = null; });
  402. };
  403. GridApi.prototype.getRangeSelections = function () {
  404. if (this.rangeController) {
  405. return this.rangeController.getCellRanges();
  406. }
  407. else {
  408. console.warn('ag-Grid: cell range selection is only available in ag-Grid Enterprise');
  409. return null;
  410. }
  411. };
  412. GridApi.prototype.addRangeSelection = function (rangeSelection) {
  413. if (!this.rangeController) {
  414. console.warn('ag-Grid: cell range selection is only available in ag-Grid Enterprise');
  415. }
  416. this.rangeController.addRange(rangeSelection);
  417. };
  418. GridApi.prototype.clearRangeSelection = function () {
  419. if (!this.rangeController) {
  420. console.warn('ag-Grid: cell range selection is only available in ag-Grid Enterprise');
  421. }
  422. this.rangeController.clearSelection();
  423. };
  424. GridApi.prototype.copySelectedRowsToClipboard = function (includeHeader, columnKeys) {
  425. if (!this.clipboardService) {
  426. console.warn('ag-Grid: clipboard is only available in ag-Grid Enterprise');
  427. }
  428. var column = null;
  429. this.clipboardService.copySelectedRowsToClipboard(includeHeader, columnKeys);
  430. };
  431. GridApi.prototype.copySelectedRangeToClipboard = function (includeHeader) {
  432. if (!this.clipboardService) {
  433. console.warn('ag-Grid: clipboard is only available in ag-Grid Enterprise');
  434. }
  435. this.clipboardService.copySelectedRangeToClipboard(includeHeader);
  436. };
  437. GridApi.prototype.copySelectedRangeDown = function () {
  438. if (!this.clipboardService) {
  439. console.warn('ag-Grid: clipboard is only available in ag-Grid Enterprise');
  440. }
  441. this.clipboardService.copyRangeDown();
  442. };
  443. GridApi.prototype.showColumnMenuAfterButtonClick = function (colKey, buttonElement) {
  444. var column = this.columnController.getPrimaryColumn(colKey);
  445. this.menuFactory.showMenuAfterButtonClick(column, buttonElement);
  446. };
  447. GridApi.prototype.showColumnMenuAfterMouseClick = function (colKey, mouseEvent) {
  448. var column = this.columnController.getPrimaryColumn(colKey);
  449. this.menuFactory.showMenuAfterMouseEvent(column, mouseEvent);
  450. };
  451. GridApi.prototype.stopEditing = function (cancel) {
  452. if (cancel === void 0) { cancel = false; }
  453. this.rowRenderer.stopEditing(cancel);
  454. };
  455. GridApi.prototype.startEditingCell = function (params) {
  456. var column = this.columnController.getGridColumn(params.colKey);
  457. var gridCell = new gridCell_1.GridCell(params.rowIndex, null, column);
  458. this.rowRenderer.startEditingCell(gridCell, params.keyPress, params.charPress);
  459. };
  460. GridApi.prototype.addAggFunc = function (key, aggFunc) {
  461. if (this.aggFuncService) {
  462. this.aggFuncService.addAggFunc(key, aggFunc);
  463. }
  464. };
  465. GridApi.prototype.addAggFuncs = function (aggFuncs) {
  466. if (this.aggFuncService) {
  467. this.aggFuncService.addAggFuncs(aggFuncs);
  468. }
  469. };
  470. GridApi.prototype.clearAggFuncs = function () {
  471. if (this.aggFuncService) {
  472. this.aggFuncService.clear();
  473. }
  474. };
  475. GridApi.prototype.insertItemsAtIndex = function (index, items) {
  476. this.rowModel.insertItemsAtIndex(index, items);
  477. };
  478. GridApi.prototype.removeItems = function (rowNodes) {
  479. this.rowModel.removeItems(rowNodes);
  480. };
  481. GridApi.prototype.addItems = function (items) {
  482. this.rowModel.addItems(items);
  483. };
  484. GridApi.prototype.refreshVirtualPageCache = function () {
  485. if (this.virtualPageRowModel) {
  486. this.virtualPageRowModel.refreshVirtualPageCache();
  487. }
  488. else {
  489. console.warn("ag-Grid: api.refreshVirtualPageCache is only available when rowModelType='virtual'.");
  490. }
  491. };
  492. GridApi.prototype.purgeVirtualPageCache = function () {
  493. if (this.virtualPageRowModel) {
  494. this.virtualPageRowModel.purgeVirtualPageCache();
  495. }
  496. else {
  497. console.warn("ag-Grid: api.refreshVirtualPageCache is only available when rowModelType='virtual'.");
  498. }
  499. };
  500. GridApi.prototype.getVirtualRowCount = function () {
  501. if (this.virtualPageRowModel) {
  502. return this.virtualPageRowModel.getVirtualRowCount();
  503. }
  504. else {
  505. console.warn("ag-Grid: api.getVirtualRowCount is only available when rowModelType='virtual'.");
  506. }
  507. };
  508. GridApi.prototype.isMaxRowFound = function () {
  509. if (this.virtualPageRowModel) {
  510. return this.virtualPageRowModel.isMaxRowFound();
  511. }
  512. else {
  513. console.warn("ag-Grid: api.isMaxRowFound is only available when rowModelType='virtual'.");
  514. }
  515. };
  516. GridApi.prototype.setVirtualRowCount = function (rowCount, maxRowFound) {
  517. if (this.virtualPageRowModel) {
  518. this.virtualPageRowModel.setVirtualRowCount(rowCount, maxRowFound);
  519. }
  520. else {
  521. console.warn("ag-Grid: api.setVirtualRowCount is only available when rowModelType='virtual'.");
  522. }
  523. };
  524. GridApi.prototype.getVirtualPageState = function () {
  525. if (this.virtualPageRowModel) {
  526. return this.virtualPageRowModel.getVirtualPageState();
  527. }
  528. else {
  529. console.warn("ag-Grid: api.getVirtualPageState is only available when rowModelType='virtual'.");
  530. }
  531. };
  532. __decorate([
  533. context_1.Autowired('csvCreator'),
  534. __metadata('design:type', csvCreator_1.CsvCreator)
  535. ], GridApi.prototype, "csvCreator", void 0);
  536. __decorate([
  537. context_1.Autowired('gridCore'),
  538. __metadata('design:type', gridCore_1.GridCore)
  539. ], GridApi.prototype, "gridCore", void 0);
  540. __decorate([
  541. context_1.Autowired('rowRenderer'),
  542. __metadata('design:type', rowRenderer_1.RowRenderer)
  543. ], GridApi.prototype, "rowRenderer", void 0);
  544. __decorate([
  545. context_1.Autowired('headerRenderer'),
  546. __metadata('design:type', headerRenderer_1.HeaderRenderer)
  547. ], GridApi.prototype, "headerRenderer", void 0);
  548. __decorate([
  549. context_1.Autowired('filterManager'),
  550. __metadata('design:type', filterManager_1.FilterManager)
  551. ], GridApi.prototype, "filterManager", void 0);
  552. __decorate([
  553. context_1.Autowired('columnController'),
  554. __metadata('design:type', columnController_1.ColumnController)
  555. ], GridApi.prototype, "columnController", void 0);
  556. __decorate([
  557. context_1.Autowired('selectionController'),
  558. __metadata('design:type', selectionController_1.SelectionController)
  559. ], GridApi.prototype, "selectionController", void 0);
  560. __decorate([
  561. context_1.Autowired('gridOptionsWrapper'),
  562. __metadata('design:type', gridOptionsWrapper_1.GridOptionsWrapper)
  563. ], GridApi.prototype, "gridOptionsWrapper", void 0);
  564. __decorate([
  565. context_1.Autowired('gridPanel'),
  566. __metadata('design:type', gridPanel_1.GridPanel)
  567. ], GridApi.prototype, "gridPanel", void 0);
  568. __decorate([
  569. context_1.Autowired('valueService'),
  570. __metadata('design:type', valueService_1.ValueService)
  571. ], GridApi.prototype, "valueService", void 0);
  572. __decorate([
  573. context_1.Autowired('masterSlaveService'),
  574. __metadata('design:type', masterSlaveService_1.MasterSlaveService)
  575. ], GridApi.prototype, "masterSlaveService", void 0);
  576. __decorate([
  577. context_1.Autowired('eventService'),
  578. __metadata('design:type', eventService_1.EventService)
  579. ], GridApi.prototype, "eventService", void 0);
  580. __decorate([
  581. context_1.Autowired('floatingRowModel'),
  582. __metadata('design:type', floatingRowModel_1.FloatingRowModel)
  583. ], GridApi.prototype, "floatingRowModel", void 0);
  584. __decorate([
  585. context_1.Autowired('context'),
  586. __metadata('design:type', context_1.Context)
  587. ], GridApi.prototype, "context", void 0);
  588. __decorate([
  589. context_1.Autowired('rowModel'),
  590. __metadata('design:type', Object)
  591. ], GridApi.prototype, "rowModel", void 0);
  592. __decorate([
  593. context_1.Autowired('sortController'),
  594. __metadata('design:type', sortController_1.SortController)
  595. ], GridApi.prototype, "sortController", void 0);
  596. __decorate([
  597. context_1.Autowired('paginationController'),
  598. __metadata('design:type', paginationController_1.PaginationController)
  599. ], GridApi.prototype, "paginationController", void 0);
  600. __decorate([
  601. context_1.Autowired('focusedCellController'),
  602. __metadata('design:type', focusedCellController_1.FocusedCellController)
  603. ], GridApi.prototype, "focusedCellController", void 0);
  604. __decorate([
  605. context_1.Optional('rangeController'),
  606. __metadata('design:type', Object)
  607. ], GridApi.prototype, "rangeController", void 0);
  608. __decorate([
  609. context_1.Optional('clipboardService'),
  610. __metadata('design:type', Object)
  611. ], GridApi.prototype, "clipboardService", void 0);
  612. __decorate([
  613. context_1.Optional('aggFuncService'),
  614. __metadata('design:type', Object)
  615. ], GridApi.prototype, "aggFuncService", void 0);
  616. __decorate([
  617. context_1.Autowired('menuFactory'),
  618. __metadata('design:type', Object)
  619. ], GridApi.prototype, "menuFactory", void 0);
  620. __decorate([
  621. context_1.Autowired('cellRendererFactory'),
  622. __metadata('design:type', cellRendererFactory_1.CellRendererFactory)
  623. ], GridApi.prototype, "cellRendererFactory", void 0);
  624. __decorate([
  625. context_1.Autowired('cellEditorFactory'),
  626. __metadata('design:type', cellEditorFactory_1.CellEditorFactory)
  627. ], GridApi.prototype, "cellEditorFactory", void 0);
  628. __decorate([
  629. context_1.PostConstruct,
  630. __metadata('design:type', Function),
  631. __metadata('design:paramtypes', []),
  632. __metadata('design:returntype', void 0)
  633. ], GridApi.prototype, "init", null);
  634. GridApi = __decorate([
  635. context_1.Bean('gridApi'),
  636. __metadata('design:paramtypes', [])
  637. ], GridApi);
  638. return GridApi;
  639. })();
  640. exports.GridApi = GridApi;