UNPKG

75.3 kBJavaScriptView Raw
1/**
2 * ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
3 * @version v18.1.2
4 * @link http://www.ag-grid.com/
5 * @license MIT
6 */
7"use strict";
8var __extends = (this && this.__extends) || (function () {
9 var extendStatics = Object.setPrototypeOf ||
10 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
11 function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
12 return function (d, b) {
13 extendStatics(d, b);
14 function __() { this.constructor = d; }
15 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
16 };
17})();
18var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
19 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
20 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
21 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;
22 return c > 3 && r && Object.defineProperty(target, key, r), r;
23};
24var __metadata = (this && this.__metadata) || function (k, v) {
25 if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
26};
27Object.defineProperty(exports, "__esModule", { value: true });
28var utils_1 = require("../utils");
29var resizeObserver_1 = require("../resizeObserver");
30var gridOptionsWrapper_1 = require("../gridOptionsWrapper");
31var columnController_1 = require("../columnController/columnController");
32var columnApi_1 = require("../columnController/columnApi");
33var rowRenderer_1 = require("../rendering/rowRenderer");
34var context_1 = require("../context/context");
35var eventService_1 = require("../eventService");
36var events_1 = require("../events");
37var dragService_1 = require("../dragAndDrop/dragService");
38var constants_1 = require("../constants");
39var selectionController_1 = require("../selectionController");
40var csvCreator_1 = require("../csvCreator");
41var mouseEventService_1 = require("./mouseEventService");
42var focusedCellController_1 = require("../focusedCellController");
43var scrollVisibleService_1 = require("./scrollVisibleService");
44var rowContainerComponent_1 = require("../rendering/rowContainerComponent");
45var paginationProxy_1 = require("../rowModels/paginationProxy");
46var popupEditorWrapper_1 = require("../rendering/cellEditors/popupEditorWrapper");
47var alignedGridsService_1 = require("../alignedGridsService");
48var pinnedRowModel_1 = require("../rowModels/pinnedRowModel");
49var gridApi_1 = require("../gridApi");
50var animationFrameService_1 = require("../misc/animationFrameService");
51var rowComp_1 = require("../rendering/rowComp");
52var navigationService_1 = require("./navigationService");
53var valueService_1 = require("../valueService/valueService");
54var touchListener_1 = require("../widgets/touchListener");
55var componentRecipes_1 = require("../components/framework/componentRecipes");
56var dragAndDropService_1 = require("../dragAndDrop/dragAndDropService");
57var rowDragFeature_1 = require("./rowDragFeature");
58var heightScaler_1 = require("../rendering/heightScaler");
59var component_1 = require("../widgets/component");
60var autoHeightCalculator_1 = require("../rendering/autoHeightCalculator");
61var columnAnimationService_1 = require("../rendering/columnAnimationService");
62var autoWidthCalculator_1 = require("../rendering/autoWidthCalculator");
63var beans_1 = require("../rendering/beans");
64var componentAnnotations_1 = require("../widgets/componentAnnotations");
65var headerRootComp_1 = require("../headerRendering/headerRootComp");
66// in the html below, it is important that there are no white space between some of the divs, as if there is white space,
67// it won't render correctly in safari, as safari renders white space as a gap
68var GRID_PANEL_NORMAL_TEMPLATE = "<div class=\"ag-root ag-font-style\" role=\"grid\">\n <ag-header-root ref=\"headerRoot\"></ag-header-root>\n <div class=\"ag-floating-top\" ref=\"eTop\" role=\"presentation\">\n <div class=\"ag-pinned-left-floating-top\" ref=\"eLeftTop\" role=\"presentation\"></div>\n <div class=\"ag-floating-top-viewport\" ref=\"eTopViewport\" role=\"presentation\">\n <div class=\"ag-floating-top-container\" ref=\"eTopContainer\" role=\"presentation\"></div>\n </div>\n <div class=\"ag-pinned-right-floating-top\" ref=\"eRightTop\" role=\"presentation\"></div>\n <div class=\"ag-floating-top-full-width-container\" ref=\"eTopFullWidthContainer\" role=\"presentation\"></div>\n </div>\n <div class=\"ag-body\" ref=\"eBody\" role=\"presentation\">\n <div class=\"ag-pinned-left-cols-viewport-wrapper\" ref=\"eLeftViewportWrapper\" role=\"presentation\">\n <div class=\"ag-pinned-left-cols-viewport\" ref=\"eLeftViewport\" role=\"presentation\">\n <div class=\"ag-pinned-left-cols-container\" ref=\"eLeftContainer\" role=\"presentation\"></div>\n </div>\n </div>\n <div class=\"ag-body-viewport-wrapper\" role=\"presentation\">\n <div class=\"ag-body-viewport\" ref=\"eBodyViewport\" role=\"presentation\">\n <div class=\"ag-body-container\" ref=\"eBodyContainer\" role=\"presentation\"></div>\n </div>\n </div>\n <div class=\"ag-pinned-right-cols-viewport-wrapper\" ref=\"eRightViewportWrapper\" role=\"presentation\">\n <div class=\"ag-pinned-right-cols-viewport\" ref=\"eRightViewport\" role=\"presentation\">\n <div class=\"ag-pinned-right-cols-container\" ref=\"eRightContainer\" role=\"presentation\"></div>\n </div>\n </div>\n <div class=\"ag-full-width-viewport-wrapper\" ref=\"eFullWidthViewportWrapper\" role=\"presentation\">\n <div class=\"ag-full-width-viewport\" ref=\"eFullWidthViewport\" role=\"presentation\">\n <div class=\"ag-full-width-container\" ref=\"eFullWidthContainer\" role=\"presentation\"></div>\n </div>\n </div>\n </div>\n <div class=\"ag-floating-bottom\" ref=\"eBottom\" role=\"presentation\">\n <div class=\"ag-pinned-left-floating-bottom\" ref=\"eLeftBottom\" role=\"presentation\"></div>\n <div class=\"ag-floating-bottom-viewport\" ref=\"eBottomViewport\" role=\"presentation\">\n <div class=\"ag-floating-bottom-container\" ref=\"eBottomContainer\" role=\"presentation\"></div>\n </div>\n <div class=\"ag-pinned-right-floating-bottom\" ref=\"eRightBottom\" role=\"presentation\"></div>\n <div class=\"ag-floating-bottom-full-width-container\" ref=\"eBottomFullWidthContainer\" role=\"presentation\"></div>\n </div>\n <div class=\"ag-overlay\" ref=\"eOverlay\"></div>\n </div>";
69var GridPanel = (function (_super) {
70 __extends(GridPanel, _super);
71 function GridPanel() {
72 var _this = _super.call(this, GRID_PANEL_NORMAL_TEMPLATE) || this;
73 _this.scrollLeft = -1;
74 _this.nextScrollLeft = -1;
75 _this.scrollTop = -1;
76 _this.nextScrollTop = -1;
77 _this.verticalRedrawNeeded = false;
78 return _this;
79 }
80 GridPanel.prototype.getVScrollPosition = function () {
81 var result = {
82 top: this.eBodyViewport.scrollTop,
83 bottom: this.eBodyViewport.scrollTop + this.eBodyViewport.offsetHeight
84 };
85 return result;
86 };
87 // used by range controller
88 GridPanel.prototype.getHScrollPosition = function () {
89 var result = {
90 left: this.eBodyViewport.scrollLeft,
91 right: this.eBodyViewport.scrollTop + this.eBodyViewport.offsetWidth
92 };
93 return result;
94 };
95 // we override this, as the base class is missing the annotation
96 GridPanel.prototype.destroy = function () {
97 _super.prototype.destroy.call(this);
98 };
99 GridPanel.prototype.onRowDataChanged = function () {
100 this.showOrHideOverlay();
101 };
102 GridPanel.prototype.showOrHideOverlay = function () {
103 if (this.paginationProxy.isEmpty() && !this.gridOptionsWrapper.isSuppressNoRowsOverlay()) {
104 this.showNoRowsOverlay();
105 }
106 else {
107 this.hideOverlay();
108 }
109 };
110 GridPanel.prototype.onNewColumnsLoaded = function () {
111 // hide overlay if columns and rows exist, this can happen if columns are loaded after data.
112 // this problem exists before of the race condition between the services (column controller in this case)
113 // and the view (grid panel). if the model beans were all initialised first, and then the view beans second,
114 // this race condition would not happen.
115 if (this.columnController.isReady() && !this.paginationProxy.isEmpty()) {
116 this.hideOverlay();
117 }
118 };
119 GridPanel.prototype.init = function () {
120 this.instantiate(this.context);
121 // makes code below more readable if we pull 'forPrint' out
122 this.scrollWidth = this.gridOptionsWrapper.getScrollbarWidth();
123 this.enableRtl = this.gridOptionsWrapper.isEnableRtl();
124 this.useAnimationFrame = !this.gridOptionsWrapper.isSuppressAnimationFrame();
125 // if the browser is Windows based, then the scrollbars take up space, and we clip by
126 // the width of the scrollbar. however if the scroll bars do not take up space (iOS)
127 // then they overlay on top of the div, so we clip some extra blank space instead.
128 this.scrollClipWidth = this.scrollWidth > 0 ? this.scrollWidth : 20;
129 // all of these element have different CSS when layout changes
130 this.gridOptionsWrapper.addLayoutElement(this.getGui());
131 this.gridOptionsWrapper.addLayoutElement(this.eBody);
132 this.gridOptionsWrapper.addLayoutElement(this.eBodyViewport);
133 this.gridOptionsWrapper.addLayoutElement(this.eTopViewport);
134 this.gridOptionsWrapper.addLayoutElement(this.eBodyContainer);
135 this.suppressScrollOnFloatingRow();
136 this.setupRowAnimationCssClass();
137 this.buildRowContainerComponents();
138 this.addEventListeners();
139 this.addDragListeners();
140 this.addScrollListener();
141 if (this.gridOptionsWrapper.isSuppressHorizontalScroll()) {
142 this.eBodyViewport.style.overflowX = 'hidden';
143 }
144 this.setupOverlay();
145 if (this.gridOptionsWrapper.isRowModelDefault() && !this.gridOptionsWrapper.getRowData()) {
146 this.showLoadingOverlay();
147 }
148 this.setPinnedContainersVisible();
149 this.setBodyAndHeaderHeights();
150 this.disableBrowserDragging();
151 this.addShortcutKeyListeners();
152 this.addMouseListeners();
153 this.addKeyboardEvents();
154 this.addBodyViewportListener();
155 this.addStopEditingWhenGridLosesFocus();
156 this.mockContextMenuForIPad();
157 this.addRowDragListener();
158 if (this.$scope) {
159 this.addAngularApplyCheck();
160 }
161 this.onDisplayedColumnsWidthChanged();
162 // this.addWindowResizeListener();
163 this.gridApi.registerGridComp(this);
164 this.alignedGridsService.registerGridComp(this);
165 this.headerRootComp.registerGridComp(this);
166 this.animationFrameService.registerGridComp(this);
167 this.navigationService.registerGridComp(this);
168 this.heightScaler.registerGridComp(this);
169 this.autoHeightCalculator.registerGridComp(this);
170 this.columnAnimationService.registerGridComp(this);
171 this.autoWidthCalculator.registerGridComp(this);
172 this.paginationAutoPageSizeService.registerGridComp(this);
173 this.beans.registerGridComp(this);
174 this.rowRenderer.registerGridComp(this);
175 if (this.rangeController) {
176 this.rangeController.registerGridComp(this);
177 }
178 var unsubscribeFromResize = resizeObserver_1.observeResize(this.eBodyViewport, this.onBodyViewportResized.bind(this));
179 this.addDestroyFunc(function () { return unsubscribeFromResize(); });
180 };
181 GridPanel.prototype.onBodyViewportResized = function () {
182 this.checkViewportAndScrolls();
183 };
184 // used by ColumnAnimationService
185 GridPanel.prototype.setColumnMovingCss = function (moving) {
186 this.addOrRemoveCssClass('ag-column-moving', moving);
187 };
188 GridPanel.prototype.setupOverlay = function () {
189 this.overlayWrapper = this.componentRecipes.newOverlayWrapperComponent();
190 this.eOverlay = this.queryForHtmlElement('[ref="eOverlay"]');
191 this.overlayWrapper.hideOverlay(this.eOverlay);
192 };
193 GridPanel.prototype.addRowDragListener = function () {
194 var rowDragFeature = new rowDragFeature_1.RowDragFeature(this.eBody, this);
195 this.context.wireBean(rowDragFeature);
196 this.dragAndDropService.addDropTarget(rowDragFeature);
197 };
198 GridPanel.prototype.addStopEditingWhenGridLosesFocus = function () {
199 var _this = this;
200 if (this.gridOptionsWrapper.isStopEditingWhenGridLosesFocus()) {
201 this.addDestroyableEventListener(this.eBody, 'focusout', function (event) {
202 // this is the element the focus is moving to
203 var elementWithFocus = event.relatedTarget;
204 // see if the element the focus is going to is part of the grid
205 var clickInsideGrid = false;
206 var pointer = elementWithFocus;
207 while (utils_1.Utils.exists(pointer) && !clickInsideGrid) {
208 var isPopup = !!_this.gridOptionsWrapper.getDomData(pointer, popupEditorWrapper_1.PopupEditorWrapper.DOM_KEY_POPUP_EDITOR_WRAPPER);
209 var isBody = _this.eBody == pointer;
210 clickInsideGrid = isPopup || isBody;
211 pointer = pointer.parentNode;
212 }
213 if (!clickInsideGrid) {
214 _this.rowRenderer.stopEditing();
215 }
216 });
217 }
218 };
219 GridPanel.prototype.addAngularApplyCheck = function () {
220 var _this = this;
221 // this makes sure if we queue up requests, we only execute oe
222 var applyTriggered = false;
223 var listener = function () {
224 // only need to do one apply at a time
225 if (applyTriggered) {
226 return;
227 }
228 applyTriggered = true; // mark 'need apply' to true
229 setTimeout(function () {
230 applyTriggered = false;
231 _this.$scope.$apply();
232 }, 0);
233 };
234 // these are the events we need to do an apply after - these are the ones that can end up
235 // with columns added or removed
236 this.addDestroyableEventListener(this.eventService, events_1.Events.EVENT_DISPLAYED_COLUMNS_CHANGED, listener);
237 this.addDestroyableEventListener(this.eventService, events_1.Events.EVENT_VIRTUAL_COLUMNS_CHANGED, listener);
238 };
239 // if we do not do this, then the user can select a pic in the grid (eg an image in a custom cell renderer)
240 // and then that will start the browser native drag n' drop, which messes up with our own drag and drop.
241 GridPanel.prototype.disableBrowserDragging = function () {
242 this.getGui().addEventListener('dragstart', function (event) {
243 if (event.target instanceof HTMLImageElement) {
244 event.preventDefault();
245 return false;
246 }
247 });
248 };
249 GridPanel.prototype.addEventListeners = function () {
250 this.addDestroyableEventListener(this.eventService, events_1.Events.EVENT_DISPLAYED_COLUMNS_CHANGED, this.onDisplayedColumnsChanged.bind(this));
251 this.addDestroyableEventListener(this.eventService, events_1.Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED, this.onDisplayedColumnsWidthChanged.bind(this));
252 this.addDestroyableEventListener(this.eventService, events_1.Events.EVENT_PINNED_ROW_DATA_CHANGED, this.setBodyAndHeaderHeights.bind(this));
253 this.addDestroyableEventListener(this.eventService, events_1.Events.EVENT_ROW_DATA_CHANGED, this.onRowDataChanged.bind(this));
254 this.addDestroyableEventListener(this.eventService, events_1.Events.EVENT_ROW_DATA_UPDATED, this.onRowDataChanged.bind(this));
255 this.addDestroyableEventListener(this.eventService, events_1.Events.EVENT_NEW_COLUMNS_LOADED, this.onNewColumnsLoaded.bind(this));
256 this.addDestroyableEventListener(this.gridOptionsWrapper, gridOptionsWrapper_1.GridOptionsWrapper.PROP_HEADER_HEIGHT, this.setBodyAndHeaderHeights.bind(this));
257 this.addDestroyableEventListener(this.gridOptionsWrapper, gridOptionsWrapper_1.GridOptionsWrapper.PROP_PIVOT_HEADER_HEIGHT, this.setBodyAndHeaderHeights.bind(this));
258 this.addDestroyableEventListener(this.gridOptionsWrapper, gridOptionsWrapper_1.GridOptionsWrapper.PROP_GROUP_HEADER_HEIGHT, this.setBodyAndHeaderHeights.bind(this));
259 this.addDestroyableEventListener(this.gridOptionsWrapper, gridOptionsWrapper_1.GridOptionsWrapper.PROP_PIVOT_GROUP_HEADER_HEIGHT, this.setBodyAndHeaderHeights.bind(this));
260 this.addDestroyableEventListener(this.gridOptionsWrapper, gridOptionsWrapper_1.GridOptionsWrapper.PROP_FLOATING_FILTERS_HEIGHT, this.setBodyAndHeaderHeights.bind(this));
261 };
262 GridPanel.prototype.addDragListeners = function () {
263 var _this = this;
264 if (!this.gridOptionsWrapper.isEnableRangeSelection() // no range selection if no property
265 || utils_1.Utils.missing(this.rangeController)) {
266 return;
267 }
268 var containers = [this.eLeftContainer, this.eRightContainer, this.eBodyContainer,
269 this.eTop, this.eBottom];
270 containers.forEach(function (container) {
271 var params = {
272 eElement: container,
273 onDragStart: _this.rangeController.onDragStart.bind(_this.rangeController),
274 onDragStop: _this.rangeController.onDragStop.bind(_this.rangeController),
275 onDragging: _this.rangeController.onDragging.bind(_this.rangeController),
276 // for range selection by dragging the mouse, we want to ignore the event if shift key is pressed,
277 // as shift key click is another type of range selection
278 skipMouseEvent: function (mouseEvent) { return mouseEvent.shiftKey; }
279 };
280 _this.dragService.addDragSource(params);
281 _this.addDestroyFunc(function () { return _this.dragService.removeDragSource(params); });
282 });
283 };
284 GridPanel.prototype.addMouseListeners = function () {
285 var _this = this;
286 var eventNames = ['click', 'mousedown', 'dblclick', 'contextmenu', 'mouseover', 'mouseout'];
287 eventNames.forEach(function (eventName) {
288 var listener = _this.processMouseEvent.bind(_this, eventName);
289 _this.eAllCellContainers.forEach(function (container) {
290 return _this.addDestroyableEventListener(container, eventName, listener);
291 });
292 });
293 };
294 GridPanel.prototype.addKeyboardEvents = function () {
295 var _this = this;
296 var eventNames = ['keydown', 'keypress'];
297 eventNames.forEach(function (eventName) {
298 var listener = _this.processKeyboardEvent.bind(_this, eventName);
299 _this.eAllCellContainers.forEach(function (container) {
300 _this.addDestroyableEventListener(container, eventName, listener);
301 });
302 });
303 };
304 GridPanel.prototype.addBodyViewportListener = function () {
305 var _this = this;
306 // we want to listen for clicks directly on the eBodyViewport, so the user has a way of showing
307 // the context menu if no rows are displayed, or user simply clicks outside of a cell
308 var listener = function (mouseEvent) {
309 var target = utils_1.Utils.getTarget(mouseEvent);
310 if (target === _this.eBodyViewport || target === _this.eLeftViewport || target === _this.eRightViewport) {
311 // show it
312 _this.onContextMenu(mouseEvent, null, null, null, null);
313 _this.preventDefaultOnContextMenu(mouseEvent);
314 }
315 };
316 //For some reason listening only to this.eBody doesnt work... Maybe because the event is consumed somewhere else?
317 //In any case, not expending much time on this, if anyome comes accross this and knows how to make this work with
318 //one listener please go ahead and change it...
319 this.addDestroyableEventListener(this.eBodyViewport, 'contextmenu', listener);
320 this.addDestroyableEventListener(this.eRightViewport, 'contextmenu', listener);
321 this.addDestroyableEventListener(this.eLeftViewport, 'contextmenu', listener);
322 };
323 // + rangeController
324 GridPanel.prototype.getBodyClientRect = function () {
325 if (this.eBody) {
326 return this.eBody.getBoundingClientRect();
327 }
328 };
329 GridPanel.prototype.getRowForEvent = function (event) {
330 var sourceElement = utils_1.Utils.getTarget(event);
331 while (sourceElement) {
332 var renderedRow = this.gridOptionsWrapper.getDomData(sourceElement, rowComp_1.RowComp.DOM_DATA_KEY_RENDERED_ROW);
333 if (renderedRow) {
334 return renderedRow;
335 }
336 sourceElement = sourceElement.parentElement;
337 }
338 return null;
339 };
340 GridPanel.prototype.processKeyboardEvent = function (eventName, keyboardEvent) {
341 var renderedCell = this.mouseEventService.getRenderedCellForEvent(keyboardEvent);
342 if (!renderedCell) {
343 return;
344 }
345 switch (eventName) {
346 case 'keydown':
347 // first see if it's a scroll key, page up / down, home / end etc
348 var wasScrollKey = this.navigationService.handlePageScrollingKey(keyboardEvent);
349 // if not a scroll key, then we pass onto cell
350 if (!wasScrollKey) {
351 renderedCell.onKeyDown(keyboardEvent);
352 }
353 break;
354 case 'keypress':
355 renderedCell.onKeyPress(keyboardEvent);
356 break;
357 }
358 };
359 // gets called by rowRenderer when new data loaded, as it will want to scroll to the top
360 GridPanel.prototype.scrollToTop = function () {
361 this.eBodyViewport.scrollTop = 0;
362 };
363 GridPanel.prototype.processMouseEvent = function (eventName, mouseEvent) {
364 if (!this.mouseEventService.isEventFromThisGrid(mouseEvent)) {
365 return;
366 }
367 if (utils_1.Utils.isStopPropagationForAgGrid(mouseEvent)) {
368 return;
369 }
370 var rowComp = this.getRowForEvent(mouseEvent);
371 var cellComp = this.mouseEventService.getRenderedCellForEvent(mouseEvent);
372 if (eventName === "contextmenu") {
373 this.handleContextMenuMouseEvent(mouseEvent, null, rowComp, cellComp);
374 }
375 else {
376 if (cellComp) {
377 cellComp.onMouseEvent(eventName, mouseEvent);
378 }
379 if (rowComp) {
380 rowComp.onMouseEvent(eventName, mouseEvent);
381 }
382 }
383 this.preventDefaultOnContextMenu(mouseEvent);
384 };
385 GridPanel.prototype.mockContextMenuForIPad = function () {
386 var _this = this;
387 // we do NOT want this when not in ipad, otherwise we will be doing
388 if (!utils_1.Utils.isUserAgentIPad()) {
389 return;
390 }
391 this.eAllCellContainers.forEach(function (container) {
392 var touchListener = new touchListener_1.TouchListener(container);
393 var longTapListener = function (event) {
394 var rowComp = _this.getRowForEvent(event.touchEvent);
395 var cellComp = _this.mouseEventService.getRenderedCellForEvent(event.touchEvent);
396 _this.handleContextMenuMouseEvent(null, event.touchEvent, rowComp, cellComp);
397 };
398 _this.addDestroyableEventListener(touchListener, touchListener_1.TouchListener.EVENT_LONG_TAP, longTapListener);
399 _this.addDestroyFunc(function () { return touchListener.destroy(); });
400 });
401 };
402 GridPanel.prototype.handleContextMenuMouseEvent = function (mouseEvent, touchEvent, rowComp, cellComp) {
403 var rowNode = rowComp ? rowComp.getRowNode() : null;
404 var column = cellComp ? cellComp.getColumn() : null;
405 var value = null;
406 if (column) {
407 var event_1 = mouseEvent ? mouseEvent : touchEvent;
408 cellComp.dispatchCellContextMenuEvent(event_1);
409 value = this.valueService.getValue(column, rowNode);
410 }
411 this.onContextMenu(mouseEvent, touchEvent, rowNode, column, value);
412 };
413 GridPanel.prototype.onContextMenu = function (mouseEvent, touchEvent, rowNode, column, value) {
414 // to allow us to debug in chrome, we ignore the event if ctrl is pressed.
415 // not everyone wants this, so first 'if' below allows to turn this hack off.
416 if (!this.gridOptionsWrapper.isAllowContextMenuWithControlKey()) {
417 // then do the check
418 if (mouseEvent && (mouseEvent.ctrlKey || mouseEvent.metaKey)) {
419 return;
420 }
421 }
422 if (this.contextMenuFactory && !this.gridOptionsWrapper.isSuppressContextMenu()) {
423 var eventOrTouch = mouseEvent ? mouseEvent : touchEvent.touches[0];
424 this.contextMenuFactory.showMenu(rowNode, column, value, eventOrTouch);
425 var event_2 = mouseEvent ? mouseEvent : touchEvent;
426 event_2.preventDefault();
427 }
428 };
429 GridPanel.prototype.preventDefaultOnContextMenu = function (mouseEvent) {
430 // if we don't do this, then middle click will never result in a 'click' event, as 'mousedown'
431 // will be consumed by the browser to mean 'scroll' (as you can scroll with the middle mouse
432 // button in the browser). so this property allows the user to receive middle button clicks if
433 // they want.
434 if (this.gridOptionsWrapper.isSuppressMiddleClickScrolls() && mouseEvent.which === 2) {
435 mouseEvent.preventDefault();
436 }
437 };
438 GridPanel.prototype.addShortcutKeyListeners = function () {
439 var _this = this;
440 this.eAllCellContainers.forEach(function (container) {
441 container.addEventListener('keydown', function (event) {
442 // if the cell the event came from is editing, then we do not
443 // want to do the default shortcut keys, otherwise the editor
444 // (eg a text field) would not be able to do the normal cut/copy/paste
445 var renderedCell = _this.mouseEventService.getRenderedCellForEvent(event);
446 if (renderedCell && renderedCell.isEditing()) {
447 return;
448 }
449 // for copy / paste, we don't want to execute when the event
450 // was from a child grid (happens in master detail)
451 if (!_this.mouseEventService.isEventFromThisGrid(event)) {
452 return;
453 }
454 if (event.ctrlKey || event.metaKey) {
455 switch (event.which) {
456 case constants_1.Constants.KEY_A: return _this.onCtrlAndA(event);
457 case constants_1.Constants.KEY_C: return _this.onCtrlAndC(event);
458 case constants_1.Constants.KEY_V: return _this.onCtrlAndV(event);
459 case constants_1.Constants.KEY_D: return _this.onCtrlAndD(event);
460 }
461 }
462 });
463 });
464 };
465 GridPanel.prototype.onCtrlAndA = function (event) {
466 if (this.rangeController && this.paginationProxy.isRowsToRender()) {
467 var rowEnd = void 0;
468 var floatingStart = void 0;
469 var floatingEnd = void 0;
470 if (this.pinnedRowModel.isEmpty(constants_1.Constants.PINNED_TOP)) {
471 floatingStart = null;
472 }
473 else {
474 floatingStart = constants_1.Constants.PINNED_TOP;
475 }
476 if (this.pinnedRowModel.isEmpty(constants_1.Constants.PINNED_BOTTOM)) {
477 floatingEnd = null;
478 rowEnd = this.paginationProxy.getTotalRowCount() - 1;
479 }
480 else {
481 floatingEnd = constants_1.Constants.PINNED_BOTTOM;
482 rowEnd = this.pinnedRowModel.getPinnedBottomRowData().length - 1;
483 }
484 var allDisplayedColumns = this.columnController.getAllDisplayedColumns();
485 if (utils_1.Utils.missingOrEmpty(allDisplayedColumns)) {
486 return;
487 }
488 this.rangeController.setRange({
489 rowStart: 0,
490 floatingStart: floatingStart,
491 rowEnd: rowEnd,
492 floatingEnd: floatingEnd,
493 columnStart: allDisplayedColumns[0],
494 columnEnd: allDisplayedColumns[allDisplayedColumns.length - 1]
495 });
496 }
497 event.preventDefault();
498 return false;
499 };
500 GridPanel.prototype.onCtrlAndC = function (event) {
501 if (!this.clipboardService) {
502 return;
503 }
504 var focusedCell = this.focusedCellController.getFocusedCell();
505 this.clipboardService.copyToClipboard();
506 event.preventDefault();
507 // the copy operation results in loosing focus on the cell,
508 // because of the trickery the copy logic uses with a temporary
509 // widget. so we set it back again.
510 if (focusedCell) {
511 this.focusedCellController.setFocusedCell(focusedCell.rowIndex, focusedCell.column, focusedCell.floating, true);
512 }
513 return false;
514 };
515 GridPanel.prototype.onCtrlAndV = function (event) {
516 if (!this.enterprise) {
517 return;
518 }
519 if (this.gridOptionsWrapper.isSuppressClipboardPaste()) {
520 return;
521 }
522 this.clipboardService.pasteFromClipboard();
523 return false;
524 };
525 GridPanel.prototype.onCtrlAndD = function (event) {
526 if (!this.enterprise) {
527 return;
528 }
529 this.clipboardService.copyRangeDown();
530 event.preventDefault();
531 return false;
532 };
533 // Valid values for position are bottom, middle and top
534 // position should be {'top','middle','bottom', or undefined/null}.
535 // if undefined/null, then the grid will to the minimal amount of scrolling,
536 // eg if grid needs to scroll up, it scrolls until row is on top,
537 // if grid needs to scroll down, it scrolls until row is on bottom,
538 // if row is already in view, grid does not scroll
539 GridPanel.prototype.ensureIndexVisible = function (index, position) {
540 // if for print or auto height, everything is always visible
541 if (this.gridOptionsWrapper.isGridAutoHeight()) {
542 return;
543 }
544 var rowCount = this.paginationProxy.getTotalRowCount();
545 if (typeof index !== 'number' || index < 0 || index >= rowCount) {
546 console.warn('invalid row index for ensureIndexVisible: ' + index);
547 return;
548 }
549 this.paginationProxy.goToPageWithIndex(index);
550 var rowNode = this.paginationProxy.getRow(index);
551 var paginationOffset = this.paginationProxy.getPixelOffset();
552 var rowTopPixel = rowNode.rowTop - paginationOffset;
553 var rowBottomPixel = rowTopPixel + rowNode.rowHeight;
554 var scrollPosition = this.getVScrollPosition();
555 var heightOffset = this.heightScaler.getOffset();
556 var vScrollTop = scrollPosition.top + heightOffset;
557 var vScrollBottom = scrollPosition.bottom + heightOffset;
558 if (this.isHorizontalScrollShowing()) {
559 vScrollBottom -= this.scrollWidth;
560 }
561 var viewportHeight = vScrollBottom - vScrollTop;
562 var newScrollPosition = null;
563 // work out the pixels for top, middle and bottom up front,
564 // make the if/else below easier to read
565 var pxTop = this.heightScaler.getScrollPositionForPixel(rowTopPixel);
566 var pxBottom = this.heightScaler.getScrollPositionForPixel(rowBottomPixel - viewportHeight);
567 var pxMiddle = (pxTop + pxBottom) / 2;
568 // make sure if middle, the row is not outside the top of the grid
569 if (pxMiddle > rowTopPixel) {
570 pxMiddle = rowTopPixel;
571 }
572 var rowBelowViewport = vScrollTop > rowTopPixel;
573 var rowAboveViewport = vScrollBottom < rowBottomPixel;
574 if (position === 'top') {
575 newScrollPosition = pxTop;
576 }
577 else if (position === 'bottom') {
578 newScrollPosition = pxBottom;
579 }
580 else if (position === 'middle') {
581 newScrollPosition = pxMiddle;
582 }
583 else if (rowBelowViewport) {
584 // if row is before, scroll up with row at top
585 newScrollPosition = pxTop;
586 }
587 else if (rowAboveViewport) {
588 // if row is below, scroll down with row at bottom
589 newScrollPosition = pxBottom;
590 }
591 if (newScrollPosition !== null) {
592 this.eBodyViewport.scrollTop = newScrollPosition;
593 this.rowRenderer.redrawAfterScroll();
594 }
595 };
596 // + moveColumnController
597 GridPanel.prototype.getCenterWidth = function () {
598 return this.eBodyViewport.clientWidth;
599 };
600 GridPanel.prototype.isHorizontalScrollShowing = function () {
601 return utils_1.Utils.isHorizontalScrollShowing(this.eBodyViewport);
602 };
603 GridPanel.prototype.isVerticalScrollShowing = function () {
604 return utils_1.Utils.isVerticalScrollShowing(this.eBodyViewport);
605 };
606 // gets called every time the viewport size changes. we use this to check visibility of scrollbars
607 // in the grid panel, and also to check size and position of viewport for row and column virtualisation.
608 GridPanel.prototype.checkViewportAndScrolls = function () {
609 // results in updating anything that depends on scroll showing
610 this.updateScrollVisibleService();
611 // fires event if height changes, used by PaginationService, HeightScalerService, RowRenderer
612 this.checkBodyHeight();
613 // check for virtual columns for ColumnController
614 this.onHorizontalViewportChanged();
615 this.setPinnedLeftWidth();
616 this.setPinnedRightWidth();
617 this.setBottomPaddingOnPinned();
618 this.hideVerticalScrollOnCenter();
619 this.hideFullWidthViewportScrollbars();
620 };
621 GridPanel.prototype.updateScrollVisibleService = function () {
622 var params = {
623 bodyHorizontalScrollShowing: false,
624 leftVerticalScrollShowing: false,
625 rightVerticalScrollShowing: false
626 };
627 if (this.enableRtl && this.columnController.isPinningLeft()) {
628 params.leftVerticalScrollShowing = utils_1.Utils.isVerticalScrollShowing(this.eLeftViewport);
629 }
630 if (!this.enableRtl && this.columnController.isPinningRight()) {
631 params.rightVerticalScrollShowing = utils_1.Utils.isVerticalScrollShowing(this.eRightViewport);
632 }
633 params.bodyHorizontalScrollShowing = this.isHorizontalScrollShowing();
634 this.scrollVisibleService.setScrollsVisible(params);
635 };
636 // the pinned container needs extra space at the bottom, some blank space, otherwise when
637 // vertically scrolled all the way down, the last row will be hidden behind the scrolls.
638 // this extra padding allows the last row to be lifted above the bottom scrollbar.
639 GridPanel.prototype.setBottomPaddingOnPinned = function () {
640 // no need for padding if the scrollbars are not taking up any space
641 if (this.scrollWidth <= 0) {
642 return;
643 }
644 if (this.isHorizontalScrollShowing()) {
645 this.eRightContainer.style.marginBottom = this.scrollWidth + 'px';
646 this.eLeftContainer.style.marginBottom = this.scrollWidth + 'px';
647 }
648 else {
649 this.eRightContainer.style.marginBottom = '';
650 this.eLeftContainer.style.marginBottom = '';
651 }
652 };
653 GridPanel.prototype.hideFullWidthViewportScrollbars = function () {
654 // if browser does not have scrollbars that take up space (eg iOS) then we don't need
655 // to adjust the sizes of the container for scrollbars
656 // if (this.scrollWidth <= 0) { return; }
657 var scrollWidthPx = this.scrollClipWidth > 0 ? this.scrollWidth + 'px' : '';
658 // if horizontal scroll is showing, we add padding to bottom so
659 // fullWidth container is not spreading over the scroll
660 this.eFullWidthViewportWrapper.style.paddingBottom = this.isHorizontalScrollShowing() ? scrollWidthPx : '';
661 // if vertical scroll is showing on full width viewport, then we clip it away, otherwise
662 // it competes with the main vertical scroll. this is done by getting the viewport to be
663 // bigger than the wrapper, the wrapper then ends up clipping the viewport.
664 var takeOutVScroll = this.isVerticalScrollShowing();
665 if (this.enableRtl) {
666 this.eFullWidthViewportWrapper.style.marginLeft = takeOutVScroll ? scrollWidthPx : '';
667 this.eFullWidthViewport.style.marginLeft = takeOutVScroll ? ('-' + scrollWidthPx) : '';
668 }
669 else {
670 this.eFullWidthViewportWrapper.style.width = takeOutVScroll ? "calc(100% - " + scrollWidthPx + ")" : '';
671 this.eFullWidthViewport.style.width = takeOutVScroll ? "calc(100% + " + scrollWidthPx + ")" : '';
672 }
673 };
674 GridPanel.prototype.ensureColumnVisible = function (key) {
675 var column = this.columnController.getGridColumn(key);
676 if (!column) {
677 return;
678 }
679 if (column.isPinned()) {
680 console.warn('calling ensureIndexVisible on a ' + column.getPinned() + ' pinned column doesn\'t make sense for column ' + column.getColId());
681 return;
682 }
683 if (!this.columnController.isColumnDisplayed(column)) {
684 console.warn('column is not currently visible');
685 return;
686 }
687 var colLeftPixel = column.getLeft();
688 var colRightPixel = colLeftPixel + column.getActualWidth();
689 var viewportWidth = this.eBodyViewport.clientWidth;
690 var scrollPosition = this.getBodyViewportScrollLeft();
691 var bodyWidth = this.columnController.getBodyContainerWidth();
692 var viewportLeftPixel;
693 var viewportRightPixel;
694 // the logic of working out left and right viewport px is both here and in the ColumnController,
695 // need to refactor it out to one place
696 if (this.enableRtl) {
697 viewportLeftPixel = bodyWidth - scrollPosition - viewportWidth;
698 viewportRightPixel = bodyWidth - scrollPosition;
699 }
700 else {
701 viewportLeftPixel = scrollPosition;
702 viewportRightPixel = viewportWidth + scrollPosition;
703 }
704 var viewportScrolledPastCol = viewportLeftPixel > colLeftPixel;
705 var viewportScrolledBeforeCol = viewportRightPixel < colRightPixel;
706 var colToSmallForViewport = viewportWidth < column.getActualWidth();
707 var alignColToLeft = viewportScrolledPastCol || colToSmallForViewport;
708 var alignColToRight = viewportScrolledBeforeCol;
709 if (alignColToLeft) {
710 // if viewport's left side is after col's left side, scroll left to pull col into viewport at left
711 if (this.enableRtl) {
712 var newScrollPosition = bodyWidth - viewportWidth - colLeftPixel;
713 this.setBodyViewportScrollLeft(newScrollPosition);
714 }
715 else {
716 this.setBodyViewportScrollLeft(colLeftPixel);
717 }
718 }
719 else if (alignColToRight) {
720 // if viewport's right side is before col's right side, scroll right to pull col into viewport at right
721 if (this.enableRtl) {
722 var newScrollPosition = bodyWidth - colRightPixel;
723 this.setBodyViewportScrollLeft(newScrollPosition);
724 }
725 else {
726 var newScrollPosition = colRightPixel - viewportWidth;
727 this.setBodyViewportScrollLeft(newScrollPosition);
728 }
729 }
730 else {
731 // otherwise, col is already in view, so do nothing
732 }
733 // this will happen anyway, as the move will cause a 'scroll' event on the body, however
734 // it is possible that the ensureColumnVisible method is called from within ag-Grid and
735 // the caller will need to have the columns rendered to continue, which will be before
736 // the event has been worked on (which is the case for cell navigation).
737 this.onHorizontalViewportChanged();
738 };
739 GridPanel.prototype.showLoadingOverlay = function () {
740 if (!this.gridOptionsWrapper.isSuppressLoadingOverlay()) {
741 this.overlayWrapper.showLoadingOverlay(this.eOverlay);
742 }
743 };
744 GridPanel.prototype.showNoRowsOverlay = function () {
745 if (!this.gridOptionsWrapper.isSuppressNoRowsOverlay()) {
746 this.overlayWrapper.showNoRowsOverlay(this.eOverlay);
747 }
748 };
749 GridPanel.prototype.hideOverlay = function () {
750 this.overlayWrapper.hideOverlay(this.eOverlay);
751 };
752 GridPanel.prototype.getWidthForSizeColsToFit = function () {
753 var availableWidth = this.eBody.clientWidth;
754 // if pinning right, then the scroll bar can show, however for some reason
755 // it overlays the grid and doesn't take space. so we are only interested
756 // in the body scroll showing.
757 var removeVerticalScrollWidth = this.isVerticalScrollShowing();
758 if (removeVerticalScrollWidth) {
759 availableWidth -= this.scrollWidth;
760 }
761 return availableWidth;
762 };
763 // method will call itself if no available width. this covers if the grid
764 // isn't visible, but is just about to be visible.
765 GridPanel.prototype.sizeColumnsToFit = function (nextTimeout) {
766 var _this = this;
767 var availableWidth = this.getWidthForSizeColsToFit();
768 if (availableWidth > 0) {
769 this.columnController.sizeColumnsToFit(availableWidth, "sizeColumnsToFit");
770 }
771 else {
772 if (nextTimeout === undefined) {
773 setTimeout(function () {
774 _this.sizeColumnsToFit(100);
775 }, 0);
776 }
777 else if (nextTimeout === 100) {
778 setTimeout(function () {
779 _this.sizeColumnsToFit(500);
780 }, 100);
781 }
782 else if (nextTimeout === 500) {
783 setTimeout(function () {
784 _this.sizeColumnsToFit(-1);
785 }, 500);
786 }
787 else {
788 console.log('ag-Grid: tried to call sizeColumnsToFit() but the grid is coming back with ' +
789 'zero width, maybe the grid is not visible yet on the screen?');
790 }
791 }
792 };
793 GridPanel.prototype.getBodyContainer = function () {
794 return this.eBodyContainer;
795 };
796 GridPanel.prototype.getDropTargetBodyContainers = function () {
797 return [this.eBodyViewport, this.eTopViewport, this.eBottomViewport];
798 };
799 GridPanel.prototype.getDropTargetLeftContainers = function () {
800 return [this.eLeftViewport, this.eLeftBottom, this.eLeftTop];
801 };
802 GridPanel.prototype.getDropTargetRightContainers = function () {
803 return [this.eRightViewport, this.eRightBottom, this.eRightTop];
804 };
805 GridPanel.prototype.buildRowContainerComponents = function () {
806 var _this = this;
807 this.eAllCellContainers = [
808 this.eLeftContainer, this.eRightContainer, this.eBodyContainer,
809 this.eTop, this.eBottom, this.eFullWidthContainer
810 ];
811 this.rowContainerComponents = {
812 body: new rowContainerComponent_1.RowContainerComponent({ eContainer: this.eBodyContainer, eViewport: this.eBodyViewport }),
813 fullWidth: new rowContainerComponent_1.RowContainerComponent({ eContainer: this.eFullWidthContainer, hideWhenNoChildren: true, eViewport: this.eFullWidthViewport }),
814 pinnedLeft: new rowContainerComponent_1.RowContainerComponent({ eContainer: this.eLeftContainer, eViewport: this.eLeftViewport }),
815 pinnedRight: new rowContainerComponent_1.RowContainerComponent({ eContainer: this.eRightContainer, eViewport: this.eRightViewport }),
816 floatingTop: new rowContainerComponent_1.RowContainerComponent({ eContainer: this.eTopContainer }),
817 floatingTopPinnedLeft: new rowContainerComponent_1.RowContainerComponent({ eContainer: this.eLeftTop }),
818 floatingTopPinnedRight: new rowContainerComponent_1.RowContainerComponent({ eContainer: this.eRightTop }),
819 floatingTopFullWidth: new rowContainerComponent_1.RowContainerComponent({ eContainer: this.eTopFullWidthContainer, hideWhenNoChildren: true }),
820 floatingBottom: new rowContainerComponent_1.RowContainerComponent({ eContainer: this.eBottomContainer }),
821 floatingBottomPinnedLeft: new rowContainerComponent_1.RowContainerComponent({ eContainer: this.eLeftBottom }),
822 floatingBottomPinnedRight: new rowContainerComponent_1.RowContainerComponent({ eContainer: this.eRightBottom }),
823 floatingBottomFullWith: new rowContainerComponent_1.RowContainerComponent({ eContainer: this.eBottomFullWidthContainer, hideWhenNoChildren: true }),
824 };
825 utils_1.Utils.iterateObject(this.rowContainerComponents, function (key, container) {
826 if (container) {
827 _this.context.wireBean(container);
828 }
829 });
830 };
831 GridPanel.prototype.setupRowAnimationCssClass = function () {
832 var _this = this;
833 var listener = function () {
834 // we don't want to use row animation if scaling, as rows jump strangely as you scroll,
835 // when scaling and doing row animation.
836 var animateRows = _this.gridOptionsWrapper.isAnimateRows() && !_this.heightScaler.isScaling();
837 utils_1.Utils.addOrRemoveCssClass(_this.eBody, 'ag-row-animation', animateRows);
838 utils_1.Utils.addOrRemoveCssClass(_this.eBody, 'ag-row-no-animation', !animateRows);
839 };
840 listener();
841 this.addDestroyableEventListener(this.eventService, events_1.Events.EVENT_HEIGHT_SCALE_CHANGED, listener);
842 };
843 // when editing a pinned row, if the cell is half outside the scrollable area, the browser can
844 // scroll the column into view. we do not want this, the pinned sections should never scroll.
845 // so we listen to scrolls on these containers and reset the scroll if we find one.
846 GridPanel.prototype.suppressScrollOnFloatingRow = function () {
847 var _this = this;
848 var resetTopScroll = function () { return _this.eTopViewport.scrollLeft = 0; };
849 var resetBottomScroll = function () { return _this.eTopViewport.scrollLeft = 0; };
850 this.addDestroyableEventListener(this.eTopViewport, 'scroll', resetTopScroll);
851 this.addDestroyableEventListener(this.eBottomViewport, 'scroll', resetBottomScroll);
852 };
853 GridPanel.prototype.getRowContainers = function () {
854 return this.rowContainerComponents;
855 };
856 GridPanel.prototype.onDisplayedColumnsChanged = function () {
857 this.setPinnedContainersVisible();
858 this.setBodyAndHeaderHeights();
859 this.onHorizontalViewportChanged();
860 };
861 GridPanel.prototype.onDisplayedColumnsWidthChanged = function () {
862 this.setWidthsOfContainers();
863 this.onHorizontalViewportChanged();
864 if (this.enableRtl) {
865 // because RTL is all backwards, a change in the width of the row
866 // can cause a change in the scroll position, without a scroll event,
867 // because the scroll position in RTL is a function that depends on
868 // the width. to be convinced of this, take out this line, enable RTL,
869 // scroll all the way to the left and then resize a column
870 this.horizontallyScrollHeaderCenterAndFloatingCenter();
871 }
872 };
873 GridPanel.prototype.setWidthsOfContainers = function () {
874 this.setCenterWidth();
875 this.setPinnedLeftWidth();
876 this.setPinnedRightWidth();
877 };
878 GridPanel.prototype.setCenterWidth = function () {
879 var widthPx = this.columnController.getBodyContainerWidth() + 'px';
880 this.eBodyContainer.style.width = widthPx;
881 this.eBottomContainer.style.width = widthPx;
882 this.eTopContainer.style.width = widthPx;
883 };
884 GridPanel.prototype.setPinnedLeftWidth = function () {
885 var widthOfCols = this.columnController.getPinnedLeftContainerWidth();
886 var widthOfColsAndScroll = widthOfCols + this.scrollWidth;
887 var widthOfColsAndClippedScroll = widthOfCols + this.scrollClipWidth;
888 var viewportWidth;
889 var wrapperWidth;
890 if (utils_1.Utils.isVerticalScrollShowing(this.eLeftViewport)) {
891 if (this.enableRtl) {
892 // show the scroll
893 viewportWidth = widthOfColsAndScroll;
894 wrapperWidth = widthOfColsAndScroll;
895 }
896 else {
897 // hide the scroll
898 viewportWidth = widthOfColsAndClippedScroll;
899 wrapperWidth = widthOfCols;
900 }
901 }
902 else {
903 // no scroll
904 viewportWidth = widthOfCols;
905 wrapperWidth = widthOfCols;
906 }
907 this.setElementWidth(this.eLeftViewportWrapper, wrapperWidth);
908 this.setElementWidth(this.eLeftViewport, viewportWidth);
909 this.setElementWidth(this.eLeftContainer, widthOfCols);
910 this.setElementWidth(this.eLeftBottom, wrapperWidth);
911 this.setElementWidth(this.eLeftTop, wrapperWidth);
912 };
913 GridPanel.prototype.setPinnedRightWidth = function () {
914 var widthOfCols = this.columnController.getPinnedRightContainerWidth();
915 var widthOfColsAndScroll = widthOfCols + this.scrollWidth;
916 var widthOfColsAndClippedScroll = widthOfCols + this.scrollClipWidth;
917 var viewportWidth;
918 var wrapperWidth;
919 if (utils_1.Utils.isVerticalScrollShowing(this.eRightViewport)) {
920 if (!this.enableRtl) {
921 // show the scroll
922 viewportWidth = widthOfColsAndScroll;
923 wrapperWidth = widthOfColsAndScroll;
924 }
925 else {
926 // hide the scroll
927 viewportWidth = widthOfColsAndClippedScroll;
928 wrapperWidth = widthOfCols;
929 }
930 }
931 else {
932 // no scroll
933 viewportWidth = widthOfCols;
934 wrapperWidth = widthOfCols;
935 }
936 this.setElementWidth(this.eRightViewportWrapper, wrapperWidth);
937 this.setElementWidth(this.eRightViewport, viewportWidth);
938 this.setElementWidth(this.eRightContainer, widthOfCols);
939 this.setElementWidth(this.eRightBottom, wrapperWidth);
940 this.setElementWidth(this.eRightTop, wrapperWidth);
941 };
942 GridPanel.prototype.setElementWidth = function (element, width) {
943 // .width didn't do the trick in firefox, so needed .minWidth also
944 element.style.width = width + 'px';
945 element.style.minWidth = width + 'px';
946 };
947 GridPanel.prototype.setPinnedContainersVisible = function () {
948 var changeDetected = false;
949 var showLeftPinned = this.columnController.isPinningLeft();
950 if (showLeftPinned !== this.pinningLeft) {
951 this.pinningLeft = showLeftPinned;
952 this.headerRootComp.setLeftVisible(showLeftPinned);
953 utils_1.Utils.setVisible(this.eLeftViewportWrapper, showLeftPinned);
954 changeDetected = true;
955 if (showLeftPinned) {
956 // because the viewport was not visible, it was not keeping previous scrollTop values
957 this.eLeftViewport.scrollTop = this.eBodyViewport.scrollTop;
958 }
959 }
960 var showRightPinned = this.columnController.isPinningRight();
961 if (showRightPinned !== this.pinningRight) {
962 this.pinningRight = showRightPinned;
963 this.headerRootComp.setRightVisible(showRightPinned);
964 utils_1.Utils.setVisible(this.eRightViewportWrapper, showRightPinned);
965 if (showRightPinned) {
966 // because the viewport was not visible, it was not keeping previous scrollTop values
967 this.eRightViewport.scrollTop = this.eBodyViewport.scrollTop;
968 }
969 changeDetected = true;
970 }
971 if (changeDetected) {
972 this.hideVerticalScrollOnCenter();
973 this.setPinnedLeftWidth();
974 this.setPinnedRightWidth();
975 }
976 };
977 GridPanel.prototype.hideVerticalScrollOnCenter = function () {
978 var neverShowScroll = this.enableRtl ?
979 this.columnController.isPinningLeft()
980 : this.columnController.isPinningRight();
981 var scrollActive = utils_1.Utils.isVerticalScrollShowing(this.eBodyViewport);
982 var hideScroll = neverShowScroll && scrollActive;
983 var margin = hideScroll ? '-' + this.scrollClipWidth + 'px' : '';
984 if (this.enableRtl) {
985 this.eBodyViewport.style.marginLeft = margin;
986 }
987 else {
988 this.eBodyViewport.style.marginRight = margin;
989 }
990 };
991 GridPanel.prototype.checkBodyHeight = function () {
992 var bodyHeight = this.eBody.clientHeight;
993 if (this.bodyHeight !== bodyHeight) {
994 this.bodyHeight = bodyHeight;
995 var event_3 = {
996 type: events_1.Events.EVENT_BODY_HEIGHT_CHANGED,
997 api: this.gridApi,
998 columnApi: this.columnApi
999 };
1000 this.eventService.dispatchEvent(event_3);
1001 }
1002 };
1003 GridPanel.prototype.setBodyAndHeaderHeights = function () {
1004 var headerRowCount = this.columnController.getHeaderRowCount();
1005 var totalHeaderHeight;
1006 var numberOfFloating = 0;
1007 var groupHeight;
1008 var headerHeight;
1009 if (!this.columnController.isPivotMode()) {
1010 if (this.gridOptionsWrapper.isFloatingFilter()) {
1011 headerRowCount++;
1012 }
1013 numberOfFloating = (this.gridOptionsWrapper.isFloatingFilter()) ? 1 : 0;
1014 groupHeight = this.gridOptionsWrapper.getGroupHeaderHeight();
1015 headerHeight = this.gridOptionsWrapper.getHeaderHeight();
1016 }
1017 else {
1018 numberOfFloating = 0;
1019 groupHeight = this.gridOptionsWrapper.getPivotGroupHeaderHeight();
1020 headerHeight = this.gridOptionsWrapper.getPivotHeaderHeight();
1021 }
1022 var numberOfNonGroups = 1 + numberOfFloating;
1023 var numberOfGroups = headerRowCount - numberOfNonGroups;
1024 totalHeaderHeight = numberOfFloating * this.gridOptionsWrapper.getFloatingFiltersHeight();
1025 totalHeaderHeight += numberOfGroups * groupHeight;
1026 totalHeaderHeight += headerHeight;
1027 this.headerRootComp.setHeight(totalHeaderHeight);
1028 var floatingTopHeight = this.pinnedRowModel.getPinnedTopTotalHeight();
1029 var floatingBottomHeight = this.pinnedRowModel.getPinnedBottomTotalHeight();
1030 this.eTop.style.minHeight = floatingTopHeight + 'px';
1031 this.eTop.style.height = floatingTopHeight + 'px';
1032 this.eBottom.style.minHeight = floatingBottomHeight + 'px';
1033 this.eBottom.style.height = floatingBottomHeight + 'px';
1034 this.checkBodyHeight();
1035 };
1036 GridPanel.prototype.getBodyHeight = function () {
1037 return this.bodyHeight;
1038 };
1039 GridPanel.prototype.setHorizontalScrollPosition = function (hScrollPosition) {
1040 this.eBodyViewport.scrollLeft = hScrollPosition;
1041 // we need to manually do the event handling (rather than wait for the event)
1042 // for the alignedGridsService, as if we don't, the aligned grid service gets
1043 // notified async, and then it's 'consuming' flag doesn't get used right, and
1044 // we can end up with an infinite loop
1045 if (this.nextScrollLeft !== hScrollPosition) {
1046 this.nextScrollLeft = hScrollPosition;
1047 this.doHorizontalScroll();
1048 }
1049 };
1050 GridPanel.prototype.setVerticalScrollPosition = function (vScrollPosition) {
1051 this.eBodyViewport.scrollTop = vScrollPosition;
1052 };
1053 // tries to scroll by pixels, but returns what the result actually was
1054 GridPanel.prototype.scrollHorizontally = function (pixels) {
1055 var oldScrollPosition = this.eBodyViewport.scrollLeft;
1056 this.setHorizontalScrollPosition(oldScrollPosition + pixels);
1057 var newScrollPosition = this.eBodyViewport.scrollLeft;
1058 return newScrollPosition - oldScrollPosition;
1059 };
1060 // tries to scroll by pixels, but returns what the result actually was
1061 GridPanel.prototype.scrollVertically = function (pixels) {
1062 var oldScrollPosition = this.eBodyViewport.scrollTop;
1063 this.setVerticalScrollPosition(oldScrollPosition + pixels);
1064 var newScrollPosition = this.eBodyViewport.scrollTop;
1065 return newScrollPosition - oldScrollPosition;
1066 };
1067 GridPanel.prototype.addScrollListener = function () {
1068 var _this = this;
1069 this.addDestroyableEventListener(this.eBodyViewport, 'scroll', function () {
1070 _this.onBodyHorizontalScroll();
1071 _this.onAnyBodyScroll(_this.eBodyViewport);
1072 });
1073 this.addDestroyableEventListener(this.eRightViewport, 'scroll', this.onAnyBodyScroll.bind(this, this.eRightViewport));
1074 this.addDestroyableEventListener(this.eLeftViewport, 'scroll', this.onAnyBodyScroll.bind(this, this.eLeftViewport));
1075 this.addDestroyableEventListener(this.eFullWidthViewport, 'scroll', this.onAnyBodyScroll.bind(this, this.eFullWidthViewport));
1076 };
1077 GridPanel.prototype.onAnyBodyScroll = function (source) {
1078 var now = new Date().getTime();
1079 var diff = now - this.lastVScrollTime;
1080 var elementIsNotControllingTheScroll = source !== this.lastVScrollElement && diff < 500;
1081 if (elementIsNotControllingTheScroll) {
1082 return;
1083 }
1084 this.lastVScrollElement = source;
1085 this.lastVScrollTime = now;
1086 var scrollTop = source.scrollTop;
1087 if (this.useAnimationFrame) {
1088 if (this.nextScrollTop !== scrollTop) {
1089 this.nextScrollTop = scrollTop;
1090 this.animationFrameService.schedule();
1091 }
1092 }
1093 else {
1094 if (scrollTop !== this.scrollTop) {
1095 this.scrollTop = scrollTop;
1096 this.synchroniseVerticalScrollPositions(scrollTop);
1097 this.redrawRowsAfterScroll();
1098 }
1099 }
1100 };
1101 GridPanel.prototype.onBodyHorizontalScroll = function () {
1102 var scrollLeft = this.eBodyViewport.scrollLeft;
1103 if (this.nextScrollLeft !== scrollLeft) {
1104 this.nextScrollLeft = scrollLeft;
1105 if (this.useAnimationFrame) {
1106 this.animationFrameService.schedule();
1107 }
1108 else {
1109 this.doHorizontalScroll();
1110 }
1111 }
1112 };
1113 GridPanel.prototype.doHorizontalScroll = function () {
1114 this.scrollLeft = this.nextScrollLeft;
1115 var event = {
1116 type: events_1.Events.EVENT_BODY_SCROLL,
1117 api: this.gridApi,
1118 columnApi: this.columnApi,
1119 direction: 'horizontal',
1120 left: this.scrollLeft,
1121 top: this.scrollTop
1122 };
1123 this.eventService.dispatchEvent(event);
1124 this.horizontallyScrollHeaderCenterAndFloatingCenter();
1125 this.onHorizontalViewportChanged();
1126 };
1127 GridPanel.prototype.executeFrame = function () {
1128 if (this.scrollLeft !== this.nextScrollLeft) {
1129 this.doHorizontalScroll();
1130 return true;
1131 }
1132 else if (this.scrollTop !== this.nextScrollTop) {
1133 this.scrollTop = this.nextScrollTop;
1134 this.synchroniseVerticalScrollPositions(this.scrollTop);
1135 this.verticalRedrawNeeded = true;
1136 return true;
1137 }
1138 else if (this.verticalRedrawNeeded) {
1139 this.redrawRowsAfterScroll();
1140 this.verticalRedrawNeeded = false;
1141 return true;
1142 }
1143 else {
1144 return false;
1145 }
1146 };
1147 GridPanel.prototype.redrawRowsAfterScroll = function () {
1148 var event = {
1149 type: events_1.Events.EVENT_BODY_SCROLL,
1150 direction: 'vertical',
1151 api: this.gridApi,
1152 columnApi: this.columnApi,
1153 left: this.scrollLeft,
1154 top: this.scrollTop
1155 };
1156 this.eventService.dispatchEvent(event);
1157 };
1158 // this gets called whenever a change in the viewport, so we can inform column controller it has to work
1159 // out the virtual columns again. gets called from following locations:
1160 // + ensureColVisible, scroll, init, layoutChanged, displayedColumnsChanged, API (doLayout)
1161 GridPanel.prototype.onHorizontalViewportChanged = function () {
1162 var scrollWidth = this.eBodyViewport.clientWidth;
1163 var scrollPosition = this.getBodyViewportScrollLeft();
1164 this.columnController.setVirtualViewportPosition(scrollWidth, scrollPosition);
1165 };
1166 GridPanel.prototype.getBodyViewportScrollLeft = function () {
1167 // we defer to a util, as how you calculated scrollLeft when doing RTL depends on the browser
1168 return utils_1.Utils.getScrollLeft(this.eBodyViewport, this.enableRtl);
1169 };
1170 GridPanel.prototype.setBodyViewportScrollLeft = function (value) {
1171 // we defer to a util, as how you calculated scrollLeft when doing RTL depends on the browser
1172 utils_1.Utils.setScrollLeft(this.eBodyViewport, value, this.enableRtl);
1173 };
1174 GridPanel.prototype.horizontallyScrollHeaderCenterAndFloatingCenter = function () {
1175 var scrollLeft = this.getBodyViewportScrollLeft();
1176 var offset = this.enableRtl ? scrollLeft : -scrollLeft;
1177 this.headerRootComp.setHorizontalScroll(offset);
1178 this.eBottomContainer.style.left = offset + 'px';
1179 this.eTopContainer.style.left = offset + 'px';
1180 };
1181 GridPanel.prototype.synchroniseVerticalScrollPositions = function (position) {
1182 if (this.lastVScrollElement !== this.eBodyViewport) {
1183 this.eBodyViewport.scrollTop = position;
1184 }
1185 if (this.lastVScrollElement !== this.eLeftViewport && this.pinningLeft) {
1186 this.eLeftViewport.scrollTop = position;
1187 }
1188 if (this.lastVScrollElement !== this.eRightViewport && this.pinningRight) {
1189 this.eRightViewport.scrollTop = position;
1190 }
1191 if (this.lastVScrollElement !== this.eFullWidthViewport) {
1192 this.eFullWidthViewport.scrollTop = position;
1193 }
1194 // the row containers need to remember the scroll position, as if they are made
1195 // hidden / shown, the scroll position is lost
1196 this.rowContainerComponents.body.setVerticalScrollPosition(position);
1197 this.rowContainerComponents.pinnedLeft.setVerticalScrollPosition(position);
1198 this.rowContainerComponents.pinnedRight.setVerticalScrollPosition(position);
1199 this.rowContainerComponents.fullWidth.setVerticalScrollPosition(position);
1200 this.redrawRowsAfterScroll();
1201 };
1202 GridPanel.prototype.addScrollEventListener = function (listener) {
1203 this.eBodyViewport.addEventListener('scroll', listener);
1204 };
1205 GridPanel.prototype.removeScrollEventListener = function (listener) {
1206 this.eBodyViewport.removeEventListener('scroll', listener);
1207 };
1208 __decorate([
1209 context_1.Autowired('alignedGridsService'),
1210 __metadata("design:type", alignedGridsService_1.AlignedGridsService)
1211 ], GridPanel.prototype, "alignedGridsService", void 0);
1212 __decorate([
1213 context_1.Autowired('gridOptionsWrapper'),
1214 __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
1215 ], GridPanel.prototype, "gridOptionsWrapper", void 0);
1216 __decorate([
1217 context_1.Autowired('columnController'),
1218 __metadata("design:type", columnController_1.ColumnController)
1219 ], GridPanel.prototype, "columnController", void 0);
1220 __decorate([
1221 context_1.Autowired('rowRenderer'),
1222 __metadata("design:type", rowRenderer_1.RowRenderer)
1223 ], GridPanel.prototype, "rowRenderer", void 0);
1224 __decorate([
1225 context_1.Autowired('pinnedRowModel'),
1226 __metadata("design:type", pinnedRowModel_1.PinnedRowModel)
1227 ], GridPanel.prototype, "pinnedRowModel", void 0);
1228 __decorate([
1229 context_1.Autowired('eventService'),
1230 __metadata("design:type", eventService_1.EventService)
1231 ], GridPanel.prototype, "eventService", void 0);
1232 __decorate([
1233 context_1.Autowired('context'),
1234 __metadata("design:type", context_1.Context)
1235 ], GridPanel.prototype, "context", void 0);
1236 __decorate([
1237 context_1.Autowired('animationFrameService'),
1238 __metadata("design:type", animationFrameService_1.AnimationFrameService)
1239 ], GridPanel.prototype, "animationFrameService", void 0);
1240 __decorate([
1241 context_1.Autowired('navigationService'),
1242 __metadata("design:type", navigationService_1.NavigationService)
1243 ], GridPanel.prototype, "navigationService", void 0);
1244 __decorate([
1245 context_1.Autowired('autoHeightCalculator'),
1246 __metadata("design:type", autoHeightCalculator_1.AutoHeightCalculator)
1247 ], GridPanel.prototype, "autoHeightCalculator", void 0);
1248 __decorate([
1249 context_1.Autowired('columnAnimationService'),
1250 __metadata("design:type", columnAnimationService_1.ColumnAnimationService)
1251 ], GridPanel.prototype, "columnAnimationService", void 0);
1252 __decorate([
1253 context_1.Autowired('autoWidthCalculator'),
1254 __metadata("design:type", autoWidthCalculator_1.AutoWidthCalculator)
1255 ], GridPanel.prototype, "autoWidthCalculator", void 0);
1256 __decorate([
1257 context_1.Autowired('paginationAutoPageSizeService'),
1258 __metadata("design:type", paginationProxy_1.PaginationAutoPageSizeService)
1259 ], GridPanel.prototype, "paginationAutoPageSizeService", void 0);
1260 __decorate([
1261 context_1.Autowired('beans'),
1262 __metadata("design:type", beans_1.Beans)
1263 ], GridPanel.prototype, "beans", void 0);
1264 __decorate([
1265 context_1.Autowired('paginationProxy'),
1266 __metadata("design:type", paginationProxy_1.PaginationProxy)
1267 ], GridPanel.prototype, "paginationProxy", void 0);
1268 __decorate([
1269 context_1.Autowired('columnApi'),
1270 __metadata("design:type", columnApi_1.ColumnApi)
1271 ], GridPanel.prototype, "columnApi", void 0);
1272 __decorate([
1273 context_1.Autowired('gridApi'),
1274 __metadata("design:type", gridApi_1.GridApi)
1275 ], GridPanel.prototype, "gridApi", void 0);
1276 __decorate([
1277 context_1.Autowired('dragService'),
1278 __metadata("design:type", dragService_1.DragService)
1279 ], GridPanel.prototype, "dragService", void 0);
1280 __decorate([
1281 context_1.Autowired('selectionController'),
1282 __metadata("design:type", selectionController_1.SelectionController)
1283 ], GridPanel.prototype, "selectionController", void 0);
1284 __decorate([
1285 context_1.Autowired('csvCreator'),
1286 __metadata("design:type", csvCreator_1.CsvCreator)
1287 ], GridPanel.prototype, "csvCreator", void 0);
1288 __decorate([
1289 context_1.Autowired('mouseEventService'),
1290 __metadata("design:type", mouseEventService_1.MouseEventService)
1291 ], GridPanel.prototype, "mouseEventService", void 0);
1292 __decorate([
1293 context_1.Autowired('focusedCellController'),
1294 __metadata("design:type", focusedCellController_1.FocusedCellController)
1295 ], GridPanel.prototype, "focusedCellController", void 0);
1296 __decorate([
1297 context_1.Autowired('$scope'),
1298 __metadata("design:type", Object)
1299 ], GridPanel.prototype, "$scope", void 0);
1300 __decorate([
1301 context_1.Autowired('scrollVisibleService'),
1302 __metadata("design:type", scrollVisibleService_1.ScrollVisibleService)
1303 ], GridPanel.prototype, "scrollVisibleService", void 0);
1304 __decorate([
1305 context_1.Autowired('frameworkFactory'),
1306 __metadata("design:type", Object)
1307 ], GridPanel.prototype, "frameworkFactory", void 0);
1308 __decorate([
1309 context_1.Autowired('valueService'),
1310 __metadata("design:type", valueService_1.ValueService)
1311 ], GridPanel.prototype, "valueService", void 0);
1312 __decorate([
1313 context_1.Autowired('componentRecipes'),
1314 __metadata("design:type", componentRecipes_1.ComponentRecipes)
1315 ], GridPanel.prototype, "componentRecipes", void 0);
1316 __decorate([
1317 context_1.Autowired('dragAndDropService'),
1318 __metadata("design:type", dragAndDropService_1.DragAndDropService)
1319 ], GridPanel.prototype, "dragAndDropService", void 0);
1320 __decorate([
1321 context_1.Autowired('heightScaler'),
1322 __metadata("design:type", heightScaler_1.HeightScaler)
1323 ], GridPanel.prototype, "heightScaler", void 0);
1324 __decorate([
1325 context_1.Autowired('enterprise'),
1326 __metadata("design:type", Boolean)
1327 ], GridPanel.prototype, "enterprise", void 0);
1328 __decorate([
1329 context_1.Optional('rangeController'),
1330 __metadata("design:type", Object)
1331 ], GridPanel.prototype, "rangeController", void 0);
1332 __decorate([
1333 context_1.Optional('contextMenuFactory'),
1334 __metadata("design:type", Object)
1335 ], GridPanel.prototype, "contextMenuFactory", void 0);
1336 __decorate([
1337 context_1.Optional('clipboardService'),
1338 __metadata("design:type", Object)
1339 ], GridPanel.prototype, "clipboardService", void 0);
1340 __decorate([
1341 componentAnnotations_1.RefSelector('eBody'),
1342 __metadata("design:type", HTMLElement)
1343 ], GridPanel.prototype, "eBody", void 0);
1344 __decorate([
1345 componentAnnotations_1.RefSelector('eBodyViewport'),
1346 __metadata("design:type", HTMLElement)
1347 ], GridPanel.prototype, "eBodyViewport", void 0);
1348 __decorate([
1349 componentAnnotations_1.RefSelector('eBodyContainer'),
1350 __metadata("design:type", HTMLElement)
1351 ], GridPanel.prototype, "eBodyContainer", void 0);
1352 __decorate([
1353 componentAnnotations_1.RefSelector('eLeftContainer'),
1354 __metadata("design:type", HTMLElement)
1355 ], GridPanel.prototype, "eLeftContainer", void 0);
1356 __decorate([
1357 componentAnnotations_1.RefSelector('eRightContainer'),
1358 __metadata("design:type", HTMLElement)
1359 ], GridPanel.prototype, "eRightContainer", void 0);
1360 __decorate([
1361 componentAnnotations_1.RefSelector('eFullWidthViewportWrapper'),
1362 __metadata("design:type", HTMLElement)
1363 ], GridPanel.prototype, "eFullWidthViewportWrapper", void 0);
1364 __decorate([
1365 componentAnnotations_1.RefSelector('eFullWidthViewport'),
1366 __metadata("design:type", HTMLElement)
1367 ], GridPanel.prototype, "eFullWidthViewport", void 0);
1368 __decorate([
1369 componentAnnotations_1.RefSelector('eFullWidthContainer'),
1370 __metadata("design:type", HTMLElement)
1371 ], GridPanel.prototype, "eFullWidthContainer", void 0);
1372 __decorate([
1373 componentAnnotations_1.RefSelector('eLeftViewport'),
1374 __metadata("design:type", HTMLElement)
1375 ], GridPanel.prototype, "eLeftViewport", void 0);
1376 __decorate([
1377 componentAnnotations_1.RefSelector('eLeftViewportWrapper'),
1378 __metadata("design:type", HTMLElement)
1379 ], GridPanel.prototype, "eLeftViewportWrapper", void 0);
1380 __decorate([
1381 componentAnnotations_1.RefSelector('eRightViewport'),
1382 __metadata("design:type", HTMLElement)
1383 ], GridPanel.prototype, "eRightViewport", void 0);
1384 __decorate([
1385 componentAnnotations_1.RefSelector('eRightViewportWrapper'),
1386 __metadata("design:type", HTMLElement)
1387 ], GridPanel.prototype, "eRightViewportWrapper", void 0);
1388 __decorate([
1389 componentAnnotations_1.RefSelector('eTop'),
1390 __metadata("design:type", HTMLElement)
1391 ], GridPanel.prototype, "eTop", void 0);
1392 __decorate([
1393 componentAnnotations_1.RefSelector('eLeftTop'),
1394 __metadata("design:type", HTMLElement)
1395 ], GridPanel.prototype, "eLeftTop", void 0);
1396 __decorate([
1397 componentAnnotations_1.RefSelector('eRightTop'),
1398 __metadata("design:type", HTMLElement)
1399 ], GridPanel.prototype, "eRightTop", void 0);
1400 __decorate([
1401 componentAnnotations_1.RefSelector('eTopContainer'),
1402 __metadata("design:type", HTMLElement)
1403 ], GridPanel.prototype, "eTopContainer", void 0);
1404 __decorate([
1405 componentAnnotations_1.RefSelector('eTopViewport'),
1406 __metadata("design:type", HTMLElement)
1407 ], GridPanel.prototype, "eTopViewport", void 0);
1408 __decorate([
1409 componentAnnotations_1.RefSelector('eTopFullWidthContainer'),
1410 __metadata("design:type", HTMLElement)
1411 ], GridPanel.prototype, "eTopFullWidthContainer", void 0);
1412 __decorate([
1413 componentAnnotations_1.RefSelector('eBottom'),
1414 __metadata("design:type", HTMLElement)
1415 ], GridPanel.prototype, "eBottom", void 0);
1416 __decorate([
1417 componentAnnotations_1.RefSelector('eLeftBottom'),
1418 __metadata("design:type", HTMLElement)
1419 ], GridPanel.prototype, "eLeftBottom", void 0);
1420 __decorate([
1421 componentAnnotations_1.RefSelector('eRightBottom'),
1422 __metadata("design:type", HTMLElement)
1423 ], GridPanel.prototype, "eRightBottom", void 0);
1424 __decorate([
1425 componentAnnotations_1.RefSelector('eBottomContainer'),
1426 __metadata("design:type", HTMLElement)
1427 ], GridPanel.prototype, "eBottomContainer", void 0);
1428 __decorate([
1429 componentAnnotations_1.RefSelector('eBottomViewport'),
1430 __metadata("design:type", HTMLElement)
1431 ], GridPanel.prototype, "eBottomViewport", void 0);
1432 __decorate([
1433 componentAnnotations_1.RefSelector('eBottomFullWidthContainer'),
1434 __metadata("design:type", HTMLElement)
1435 ], GridPanel.prototype, "eBottomFullWidthContainer", void 0);
1436 __decorate([
1437 componentAnnotations_1.RefSelector('headerRoot'),
1438 __metadata("design:type", headerRootComp_1.HeaderRootComp)
1439 ], GridPanel.prototype, "headerRootComp", void 0);
1440 __decorate([
1441 context_1.PreDestroy,
1442 __metadata("design:type", Function),
1443 __metadata("design:paramtypes", []),
1444 __metadata("design:returntype", void 0)
1445 ], GridPanel.prototype, "destroy", null);
1446 __decorate([
1447 context_1.PostConstruct,
1448 __metadata("design:type", Function),
1449 __metadata("design:paramtypes", []),
1450 __metadata("design:returntype", void 0)
1451 ], GridPanel.prototype, "init", null);
1452 return GridPanel;
1453}(component_1.Component));
1454exports.GridPanel = GridPanel;