1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | "use strict";
|
8 | var __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 | })();
|
18 | var __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 | };
|
24 | var __metadata = (this && this.__metadata) || function (k, v) {
|
25 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
26 | };
|
27 | Object.defineProperty(exports, "__esModule", { value: true });
|
28 | var eventService_1 = require("../eventService");
|
29 | var context_1 = require("../context/context");
|
30 | var events_1 = require("../events");
|
31 | var beanStub_1 = require("../context/beanStub");
|
32 | var columnApi_1 = require("../columnController/columnApi");
|
33 | var gridApi_1 = require("../gridApi");
|
34 | var ColumnHoverService = (function (_super) {
|
35 | __extends(ColumnHoverService, _super);
|
36 | function ColumnHoverService() {
|
37 | return _super !== null && _super.apply(this, arguments) || this;
|
38 | }
|
39 | ColumnHoverService.prototype.setMouseOver = function (columns) {
|
40 | this.selectedColumns = columns;
|
41 | var event = {
|
42 | type: events_1.Events.EVENT_COLUMN_HOVER_CHANGED,
|
43 | api: this.gridApi,
|
44 | columnApi: this.columnApi
|
45 | };
|
46 | this.eventService.dispatchEvent(event);
|
47 | };
|
48 | ColumnHoverService.prototype.clearMouseOver = function () {
|
49 | this.selectedColumns = null;
|
50 | var event = {
|
51 | type: events_1.Events.EVENT_COLUMN_HOVER_CHANGED,
|
52 | api: this.gridApi,
|
53 | columnApi: this.columnApi
|
54 | };
|
55 | this.eventService.dispatchEvent(event);
|
56 | };
|
57 | ColumnHoverService.prototype.isHovered = function (column) {
|
58 | return this.selectedColumns && this.selectedColumns.indexOf(column) >= 0;
|
59 | };
|
60 | __decorate([
|
61 | context_1.Autowired('eventService'),
|
62 | __metadata("design:type", eventService_1.EventService)
|
63 | ], ColumnHoverService.prototype, "eventService", void 0);
|
64 | __decorate([
|
65 | context_1.Autowired('columnApi'),
|
66 | __metadata("design:type", columnApi_1.ColumnApi)
|
67 | ], ColumnHoverService.prototype, "columnApi", void 0);
|
68 | __decorate([
|
69 | context_1.Autowired('gridApi'),
|
70 | __metadata("design:type", gridApi_1.GridApi)
|
71 | ], ColumnHoverService.prototype, "gridApi", void 0);
|
72 | ColumnHoverService = __decorate([
|
73 | context_1.Bean('columnHoverService')
|
74 | ], ColumnHoverService);
|
75 | return ColumnHoverService;
|
76 | }(beanStub_1.BeanStub));
|
77 | exports.ColumnHoverService = ColumnHoverService;
|