1 |
|
2 | (function webpackUniversalModuleDefinition(root, factory) {
|
3 | if(typeof exports === 'object' && typeof module === 'object')
|
4 | module.exports = factory();
|
5 | else if(typeof define === 'function' && define.amd)
|
6 | define([], factory);
|
7 | else if(typeof exports === 'object')
|
8 | exports["agGrid"] = factory();
|
9 | else
|
10 | root["agGrid"] = factory();
|
11 | })(this, function() {
|
12 | return (function(modules) {
|
13 |
|
14 | var installedModules = {};
|
15 |
|
16 |
|
17 | function __webpack_require__(moduleId) {
|
18 |
|
19 |
|
20 | if(installedModules[moduleId]) {
|
21 | return installedModules[moduleId].exports;
|
22 | }
|
23 |
|
24 | var module = installedModules[moduleId] = {
|
25 | i: moduleId,
|
26 | l: false,
|
27 | exports: {}
|
28 | };
|
29 |
|
30 |
|
31 | modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
32 |
|
33 |
|
34 | module.l = true;
|
35 |
|
36 |
|
37 | return module.exports;
|
38 | }
|
39 |
|
40 |
|
41 |
|
42 | __webpack_require__.m = modules;
|
43 |
|
44 |
|
45 | __webpack_require__.c = installedModules;
|
46 |
|
47 |
|
48 | __webpack_require__.d = function(exports, name, getter) {
|
49 | if(!__webpack_require__.o(exports, name)) {
|
50 | Object.defineProperty(exports, name, {
|
51 | configurable: false,
|
52 | enumerable: true,
|
53 | get: getter
|
54 | /******/ });
|
55 | /******/ }
|
56 | /******/ };
|
57 | /******/
|
58 | /******/ // getDefaultExport function for compatibility with non-harmony modules
|
59 | /******/ __webpack_require__.n = function(module) {
|
60 | var getter = module && module.__esModule ?
|
61 | function getDefault() { return module['default']; } :
|
62 | function getModuleExports() { return module; };
|
63 | __webpack_require__.d(getter, 'a', getter);
|
64 | return getter;
|
65 | };
|
66 |
|
67 |
|
68 | __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
69 |
|
70 |
|
71 | __webpack_require__.p = "";
|
72 |
|
73 |
|
74 | return __webpack_require__(__webpack_require__.s = 120);
|
75 | })
|
76 |
|
77 | ([
|
78 |
|
79 | (function(module, exports, __webpack_require__) {
|
80 |
|
81 | "use strict";
|
82 |
|
83 |
|
84 |
|
85 |
|
86 |
|
87 |
|
88 |
|
89 | Object.defineProperty(exports, "__esModule", { value: true });
|
90 | var utils_1 = __webpack_require__(1);
|
91 | var Context = (function () {
|
92 | function Context(params, logger) {
|
93 | this.beans = {};
|
94 | this.componentsMappedByName = {};
|
95 | this.destroyed = false;
|
96 | if (!params || !params.beans) {
|
97 | return;
|
98 | }
|
99 | this.contextParams = params;
|
100 | this.logger = logger;
|
101 | this.logger.log(">> creating ag-Application Context");
|
102 | this.setupComponents();
|
103 | this.createBeans();
|
104 | var beans = utils_1.Utils.mapObject(this.beans, function (beanEntry) { return beanEntry.beanInstance; });
|
105 | this.wireBeans(beans);
|
106 | this.logger.log(">> ag-Application Context ready - component is alive");
|
107 | }
|
108 | Context.prototype.setupComponents = function () {
|
109 | var _this = this;
|
110 | if (this.contextParams.components) {
|
111 | this.contextParams.components.forEach(function (componentMeta) { return _this.addComponent(componentMeta); });
|
112 | }
|
113 | };
|
114 | Context.prototype.addComponent = function (componentMeta) {
|
115 |
|
116 |
|
117 |
|
118 |
|
119 | var classEscaped = componentMeta.componentName.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
120 |
|
121 | var classUpperCase = classEscaped.toUpperCase();
|
122 |
|
123 | this.componentsMappedByName[classUpperCase] = componentMeta.theClass;
|
124 | };
|
125 | Context.prototype.createComponent = function (element, afterPreCreateCallback) {
|
126 | var key = element.nodeName;
|
127 | if (this.componentsMappedByName && this.componentsMappedByName[key]) {
|
128 | var newComponent = new this.componentsMappedByName[key]();
|
129 | this.wireBean(newComponent, afterPreCreateCallback);
|
130 | return newComponent;
|
131 | }
|
132 | else {
|
133 | return null;
|
134 | }
|
135 | };
|
136 | Context.prototype.wireBean = function (bean, afterPreCreateCallback) {
|
137 | if (!bean) {
|
138 | throw Error("Can't wire to bean since it is null");
|
139 | }
|
140 | this.wireBeans([bean], afterPreCreateCallback);
|
141 | };
|
142 | Context.prototype.wireBeans = function (beans, afterPreCreateCallback) {
|
143 | this.autoWireBeans(beans);
|
144 | this.methodWireBeans(beans);
|
145 | this.preConstruct(beans);
|
146 |
|
147 |
|
148 | if (utils_1.Utils.exists(afterPreCreateCallback)) {
|
149 | beans.forEach(afterPreCreateCallback);
|
150 | }
|
151 | this.postConstruct(beans);
|
152 | };
|
153 | Context.prototype.createBeans = function () {
|
154 | var _this = this;
|
155 |
|
156 | this.contextParams.beans.forEach(this.createBeanEntry.bind(this));
|
157 |
|
158 | if (this.contextParams.overrideBeans) {
|
159 | this.contextParams.overrideBeans.forEach(this.createBeanEntry.bind(this));
|
160 | }
|
161 |
|
162 | utils_1.Utils.iterateObject(this.beans, function (key, beanEntry) {
|
163 | var constructorParamsMeta;
|
164 | if (beanEntry.bean.__agBeanMetaData && beanEntry.bean.__agBeanMetaData.autowireMethods && beanEntry.bean.__agBeanMetaData.autowireMethods.agConstructor) {
|
165 | constructorParamsMeta = beanEntry.bean.__agBeanMetaData.autowireMethods.agConstructor;
|
166 | }
|
167 | var constructorParams = _this.getBeansForParameters(constructorParamsMeta, beanEntry.bean.name);
|
168 | var newInstance = applyToConstructor(beanEntry.bean, constructorParams);
|
169 | beanEntry.beanInstance = newInstance;
|
170 | _this.logger.log("bean " + _this.getBeanName(newInstance) + " created");
|
171 | });
|
172 | };
|
173 | Context.prototype.createBeanEntry = function (Bean) {
|
174 | var metaData = Bean.__agBeanMetaData;
|
175 | if (!metaData) {
|
176 | var beanName = void 0;
|
177 | if (Bean.prototype.constructor) {
|
178 | beanName = Bean.prototype.constructor.name;
|
179 | }
|
180 | else {
|
181 | beanName = "" + Bean;
|
182 | }
|
183 | console.error("context item " + beanName + " is not a bean");
|
184 | return;
|
185 | }
|
186 | var beanEntry = {
|
187 | bean: Bean,
|
188 | beanInstance: null,
|
189 | beanName: metaData.beanName
|
190 | };
|
191 | this.beans[metaData.beanName] = beanEntry;
|
192 | };
|
193 | Context.prototype.autoWireBeans = function (beans) {
|
194 | var _this = this;
|
195 | beans.forEach(function (bean) { return _this.autoWireBean(bean); });
|
196 | };
|
197 | Context.prototype.methodWireBeans = function (beans) {
|
198 | var _this = this;
|
199 | beans.forEach(function (bean) {
|
200 | if (!bean) {
|
201 | throw Error("Can't wire to bean since it is null");
|
202 | }
|
203 | return _this.methodWireBean(bean);
|
204 | });
|
205 | };
|
206 | Context.prototype.autoWireBean = function (bean) {
|
207 | var _this = this;
|
208 | var currentBean = bean;
|
209 | var _loop_1 = function () {
|
210 | var currentConstructor = currentBean.constructor;
|
211 | if (currentConstructor.__agBeanMetaData && currentConstructor.__agBeanMetaData.agClassAttributes) {
|
212 | var attributes = currentConstructor.__agBeanMetaData.agClassAttributes;
|
213 | if (!attributes) {
|
214 | return { value: void 0 };
|
215 | }
|
216 | var beanName_1 = this_1.getBeanName(currentConstructor);
|
217 | attributes.forEach(function (attribute) {
|
218 | var otherBean = _this.lookupBeanInstance(beanName_1, attribute.beanName, attribute.optional);
|
219 | bean[attribute.attributeName] = otherBean;
|
220 | });
|
221 | }
|
222 | currentBean = Object.getPrototypeOf(currentBean) ? Object.getPrototypeOf(currentBean) : null;
|
223 | };
|
224 | var this_1 = this;
|
225 | while (currentBean != null) {
|
226 | var state_1 = _loop_1();
|
227 | if (typeof state_1 === "object")
|
228 | return state_1.value;
|
229 | }
|
230 | };
|
231 | Context.prototype.getBeanName = function (constructor) {
|
232 | if (constructor.__agBeanMetaData && constructor.__agBeanMetaData.beanName) {
|
233 | return constructor.__agBeanMetaData.beanName;
|
234 | }
|
235 | var constructorString = constructor.toString();
|
236 | var beanName = constructorString.substring(9, constructorString.indexOf("("));
|
237 | return beanName;
|
238 | };
|
239 | Context.prototype.methodWireBean = function (bean) {
|
240 | var _this = this;
|
241 | var autowiredMethods;
|
242 | if (bean.constructor.__agBeanMetaData && bean.constructor.__agBeanMetaData.autowireMethods) {
|
243 | autowiredMethods = bean.constructor.__agBeanMetaData.autowireMethods;
|
244 | }
|
245 | utils_1.Utils.iterateObject(autowiredMethods, function (methodName, wireParams) {
|
246 |
|
247 | if (methodName === "agConstructor") {
|
248 | return;
|
249 | }
|
250 | var beanName = _this.getBeanName(bean.constructor);
|
251 | var initParams = _this.getBeansForParameters(wireParams, beanName);
|
252 | bean[methodName].apply(bean, initParams);
|
253 | });
|
254 | };
|
255 | Context.prototype.getBeansForParameters = function (parameters, beanName) {
|
256 | var _this = this;
|
257 | var beansList = [];
|
258 | if (parameters) {
|
259 | utils_1.Utils.iterateObject(parameters, function (paramIndex, otherBeanName) {
|
260 | var otherBean = _this.lookupBeanInstance(beanName, otherBeanName);
|
261 | beansList[Number(paramIndex)] = otherBean;
|
262 | });
|
263 | }
|
264 | return beansList;
|
265 | };
|
266 | Context.prototype.lookupBeanInstance = function (wiringBean, beanName, optional) {
|
267 | if (optional === void 0) { optional = false; }
|
268 | if (beanName === "context") {
|
269 | return this;
|
270 | }
|
271 | else if (this.contextParams.seed && this.contextParams.seed.hasOwnProperty(beanName)) {
|
272 | return this.contextParams.seed[beanName];
|
273 | }
|
274 | else {
|
275 | var beanEntry = this.beans[beanName];
|
276 | if (beanEntry) {
|
277 | return beanEntry.beanInstance;
|
278 | }
|
279 | if (!optional) {
|
280 | console.error("ag-Grid: unable to find bean reference " + beanName + " while initialising " + wiringBean);
|
281 | }
|
282 | return null;
|
283 | }
|
284 | };
|
285 | Context.prototype.postConstruct = function (beans) {
|
286 | beans.forEach(function (bean) {
|
287 |
|
288 | if (bean.constructor.__agBeanMetaData && bean.constructor.__agBeanMetaData.postConstructMethods) {
|
289 | bean.constructor.__agBeanMetaData && bean.constructor.__agBeanMetaData.postConstructMethods.forEach(function (methodName) { return bean[methodName](); });
|
290 | }
|
291 | });
|
292 | };
|
293 | Context.prototype.preConstruct = function (beans) {
|
294 | beans.forEach(function (bean) {
|
295 |
|
296 | if (bean.constructor.__agBeanMetaData && bean.constructor.__agBeanMetaData.preConstructMethods) {
|
297 | bean.constructor.__agBeanMetaData.preConstructMethods.forEach(function (methodName) { return bean[methodName](); });
|
298 | }
|
299 | });
|
300 | };
|
301 | Context.prototype.getBean = function (name) {
|
302 | return this.lookupBeanInstance("getBean", name, true);
|
303 | };
|
304 | Context.prototype.destroy = function () {
|
305 |
|
306 | if (this.destroyed) {
|
307 | return;
|
308 | }
|
309 | this.logger.log(">> Shutting down ag-Application Context");
|
310 |
|
311 | utils_1.Utils.iterateObject(this.beans, function (key, beanEntry) {
|
312 | var bean = beanEntry.beanInstance;
|
313 | if (bean.constructor.__agBeanMetaData && bean.constructor.__agBeanMetaData.preDestroyMethods) {
|
314 | bean.constructor.__agBeanMetaData.preDestroyMethods.forEach(function (methodName) { return bean[methodName](); });
|
315 | }
|
316 | });
|
317 | this.destroyed = true;
|
318 | this.logger.log(">> ag-Application Context shut down - component is dead");
|
319 | };
|
320 | return Context;
|
321 | }());
|
322 | exports.Context = Context;
|
323 |
|
324 |
|
325 | function applyToConstructor(constructor, argArray) {
|
326 | var args = [null].concat(argArray);
|
327 | var factoryFunction = constructor.bind.apply(constructor, args);
|
328 | return new factoryFunction();
|
329 | }
|
330 | function PreConstruct(target, methodName, descriptor) {
|
331 | var props = getOrCreateProps(target.constructor);
|
332 | if (!props.postConstructMethods) {
|
333 | props.preConstructMethods = [];
|
334 | }
|
335 | props.preConstructMethods.push(methodName);
|
336 | }
|
337 | exports.PreConstruct = PreConstruct;
|
338 | function PostConstruct(target, methodName, descriptor) {
|
339 | var props = getOrCreateProps(target.constructor);
|
340 | if (!props.postConstructMethods) {
|
341 | props.postConstructMethods = [];
|
342 | }
|
343 | props.postConstructMethods.push(methodName);
|
344 | }
|
345 | exports.PostConstruct = PostConstruct;
|
346 | function PreDestroy(target, methodName, descriptor) {
|
347 | var props = getOrCreateProps(target.constructor);
|
348 | if (!props.preDestroyMethods) {
|
349 | props.preDestroyMethods = [];
|
350 | }
|
351 | props.preDestroyMethods.push(methodName);
|
352 | }
|
353 | exports.PreDestroy = PreDestroy;
|
354 | function Bean(beanName) {
|
355 | return function (classConstructor) {
|
356 | var props = getOrCreateProps(classConstructor);
|
357 | props.beanName = beanName;
|
358 | };
|
359 | }
|
360 | exports.Bean = Bean;
|
361 | function Autowired(name) {
|
362 | return function (target, propertyKey, descriptor) {
|
363 | autowiredFunc(target, name, false, target, propertyKey, null);
|
364 | };
|
365 | }
|
366 | exports.Autowired = Autowired;
|
367 | function Optional(name) {
|
368 | return function (target, propertyKey, descriptor) {
|
369 | autowiredFunc(target, name, true, target, propertyKey, null);
|
370 | };
|
371 | }
|
372 | exports.Optional = Optional;
|
373 | function autowiredFunc(target, name, optional, classPrototype, methodOrAttributeName, index) {
|
374 | if (name === null) {
|
375 | console.error("ag-Grid: Autowired name should not be null");
|
376 | return;
|
377 | }
|
378 | if (typeof index === "number") {
|
379 | console.error("ag-Grid: Autowired should be on an attribute");
|
380 | return;
|
381 | }
|
382 |
|
383 | var props = getOrCreateProps(target.constructor);
|
384 | if (!props.agClassAttributes) {
|
385 | props.agClassAttributes = [];
|
386 | }
|
387 | props.agClassAttributes.push({
|
388 | attributeName: methodOrAttributeName,
|
389 | beanName: name,
|
390 | optional: optional
|
391 | });
|
392 | }
|
393 | function Qualifier(name) {
|
394 | return function (classPrototype, methodOrAttributeName, index) {
|
395 | var constructor = typeof classPrototype == "function" ? classPrototype : classPrototype.constructor;
|
396 | var props;
|
397 | if (typeof index === "number") {
|
398 |
|
399 | var methodName = void 0;
|
400 | if (methodOrAttributeName) {
|
401 | props = getOrCreateProps(constructor);
|
402 | methodName = methodOrAttributeName;
|
403 | }
|
404 | else {
|
405 | props = getOrCreateProps(constructor);
|
406 | methodName = "agConstructor";
|
407 | }
|
408 | if (!props.autowireMethods) {
|
409 | props.autowireMethods = {};
|
410 | }
|
411 | if (!props.autowireMethods[methodName]) {
|
412 | props.autowireMethods[methodName] = {};
|
413 | }
|
414 | props.autowireMethods[methodName][index] = name;
|
415 | }
|
416 | };
|
417 | }
|
418 | exports.Qualifier = Qualifier;
|
419 | function getOrCreateProps(target) {
|
420 | if (!target.hasOwnProperty("__agBeanMetaData")) {
|
421 | target.__agBeanMetaData = {};
|
422 | }
|
423 | return target.__agBeanMetaData;
|
424 | }
|
425 |
|
426 |
|
427 | }),
|
428 |
|
429 | (function(module, exports, __webpack_require__) {
|
430 |
|
431 | "use strict";
|
432 |
|
433 |
|
434 |
|
435 |
|
436 |
|
437 |
|
438 |
|
439 | Object.defineProperty(exports, "__esModule", { value: true });
|
440 | var constants_1 = __webpack_require__(9);
|
441 | var FUNCTION_STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
|
442 | var FUNCTION_ARGUMENT_NAMES = /([^\s,]+)/g;
|
443 | var AG_GRID_STOP_PROPAGATION = '__ag_Grid_Stop_Propagation';
|
444 |
|
445 | var Timer = (function () {
|
446 | function Timer() {
|
447 | this.timestamp = new Date().getTime();
|
448 | }
|
449 | Timer.prototype.print = function (msg) {
|
450 | var duration = (new Date().getTime()) - this.timestamp;
|
451 | console.log(msg + " = " + duration);
|
452 | this.timestamp = new Date().getTime();
|
453 | };
|
454 | return Timer;
|
455 | }());
|
456 | exports.Timer = Timer;
|
457 |
|
458 | var HTML_ESCAPES = {
|
459 | '&': '&',
|
460 | '<': '<',
|
461 | '>': '>',
|
462 | '"': '"',
|
463 | "'": '''
|
464 | };
|
465 | var reUnescapedHtml = /[&<>"']/g;
|
466 | var Utils = (function () {
|
467 | function Utils() {
|
468 | }
|
469 |
|
470 | Utils.doOnce = function (func, key) {
|
471 | if (this.doOnceFlags[key]) {
|
472 | return;
|
473 | }
|
474 | func();
|
475 | this.doOnceFlags[key] = true;
|
476 | };
|
477 |
|
478 |
|
479 | Utils.areEventsNear = function (e1, e2, pixelCount) {
|
480 |
|
481 | if (pixelCount === 0) {
|
482 | return false;
|
483 | }
|
484 | var diffX = Math.abs(e1.clientX - e2.clientX);
|
485 | var diffY = Math.abs(e1.clientY - e2.clientY);
|
486 | return Math.max(diffX, diffY) <= pixelCount;
|
487 | };
|
488 | Utils.shallowCompare = function (arr1, arr2) {
|
489 |
|
490 | if (this.missing(arr1) && this.missing(arr2)) {
|
491 | return true;
|
492 | }
|
493 |
|
494 | if (this.missing(arr1) || this.missing(arr2)) {
|
495 | return false;
|
496 | }
|
497 | if (arr1.length !== arr2.length) {
|
498 | return false;
|
499 | }
|
500 | for (var i = 0; i < arr1.length; i++) {
|
501 | if (arr1[i] !== arr2[i]) {
|
502 | return false;
|
503 | }
|
504 | }
|
505 | return true;
|
506 | };
|
507 | Utils.getNameOfClass = function (TheClass) {
|
508 | var funcNameRegex = /function (.{1,})\(/;
|
509 | var funcAsString = TheClass.toString();
|
510 | var results = (funcNameRegex).exec(funcAsString);
|
511 | return (results && results.length > 1) ? results[1] : "";
|
512 | };
|
513 | Utils.values = function (object) {
|
514 | var result = [];
|
515 | this.iterateObject(object, function (key, value) {
|
516 | result.push(value);
|
517 | });
|
518 | return result;
|
519 | };
|
520 | Utils.getValueUsingField = function (data, field, fieldContainsDots) {
|
521 | if (!field || !data) {
|
522 | return;
|
523 | }
|
524 |
|
525 | if (!fieldContainsDots) {
|
526 | return data[field];
|
527 | }
|
528 | else {
|
529 |
|
530 | var fields = field.split('.');
|
531 | var currentObject = data;
|
532 | for (var i = 0; i < fields.length; i++) {
|
533 | currentObject = currentObject[fields[i]];
|
534 | if (this.missing(currentObject)) {
|
535 | return null;
|
536 | }
|
537 | }
|
538 | return currentObject;
|
539 | }
|
540 | };
|
541 | Utils.getScrollLeft = function (element, rtl) {
|
542 | var scrollLeft = element.scrollLeft;
|
543 | if (rtl) {
|
544 |
|
545 | scrollLeft = Math.abs(scrollLeft);
|
546 |
|
547 | if (this.isBrowserSafari() || this.isBrowserChrome()) {
|
548 | scrollLeft = element.scrollWidth - element.clientWidth - scrollLeft;
|
549 | }
|
550 | }
|
551 | return scrollLeft;
|
552 | };
|
553 | Utils.cleanNumber = function (value) {
|
554 | if (typeof value === 'string') {
|
555 | value = parseInt(value);
|
556 | }
|
557 | if (typeof value === 'number') {
|
558 | value = Math.floor(value);
|
559 | }
|
560 | else {
|
561 | value = null;
|
562 | }
|
563 | return value;
|
564 | };
|
565 | Utils.setScrollLeft = function (element, value, rtl) {
|
566 | if (rtl) {
|
567 |
|
568 | if (this.isBrowserSafari() || this.isBrowserChrome()) {
|
569 | value = element.scrollWidth - element.clientWidth - value;
|
570 | }
|
571 |
|
572 | if (this.isBrowserFirefox()) {
|
573 | value *= -1;
|
574 | }
|
575 | }
|
576 | element.scrollLeft = value;
|
577 | };
|
578 | Utils.iterateNamedNodeMap = function (map, callback) {
|
579 | if (!map) {
|
580 | return;
|
581 | }
|
582 | for (var i = 0; i < map.length; i++) {
|
583 | var attr = map[i];
|
584 | callback(attr.name, attr.value);
|
585 | }
|
586 | };
|
587 | Utils.iterateObject = function (object, callback) {
|
588 | if (this.missing(object)) {
|
589 | return;
|
590 | }
|
591 | if (Array.isArray(object)) {
|
592 | object.forEach(function (value, index) {
|
593 | callback(index + '', value);
|
594 | });
|
595 | }
|
596 | else {
|
597 | var keys = Object.keys(object);
|
598 | for (var i = 0; i < keys.length; i++) {
|
599 | var key = keys[i];
|
600 | var value = object[key];
|
601 | callback(key, value);
|
602 | }
|
603 | }
|
604 | };
|
605 | Utils.cloneObject = function (object) {
|
606 | var copy = {};
|
607 | var keys = Object.keys(object);
|
608 | for (var i = 0; i < keys.length; i++) {
|
609 | var key = keys[i];
|
610 | var value = object[key];
|
611 | copy[key] = value;
|
612 | }
|
613 | return copy;
|
614 | };
|
615 | Utils.map = function (array, callback) {
|
616 | var result = [];
|
617 | for (var i = 0; i < array.length; i++) {
|
618 | var item = array[i];
|
619 | var mappedItem = callback(item);
|
620 | result.push(mappedItem);
|
621 | }
|
622 | return result;
|
623 | };
|
624 | Utils.mapObject = function (object, callback) {
|
625 | var result = [];
|
626 | Utils.iterateObject(object, function (key, value) {
|
627 | result.push(callback(value));
|
628 | });
|
629 | return result;
|
630 | };
|
631 | Utils.forEach = function (array, callback) {
|
632 | if (!array) {
|
633 | return;
|
634 | }
|
635 | for (var i = 0; i < array.length; i++) {
|
636 | var value = array[i];
|
637 | callback(value, i);
|
638 | }
|
639 | };
|
640 | Utils.filter = function (array, callback) {
|
641 | var result = [];
|
642 | array.forEach(function (item) {
|
643 | if (callback(item)) {
|
644 | result.push(item);
|
645 | }
|
646 | });
|
647 | return result;
|
648 | };
|
649 | Utils.getAllKeysInObjects = function (objects) {
|
650 | var allValues = {};
|
651 | objects.forEach(function (obj) {
|
652 | if (obj) {
|
653 | Object.keys(obj).forEach(function (key) { return allValues[key] = null; });
|
654 | }
|
655 | });
|
656 | return Object.keys(allValues);
|
657 | };
|
658 | Utils.mergeDeep = function (dest, source) {
|
659 | if (this.exists(source)) {
|
660 | this.iterateObject(source, function (key, newValue) {
|
661 | var oldValue = dest[key];
|
662 | if (oldValue === newValue) {
|
663 | return;
|
664 | }
|
665 | if (typeof oldValue === 'object' && typeof newValue === 'object') {
|
666 | Utils.mergeDeep(oldValue, newValue);
|
667 | }
|
668 | else {
|
669 | dest[key] = newValue;
|
670 | }
|
671 | });
|
672 | }
|
673 | };
|
674 | Utils.assign = function (object) {
|
675 | var _this = this;
|
676 | var sources = [];
|
677 | for (var _i = 1; _i < arguments.length; _i++) {
|
678 | sources[_i - 1] = arguments[_i];
|
679 | }
|
680 | sources.forEach(function (source) {
|
681 | if (_this.exists(source)) {
|
682 | _this.iterateObject(source, function (key, value) {
|
683 | object[key] = value;
|
684 | });
|
685 | }
|
686 | });
|
687 | return object;
|
688 | };
|
689 | Utils.parseYyyyMmDdToDate = function (yyyyMmDd, separator) {
|
690 | try {
|
691 | if (!yyyyMmDd)
|
692 | return null;
|
693 | if (yyyyMmDd.indexOf(separator) === -1)
|
694 | return null;
|
695 | var fields = yyyyMmDd.split(separator);
|
696 | if (fields.length != 3)
|
697 | return null;
|
698 | return new Date(Number(fields[0]), Number(fields[1]) - 1, Number(fields[2]));
|
699 | }
|
700 | catch (e) {
|
701 | return null;
|
702 | }
|
703 | };
|
704 | Utils.serializeDateToYyyyMmDd = function (date, separator) {
|
705 | if (!date)
|
706 | return null;
|
707 | return date.getFullYear() + separator + Utils.pad(date.getMonth() + 1, 2) + separator + Utils.pad(date.getDate(), 2);
|
708 | };
|
709 | Utils.pad = function (num, totalStringSize) {
|
710 | var asString = num + "";
|
711 | while (asString.length < totalStringSize)
|
712 | asString = "0" + asString;
|
713 | return asString;
|
714 | };
|
715 | Utils.pushAll = function (target, source) {
|
716 | if (this.missing(source) || this.missing(target)) {
|
717 | return;
|
718 | }
|
719 | source.forEach(function (func) { return target.push(func); });
|
720 | };
|
721 | Utils.createArrayOfNumbers = function (first, last) {
|
722 | var result = [];
|
723 | for (var i = first; i <= last; i++) {
|
724 | result.push(i);
|
725 | }
|
726 | return result;
|
727 | };
|
728 | Utils.getFunctionParameters = function (func) {
|
729 | var fnStr = func.toString().replace(FUNCTION_STRIP_COMMENTS, '');
|
730 | var result = fnStr.slice(fnStr.indexOf('(') + 1, fnStr.indexOf(')')).match(FUNCTION_ARGUMENT_NAMES);
|
731 | if (result === null) {
|
732 | return [];
|
733 | }
|
734 | else {
|
735 | return result;
|
736 | }
|
737 | };
|
738 | Utils.find = function (collection, predicate, value) {
|
739 | if (collection === null || collection === undefined) {
|
740 | return null;
|
741 | }
|
742 | if (!Array.isArray(collection)) {
|
743 | var objToArray = this.values(collection);
|
744 | return this.find(objToArray, predicate, value);
|
745 | }
|
746 | var collectionAsArray = collection;
|
747 | var firstMatchingItem;
|
748 | for (var i = 0; i < collectionAsArray.length; i++) {
|
749 | var item = collectionAsArray[i];
|
750 | if (typeof predicate === 'string') {
|
751 | if (item[predicate] === value) {
|
752 | firstMatchingItem = item;
|
753 | break;
|
754 | }
|
755 | }
|
756 | else {
|
757 | var callback = predicate;
|
758 | if (callback(item)) {
|
759 | firstMatchingItem = item;
|
760 | break;
|
761 | }
|
762 | }
|
763 | }
|
764 | return firstMatchingItem;
|
765 | };
|
766 | Utils.toStrings = function (array) {
|
767 | return this.map(array, function (item) {
|
768 | if (item === undefined || item === null || !item.toString) {
|
769 | return null;
|
770 | }
|
771 | else {
|
772 | return item.toString();
|
773 | }
|
774 | });
|
775 | };
|
776 | Utils.iterateArray = function (array, callback) {
|
777 | for (var index = 0; index < array.length; index++) {
|
778 | var value = array[index];
|
779 | callback(value, index);
|
780 | }
|
781 | };
|
782 |
|
783 |
|
784 | Utils.isNode = function (o) {
|
785 | return (typeof Node === "function" ? o instanceof Node :
|
786 | o && typeof o === "object" && typeof o.nodeType === "number" && typeof o.nodeName === "string");
|
787 | };
|
788 |
|
789 |
|
790 | Utils.isElement = function (o) {
|
791 | return (typeof HTMLElement === "function" ? o instanceof HTMLElement :
|
792 | o && typeof o === "object" && o !== null && o.nodeType === 1 && typeof o.nodeName === "string");
|
793 | };
|
794 | Utils.isNodeOrElement = function (o) {
|
795 | return this.isNode(o) || this.isElement(o);
|
796 | };
|
797 |
|
798 | Utils.copyNodeList = function (nodeList) {
|
799 | var childCount = nodeList ? nodeList.length : 0;
|
800 | var res = [];
|
801 | for (var i = 0; i < childCount; i++) {
|
802 | res.push(nodeList[i]);
|
803 | }
|
804 | return res;
|
805 | };
|
806 | Utils.isEventFromPrintableCharacter = function (event) {
|
807 | var pressedChar = String.fromCharCode(event.charCode);
|
808 |
|
809 |
|
810 |
|
811 |
|
812 |
|
813 |
|
814 | if (this.isKeyPressed(event, constants_1.Constants.KEY_NEW_LINE)) {
|
815 | return false;
|
816 | }
|
817 | if (exports._.exists(event.key)) {
|
818 |
|
819 |
|
820 | var printableCharacter = event.key.length === 1;
|
821 |
|
822 |
|
823 | var numpadDelWithNumlockOnForEdgeOrIe = Utils.isNumpadDelWithNumlockOnForEdgeOrIe(event);
|
824 | return printableCharacter || numpadDelWithNumlockOnForEdgeOrIe;
|
825 | }
|
826 | else {
|
827 |
|
828 |
|
829 | return Utils.PRINTABLE_CHARACTERS.indexOf(pressedChar) >= 0;
|
830 | }
|
831 | };
|
832 |
|
833 | Utils.addChangeListener = function (element, listener) {
|
834 | element.addEventListener("changed", listener);
|
835 | element.addEventListener("paste", listener);
|
836 | element.addEventListener("input", listener);
|
837 |
|
838 |
|
839 | element.addEventListener("keydown", listener);
|
840 | element.addEventListener("keyup", listener);
|
841 | };
|
842 |
|
843 | Utils.makeNull = function (value) {
|
844 | var valueNoType = value;
|
845 | if (value === null || value === undefined || valueNoType === "") {
|
846 | return null;
|
847 | }
|
848 | else {
|
849 | return value;
|
850 | }
|
851 | };
|
852 | Utils.missing = function (value) {
|
853 | return !this.exists(value);
|
854 | };
|
855 | Utils.missingOrEmpty = function (value) {
|
856 | return this.missing(value) || value.length === 0;
|
857 | };
|
858 | Utils.missingOrEmptyObject = function (value) {
|
859 | return this.missing(value) || Object.keys(value).length === 0;
|
860 | };
|
861 | Utils.exists = function (value) {
|
862 | if (value === null || value === undefined || value === '') {
|
863 | return false;
|
864 | }
|
865 | else {
|
866 | return true;
|
867 | }
|
868 | };
|
869 | Utils.firstExistingValue = function () {
|
870 | var values = [];
|
871 | for (var _i = 0; _i < arguments.length; _i++) {
|
872 | values[_i] = arguments[_i];
|
873 | }
|
874 | for (var i = 0; i < values.length; i++) {
|
875 | var value = values[i];
|
876 | if (exports._.exists(value))
|
877 | return value;
|
878 | }
|
879 | return null;
|
880 | };
|
881 | Utils.anyExists = function (values) {
|
882 | if (values) {
|
883 | for (var i = 0; i < values.length; i++) {
|
884 | if (this.exists(values[i])) {
|
885 | return true;
|
886 | }
|
887 | }
|
888 | }
|
889 | return false;
|
890 | };
|
891 | Utils.existsAndNotEmpty = function (value) {
|
892 | return this.exists(value) && value.length > 0;
|
893 | };
|
894 | Utils.removeAllChildren = function (node) {
|
895 | if (node) {
|
896 | while (node.hasChildNodes()) {
|
897 | node.removeChild(node.lastChild);
|
898 | }
|
899 | }
|
900 | };
|
901 | Utils.removeElement = function (parent, cssSelector) {
|
902 | this.removeFromParent(parent.querySelector(cssSelector));
|
903 | };
|
904 | Utils.removeFromParent = function (node) {
|
905 | if (node && node.parentNode) {
|
906 | node.parentNode.removeChild(node);
|
907 | }
|
908 | };
|
909 | Utils.isVisible = function (element) {
|
910 | return (element.offsetParent !== null);
|
911 | };
|
912 | |
913 |
|
914 |
|
915 |
|
916 | Utils.loadTemplate = function (template) {
|
917 | var tempDiv = document.createElement("div");
|
918 | tempDiv.innerHTML = template;
|
919 | return tempDiv.firstChild;
|
920 | };
|
921 | Utils.appendHtml = function (eContainer, htmlTemplate) {
|
922 | if (eContainer.lastChild) {
|
923 |
|
924 |
|
925 |
|
926 |
|
927 | eContainer.insertAdjacentHTML('afterbegin', htmlTemplate);
|
928 | }
|
929 | else {
|
930 | eContainer.innerHTML = htmlTemplate;
|
931 | }
|
932 | };
|
933 | Utils.addOrRemoveCssClass = function (element, className, addOrRemove) {
|
934 | if (addOrRemove) {
|
935 | this.addCssClass(element, className);
|
936 | }
|
937 | else {
|
938 | this.removeCssClass(element, className);
|
939 | }
|
940 | };
|
941 | Utils.callIfPresent = function (func) {
|
942 | if (func) {
|
943 | func();
|
944 | }
|
945 | };
|
946 | Utils.addCssClass = function (element, className) {
|
947 | var _this = this;
|
948 | if (!className || className.length === 0) {
|
949 | return;
|
950 | }
|
951 | if (className.indexOf(' ') >= 0) {
|
952 | className.split(' ').forEach(function (value) { return _this.addCssClass(element, value); });
|
953 | return;
|
954 | }
|
955 | if (element.classList) {
|
956 | if (!element.classList.contains(className)) {
|
957 | element.classList.add(className);
|
958 | }
|
959 | }
|
960 | else {
|
961 | if (element.className && element.className.length > 0) {
|
962 | var cssClasses = element.className.split(' ');
|
963 | if (cssClasses.indexOf(className) < 0) {
|
964 | cssClasses.push(className);
|
965 | element.className = cssClasses.join(' ');
|
966 | }
|
967 | }
|
968 | else {
|
969 | element.className = className;
|
970 | }
|
971 | }
|
972 | };
|
973 | Utils.containsClass = function (element, className) {
|
974 | if (element.classList) {
|
975 |
|
976 | return element.classList.contains(className);
|
977 | }
|
978 | else if (element.className) {
|
979 |
|
980 |
|
981 | var onlyClass = element.className === className;
|
982 |
|
983 |
|
984 | var contains = element.className.indexOf(' ' + className + ' ') >= 0;
|
985 |
|
986 | var startsWithClass = element.className.indexOf(className + ' ') === 0;
|
987 | var endsWithClass = element.className.lastIndexOf(' ' + className) === (element.className.length - className.length - 1);
|
988 | return onlyClass || contains || startsWithClass || endsWithClass;
|
989 | }
|
990 | else {
|
991 |
|
992 | return false;
|
993 | }
|
994 | };
|
995 | Utils.getElementAttribute = function (element, attributeName) {
|
996 | if (element.attributes) {
|
997 | if (element.attributes[attributeName]) {
|
998 | var attribute = element.attributes[attributeName];
|
999 | return attribute.value;
|
1000 | }
|
1001 | else {
|
1002 | return null;
|
1003 | }
|
1004 | }
|
1005 | else {
|
1006 | return null;
|
1007 | }
|
1008 | };
|
1009 | Utils.offsetHeight = function (element) {
|
1010 | return element && element.clientHeight ? element.clientHeight : 0;
|
1011 | };
|
1012 | Utils.offsetWidth = function (element) {
|
1013 | return element && element.clientWidth ? element.clientWidth : 0;
|
1014 | };
|
1015 | Utils.sortNumberArray = function (numberArray) {
|
1016 | numberArray.sort(function (a, b) { return a - b; });
|
1017 | };
|
1018 | Utils.removeCssClass = function (element, className) {
|
1019 | if (element.classList) {
|
1020 | if (element.classList.contains(className)) {
|
1021 | element.classList.remove(className);
|
1022 | }
|
1023 | }
|
1024 | else {
|
1025 | if (element.className && element.className.length > 0) {
|
1026 | var cssClasses = element.className.split(' ');
|
1027 | if (cssClasses.indexOf(className) >= 0) {
|
1028 |
|
1029 | while (cssClasses.indexOf(className) >= 0) {
|
1030 | cssClasses.splice(cssClasses.indexOf(className), 1);
|
1031 | }
|
1032 | element.className = cssClasses.join(' ');
|
1033 | }
|
1034 | }
|
1035 | }
|
1036 | };
|
1037 | Utils.removeRepeatsFromArray = function (array, object) {
|
1038 | if (!array) {
|
1039 | return;
|
1040 | }
|
1041 | for (var index = array.length - 2; index >= 0; index--) {
|
1042 | var thisOneMatches = array[index] === object;
|
1043 | var nextOneMatches = array[index + 1] === object;
|
1044 | if (thisOneMatches && nextOneMatches) {
|
1045 | array.splice(index + 1, 1);
|
1046 | }
|
1047 | }
|
1048 | };
|
1049 | Utils.removeFromArray = function (array, object) {
|
1050 | if (array.indexOf(object) >= 0) {
|
1051 | array.splice(array.indexOf(object), 1);
|
1052 | }
|
1053 | };
|
1054 | Utils.removeAllFromArray = function (array, toRemove) {
|
1055 | toRemove.forEach(function (item) {
|
1056 | if (array.indexOf(item) >= 0) {
|
1057 | array.splice(array.indexOf(item), 1);
|
1058 | }
|
1059 | });
|
1060 | };
|
1061 | Utils.insertIntoArray = function (array, object, toIndex) {
|
1062 | array.splice(toIndex, 0, object);
|
1063 | };
|
1064 | Utils.insertArrayIntoArray = function (dest, src, toIndex) {
|
1065 | if (this.missing(dest) || this.missing(src)) {
|
1066 | return;
|
1067 | }
|
1068 |
|
1069 | for (var i = src.length - 1; i >= 0; i--) {
|
1070 | var item = src[i];
|
1071 | this.insertIntoArray(dest, item, toIndex);
|
1072 | }
|
1073 | };
|
1074 | Utils.moveInArray = function (array, objectsToMove, toIndex) {
|
1075 | var _this = this;
|
1076 |
|
1077 | objectsToMove.forEach(function (obj) {
|
1078 | _this.removeFromArray(array, obj);
|
1079 | });
|
1080 |
|
1081 |
|
1082 | objectsToMove.slice().reverse().forEach(function (obj) {
|
1083 | _this.insertIntoArray(array, obj, toIndex);
|
1084 | });
|
1085 | };
|
1086 | Utils.defaultComparator = function (valueA, valueB, accentedCompare) {
|
1087 | if (accentedCompare === void 0) { accentedCompare = false; }
|
1088 | var valueAMissing = valueA === null || valueA === undefined;
|
1089 | var valueBMissing = valueB === null || valueB === undefined;
|
1090 |
|
1091 |
|
1092 |
|
1093 | if (valueA && valueA.toNumber) {
|
1094 | valueA = valueA.toNumber();
|
1095 | }
|
1096 | if (valueB && valueB.toNumber) {
|
1097 | valueB = valueB.toNumber();
|
1098 | }
|
1099 | if (valueAMissing && valueBMissing) {
|
1100 | return 0;
|
1101 | }
|
1102 | if (valueAMissing) {
|
1103 | return -1;
|
1104 | }
|
1105 | if (valueBMissing) {
|
1106 | return 1;
|
1107 | }
|
1108 | if (typeof valueA === "string") {
|
1109 | if (!accentedCompare) {
|
1110 | return doQuickCompare(valueA, valueB);
|
1111 | }
|
1112 | else {
|
1113 | try {
|
1114 |
|
1115 | return valueA.localeCompare(valueB);
|
1116 | }
|
1117 | catch (e) {
|
1118 |
|
1119 |
|
1120 | return doQuickCompare(valueA, valueB);
|
1121 | }
|
1122 | }
|
1123 | }
|
1124 | if (valueA < valueB) {
|
1125 | return -1;
|
1126 | }
|
1127 | else if (valueA > valueB) {
|
1128 | return 1;
|
1129 | }
|
1130 | else {
|
1131 | return 0;
|
1132 | }
|
1133 | function doQuickCompare(a, b) {
|
1134 | return (a > b ? 1 : (a < b ? -1 : 0));
|
1135 | }
|
1136 | };
|
1137 | Utils.compareArrays = function (array1, array2) {
|
1138 | if (this.missing(array1) && this.missing(array2)) {
|
1139 | return true;
|
1140 | }
|
1141 | if (this.missing(array1) || this.missing(array2)) {
|
1142 | return false;
|
1143 | }
|
1144 | if (array1.length !== array2.length) {
|
1145 | return false;
|
1146 | }
|
1147 | for (var i = 0; i < array1.length; i++) {
|
1148 | if (array1[i] !== array2[i]) {
|
1149 | return false;
|
1150 | }
|
1151 | }
|
1152 | return true;
|
1153 | };
|
1154 | Utils.ensureDomOrder = function (eContainer, eChild, eChildBefore) {
|
1155 |
|
1156 | if (eChildBefore && eChildBefore.nextSibling === eChild) {
|
1157 | return;
|
1158 | }
|
1159 | if (eChildBefore) {
|
1160 | if (eChildBefore.nextSibling) {
|
1161 |
|
1162 | eContainer.insertBefore(eChild, eChildBefore.nextSibling);
|
1163 | }
|
1164 | else {
|
1165 |
|
1166 | eContainer.appendChild(eChild);
|
1167 | }
|
1168 | }
|
1169 | else {
|
1170 |
|
1171 | if (eContainer.firstChild) {
|
1172 |
|
1173 | eContainer.insertBefore(eChild, eContainer.firstChild);
|
1174 | }
|
1175 | }
|
1176 | };
|
1177 | Utils.insertWithDomOrder = function (eContainer, eChild, eChildBefore) {
|
1178 | if (eChildBefore) {
|
1179 | if (eChildBefore.nextSibling) {
|
1180 |
|
1181 | eContainer.insertBefore(eChild, eChildBefore.nextSibling);
|
1182 | }
|
1183 | else {
|
1184 |
|
1185 | eContainer.appendChild(eChild);
|
1186 | }
|
1187 | }
|
1188 | else {
|
1189 | if (eContainer.firstChild) {
|
1190 |
|
1191 | eContainer.insertBefore(eChild, eContainer.firstChild);
|
1192 | }
|
1193 | else {
|
1194 |
|
1195 | eContainer.appendChild(eChild);
|
1196 | }
|
1197 | }
|
1198 | };
|
1199 | Utils.insertTemplateWithDomOrder = function (eContainer, htmlTemplate, eChildBefore) {
|
1200 | var res;
|
1201 | if (eChildBefore) {
|
1202 |
|
1203 | eChildBefore.insertAdjacentHTML('afterend', htmlTemplate);
|
1204 | res = eChildBefore.nextSibling;
|
1205 | }
|
1206 | else {
|
1207 | if (eContainer.firstChild) {
|
1208 |
|
1209 | eContainer.insertAdjacentHTML('afterbegin', htmlTemplate);
|
1210 | }
|
1211 | else {
|
1212 |
|
1213 | eContainer.innerHTML = htmlTemplate;
|
1214 | }
|
1215 | res = eContainer.firstChild;
|
1216 | }
|
1217 | return res;
|
1218 | };
|
1219 | Utils.every = function (items, callback) {
|
1220 | if (!items || items.length === 0) {
|
1221 | return true;
|
1222 | }
|
1223 | for (var i = 0; i < items.length; i++) {
|
1224 | if (!callback(items[i])) {
|
1225 | return false;
|
1226 | }
|
1227 | }
|
1228 | return true;
|
1229 | };
|
1230 | Utils.toStringOrNull = function (value) {
|
1231 | if (this.exists(value) && value.toString) {
|
1232 | return value.toString();
|
1233 | }
|
1234 | else {
|
1235 | return null;
|
1236 | }
|
1237 | };
|
1238 | Utils.formatWidth = function (width) {
|
1239 | if (typeof width === "number") {
|
1240 | return width + "px";
|
1241 | }
|
1242 | else {
|
1243 | return width;
|
1244 | }
|
1245 | };
|
1246 | Utils.formatNumberTwoDecimalPlacesAndCommas = function (value) {
|
1247 | if (typeof value !== 'number') {
|
1248 | return '';
|
1249 | }
|
1250 |
|
1251 | return (Math.round(value * 100) / 100).toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1,");
|
1252 | };
|
1253 |
|
1254 |
|
1255 | Utils.formatNumberCommas = function (value) {
|
1256 | if (typeof value !== 'number') {
|
1257 | return '';
|
1258 | }
|
1259 |
|
1260 | return value.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1,");
|
1261 | };
|
1262 | Utils.prependDC = function (parent, documentFragment) {
|
1263 | if (this.exists(parent.firstChild)) {
|
1264 | parent.insertBefore(documentFragment, parent.firstChild);
|
1265 | }
|
1266 | else {
|
1267 | parent.appendChild(documentFragment);
|
1268 | }
|
1269 | };
|
1270 | |
1271 |
|
1272 |
|
1273 |
|
1274 | Utils.createIcon = function (iconName, gridOptionsWrapper, column) {
|
1275 | var iconContents = this.createIconNoSpan(iconName, gridOptionsWrapper, column);
|
1276 | if (iconContents.className.indexOf('ag-icon') > -1) {
|
1277 | return iconContents;
|
1278 | }
|
1279 | else {
|
1280 | var eResult = document.createElement('span');
|
1281 | eResult.appendChild(iconContents);
|
1282 | return eResult;
|
1283 | }
|
1284 | };
|
1285 | Utils.createIconNoSpan = function (iconName, gridOptionsWrapper, column) {
|
1286 | var userProvidedIcon;
|
1287 |
|
1288 | if (column && column.getColDef().icons) {
|
1289 | userProvidedIcon = column.getColDef().icons[iconName];
|
1290 | }
|
1291 |
|
1292 | if (!userProvidedIcon && gridOptionsWrapper.getIcons()) {
|
1293 | userProvidedIcon = gridOptionsWrapper.getIcons()[iconName];
|
1294 | }
|
1295 |
|
1296 | if (userProvidedIcon) {
|
1297 | var rendererResult = void 0;
|
1298 | if (typeof userProvidedIcon === 'function') {
|
1299 | rendererResult = userProvidedIcon();
|
1300 | }
|
1301 | else if (typeof userProvidedIcon === 'string') {
|
1302 | rendererResult = userProvidedIcon;
|
1303 | }
|
1304 | else {
|
1305 | throw 'icon from grid options needs to be a string or a function';
|
1306 | }
|
1307 | if (typeof rendererResult === 'string') {
|
1308 | return this.loadTemplate(rendererResult);
|
1309 | }
|
1310 | else if (this.isNodeOrElement(rendererResult)) {
|
1311 | return rendererResult;
|
1312 | }
|
1313 | else {
|
1314 | throw 'iconRenderer should return back a string or a dom object';
|
1315 | }
|
1316 | }
|
1317 | else {
|
1318 | var span = document.createElement('span');
|
1319 | var cssClass = this.iconNameClassMap[iconName];
|
1320 | if (!cssClass) {
|
1321 | throw new Error(iconName + " did not find class");
|
1322 | }
|
1323 | span.setAttribute("class", "ag-icon ag-icon-" + cssClass);
|
1324 | return span;
|
1325 | }
|
1326 | };
|
1327 | Utils.addStylesToElement = function (eElement, styles) {
|
1328 | var _this = this;
|
1329 | if (!styles) {
|
1330 | return;
|
1331 | }
|
1332 | Object.keys(styles).forEach(function (key) {
|
1333 | var keyCamelCase = _this.hyphenToCamelCase(key);
|
1334 | eElement.style[keyCamelCase] = styles[key];
|
1335 | });
|
1336 | };
|
1337 | Utils.isHorizontalScrollShowing = function (element) {
|
1338 | return element.clientWidth < element.scrollWidth;
|
1339 | };
|
1340 | Utils.isVerticalScrollShowing = function (element) {
|
1341 | return element.clientHeight < element.scrollHeight;
|
1342 | };
|
1343 | Utils.getMaxDivHeight = function () {
|
1344 | if (!document.body) {
|
1345 | return -1;
|
1346 | }
|
1347 | var res = 1000000;
|
1348 |
|
1349 | var testUpTo = navigator.userAgent.toLowerCase().match(/firefox/) ? 6000000 : 1000000000;
|
1350 | var div = this.loadTemplate("<div/>");
|
1351 | document.body.appendChild(div);
|
1352 | while (true) {
|
1353 | var test = res * 2;
|
1354 | div.style.height = test + 'px';
|
1355 | if (test > testUpTo || div.clientHeight !== test) {
|
1356 | break;
|
1357 | }
|
1358 | else {
|
1359 | res = test;
|
1360 | }
|
1361 | }
|
1362 | document.body.removeChild(div);
|
1363 | return res;
|
1364 | };
|
1365 | Utils.getScrollbarWidth = function () {
|
1366 | var outer = document.createElement("div");
|
1367 | outer.style.visibility = "hidden";
|
1368 | outer.style.width = "100px";
|
1369 | outer.style.msOverflowStyle = "scrollbar";
|
1370 | document.body.appendChild(outer);
|
1371 | var widthNoScroll = outer.offsetWidth;
|
1372 |
|
1373 | outer.style.overflow = "scroll";
|
1374 |
|
1375 | var inner = document.createElement("div");
|
1376 | inner.style.width = "100%";
|
1377 | outer.appendChild(inner);
|
1378 | var widthWithScroll = inner.offsetWidth;
|
1379 |
|
1380 | outer.parentNode.removeChild(outer);
|
1381 | return widthNoScroll - widthWithScroll;
|
1382 | };
|
1383 | Utils.isKeyPressed = function (event, keyToCheck) {
|
1384 | var pressedKey = event.which || event.keyCode;
|
1385 | return pressedKey === keyToCheck;
|
1386 | };
|
1387 | Utils.setVisible = function (element, visible) {
|
1388 | this.addOrRemoveCssClass(element, 'ag-hidden', !visible);
|
1389 | };
|
1390 | Utils.setHidden = function (element, hidden) {
|
1391 | this.addOrRemoveCssClass(element, 'ag-visibility-hidden', hidden);
|
1392 | };
|
1393 | Utils.isBrowserIE = function () {
|
1394 | if (this.isIE === undefined) {
|
1395 | this.isIE = false || !!document.documentMode;
|
1396 | }
|
1397 | return this.isIE;
|
1398 | };
|
1399 | Utils.isBrowserEdge = function () {
|
1400 | if (this.isEdge === undefined) {
|
1401 | this.isEdge = !this.isBrowserIE() && !!window.StyleMedia;
|
1402 | }
|
1403 | return this.isEdge;
|
1404 | };
|
1405 | Utils.isBrowserSafari = function () {
|
1406 | if (this.isSafari === undefined) {
|
1407 | var anyWindow = window;
|
1408 |
|
1409 | this.isSafari = Object.prototype.toString.call(anyWindow.HTMLElement).indexOf('Constructor') > 0
|
1410 | || (function (p) {
|
1411 | return p.toString() === "[object SafariRemoteNotification]";
|
1412 | })(!anyWindow.safari || anyWindow.safari.pushNotification);
|
1413 | }
|
1414 | return this.isSafari;
|
1415 | };
|
1416 | Utils.isBrowserChrome = function () {
|
1417 | if (this.isChrome === undefined) {
|
1418 | var anyWindow = window;
|
1419 | this.isChrome = !!anyWindow.chrome && !!anyWindow.chrome.webstore;
|
1420 | }
|
1421 | return this.isChrome;
|
1422 | };
|
1423 | Utils.isBrowserFirefox = function () {
|
1424 | if (this.isFirefox === undefined) {
|
1425 | var anyWindow = window;
|
1426 | this.isFirefox = typeof anyWindow.InstallTrigger !== 'undefined';
|
1427 | }
|
1428 | return this.isFirefox;
|
1429 | };
|
1430 | Utils.isUserAgentIPad = function () {
|
1431 | if (this.isIPad === undefined) {
|
1432 |
|
1433 | this.isIPad = navigator.userAgent.match(/iPad|iPhone/i) != null;
|
1434 | }
|
1435 | return this.isIPad;
|
1436 | };
|
1437 |
|
1438 |
|
1439 | Utils.getTarget = function (event) {
|
1440 | var eventNoType = event;
|
1441 | return eventNoType.target || eventNoType.srcElement;
|
1442 | };
|
1443 | Utils.isElementInEventPath = function (element, event) {
|
1444 | if (!event || !element) {
|
1445 | return false;
|
1446 | }
|
1447 | var path = exports._.getEventPath(event);
|
1448 | return path.indexOf(element) >= 0;
|
1449 | };
|
1450 | Utils.createEventPath = function (event) {
|
1451 | var res = [];
|
1452 | var pointer = exports._.getTarget(event);
|
1453 | while (pointer) {
|
1454 | res.push(pointer);
|
1455 | pointer = pointer.parentElement;
|
1456 | }
|
1457 | return res;
|
1458 | };
|
1459 |
|
1460 |
|
1461 |
|
1462 |
|
1463 | Utils.addAgGridEventPath = function (event) {
|
1464 | event.__agGridEventPath = this.getEventPath(event);
|
1465 | };
|
1466 | Utils.getEventPath = function (event) {
|
1467 |
|
1468 |
|
1469 | var eventNoType = event;
|
1470 | if (event.deepPath) {
|
1471 |
|
1472 | return event.deepPath();
|
1473 | }
|
1474 | else if (eventNoType.path) {
|
1475 |
|
1476 | return eventNoType.path;
|
1477 | }
|
1478 | else if (eventNoType.composedPath) {
|
1479 |
|
1480 | return eventNoType.composedPath();
|
1481 | }
|
1482 | else if (eventNoType.__agGridEventPath) {
|
1483 |
|
1484 | return eventNoType.__agGridEventPath;
|
1485 | }
|
1486 | else {
|
1487 |
|
1488 |
|
1489 | return this.createEventPath(event);
|
1490 | }
|
1491 | };
|
1492 | Utils.forEachSnapshotFirst = function (list, callback) {
|
1493 | if (list) {
|
1494 | var arrayCopy = list.slice(0);
|
1495 | arrayCopy.forEach(callback);
|
1496 | }
|
1497 | };
|
1498 |
|
1499 | Utils.getBodyWidth = function () {
|
1500 | if (document.body) {
|
1501 | return document.body.clientWidth;
|
1502 | }
|
1503 | if (window.innerHeight) {
|
1504 | return window.innerWidth;
|
1505 | }
|
1506 | if (document.documentElement && document.documentElement.clientWidth) {
|
1507 | return document.documentElement.clientWidth;
|
1508 | }
|
1509 | return -1;
|
1510 | };
|
1511 |
|
1512 | Utils.getBodyHeight = function () {
|
1513 | if (document.body) {
|
1514 | return document.body.clientHeight;
|
1515 | }
|
1516 | if (window.innerHeight) {
|
1517 | return window.innerHeight;
|
1518 | }
|
1519 | if (document.documentElement && document.documentElement.clientHeight) {
|
1520 | return document.documentElement.clientHeight;
|
1521 | }
|
1522 | return -1;
|
1523 | };
|
1524 | Utils.setCheckboxState = function (eCheckbox, state) {
|
1525 | if (typeof state === 'boolean') {
|
1526 | eCheckbox.checked = state;
|
1527 | eCheckbox.indeterminate = false;
|
1528 | }
|
1529 | else {
|
1530 |
|
1531 |
|
1532 | eCheckbox.indeterminate = true;
|
1533 | }
|
1534 | };
|
1535 | Utils.traverseNodesWithKey = function (nodes, callback) {
|
1536 | var keyParts = [];
|
1537 | recursiveSearchNodes(nodes);
|
1538 | function recursiveSearchNodes(nodes) {
|
1539 | nodes.forEach(function (node) {
|
1540 |
|
1541 | if (node.group || node.hasChildren()) {
|
1542 | keyParts.push(node.key);
|
1543 | var key = keyParts.join('|');
|
1544 | callback(node, key);
|
1545 | recursiveSearchNodes(node.childrenAfterGroup);
|
1546 | keyParts.pop();
|
1547 | }
|
1548 | });
|
1549 | }
|
1550 | };
|
1551 |
|
1552 | Utils.camelCaseToHyphen = function (str) {
|
1553 | if (str === null || str === undefined) {
|
1554 | return null;
|
1555 | }
|
1556 | return str.replace(/([A-Z])/g, function (g) { return '-' + g[0].toLowerCase(); });
|
1557 | };
|
1558 |
|
1559 | Utils.hyphenToCamelCase = function (str) {
|
1560 | if (str === null || str === undefined) {
|
1561 | return null;
|
1562 | }
|
1563 | return str.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); });
|
1564 | };
|
1565 |
|
1566 | Utils.cssStyleObjectToMarkup = function (stylesToUse) {
|
1567 | var _this = this;
|
1568 | if (!stylesToUse) {
|
1569 | return '';
|
1570 | }
|
1571 | var resParts = [];
|
1572 | this.iterateObject(stylesToUse, function (styleKey, styleValue) {
|
1573 | var styleKeyDashed = _this.camelCaseToHyphen(styleKey);
|
1574 | resParts.push(styleKeyDashed + ": " + styleValue + ";");
|
1575 | });
|
1576 | return resParts.join(' ');
|
1577 | };
|
1578 | |
1579 |
|
1580 |
|
1581 | Utils.isNumeric = function (value) {
|
1582 | if (value === '')
|
1583 | return false;
|
1584 | return !isNaN(parseFloat(value)) && isFinite(value);
|
1585 | };
|
1586 | Utils.escape = function (toEscape) {
|
1587 | if (toEscape === null || toEscape === undefined || !toEscape.replace) {
|
1588 | return toEscape;
|
1589 | }
|
1590 | return toEscape.replace(reUnescapedHtml, function (chr) { return HTML_ESCAPES[chr]; });
|
1591 | };
|
1592 |
|
1593 | |
1594 |
|
1595 |
|
1596 |
|
1597 |
|
1598 |
|
1599 |
|
1600 |
|
1601 |
|
1602 |
|
1603 |
|
1604 |
|
1605 |
|
1606 |
|
1607 |
|
1608 |
|
1609 |
|
1610 |
|
1611 |
|
1612 |
|
1613 |
|
1614 |
|
1615 |
|
1616 |
|
1617 |
|
1618 |
|
1619 |
|
1620 |
|
1621 |
|
1622 |
|
1623 |
|
1624 |
|
1625 |
|
1626 |
|
1627 |
|
1628 |
|
1629 |
|
1630 |
|
1631 |
|
1632 |
|
1633 |
|
1634 |
|
1635 |
|
1636 |
|
1637 |
|
1638 |
|
1639 |
|
1640 |
|
1641 |
|
1642 |
|
1643 |
|
1644 |
|
1645 |
|
1646 |
|
1647 |
|
1648 |
|
1649 |
|
1650 |
|
1651 |
|
1652 |
|
1653 |
|
1654 |
|
1655 |
|
1656 |
|
1657 |
|
1658 |
|
1659 |
|
1660 |
|
1661 |
|
1662 |
|
1663 |
|
1664 |
|
1665 |
|
1666 |
|
1667 |
|
1668 |
|
1669 |
|
1670 |
|
1671 |
|
1672 |
|
1673 |
|
1674 |
|
1675 |
|
1676 |
|
1677 |
|
1678 |
|
1679 |
|
1680 |
|
1681 |
|
1682 |
|
1683 |
|
1684 |
|
1685 |
|
1686 |
|
1687 |
|
1688 |
|
1689 |
|
1690 |
|
1691 |
|
1692 |
|
1693 | Utils.normalizeWheel = function (event) {
|
1694 | var PIXEL_STEP = 10;
|
1695 | var LINE_HEIGHT = 40;
|
1696 | var PAGE_HEIGHT = 800;
|
1697 |
|
1698 | var sX = 0;
|
1699 | var sY = 0;
|
1700 |
|
1701 | var pX = 0;
|
1702 | var pY = 0;
|
1703 |
|
1704 | if ('detail' in event) {
|
1705 | sY = event.detail;
|
1706 | }
|
1707 | if ('wheelDelta' in event) {
|
1708 | sY = -event.wheelDelta / 120;
|
1709 | }
|
1710 | if ('wheelDeltaY' in event) {
|
1711 | sY = -event.wheelDeltaY / 120;
|
1712 | }
|
1713 | if ('wheelDeltaX' in event) {
|
1714 | sX = -event.wheelDeltaX / 120;
|
1715 | }
|
1716 |
|
1717 | if ('axis' in event && event.axis === event.HORIZONTAL_AXIS) {
|
1718 | sX = sY;
|
1719 | sY = 0;
|
1720 | }
|
1721 | pX = sX * PIXEL_STEP;
|
1722 | pY = sY * PIXEL_STEP;
|
1723 | if ('deltaY' in event) {
|
1724 | pY = event.deltaY;
|
1725 | }
|
1726 | if ('deltaX' in event) {
|
1727 | pX = event.deltaX;
|
1728 | }
|
1729 | if ((pX || pY) && event.deltaMode) {
|
1730 | if (event.deltaMode == 1) {
|
1731 | pX *= LINE_HEIGHT;
|
1732 | pY *= LINE_HEIGHT;
|
1733 | }
|
1734 | else {
|
1735 | pX *= PAGE_HEIGHT;
|
1736 | pY *= PAGE_HEIGHT;
|
1737 | }
|
1738 | }
|
1739 |
|
1740 | if (pX && !sX) {
|
1741 | sX = (pX < 1) ? -1 : 1;
|
1742 | }
|
1743 | if (pY && !sY) {
|
1744 | sY = (pY < 1) ? -1 : 1;
|
1745 | }
|
1746 | return {
|
1747 | spinX: sX,
|
1748 | spinY: sY,
|
1749 | pixelX: pX,
|
1750 | pixelY: pY
|
1751 | };
|
1752 | };
|
1753 | |
1754 |
|
1755 |
|
1756 | Utils.debounce = function (func, wait, immediate) {
|
1757 | if (immediate === void 0) { immediate = false; }
|
1758 |
|
1759 |
|
1760 |
|
1761 | var timeout;
|
1762 |
|
1763 | return function () {
|
1764 |
|
1765 | var context = this, args = arguments;
|
1766 |
|
1767 |
|
1768 | var callNow = immediate && !timeout;
|
1769 |
|
1770 |
|
1771 |
|
1772 |
|
1773 | clearTimeout(timeout);
|
1774 |
|
1775 | timeout = setTimeout(function () {
|
1776 |
|
1777 |
|
1778 | timeout = null;
|
1779 |
|
1780 | if (!immediate) {
|
1781 |
|
1782 |
|
1783 |
|
1784 | func.apply(context, args);
|
1785 | }
|
1786 | }, wait);
|
1787 |
|
1788 | if (callNow)
|
1789 | func.apply(context, args);
|
1790 | };
|
1791 | };
|
1792 | ;
|
1793 |
|
1794 |
|
1795 |
|
1796 |
|
1797 |
|
1798 |
|
1799 | Utils.stopPropagationForAgGrid = function (event) {
|
1800 | event[AG_GRID_STOP_PROPAGATION] = true;
|
1801 | };
|
1802 | Utils.isStopPropagationForAgGrid = function (event) {
|
1803 | return event[AG_GRID_STOP_PROPAGATION] === true;
|
1804 | };
|
1805 | Utils.executeInAWhile = function (funcs) {
|
1806 | this.executeAfter(funcs, 400);
|
1807 | };
|
1808 | Utils.executeNextVMTurn = function (funcs) {
|
1809 | this.executeAfter(funcs, 0);
|
1810 | };
|
1811 | Utils.executeAfter = function (funcs, millis) {
|
1812 | if (funcs.length > 0) {
|
1813 | setTimeout(function () {
|
1814 | funcs.forEach(function (func) { return func(); });
|
1815 | }, millis);
|
1816 | }
|
1817 | };
|
1818 | Utils.referenceCompare = function (left, right) {
|
1819 | if (left == null && right == null)
|
1820 | return true;
|
1821 | if (left == null && right)
|
1822 | return false;
|
1823 | if (left && right == null)
|
1824 | return false;
|
1825 | return left === right;
|
1826 | };
|
1827 | Utils.get = function (source, expression, defaultValue) {
|
1828 | if (source == null)
|
1829 | return defaultValue;
|
1830 | if (expression.indexOf('.') > -1) {
|
1831 | var fields = expression.split('.');
|
1832 | var thisKey = fields[0];
|
1833 | var nextValue = source[thisKey];
|
1834 | if (nextValue != null) {
|
1835 | return Utils.get(nextValue, fields.slice(1, fields.length).join('.'), defaultValue);
|
1836 | }
|
1837 | else {
|
1838 | return defaultValue;
|
1839 | }
|
1840 | }
|
1841 | else {
|
1842 | var nextValue = source[expression];
|
1843 | return nextValue != null ? nextValue : defaultValue;
|
1844 | }
|
1845 | };
|
1846 | Utils.addSafePassiveEventListener = function (eElement, event, listener) {
|
1847 | eElement.addEventListener(event, listener, (Utils.passiveEvents.indexOf(event) > -1 ? { passive: true } : undefined));
|
1848 | };
|
1849 | Utils.camelCaseToHumanText = function (camelCase) {
|
1850 | if (camelCase == null)
|
1851 | return null;
|
1852 |
|
1853 |
|
1854 | var rex = /([A-Z])([A-Z])([a-z])|([a-z])([A-Z])/g;
|
1855 | var words = camelCase.replace(rex, '$1$4 $2$3$5').replace('.', ' ').split(' ');
|
1856 | return words.map(function (word) { return word.substring(0, 1).toUpperCase() + ((word.length > 1) ? word.substring(1, word.length) : ''); }).join(' ');
|
1857 | };
|
1858 |
|
1859 |
|
1860 |
|
1861 |
|
1862 | Utils.message = function (msg) {
|
1863 | var eMessage = document.createElement('div');
|
1864 | eMessage.innerHTML = msg;
|
1865 | var eBox = document.querySelector('#__ag__message');
|
1866 | if (!eBox) {
|
1867 | var template = "<div id=\"__ag__message\" style=\"display: inline-block; position: absolute; top: 0px; left: 0px; color: white; background-color: black; z-index: 20; padding: 2px; border: 1px solid darkred; height: 200px; overflow-y: auto;\"></div>";
|
1868 | eBox = this.loadTemplate(template);
|
1869 | if (document.body) {
|
1870 | document.body.appendChild(eBox);
|
1871 | }
|
1872 | }
|
1873 | eBox.appendChild(eMessage);
|
1874 | };
|
1875 |
|
1876 |
|
1877 |
|
1878 |
|
1879 | Utils.sortRowNodesByOrder = function (rowNodes, rowNodeOrder) {
|
1880 | if (!rowNodes) {
|
1881 | return;
|
1882 | }
|
1883 | rowNodes.sort(function (nodeA, nodeB) {
|
1884 | var positionA = rowNodeOrder[nodeA.id];
|
1885 | var positionB = rowNodeOrder[nodeB.id];
|
1886 | var aHasIndex = positionA !== undefined;
|
1887 | var bHasIndex = positionB !== undefined;
|
1888 | var bothNodesAreUserNodes = aHasIndex && bHasIndex;
|
1889 | var bothNodesAreFillerNodes = !aHasIndex && !bHasIndex;
|
1890 | if (bothNodesAreUserNodes) {
|
1891 |
|
1892 |
|
1893 | return positionA - positionB;
|
1894 | }
|
1895 | else if (bothNodesAreFillerNodes) {
|
1896 |
|
1897 |
|
1898 |
|
1899 |
|
1900 |
|
1901 |
|
1902 | return nodeA.id > nodeB.id ? 1 : -1;
|
1903 | }
|
1904 | else if (aHasIndex) {
|
1905 | return 1;
|
1906 | }
|
1907 | else {
|
1908 | return -1;
|
1909 | }
|
1910 | });
|
1911 | };
|
1912 | Utils.fuzzyCheckStrings = function (inputValues, validValues, allSuggestions) {
|
1913 | var _this = this;
|
1914 | var fuzzyMatches = {};
|
1915 | var invalidInputs = inputValues.filter(function (inputValue) {
|
1916 | return !validValues.some(function (validValue) { return validValue === inputValue; });
|
1917 | });
|
1918 | if (invalidInputs.length > 0) {
|
1919 | invalidInputs.forEach(function (invalidInput) {
|
1920 | return fuzzyMatches[invalidInput] = _this.fuzzySuggestions(invalidInput, validValues, allSuggestions);
|
1921 | });
|
1922 | }
|
1923 | return fuzzyMatches;
|
1924 | };
|
1925 | Utils.fuzzySuggestions = function (inputValue, validValues, allSuggestions) {
|
1926 | var thisSuggestions = allSuggestions.slice(0);
|
1927 | thisSuggestions.sort(function (suggestedValueLeft, suggestedValueRight) {
|
1928 | var leftDifference = exports._.string_similarity(suggestedValueLeft.toLowerCase(), inputValue.toLowerCase());
|
1929 | var rightDifference = exports._.string_similarity(suggestedValueRight.toLowerCase(), inputValue.toLowerCase());
|
1930 | return leftDifference > rightDifference ? -1 :
|
1931 | leftDifference === rightDifference ? 0 :
|
1932 | 1;
|
1933 | });
|
1934 | return thisSuggestions;
|
1935 | };
|
1936 |
|
1937 |
|
1938 | Utils.get_bigrams = function (from) {
|
1939 | var i, j, ref, s, v;
|
1940 | s = from.toLowerCase();
|
1941 | v = new Array(s.length - 1);
|
1942 | for (i = j = 0, ref = v.length; j <= ref; i = j += 1) {
|
1943 | v[i] = s.slice(i, i + 2);
|
1944 | }
|
1945 | return v;
|
1946 | };
|
1947 | Utils.isNumpadDelWithNumlockOnForEdgeOrIe = function (event) {
|
1948 | if (Utils.isBrowserEdge() || Utils.isBrowserIE()) {
|
1949 | return event.key === Utils.NUMPAD_DEL_NUMLOCK_ON_KEY &&
|
1950 | event.charCode === Utils.NUMPAD_DEL_NUMLOCK_ON_CHARCODE;
|
1951 | }
|
1952 | return false;
|
1953 | };
|
1954 | Utils.PRINTABLE_CHARACTERS = 'qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890!"£$%^&*()_+-=[];\'#,./\\|<>?:@~{}';
|
1955 | Utils.NUMPAD_DEL_NUMLOCK_ON_KEY = 'Del';
|
1956 | Utils.NUMPAD_DEL_NUMLOCK_ON_CHARCODE = 46;
|
1957 | Utils.doOnceFlags = {};
|
1958 |
|
1959 |
|
1960 |
|
1961 |
|
1962 |
|
1963 |
|
1964 |
|
1965 | Utils.iconNameClassMap = {
|
1966 | 'columnMovePin': 'pin',
|
1967 | 'columnMoveAdd': 'plus',
|
1968 | 'columnMoveHide': 'eye-slash',
|
1969 | 'columnMoveMove': 'arrows',
|
1970 | 'columnMoveLeft': 'left',
|
1971 | 'columnMoveRight': 'right',
|
1972 | 'columnMoveGroup': 'group',
|
1973 | 'columnMoveValue': 'aggregation',
|
1974 | 'columnMovePivot': 'pivot',
|
1975 | 'dropNotAllowed': 'not-allowed',
|
1976 | 'groupContracted': 'expanded',
|
1977 | 'groupExpanded': 'contracted',
|
1978 | 'checkboxChecked': 'checkbox-checked',
|
1979 | 'checkboxUnchecked': 'checkbox-unchecked',
|
1980 | 'checkboxIndeterminate': 'checkbox-indeterminate',
|
1981 | 'checkboxCheckedReadOnly': 'checkbox-checked-readonly',
|
1982 | 'checkboxUncheckedReadOnly': 'checkbox-unchecked-readonly',
|
1983 | 'checkboxIndeterminateReadOnly': 'checkbox-indeterminate-readonly',
|
1984 | 'groupLoading': 'loading',
|
1985 | 'menu': 'menu',
|
1986 | 'filter': 'filter',
|
1987 | 'columns': 'columns',
|
1988 | 'menuPin': 'pin',
|
1989 | 'menuValue': 'aggregation',
|
1990 | 'menuAddRowGroup': 'group',
|
1991 | 'menuRemoveRowGroup': 'group',
|
1992 | 'clipboardCopy': 'copy',
|
1993 | 'clipboardCut': 'cut',
|
1994 | 'clipboardPaste': 'paste',
|
1995 | 'pivotPanel': 'pivot',
|
1996 | 'rowGroupPanel': 'group',
|
1997 | 'valuePanel': 'aggregation',
|
1998 | 'columnGroupOpened': 'expanded',
|
1999 | 'columnGroupClosed': 'contracted',
|
2000 | 'columnSelectClosed': 'tree-closed',
|
2001 | 'columnSelectOpen': 'tree-open',
|
2002 |
|
2003 | 'sortAscending': 'asc',
|
2004 | 'sortDescending': 'desc',
|
2005 | 'sortUnSort': 'none'
|
2006 | };
|
2007 | Utils.passiveEvents = ['touchstart', 'touchend', 'touchmove', 'touchcancel'];
|
2008 | Utils.string_similarity = function (str1, str2) {
|
2009 | var hit_count, j, k, len, len1, pairs1, pairs2, union, x, y;
|
2010 | if (str1.length > 0 && str2.length > 0) {
|
2011 | pairs1 = Utils.get_bigrams(str1);
|
2012 | pairs2 = Utils.get_bigrams(str2);
|
2013 | union = pairs1.length + pairs2.length;
|
2014 | hit_count = 0;
|
2015 | for (j = 0, len = pairs1.length; j < len; j++) {
|
2016 | x = pairs1[j];
|
2017 | for (k = 0, len1 = pairs2.length; k < len1; k++) {
|
2018 | y = pairs2[k];
|
2019 | if (x === y) {
|
2020 | hit_count++;
|
2021 | }
|
2022 | }
|
2023 | }
|
2024 | if (hit_count > 0) {
|
2025 | return (2.0 * hit_count) / union;
|
2026 | }
|
2027 | }
|
2028 | return 0.0;
|
2029 | };
|
2030 | return Utils;
|
2031 | }());
|
2032 | exports.Utils = Utils;
|
2033 | var NumberSequence = (function () {
|
2034 | function NumberSequence(initValue, step) {
|
2035 | if (initValue === void 0) { initValue = 0; }
|
2036 | if (step === void 0) { step = 1; }
|
2037 | this.nextValue = initValue;
|
2038 | this.step = step;
|
2039 | }
|
2040 | NumberSequence.prototype.next = function () {
|
2041 | var valToReturn = this.nextValue;
|
2042 | this.nextValue += this.step;
|
2043 | return valToReturn;
|
2044 | };
|
2045 | NumberSequence.prototype.peek = function () {
|
2046 | return this.nextValue;
|
2047 | };
|
2048 | NumberSequence.prototype.skip = function (count) {
|
2049 | this.nextValue += count;
|
2050 | };
|
2051 | return NumberSequence;
|
2052 | }());
|
2053 | exports.NumberSequence = NumberSequence;
|
2054 | exports._ = Utils;
|
2055 | var PromiseStatus;
|
2056 | (function (PromiseStatus) {
|
2057 | PromiseStatus[PromiseStatus["IN_PROGRESS"] = 0] = "IN_PROGRESS";
|
2058 | PromiseStatus[PromiseStatus["RESOLVED"] = 1] = "RESOLVED";
|
2059 | })(PromiseStatus = exports.PromiseStatus || (exports.PromiseStatus = {}));
|
2060 | var Promise = (function () {
|
2061 | function Promise(callback) {
|
2062 | this.status = PromiseStatus.IN_PROGRESS;
|
2063 | this.resolution = null;
|
2064 | this.listOfWaiters = [];
|
2065 | callback(this.onDone.bind(this), this.onReject.bind(this));
|
2066 | }
|
2067 | Promise.all = function (toCombine) {
|
2068 | return new Promise(function (resolve) {
|
2069 | var combinedValues = [];
|
2070 | var remainingToResolve = toCombine.length;
|
2071 | toCombine.forEach(function (source, index) {
|
2072 | source.then(function (sourceResolved) {
|
2073 | remainingToResolve--;
|
2074 | combinedValues[index] = sourceResolved;
|
2075 | if (remainingToResolve == 0) {
|
2076 | resolve(combinedValues);
|
2077 | }
|
2078 | });
|
2079 | combinedValues.push(null);
|
2080 | });
|
2081 | });
|
2082 | };
|
2083 | Promise.resolve = function (value) {
|
2084 | return new Promise(function (resolve) { return resolve(value); });
|
2085 | };
|
2086 | Promise.external = function () {
|
2087 | var capture;
|
2088 | var promise = new Promise(function (resolve) {
|
2089 | capture = resolve;
|
2090 | });
|
2091 | return {
|
2092 | promise: promise,
|
2093 | resolve: function (value) {
|
2094 | capture(value);
|
2095 | }
|
2096 | };
|
2097 | };
|
2098 | Promise.prototype.then = function (func) {
|
2099 | if (this.status === PromiseStatus.IN_PROGRESS) {
|
2100 | this.listOfWaiters.push(func);
|
2101 | }
|
2102 | else {
|
2103 | func(this.resolution);
|
2104 | }
|
2105 | };
|
2106 | Promise.prototype.firstOneOnly = function (func) {
|
2107 | if (this.status === PromiseStatus.IN_PROGRESS) {
|
2108 | if (this.listOfWaiters.length === 0) {
|
2109 | this.listOfWaiters.push(func);
|
2110 | }
|
2111 | }
|
2112 | else {
|
2113 | func(this.resolution);
|
2114 | }
|
2115 | };
|
2116 | Promise.prototype.map = function (adapter) {
|
2117 | var _this = this;
|
2118 | return new Promise(function (resolve) {
|
2119 | _this.then(function (unmapped) {
|
2120 | resolve(adapter(unmapped));
|
2121 | });
|
2122 | });
|
2123 | };
|
2124 | Promise.prototype.resolveNow = function (ifNotResolvedValue, ifResolved) {
|
2125 | if (this.status == PromiseStatus.IN_PROGRESS)
|
2126 | return ifNotResolvedValue;
|
2127 | return ifResolved(this.resolution);
|
2128 | };
|
2129 | Promise.prototype.onDone = function (value) {
|
2130 | this.status = PromiseStatus.RESOLVED;
|
2131 | this.resolution = value;
|
2132 | this.listOfWaiters.forEach(function (waiter) { return waiter(value); });
|
2133 | };
|
2134 | Promise.prototype.onReject = function (params) {
|
2135 | console.warn('TBI');
|
2136 | };
|
2137 | return Promise;
|
2138 | }());
|
2139 | exports.Promise = Promise;
|
2140 |
|
2141 |
|
2142 | }),
|
2143 |
|
2144 | (function(module, exports, __webpack_require__) {
|
2145 |
|
2146 | "use strict";
|
2147 |
|
2148 |
|
2149 |
|
2150 |
|
2151 |
|
2152 |
|
2153 |
|
2154 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
2155 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
2156 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
2157 | 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;
|
2158 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
2159 | };
|
2160 | var __metadata = (this && this.__metadata) || function (k, v) {
|
2161 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
2162 | };
|
2163 | var __param = (this && this.__param) || function (paramIndex, decorator) {
|
2164 | return function (target, key) { decorator(target, key, paramIndex); }
|
2165 | };
|
2166 | Object.defineProperty(exports, "__esModule", { value: true });
|
2167 | var eventService_1 = __webpack_require__(3);
|
2168 | var constants_1 = __webpack_require__(9);
|
2169 | var componentUtil_1 = __webpack_require__(62);
|
2170 | var gridApi_1 = __webpack_require__(6);
|
2171 | var context_1 = __webpack_require__(0);
|
2172 | var columnApi_1 = __webpack_require__(7);
|
2173 | var columnController_1 = __webpack_require__(4);
|
2174 | var utils_1 = __webpack_require__(1);
|
2175 | var environment_1 = __webpack_require__(41);
|
2176 | var propertyKeys_1 = __webpack_require__(89);
|
2177 | var colDefUtil_1 = __webpack_require__(106);
|
2178 | var eventKeys_1 = __webpack_require__(25);
|
2179 | var autoHeightCalculator_1 = __webpack_require__(79);
|
2180 | var DEFAULT_ROW_HEIGHT = 25;
|
2181 | var DEFAULT_DETAIL_ROW_HEIGHT = 300;
|
2182 | var DEFAULT_VIEWPORT_ROW_MODEL_PAGE_SIZE = 5;
|
2183 | var DEFAULT_VIEWPORT_ROW_MODEL_BUFFER_SIZE = 5;
|
2184 | var legacyThemes = [
|
2185 | 'ag-fresh',
|
2186 | 'ag-bootstrap',
|
2187 | 'ag-blue',
|
2188 | 'ag-dark',
|
2189 | 'ag-material'
|
2190 | ];
|
2191 | function isTrue(value) {
|
2192 | return value === true || value === 'true';
|
2193 | }
|
2194 | function zeroOrGreater(value, defaultValue) {
|
2195 | if (value >= 0) {
|
2196 | return value;
|
2197 | }
|
2198 | else {
|
2199 |
|
2200 | return defaultValue;
|
2201 | }
|
2202 | }
|
2203 | function oneOrGreater(value, defaultValue) {
|
2204 | if (value > 0) {
|
2205 | return value;
|
2206 | }
|
2207 | else {
|
2208 |
|
2209 | return defaultValue;
|
2210 | }
|
2211 | }
|
2212 | var GridOptionsWrapper = (function () {
|
2213 | function GridOptionsWrapper() {
|
2214 | this.propertyEventService = new eventService_1.EventService();
|
2215 | this.domDataKey = '__AG_' + Math.random().toString();
|
2216 | this.layoutElements = [];
|
2217 | }
|
2218 | GridOptionsWrapper_1 = GridOptionsWrapper;
|
2219 | GridOptionsWrapper.prototype.agWire = function (gridApi, columnApi) {
|
2220 | this.gridOptions.api = gridApi;
|
2221 | this.gridOptions.columnApi = columnApi;
|
2222 | this.checkForDeprecated();
|
2223 | };
|
2224 | GridOptionsWrapper.prototype.destroy = function () {
|
2225 |
|
2226 |
|
2227 |
|
2228 | this.gridOptions.api = null;
|
2229 | this.gridOptions.columnApi = null;
|
2230 | };
|
2231 | GridOptionsWrapper.prototype.init = function () {
|
2232 | if (!(this.gridOptions.suppressPropertyNamesCheck === true)) {
|
2233 | this.checkGridOptionsProperties();
|
2234 | this.checkColumnDefProperties();
|
2235 | }
|
2236 | var async = this.useAsyncEvents();
|
2237 | this.eventService.addGlobalListener(this.globalEventHandler.bind(this), async);
|
2238 | if (this.isGroupSelectsChildren() && this.isSuppressParentsInRowNodes()) {
|
2239 | console.warn('ag-Grid: groupSelectsChildren does not work wth suppressParentsInRowNodes, this selection method needs the part in rowNode to work');
|
2240 | }
|
2241 | if (this.isGroupSelectsChildren()) {
|
2242 | if (!this.isRowSelectionMulti()) {
|
2243 | console.warn("ag-Grid: rowSelection must be 'multiple' for groupSelectsChildren to make sense");
|
2244 | }
|
2245 | if (this.isRowModelServerSide()) {
|
2246 | console.warn('ag-Grid: group selects children is NOT support for Server Side Row Model. ' +
|
2247 | 'This is because the rows are lazy loaded, so selecting a group is not possible as' +
|
2248 | 'the grid has no way of knowing what the children are.');
|
2249 | }
|
2250 | }
|
2251 | if (this.isGroupRemoveSingleChildren() && this.isGroupHideOpenParents()) {
|
2252 | console.warn('ag-Grid: groupRemoveSingleChildren and groupHideOpenParents do not work with each other, you need to pick one. And don\'t ask us how to us these together on our support forum either you will get the same answer!');
|
2253 | }
|
2254 | this.addEventListener(GridOptionsWrapper_1.PROP_GRID_AUTO_HEIGHT, this.updateLayoutClasses.bind(this));
|
2255 | };
|
2256 | GridOptionsWrapper.prototype.checkColumnDefProperties = function () {
|
2257 | var _this = this;
|
2258 | if (this.gridOptions.columnDefs == null)
|
2259 | return;
|
2260 | this.gridOptions.columnDefs.forEach(function (colDef) {
|
2261 | var userProperties = Object.getOwnPropertyNames(colDef);
|
2262 | var validProperties = colDefUtil_1.ColDefUtil.ALL_PROPERTIES.concat(colDefUtil_1.ColDefUtil.FRAMEWORK_PROPERTIES);
|
2263 | _this.checkProperties(userProperties, validProperties, validProperties, 'colDef', 'https://www.ag-grid.com/javascript-grid-column-properties/');
|
2264 | });
|
2265 | };
|
2266 | GridOptionsWrapper.prototype.checkGridOptionsProperties = function () {
|
2267 | var userProperties = Object.getOwnPropertyNames(this.gridOptions);
|
2268 | var validProperties = propertyKeys_1.PropertyKeys.ALL_PROPERTIES.concat(propertyKeys_1.PropertyKeys.FRAMEWORK_PROPERTIES);
|
2269 | Object.keys(eventKeys_1.Events).forEach(function (it) { return validProperties.push(componentUtil_1.ComponentUtil.getCallbackForEvent(eventKeys_1.Events[it])); });
|
2270 | var validPropertiesAndExceptions = validProperties.concat('api', 'columnApi');
|
2271 | this.checkProperties(userProperties, validPropertiesAndExceptions, validProperties, 'gridOptions', 'https://www.ag-grid.com/javascript-grid-properties/');
|
2272 | };
|
2273 | GridOptionsWrapper.prototype.checkProperties = function (userProperties, validPropertiesAndExceptions, validProperties, containerName, docsUrl) {
|
2274 | var invalidProperties = utils_1.Utils.fuzzyCheckStrings(userProperties, validPropertiesAndExceptions, validProperties);
|
2275 | var invalidPropertyKeys = Object.keys(invalidProperties);
|
2276 | invalidPropertyKeys.forEach(function (invalidPropertyKey) {
|
2277 | var fuzzySuggestions = invalidProperties[invalidPropertyKey];
|
2278 | console.warn("ag-grid: invalid " + containerName + " property '" + invalidPropertyKey + "' did you mean any of these: " + fuzzySuggestions.slice(0, 8).join(","));
|
2279 | });
|
2280 | if (invalidPropertyKeys.length > 0) {
|
2281 | console.warn("ag-grid: to see all the valid " + containerName + " properties please check: " + docsUrl);
|
2282 | }
|
2283 | };
|
2284 |
|
2285 | GridOptionsWrapper.prototype.getDomData = function (element, key) {
|
2286 | var domData = element[this.domDataKey];
|
2287 | if (domData) {
|
2288 | return domData[key];
|
2289 | }
|
2290 | else {
|
2291 | return undefined;
|
2292 | }
|
2293 | };
|
2294 | GridOptionsWrapper.prototype.setDomData = function (element, key, value) {
|
2295 | var domData = element[this.domDataKey];
|
2296 | if (utils_1.Utils.missing(domData)) {
|
2297 | domData = {};
|
2298 | element[this.domDataKey] = domData;
|
2299 | }
|
2300 | domData[key] = value;
|
2301 | };
|
2302 | GridOptionsWrapper.prototype.isEnterprise = function () { return this.enterprise; };
|
2303 | GridOptionsWrapper.prototype.isRowSelection = function () { return this.gridOptions.rowSelection === "single" || this.gridOptions.rowSelection === "multiple"; };
|
2304 | GridOptionsWrapper.prototype.isRowDeselection = function () { return isTrue(this.gridOptions.rowDeselection); };
|
2305 | GridOptionsWrapper.prototype.isRowSelectionMulti = function () { return this.gridOptions.rowSelection === 'multiple'; };
|
2306 | GridOptionsWrapper.prototype.isRowMultiSelectWithClick = function () { return isTrue(this.gridOptions.rowMultiSelectWithClick); };
|
2307 | GridOptionsWrapper.prototype.getContext = function () { return this.gridOptions.context; };
|
2308 | GridOptionsWrapper.prototype.isPivotMode = function () { return isTrue(this.gridOptions.pivotMode); };
|
2309 | GridOptionsWrapper.prototype.isPivotTotals = function () { return isTrue(this.gridOptions.pivotTotals); };
|
2310 | GridOptionsWrapper.prototype.getPivotColumnGroupTotals = function () { return this.gridOptions.pivotColumnGroupTotals; };
|
2311 | GridOptionsWrapper.prototype.getPivotRowTotals = function () { return this.gridOptions.pivotRowTotals; };
|
2312 | GridOptionsWrapper.prototype.isRowModelInfinite = function () { return this.gridOptions.rowModelType === constants_1.Constants.ROW_MODEL_TYPE_INFINITE; };
|
2313 | GridOptionsWrapper.prototype.isRowModelViewport = function () { return this.gridOptions.rowModelType === constants_1.Constants.ROW_MODEL_TYPE_VIEWPORT; };
|
2314 | GridOptionsWrapper.prototype.isRowModelServerSide = function () { return this.gridOptions.rowModelType === constants_1.Constants.ROW_MODEL_TYPE_SERVER_SIDE; };
|
2315 | GridOptionsWrapper.prototype.isRowModelDefault = function () {
|
2316 | return utils_1.Utils.missing(this.gridOptions.rowModelType) ||
|
2317 | this.gridOptions.rowModelType === constants_1.Constants.ROW_MODEL_TYPE_CLIENT_SIDE ||
|
2318 | this.gridOptions.rowModelType === constants_1.Constants.DEPRECATED_ROW_MODEL_TYPE_NORMAL;
|
2319 | };
|
2320 | GridOptionsWrapper.prototype.isFullRowEdit = function () { return this.gridOptions.editType === 'fullRow'; };
|
2321 | GridOptionsWrapper.prototype.isSuppressFocusAfterRefresh = function () { return isTrue(this.gridOptions.suppressFocusAfterRefresh); };
|
2322 | GridOptionsWrapper.prototype.isShowToolPanel = function () { return isTrue(this.gridOptions.showToolPanel); };
|
2323 | GridOptionsWrapper.prototype.isToolPanelSuppressValues = function () { return isTrue(this.gridOptions.toolPanelSuppressValues); };
|
2324 | GridOptionsWrapper.prototype.isToolPanelSuppressPivots = function () {
|
2325 |
|
2326 | return isTrue(this.gridOptions.toolPanelSuppressPivots) || this.isTreeData();
|
2327 | };
|
2328 | GridOptionsWrapper.prototype.isToolPanelSuppressRowGroups = function () {
|
2329 |
|
2330 | return isTrue(this.gridOptions.toolPanelSuppressRowGroups) || this.isTreeData();
|
2331 | };
|
2332 | GridOptionsWrapper.prototype.isToolPanelSuppressSideButtons = function () { return isTrue(this.gridOptions.toolPanelSuppressSideButtons); };
|
2333 | GridOptionsWrapper.prototype.isToolPanelSuppressPivotMode = function () { return isTrue(this.gridOptions.toolPanelSuppressPivotMode) || this.isTreeData(); };
|
2334 | GridOptionsWrapper.prototype.isContractColumnSelection = function () { return isTrue(this.gridOptions.contractColumnSelection); };
|
2335 | GridOptionsWrapper.prototype.isToolPanelSuppressColumnFilter = function () { return isTrue(this.gridOptions.toolPanelSuppressColumnFilter); };
|
2336 | GridOptionsWrapper.prototype.isToolPanelSuppressColumnSelectAll = function () { return isTrue(this.gridOptions.toolPanelSuppressColumnSelectAll); };
|
2337 | GridOptionsWrapper.prototype.isToolPanelSuppressColumnExpandAll = function () { return isTrue(this.gridOptions.toolPanelSuppressColumnExpandAll); };
|
2338 | GridOptionsWrapper.prototype.isSuppressTouch = function () { return isTrue(this.gridOptions.suppressTouch); };
|
2339 | GridOptionsWrapper.prototype.isSuppressRowTransform = function () { return isTrue(this.gridOptions.suppressRowTransform); };
|
2340 | GridOptionsWrapper.prototype.useAsyncEvents = function () { return !isTrue(this.gridOptions.suppressAsyncEvents); };
|
2341 | GridOptionsWrapper.prototype.isEnableCellChangeFlash = function () { return isTrue(this.gridOptions.enableCellChangeFlash); };
|
2342 | GridOptionsWrapper.prototype.isGroupSelectsChildren = function () {
|
2343 | var result = isTrue(this.gridOptions.groupSelectsChildren);
|
2344 | if (result && this.isTreeData()) {
|
2345 | console.warn('ag-Grid: groupSelectsChildren does not work with tree data');
|
2346 | return false;
|
2347 | }
|
2348 | else {
|
2349 | return result;
|
2350 | }
|
2351 | };
|
2352 | GridOptionsWrapper.prototype.isSuppressRowHoverHighlight = function () { return isTrue(this.gridOptions.suppressRowHoverHighlight); };
|
2353 | GridOptionsWrapper.prototype.isGroupSelectsFiltered = function () { return isTrue(this.gridOptions.groupSelectsFiltered); };
|
2354 | GridOptionsWrapper.prototype.isGroupHideOpenParents = function () { return isTrue(this.gridOptions.groupHideOpenParents); };
|
2355 |
|
2356 | GridOptionsWrapper.prototype.isGroupMultiAutoColumn = function () { return isTrue(this.gridOptions.groupMultiAutoColumn) || isTrue(this.gridOptions.groupHideOpenParents); };
|
2357 | GridOptionsWrapper.prototype.isGroupRemoveSingleChildren = function () { return isTrue(this.gridOptions.groupRemoveSingleChildren); };
|
2358 | GridOptionsWrapper.prototype.isGroupRemoveLowestSingleChildren = function () { return isTrue(this.gridOptions.groupRemoveLowestSingleChildren); };
|
2359 | GridOptionsWrapper.prototype.isGroupIncludeFooter = function () { return isTrue(this.gridOptions.groupIncludeFooter); };
|
2360 | GridOptionsWrapper.prototype.isGroupIncludeTotalFooter = function () { return isTrue(this.gridOptions.groupIncludeTotalFooter); };
|
2361 | GridOptionsWrapper.prototype.isGroupSuppressBlankHeader = function () { return isTrue(this.gridOptions.groupSuppressBlankHeader); };
|
2362 | GridOptionsWrapper.prototype.isSuppressRowClickSelection = function () { return isTrue(this.gridOptions.suppressRowClickSelection); };
|
2363 | GridOptionsWrapper.prototype.isSuppressCellSelection = function () { return isTrue(this.gridOptions.suppressCellSelection); };
|
2364 | GridOptionsWrapper.prototype.isSuppressMultiSort = function () { return isTrue(this.gridOptions.suppressMultiSort); };
|
2365 | GridOptionsWrapper.prototype.isMultiSortKeyCtrl = function () { return this.gridOptions.multiSortKey === 'ctrl'; };
|
2366 | GridOptionsWrapper.prototype.isGroupSuppressAutoColumn = function () { return isTrue(this.gridOptions.groupSuppressAutoColumn); };
|
2367 | GridOptionsWrapper.prototype.isSuppressDragLeaveHidesColumns = function () { return isTrue(this.gridOptions.suppressDragLeaveHidesColumns); };
|
2368 | GridOptionsWrapper.prototype.isSuppressScrollOnNewData = function () { return isTrue(this.gridOptions.suppressScrollOnNewData); };
|
2369 | GridOptionsWrapper.prototype.isRowDragManaged = function () { return isTrue(this.gridOptions.rowDragManaged); };
|
2370 | GridOptionsWrapper.prototype.isSuppressRowDrag = function () { return isTrue(this.gridOptions.suppressRowDrag); };
|
2371 | GridOptionsWrapper.prototype.isGridAutoHeight = function () { return isTrue(this.gridOptions.gridAutoHeight); };
|
2372 | GridOptionsWrapper.prototype.isSuppressHorizontalScroll = function () { return isTrue(this.gridOptions.suppressHorizontalScroll); };
|
2373 | GridOptionsWrapper.prototype.isSuppressLoadingOverlay = function () { return isTrue(this.gridOptions.suppressLoadingOverlay); };
|
2374 | GridOptionsWrapper.prototype.isSuppressNoRowsOverlay = function () { return isTrue(this.gridOptions.suppressNoRowsOverlay); };
|
2375 | GridOptionsWrapper.prototype.isSuppressFieldDotNotation = function () { return isTrue(this.gridOptions.suppressFieldDotNotation); };
|
2376 | GridOptionsWrapper.prototype.getPinnedTopRowData = function () { return this.gridOptions.pinnedTopRowData; };
|
2377 | GridOptionsWrapper.prototype.getPinnedBottomRowData = function () { return this.gridOptions.pinnedBottomRowData; };
|
2378 | GridOptionsWrapper.prototype.isFunctionsPassive = function () { return isTrue(this.gridOptions.functionsPassive); };
|
2379 | GridOptionsWrapper.prototype.isSuppressTabbing = function () { return isTrue(this.gridOptions.suppressTabbing); };
|
2380 | GridOptionsWrapper.prototype.isSuppressChangeDetection = function () { return isTrue(this.gridOptions.suppressChangeDetection); };
|
2381 | GridOptionsWrapper.prototype.isSuppressAnimationFrame = function () { return isTrue(this.gridOptions.suppressAnimationFrame); };
|
2382 | GridOptionsWrapper.prototype.getQuickFilterText = function () { return this.gridOptions.quickFilterText; };
|
2383 | GridOptionsWrapper.prototype.isCacheQuickFilter = function () { return isTrue(this.gridOptions.cacheQuickFilter); };
|
2384 | GridOptionsWrapper.prototype.isUnSortIcon = function () { return isTrue(this.gridOptions.unSortIcon); };
|
2385 | GridOptionsWrapper.prototype.isSuppressMenuHide = function () { return isTrue(this.gridOptions.suppressMenuHide); };
|
2386 | GridOptionsWrapper.prototype.isEnterMovesDownAfterEdit = function () { return isTrue(this.gridOptions.enterMovesDownAfterEdit); };
|
2387 | GridOptionsWrapper.prototype.isEnterMovesDown = function () { return isTrue(this.gridOptions.enterMovesDown); };
|
2388 | GridOptionsWrapper.prototype.getRowStyle = function () { return this.gridOptions.rowStyle; };
|
2389 | GridOptionsWrapper.prototype.getRowClass = function () { return this.gridOptions.rowClass; };
|
2390 | GridOptionsWrapper.prototype.getRowStyleFunc = function () { return this.gridOptions.getRowStyle; };
|
2391 | GridOptionsWrapper.prototype.getRowClassFunc = function () { return this.gridOptions.getRowClass; };
|
2392 | GridOptionsWrapper.prototype.rowClassRules = function () { return this.gridOptions.rowClassRules; };
|
2393 | GridOptionsWrapper.prototype.getPopupParent = function () { return this.gridOptions.popupParent; };
|
2394 | GridOptionsWrapper.prototype.getPostProcessPopupFunc = function () { return this.gridOptions.postProcessPopup; };
|
2395 | GridOptionsWrapper.prototype.getDoesDataFlowerFunc = function () { return this.gridOptions.doesDataFlower; };
|
2396 | GridOptionsWrapper.prototype.getPaginationNumberFormatterFunc = function () { return this.gridOptions.paginationNumberFormatter; };
|
2397 | GridOptionsWrapper.prototype.getChildCountFunc = function () { return this.gridOptions.getChildCount; };
|
2398 | GridOptionsWrapper.prototype.getDefaultGroupSortComparator = function () { return this.gridOptions.defaultGroupSortComparator; };
|
2399 | GridOptionsWrapper.prototype.getIsFullWidthCellFunc = function () { return this.gridOptions.isFullWidthCell; };
|
2400 | GridOptionsWrapper.prototype.getFullWidthCellRendererParams = function () { return this.gridOptions.fullWidthCellRendererParams; };
|
2401 | GridOptionsWrapper.prototype.isEmbedFullWidthRows = function () { return isTrue(this.gridOptions.embedFullWidthRows); };
|
2402 | GridOptionsWrapper.prototype.getBusinessKeyForNodeFunc = function () { return this.gridOptions.getBusinessKeyForNode; };
|
2403 | GridOptionsWrapper.prototype.getApi = function () { return this.gridOptions.api; };
|
2404 | GridOptionsWrapper.prototype.getColumnApi = function () { return this.gridOptions.columnApi; };
|
2405 | GridOptionsWrapper.prototype.isDeltaRowDataMode = function () { return isTrue(this.gridOptions.deltaRowDataMode); };
|
2406 | GridOptionsWrapper.prototype.isEnsureDomOrder = function () { return isTrue(this.gridOptions.ensureDomOrder); };
|
2407 | GridOptionsWrapper.prototype.isEnableColResize = function () { return isTrue(this.gridOptions.enableColResize); };
|
2408 | GridOptionsWrapper.prototype.getColResizeDefault = function () { return this.gridOptions.colResizeDefault; };
|
2409 | GridOptionsWrapper.prototype.isSingleClickEdit = function () { return isTrue(this.gridOptions.singleClickEdit); };
|
2410 | GridOptionsWrapper.prototype.isSuppressClickEdit = function () { return isTrue(this.gridOptions.suppressClickEdit); };
|
2411 | GridOptionsWrapper.prototype.isStopEditingWhenGridLosesFocus = function () { return isTrue(this.gridOptions.stopEditingWhenGridLosesFocus); };
|
2412 | GridOptionsWrapper.prototype.getGroupDefaultExpanded = function () { return this.gridOptions.groupDefaultExpanded; };
|
2413 | GridOptionsWrapper.prototype.getMaxConcurrentDatasourceRequests = function () { return this.gridOptions.maxConcurrentDatasourceRequests; };
|
2414 | GridOptionsWrapper.prototype.getMaxBlocksInCache = function () { return this.gridOptions.maxBlocksInCache; };
|
2415 | GridOptionsWrapper.prototype.getCacheOverflowSize = function () { return this.gridOptions.cacheOverflowSize; };
|
2416 | GridOptionsWrapper.prototype.getPaginationPageSize = function () { return this.gridOptions.paginationPageSize; };
|
2417 | GridOptionsWrapper.prototype.getCacheBlockSize = function () { return this.gridOptions.cacheBlockSize; };
|
2418 | GridOptionsWrapper.prototype.getInfiniteInitialRowCount = function () { return this.gridOptions.infiniteInitialRowCount; };
|
2419 | GridOptionsWrapper.prototype.isPurgeClosedRowNodes = function () { return isTrue(this.gridOptions.purgeClosedRowNodes); };
|
2420 | GridOptionsWrapper.prototype.isSuppressPaginationPanel = function () { return isTrue(this.gridOptions.suppressPaginationPanel); };
|
2421 | GridOptionsWrapper.prototype.getRowData = function () { return this.gridOptions.rowData; };
|
2422 | GridOptionsWrapper.prototype.isGroupUseEntireRow = function () { return isTrue(this.gridOptions.groupUseEntireRow); };
|
2423 | GridOptionsWrapper.prototype.isEnableRtl = function () { return isTrue(this.gridOptions.enableRtl); };
|
2424 | GridOptionsWrapper.prototype.getAutoGroupColumnDef = function () { return this.gridOptions.autoGroupColumnDef; };
|
2425 | GridOptionsWrapper.prototype.isGroupSuppressRow = function () { return isTrue(this.gridOptions.groupSuppressRow); };
|
2426 | GridOptionsWrapper.prototype.getRowGroupPanelShow = function () { return this.gridOptions.rowGroupPanelShow; };
|
2427 | GridOptionsWrapper.prototype.getPivotPanelShow = function () { return this.gridOptions.pivotPanelShow; };
|
2428 | GridOptionsWrapper.prototype.isAngularCompileRows = function () { return isTrue(this.gridOptions.angularCompileRows); };
|
2429 | GridOptionsWrapper.prototype.isAngularCompileFilters = function () { return isTrue(this.gridOptions.angularCompileFilters); };
|
2430 | GridOptionsWrapper.prototype.isAngularCompileHeaders = function () { return isTrue(this.gridOptions.angularCompileHeaders); };
|
2431 | GridOptionsWrapper.prototype.isDebug = function () { return isTrue(this.gridOptions.debug); };
|
2432 | GridOptionsWrapper.prototype.getColumnDefs = function () { return this.gridOptions.columnDefs; };
|
2433 | GridOptionsWrapper.prototype.getColumnTypes = function () { return this.gridOptions.columnTypes; };
|
2434 | GridOptionsWrapper.prototype.getDatasource = function () { return this.gridOptions.datasource; };
|
2435 | GridOptionsWrapper.prototype.getViewportDatasource = function () { return this.gridOptions.viewportDatasource; };
|
2436 | GridOptionsWrapper.prototype.getServerSideDatasource = function () { return this.gridOptions.serverSideDatasource; };
|
2437 | GridOptionsWrapper.prototype.isEnableSorting = function () { return isTrue(this.gridOptions.enableSorting) || isTrue(this.gridOptions.enableServerSideSorting); };
|
2438 | GridOptionsWrapper.prototype.isAccentedSort = function () { return isTrue(this.gridOptions.accentedSort); };
|
2439 | GridOptionsWrapper.prototype.isEnableCellExpressions = function () { return isTrue(this.gridOptions.enableCellExpressions); };
|
2440 | GridOptionsWrapper.prototype.isEnableGroupEdit = function () { return isTrue(this.gridOptions.enableGroupEdit); };
|
2441 | GridOptionsWrapper.prototype.isSuppressMiddleClickScrolls = function () { return isTrue(this.gridOptions.suppressMiddleClickScrolls); };
|
2442 | GridOptionsWrapper.prototype.isSuppressPreventDefaultOnMouseWheel = function () { return isTrue(this.gridOptions.suppressPreventDefaultOnMouseWheel); };
|
2443 | GridOptionsWrapper.prototype.isSuppressColumnVirtualisation = function () { return isTrue(this.gridOptions.suppressColumnVirtualisation); };
|
2444 | GridOptionsWrapper.prototype.isSuppressContextMenu = function () { return isTrue(this.gridOptions.suppressContextMenu); };
|
2445 | GridOptionsWrapper.prototype.isAllowContextMenuWithControlKey = function () { return isTrue(this.gridOptions.allowContextMenuWithControlKey); };
|
2446 | GridOptionsWrapper.prototype.isSuppressCopyRowsToClipboard = function () { return isTrue(this.gridOptions.suppressCopyRowsToClipboard); };
|
2447 | GridOptionsWrapper.prototype.isSuppressClipboardPaste = function () { return isTrue(this.gridOptions.suppressClipboardPaste); };
|
2448 | GridOptionsWrapper.prototype.isEnableFilter = function () { return isTrue(this.gridOptions.enableFilter) || isTrue(this.gridOptions.enableServerSideFilter); };
|
2449 | GridOptionsWrapper.prototype.isPagination = function () { return isTrue(this.gridOptions.pagination); };
|
2450 | GridOptionsWrapper.prototype.isSuppressEnterpriseResetOnNewColumns = function () { return isTrue(this.gridOptions.suppressEnterpriseResetOnNewColumns); };
|
2451 | GridOptionsWrapper.prototype.getProcessDataFromClipboardFunc = function () { return this.gridOptions.processDataFromClipboard; };
|
2452 | GridOptionsWrapper.prototype.getBatchUpdateWaitMillis = function () {
|
2453 | return utils_1.Utils.exists(this.gridOptions.batchUpdateWaitMillis) ? this.gridOptions.batchUpdateWaitMillis : constants_1.Constants.BATCH_WAIT_MILLIS;
|
2454 | };
|
2455 |
|
2456 | GridOptionsWrapper.prototype.isEnableServerSideFilter = function () { return this.gridOptions.enableServerSideFilter; };
|
2457 | GridOptionsWrapper.prototype.isEnableServerSideSorting = function () { return isTrue(this.gridOptions.enableServerSideSorting); };
|
2458 | GridOptionsWrapper.prototype.isSuppressMovableColumns = function () { return isTrue(this.gridOptions.suppressMovableColumns); };
|
2459 | GridOptionsWrapper.prototype.isAnimateRows = function () {
|
2460 |
|
2461 | if (this.isEnsureDomOrder()) {
|
2462 | return false;
|
2463 | }
|
2464 | return isTrue(this.gridOptions.animateRows);
|
2465 | };
|
2466 | GridOptionsWrapper.prototype.isSuppressColumnMoveAnimation = function () { return isTrue(this.gridOptions.suppressColumnMoveAnimation); };
|
2467 | GridOptionsWrapper.prototype.isSuppressAggFuncInHeader = function () { return isTrue(this.gridOptions.suppressAggFuncInHeader); };
|
2468 | GridOptionsWrapper.prototype.isSuppressAggAtRootLevel = function () { return isTrue(this.gridOptions.suppressAggAtRootLevel); };
|
2469 | GridOptionsWrapper.prototype.isEnableRangeSelection = function () { return isTrue(this.gridOptions.enableRangeSelection); };
|
2470 | GridOptionsWrapper.prototype.isSuppressMultiRangeSelection = function () { return isTrue(this.gridOptions.suppressMultiRangeSelection); };
|
2471 | GridOptionsWrapper.prototype.isPaginationAutoPageSize = function () { return isTrue(this.gridOptions.paginationAutoPageSize); };
|
2472 | GridOptionsWrapper.prototype.isRememberGroupStateWhenNewData = function () { return isTrue(this.gridOptions.rememberGroupStateWhenNewData); };
|
2473 | GridOptionsWrapper.prototype.getIcons = function () { return this.gridOptions.icons; };
|
2474 | GridOptionsWrapper.prototype.getAggFuncs = function () { return this.gridOptions.aggFuncs; };
|
2475 | GridOptionsWrapper.prototype.getSortingOrder = function () { return this.gridOptions.sortingOrder; };
|
2476 | GridOptionsWrapper.prototype.getAlignedGrids = function () { return this.gridOptions.alignedGrids; };
|
2477 | GridOptionsWrapper.prototype.isMasterDetail = function () {
|
2478 | var _this = this;
|
2479 | var usingMasterDetail = isTrue(this.gridOptions.masterDetail);
|
2480 | utils_1.Utils.doOnce(function () {
|
2481 | if (usingMasterDetail && !_this.enterprise) {
|
2482 | console.warn('ag-grid: Master Detail is an Enterprise feature of ag-Grid.');
|
2483 | }
|
2484 | }, 'MasterDetailEnterpriseCheck');
|
2485 | return usingMasterDetail && this.enterprise;
|
2486 | };
|
2487 | GridOptionsWrapper.prototype.getIsRowMasterFunc = function () { return this.gridOptions.isRowMaster; };
|
2488 | GridOptionsWrapper.prototype.getIsRowSelectableFunc = function () { return this.gridOptions.isRowSelectable; };
|
2489 | GridOptionsWrapper.prototype.getGroupRowRendererParams = function () { return this.gridOptions.groupRowRendererParams; };
|
2490 | GridOptionsWrapper.prototype.getOverlayLoadingTemplate = function () { return this.gridOptions.overlayLoadingTemplate; };
|
2491 | GridOptionsWrapper.prototype.getOverlayNoRowsTemplate = function () { return this.gridOptions.overlayNoRowsTemplate; };
|
2492 | GridOptionsWrapper.prototype.isSuppressAutoSize = function () { return isTrue(this.gridOptions.suppressAutoSize); };
|
2493 | GridOptionsWrapper.prototype.isSuppressParentsInRowNodes = function () { return isTrue(this.gridOptions.suppressParentsInRowNodes); };
|
2494 | GridOptionsWrapper.prototype.isEnableStatusBar = function () { return isTrue(this.gridOptions.enableStatusBar); };
|
2495 | GridOptionsWrapper.prototype.isAlwaysShowStatusBar = function () { return isTrue(this.gridOptions.alwaysShowStatusBar); };
|
2496 | GridOptionsWrapper.prototype.isFunctionsReadOnly = function () { return isTrue(this.gridOptions.functionsReadOnly); };
|
2497 | GridOptionsWrapper.prototype.isFloatingFilter = function () { return this.gridOptions.floatingFilter; };
|
2498 | GridOptionsWrapper.prototype.isEnableOldSetFilterModel = function () { return isTrue(this.gridOptions.enableOldSetFilterModel); };
|
2499 |
|
2500 | GridOptionsWrapper.prototype.getDefaultColDef = function () { return this.gridOptions.defaultColDef; };
|
2501 | GridOptionsWrapper.prototype.getDefaultColGroupDef = function () { return this.gridOptions.defaultColGroupDef; };
|
2502 | GridOptionsWrapper.prototype.getDefaultExportParams = function () { return this.gridOptions.defaultExportParams; };
|
2503 | GridOptionsWrapper.prototype.isSuppressCsvExport = function () { return isTrue(this.gridOptions.suppressCsvExport); };
|
2504 | GridOptionsWrapper.prototype.isSuppressExcelExport = function () { return isTrue(this.gridOptions.suppressExcelExport); };
|
2505 | GridOptionsWrapper.prototype.isSuppressMakeColumnVisibleAfterUnGroup = function () { return isTrue(this.gridOptions.suppressMakeColumnVisibleAfterUnGroup); };
|
2506 | GridOptionsWrapper.prototype.getNodeChildDetailsFunc = function () { return this.gridOptions.getNodeChildDetails; };
|
2507 | GridOptionsWrapper.prototype.getDataPathFunc = function () { return this.gridOptions.getDataPath; };
|
2508 |
|
2509 | GridOptionsWrapper.prototype.getGroupRowAggNodesFunc = function () { return this.gridOptions.groupRowAggNodes; };
|
2510 | GridOptionsWrapper.prototype.getContextMenuItemsFunc = function () { return this.gridOptions.getContextMenuItems; };
|
2511 | GridOptionsWrapper.prototype.getMainMenuItemsFunc = function () { return this.gridOptions.getMainMenuItems; };
|
2512 | GridOptionsWrapper.prototype.getRowNodeIdFunc = function () { return this.gridOptions.getRowNodeId; };
|
2513 | GridOptionsWrapper.prototype.getNavigateToNextCellFunc = function () { return this.gridOptions.navigateToNextCell; };
|
2514 | GridOptionsWrapper.prototype.getTabToNextCellFunc = function () { return this.gridOptions.tabToNextCell; };
|
2515 | GridOptionsWrapper.prototype.isTreeData = function () { return isTrue(this.gridOptions.treeData); };
|
2516 | GridOptionsWrapper.prototype.isValueCache = function () { return isTrue(this.gridOptions.valueCache); };
|
2517 | GridOptionsWrapper.prototype.isValueCacheNeverExpires = function () { return isTrue(this.gridOptions.valueCacheNeverExpires); };
|
2518 | GridOptionsWrapper.prototype.isAggregateOnlyChangedColumns = function () { return isTrue(this.gridOptions.aggregateOnlyChangedColumns); };
|
2519 | GridOptionsWrapper.prototype.getProcessSecondaryColDefFunc = function () { return this.gridOptions.processSecondaryColDef; };
|
2520 | GridOptionsWrapper.prototype.getProcessSecondaryColGroupDefFunc = function () { return this.gridOptions.processSecondaryColGroupDef; };
|
2521 | GridOptionsWrapper.prototype.getSendToClipboardFunc = function () { return this.gridOptions.sendToClipboard; };
|
2522 | GridOptionsWrapper.prototype.getProcessRowPostCreateFunc = function () { return this.gridOptions.processRowPostCreate; };
|
2523 | GridOptionsWrapper.prototype.getProcessCellForClipboardFunc = function () { return this.gridOptions.processCellForClipboard; };
|
2524 | GridOptionsWrapper.prototype.getProcessHeaderForClipboardFunc = function () { return this.gridOptions.processHeaderForClipboard; };
|
2525 | GridOptionsWrapper.prototype.getProcessCellFromClipboardFunc = function () { return this.gridOptions.processCellFromClipboard; };
|
2526 | GridOptionsWrapper.prototype.getViewportRowModelPageSize = function () { return oneOrGreater(this.gridOptions.viewportRowModelPageSize, DEFAULT_VIEWPORT_ROW_MODEL_PAGE_SIZE); };
|
2527 | GridOptionsWrapper.prototype.getViewportRowModelBufferSize = function () { return zeroOrGreater(this.gridOptions.viewportRowModelBufferSize, DEFAULT_VIEWPORT_ROW_MODEL_BUFFER_SIZE); };
|
2528 |
|
2529 |
|
2530 | GridOptionsWrapper.prototype.isServerSideSortingAlwaysResets = function () { return isTrue(this.gridOptions.serverSideSortingAlwaysResets); };
|
2531 | GridOptionsWrapper.prototype.getPostSortFunc = function () { return this.gridOptions.postSort; };
|
2532 | GridOptionsWrapper.prototype.getClipboardDeliminator = function () {
|
2533 | return utils_1.Utils.exists(this.gridOptions.clipboardDeliminator) ? this.gridOptions.clipboardDeliminator : '\t';
|
2534 | };
|
2535 | GridOptionsWrapper.prototype.setProperty = function (key, value) {
|
2536 | var gridOptionsNoType = this.gridOptions;
|
2537 | var previousValue = gridOptionsNoType[key];
|
2538 | if (previousValue !== value) {
|
2539 | gridOptionsNoType[key] = value;
|
2540 | var event_1 = {
|
2541 | type: key,
|
2542 | currentValue: value,
|
2543 | previousValue: previousValue
|
2544 | };
|
2545 | this.propertyEventService.dispatchEvent(event_1);
|
2546 | }
|
2547 | };
|
2548 |
|
2549 |
|
2550 | GridOptionsWrapper.prototype.addLayoutElement = function (element) {
|
2551 | this.layoutElements.push(element);
|
2552 | this.updateLayoutClasses();
|
2553 | };
|
2554 | GridOptionsWrapper.prototype.updateLayoutClasses = function () {
|
2555 | var autoHeight = this.isGridAutoHeight();
|
2556 | this.layoutElements.forEach(function (e) {
|
2557 | utils_1.Utils.addOrRemoveCssClass(e, 'ag-layout-auto-height', autoHeight);
|
2558 | utils_1.Utils.addOrRemoveCssClass(e, 'ag-layout-normal', !autoHeight);
|
2559 | });
|
2560 | };
|
2561 | GridOptionsWrapper.prototype.addEventListener = function (key, listener) {
|
2562 | GridOptionsWrapper_1.checkEventDeprecation(key);
|
2563 | this.propertyEventService.addEventListener(key, listener);
|
2564 | };
|
2565 | GridOptionsWrapper.checkEventDeprecation = function (eventName) {
|
2566 | if (eventName === 'floatingRowDataChanged') {
|
2567 | console.warn('ag-Grid: floatingRowDataChanged is now called pinnedRowDataChanged');
|
2568 | }
|
2569 | };
|
2570 | GridOptionsWrapper.prototype.removeEventListener = function (key, listener) {
|
2571 | this.propertyEventService.removeEventListener(key, listener);
|
2572 | };
|
2573 | GridOptionsWrapper.prototype.getAutoSizePadding = function () {
|
2574 | return this.gridOptions.autoSizePadding > 0 ? this.gridOptions.autoSizePadding : 20;
|
2575 | };
|
2576 |
|
2577 | GridOptionsWrapper.prototype.getHeaderHeight = function () {
|
2578 | if (typeof this.gridOptions.headerHeight === 'number') {
|
2579 | return this.gridOptions.headerHeight;
|
2580 | }
|
2581 | else {
|
2582 | return this.specialForNewMaterial(25, 'headerHeight');
|
2583 | }
|
2584 | };
|
2585 | GridOptionsWrapper.prototype.getFloatingFiltersHeight = function () {
|
2586 | if (typeof this.gridOptions.floatingFiltersHeight === 'number') {
|
2587 | return this.gridOptions.floatingFiltersHeight;
|
2588 | }
|
2589 | else {
|
2590 | return this.specialForNewMaterial(25, 'headerHeight');
|
2591 | }
|
2592 | };
|
2593 | GridOptionsWrapper.prototype.getGroupHeaderHeight = function () {
|
2594 | if (typeof this.gridOptions.groupHeaderHeight === 'number') {
|
2595 | return this.gridOptions.groupHeaderHeight;
|
2596 | }
|
2597 | else {
|
2598 | return this.getHeaderHeight();
|
2599 | }
|
2600 | };
|
2601 | GridOptionsWrapper.prototype.getPivotHeaderHeight = function () {
|
2602 | if (typeof this.gridOptions.pivotHeaderHeight === 'number') {
|
2603 | return this.gridOptions.pivotHeaderHeight;
|
2604 | }
|
2605 | else {
|
2606 | return this.getHeaderHeight();
|
2607 | }
|
2608 | };
|
2609 | GridOptionsWrapper.prototype.getPivotGroupHeaderHeight = function () {
|
2610 | if (typeof this.gridOptions.pivotGroupHeaderHeight === 'number') {
|
2611 | return this.gridOptions.pivotGroupHeaderHeight;
|
2612 | }
|
2613 | else {
|
2614 | return this.getGroupHeaderHeight();
|
2615 | }
|
2616 | };
|
2617 | GridOptionsWrapper.prototype.isExternalFilterPresent = function () {
|
2618 | if (typeof this.gridOptions.isExternalFilterPresent === 'function') {
|
2619 | return this.gridOptions.isExternalFilterPresent();
|
2620 | }
|
2621 | else {
|
2622 | return false;
|
2623 | }
|
2624 | };
|
2625 | GridOptionsWrapper.prototype.doesExternalFilterPass = function (node) {
|
2626 | if (typeof this.gridOptions.doesExternalFilterPass === 'function') {
|
2627 | return this.gridOptions.doesExternalFilterPass(node);
|
2628 | }
|
2629 | else {
|
2630 | return false;
|
2631 | }
|
2632 | };
|
2633 | GridOptionsWrapper.prototype.getDocument = function () {
|
2634 |
|
2635 |
|
2636 | var result;
|
2637 | if (utils_1.Utils.exists(this.gridOptions.getDocument)) {
|
2638 | result = this.gridOptions.getDocument();
|
2639 | }
|
2640 | if (utils_1.Utils.exists(result)) {
|
2641 | return result;
|
2642 | }
|
2643 | else {
|
2644 | return document;
|
2645 | }
|
2646 | };
|
2647 | GridOptionsWrapper.prototype.getMinColWidth = function () {
|
2648 | if (this.gridOptions.minColWidth > GridOptionsWrapper_1.MIN_COL_WIDTH) {
|
2649 | return this.gridOptions.minColWidth;
|
2650 | }
|
2651 | else {
|
2652 | return GridOptionsWrapper_1.MIN_COL_WIDTH;
|
2653 | }
|
2654 | };
|
2655 | GridOptionsWrapper.prototype.getMaxColWidth = function () {
|
2656 | if (this.gridOptions.maxColWidth > GridOptionsWrapper_1.MIN_COL_WIDTH) {
|
2657 | return this.gridOptions.maxColWidth;
|
2658 | }
|
2659 | else {
|
2660 | return null;
|
2661 | }
|
2662 | };
|
2663 | GridOptionsWrapper.prototype.getColWidth = function () {
|
2664 | if (typeof this.gridOptions.colWidth !== 'number' || this.gridOptions.colWidth < GridOptionsWrapper_1.MIN_COL_WIDTH) {
|
2665 | return 200;
|
2666 | }
|
2667 | else {
|
2668 | return this.gridOptions.colWidth;
|
2669 | }
|
2670 | };
|
2671 | GridOptionsWrapper.prototype.getRowBuffer = function () {
|
2672 | if (typeof this.gridOptions.rowBuffer === 'number') {
|
2673 | if (this.gridOptions.rowBuffer < 0) {
|
2674 | console.warn('ag-Grid: rowBuffer should not be negative');
|
2675 | }
|
2676 | return this.gridOptions.rowBuffer;
|
2677 | }
|
2678 | else {
|
2679 | return constants_1.Constants.ROW_BUFFER_SIZE;
|
2680 | }
|
2681 | };
|
2682 |
|
2683 |
|
2684 |
|
2685 | GridOptionsWrapper.prototype.getScrollbarWidth = function () {
|
2686 | var scrollbarWidth = this.gridOptions.scrollbarWidth;
|
2687 | if (typeof scrollbarWidth !== 'number' || scrollbarWidth < 0) {
|
2688 | scrollbarWidth = utils_1.Utils.getScrollbarWidth();
|
2689 | }
|
2690 | return scrollbarWidth;
|
2691 | };
|
2692 | GridOptionsWrapper.prototype.checkForDeprecated = function () {
|
2693 |
|
2694 |
|
2695 | var options = this.gridOptions;
|
2696 | if (options.suppressUnSort) {
|
2697 | console.warn('ag-grid: as of v1.12.4 suppressUnSort is not used. Please use sortingOrder instead.');
|
2698 | }
|
2699 | if (options.suppressDescSort) {
|
2700 | console.warn('ag-grid: as of v1.12.4 suppressDescSort is not used. Please use sortingOrder instead.');
|
2701 | }
|
2702 | if (options.groupAggFields) {
|
2703 | console.warn('ag-grid: as of v3 groupAggFields is not used. Please add appropriate agg fields to your columns.');
|
2704 | }
|
2705 | if (options.groupHidePivotColumns) {
|
2706 | console.warn('ag-grid: as of v3 groupHidePivotColumns is not used as pivot columns are now called rowGroup columns. Please refer to the documentation');
|
2707 | }
|
2708 | if (options.groupKeys) {
|
2709 | console.warn('ag-grid: as of v3 groupKeys is not used. You need to set rowGroupIndex on the columns to group. Please refer to the documentation');
|
2710 | }
|
2711 | if (typeof options.groupDefaultExpanded === 'boolean') {
|
2712 | console.warn('ag-grid: groupDefaultExpanded can no longer be boolean. for groupDefaultExpanded=true, use groupDefaultExpanded=9999 instead, to expand all the groups');
|
2713 | }
|
2714 | if (options.onRowDeselected || options.rowDeselected) {
|
2715 | console.warn('ag-grid: since version 3.4 event rowDeselected no longer exists, please check the docs');
|
2716 | }
|
2717 | if (options.rowsAlreadyGrouped) {
|
2718 | console.warn('ag-grid: since version 3.4 rowsAlreadyGrouped no longer exists, please use getNodeChildDetails() instead');
|
2719 | }
|
2720 | if (options.groupAggFunction) {
|
2721 | console.warn('ag-grid: since version 4.3.x groupAggFunction is now called groupRowAggNodes');
|
2722 | }
|
2723 | if (options.checkboxSelection) {
|
2724 | console.warn('ag-grid: since version 8.0.x checkboxSelection is not supported as a grid option. ' +
|
2725 | 'If you want this on all columns, use defaultColDef instead and set it there');
|
2726 | }
|
2727 | if (options.paginationInitialRowCount) {
|
2728 | console.warn('ag-grid: since version 9.0.x paginationInitialRowCount is now called infiniteInitialRowCount');
|
2729 | }
|
2730 | if (options.infinitePageSize) {
|
2731 | console.warn('ag-grid: since version 9.0.x infinitePageSize is now called cacheBlockSize');
|
2732 | }
|
2733 | if (options.infiniteBlockSize) {
|
2734 | console.warn('ag-grid: since version 10.0.x infiniteBlockSize is now called cacheBlockSize');
|
2735 | }
|
2736 | if (options.maxPagesInCache) {
|
2737 | console.warn('ag-grid: since version 10.0.x maxPagesInCache is now called maxBlocksInCache');
|
2738 | }
|
2739 | if (options.paginationOverflowSize) {
|
2740 | console.warn('ag-grid: since version 10.0.x paginationOverflowSize is now called cacheOverflowSize');
|
2741 | }
|
2742 | if (options.forPrint) {
|
2743 | console.warn('ag-grid: since version 10.1.x, use property domLayout="forPrint" instead of forPrint=true');
|
2744 | }
|
2745 | if (options.suppressMenuFilterPanel) {
|
2746 | console.warn("ag-grid: since version 11.0.x, use property colDef.menuTabs=['generalMenuTab','columnsMenuTab'] instead of suppressMenuFilterPanel=true");
|
2747 | }
|
2748 | if (options.suppressMenuMainPanel) {
|
2749 | console.warn("ag-grid: since version 11.0.x, use property colDef.menuTabs=['filterMenuTab','columnsMenuTab'] instead of suppressMenuMainPanel=true");
|
2750 | }
|
2751 | if (options.suppressMenuColumnPanel) {
|
2752 | console.warn("ag-grid: since version 11.0.x, use property colDef.menuTabs=['generalMenuTab','filterMenuTab'] instead of suppressMenuColumnPanel=true");
|
2753 | }
|
2754 | if (options.suppressUseColIdForGroups) {
|
2755 | console.warn("ag-grid: since version 11.0.x, this is not in use anymore. You should be able to remove it from your definition");
|
2756 | }
|
2757 | if (options.groupColumnDef) {
|
2758 | console.warn("ag-grid: since version 11.0.x, groupColumnDef has been renamed, this property is now called autoGroupColumnDef. Please change your configuration accordingly");
|
2759 | }
|
2760 | if (options.slaveGrids) {
|
2761 | console.warn("ag-grid: since version 12.x, slaveGrids has been renamed, this property is now called alignedGrids. Please change your configuration accordingly");
|
2762 | }
|
2763 | if (options.floatingTopRowData) {
|
2764 | console.warn("ag-grid: since version 12.x, floatingTopRowData is now called pinnedTopRowData");
|
2765 | }
|
2766 | if (options.floatingBottomRowData) {
|
2767 | console.warn("ag-grid: since version 12.x, floatingBottomRowData is now called pinnedBottomRowData");
|
2768 | }
|
2769 | if (options.paginationStartPage) {
|
2770 | console.warn("ag-grid: since version 12.x, paginationStartPage is gone, please call api.paginationGoToPage(" + options.paginationStartPage + ") instead.");
|
2771 | }
|
2772 | if (options.getHeaderCellTemplate) {
|
2773 | console.warn("ag-grid: since version 15.x, getHeaderCellTemplate is gone, please check the header documentation on how to set header templates.");
|
2774 | }
|
2775 | if (options.headerCellTemplate) {
|
2776 | console.warn("ag-grid: since version 15.x, headerCellTemplate is gone, please check the header documentation on how to set header templates.");
|
2777 | }
|
2778 | if (options.headerCellRenderer) {
|
2779 | console.warn("ag-grid: since version 15.x, headerCellRenderer is gone, please check the header documentation on how to set header templates.");
|
2780 | }
|
2781 | if (options.angularCompileHeaders) {
|
2782 | console.warn("ag-grid: since version 15.x, angularCompileHeaders is gone, please see the getting started for Angular 1 docs to see how to do headers in Angular 1.x.");
|
2783 | }
|
2784 | if (options.domLayout === 'forPrint') {
|
2785 | console.warn("ag-grid: since version 18.x, forPrint is no longer supported, as same can be achieved using autoHeight (and set the grid width accordingly). please use autoHeight instead.");
|
2786 | }
|
2787 | if (options.domLayout === 'autoHeight') {
|
2788 | console.warn("ag-grid: since version 18.x, domLayout is gone, instead if doing auto-height, set gridAutoHeight=true.");
|
2789 | options.gridAutoHeight = true;
|
2790 | }
|
2791 | if (options.pivotTotals) {
|
2792 | console.warn("ag-grid: since version 18.x, pivotTotals has been removed, instead if using pivotTotals, set pivotColumnGroupTotals='before'|'after'.");
|
2793 | options.pivotColumnGroupTotals = 'before';
|
2794 | }
|
2795 | if (options.rowModelType === 'inMemory') {
|
2796 | console.warn("ag-grid: since version 18.x, The In Memory Row Model has been renamed to the Client Side Row Model, set rowModelType='clientSide' instead.");
|
2797 | options.rowModelType = 'clientSide';
|
2798 | }
|
2799 | if (options.rowModelType === 'enterprise') {
|
2800 | console.warn("ag-grid: since version 18.x, The Enterprise Row Model has been renamed to the Server Side Row Model, set rowModelType='serverSide' instead.");
|
2801 | options.rowModelType = 'serverSide';
|
2802 | }
|
2803 | if (options.layoutInterval) {
|
2804 | console.warn("ag-grid: since version 18.x, layoutInterval is no longer a property. This is because the grid now uses CSS Flex for layout.");
|
2805 | }
|
2806 | };
|
2807 | GridOptionsWrapper.prototype.getLocaleTextFunc = function () {
|
2808 | if (this.gridOptions.localeTextFunc) {
|
2809 | return this.gridOptions.localeTextFunc;
|
2810 | }
|
2811 | var that = this;
|
2812 | return function (key, defaultValue) {
|
2813 | var localeText = that.gridOptions.localeText;
|
2814 | if (localeText && localeText[key]) {
|
2815 | return localeText[key];
|
2816 | }
|
2817 | else {
|
2818 | return defaultValue;
|
2819 | }
|
2820 | };
|
2821 | };
|
2822 |
|
2823 | GridOptionsWrapper.prototype.globalEventHandler = function (eventName, event) {
|
2824 | var callbackMethodName = componentUtil_1.ComponentUtil.getCallbackForEvent(eventName);
|
2825 | if (typeof this.gridOptions[callbackMethodName] === 'function') {
|
2826 | this.gridOptions[callbackMethodName](event);
|
2827 | }
|
2828 | };
|
2829 |
|
2830 | GridOptionsWrapper.prototype.getRowHeightAsNumber = function () {
|
2831 | var rowHeight = this.gridOptions.rowHeight;
|
2832 | if (utils_1.Utils.missing(rowHeight)) {
|
2833 | return this.getDefaultRowHeight();
|
2834 | }
|
2835 | else if (this.isNumeric(this.gridOptions.rowHeight)) {
|
2836 | return this.gridOptions.rowHeight;
|
2837 | }
|
2838 | else {
|
2839 | console.warn('ag-Grid row height must be a number if not using standard row model');
|
2840 | return this.getDefaultRowHeight();
|
2841 | }
|
2842 | };
|
2843 | GridOptionsWrapper.prototype.getRowHeightForNode = function (rowNode) {
|
2844 |
|
2845 |
|
2846 |
|
2847 | if (typeof this.gridOptions.getRowHeight === 'function') {
|
2848 | var params = {
|
2849 | node: rowNode,
|
2850 | data: rowNode.data,
|
2851 | api: this.gridOptions.api,
|
2852 | context: this.gridOptions.context
|
2853 | };
|
2854 | return this.gridOptions.getRowHeight(params);
|
2855 | }
|
2856 | else if (rowNode.detail && this.isMasterDetail()) {
|
2857 | if (this.isNumeric(this.gridOptions.detailRowHeight)) {
|
2858 | return this.gridOptions.detailRowHeight;
|
2859 | }
|
2860 | else {
|
2861 | return DEFAULT_DETAIL_ROW_HEIGHT;
|
2862 | }
|
2863 | }
|
2864 | else {
|
2865 | var defaultHeight = this.isNumeric(this.gridOptions.rowHeight) ?
|
2866 | this.gridOptions.rowHeight : this.getDefaultRowHeight();
|
2867 | if (this.columnController.isAutoRowHeightActive()) {
|
2868 | var autoHeight = this.autoHeightCalculator.getPreferredHeightForRow(rowNode);
|
2869 |
|
2870 |
|
2871 | if (autoHeight > defaultHeight) {
|
2872 | return autoHeight;
|
2873 | }
|
2874 | else {
|
2875 | return defaultHeight;
|
2876 | }
|
2877 | }
|
2878 | else {
|
2879 | return defaultHeight;
|
2880 | }
|
2881 | }
|
2882 | };
|
2883 | GridOptionsWrapper.prototype.isDynamicRowHeight = function () {
|
2884 | return typeof this.gridOptions.getRowHeight === 'function';
|
2885 | };
|
2886 | GridOptionsWrapper.prototype.getVirtualItemHeight = function () {
|
2887 | return this.specialForNewMaterial(20, 'virtualItemHeight');
|
2888 | };
|
2889 | GridOptionsWrapper.prototype.isNumeric = function (value) {
|
2890 | return !isNaN(value) && typeof value === 'number';
|
2891 | };
|
2892 |
|
2893 |
|
2894 | GridOptionsWrapper.prototype.specialForNewMaterial = function (defaultValue, sassVariableName) {
|
2895 | var theme = this.environment.getTheme();
|
2896 | if (theme.indexOf('ag-theme') === 0) {
|
2897 | return this.environment.getSassVariable(theme, sassVariableName);
|
2898 | }
|
2899 | else {
|
2900 | return defaultValue;
|
2901 | }
|
2902 | };
|
2903 | GridOptionsWrapper.prototype.getDefaultRowHeight = function () {
|
2904 | return this.specialForNewMaterial(DEFAULT_ROW_HEIGHT, 'rowHeight');
|
2905 | };
|
2906 | GridOptionsWrapper.MIN_COL_WIDTH = 10;
|
2907 | GridOptionsWrapper.PROP_HEADER_HEIGHT = 'headerHeight';
|
2908 | GridOptionsWrapper.PROP_GROUP_REMOVE_SINGLE_CHILDREN = 'groupRemoveSingleChildren';
|
2909 | GridOptionsWrapper.PROP_GROUP_REMOVE_LOWEST_SINGLE_CHILDREN = 'groupRemoveLowestSingleChildren';
|
2910 | GridOptionsWrapper.PROP_PIVOT_HEADER_HEIGHT = 'pivotHeaderHeight';
|
2911 | GridOptionsWrapper.PROP_SUPPRESS_CLIPBOARD_PASTE = 'suppressClipboardPaste';
|
2912 | GridOptionsWrapper.PROP_GROUP_HEADER_HEIGHT = 'groupHeaderHeight';
|
2913 | GridOptionsWrapper.PROP_PIVOT_GROUP_HEADER_HEIGHT = 'pivotGroupHeaderHeight';
|
2914 | GridOptionsWrapper.PROP_FLOATING_FILTERS_HEIGHT = 'floatingFiltersHeight';
|
2915 | GridOptionsWrapper.PROP_SUPPRESS_ROW_DRAG = 'suppressRowDrag';
|
2916 | GridOptionsWrapper.PROP_POPUP_PARENT = 'popupParent';
|
2917 | GridOptionsWrapper.PROP_GRID_AUTO_HEIGHT = 'gridAutoHeight';
|
2918 | __decorate([
|
2919 | context_1.Autowired('gridOptions'),
|
2920 | __metadata("design:type", Object)
|
2921 | ], GridOptionsWrapper.prototype, "gridOptions", void 0);
|
2922 | __decorate([
|
2923 | context_1.Autowired('columnController'),
|
2924 | __metadata("design:type", columnController_1.ColumnController)
|
2925 | ], GridOptionsWrapper.prototype, "columnController", void 0);
|
2926 | __decorate([
|
2927 | context_1.Autowired('eventService'),
|
2928 | __metadata("design:type", eventService_1.EventService)
|
2929 | ], GridOptionsWrapper.prototype, "eventService", void 0);
|
2930 | __decorate([
|
2931 | context_1.Autowired('enterprise'),
|
2932 | __metadata("design:type", Boolean)
|
2933 | ], GridOptionsWrapper.prototype, "enterprise", void 0);
|
2934 | __decorate([
|
2935 | context_1.Autowired('frameworkFactory'),
|
2936 | __metadata("design:type", Object)
|
2937 | ], GridOptionsWrapper.prototype, "frameworkFactory", void 0);
|
2938 | __decorate([
|
2939 | context_1.Autowired('gridApi'),
|
2940 | __metadata("design:type", gridApi_1.GridApi)
|
2941 | ], GridOptionsWrapper.prototype, "gridApi", void 0);
|
2942 | __decorate([
|
2943 | context_1.Autowired('columnApi'),
|
2944 | __metadata("design:type", columnApi_1.ColumnApi)
|
2945 | ], GridOptionsWrapper.prototype, "columnApi", void 0);
|
2946 | __decorate([
|
2947 | context_1.Autowired('environment'),
|
2948 | __metadata("design:type", environment_1.Environment)
|
2949 | ], GridOptionsWrapper.prototype, "environment", void 0);
|
2950 | __decorate([
|
2951 | context_1.Autowired('autoHeightCalculator'),
|
2952 | __metadata("design:type", autoHeightCalculator_1.AutoHeightCalculator)
|
2953 | ], GridOptionsWrapper.prototype, "autoHeightCalculator", void 0);
|
2954 | __decorate([
|
2955 | __param(0, context_1.Qualifier('gridApi')), __param(1, context_1.Qualifier('columnApi')),
|
2956 | __metadata("design:type", Function),
|
2957 | __metadata("design:paramtypes", [gridApi_1.GridApi, columnApi_1.ColumnApi]),
|
2958 | __metadata("design:returntype", void 0)
|
2959 | ], GridOptionsWrapper.prototype, "agWire", null);
|
2960 | __decorate([
|
2961 | context_1.PreDestroy,
|
2962 | __metadata("design:type", Function),
|
2963 | __metadata("design:paramtypes", []),
|
2964 | __metadata("design:returntype", void 0)
|
2965 | ], GridOptionsWrapper.prototype, "destroy", null);
|
2966 | __decorate([
|
2967 | context_1.PostConstruct,
|
2968 | __metadata("design:type", Function),
|
2969 | __metadata("design:paramtypes", []),
|
2970 | __metadata("design:returntype", void 0)
|
2971 | ], GridOptionsWrapper.prototype, "init", null);
|
2972 | GridOptionsWrapper = GridOptionsWrapper_1 = __decorate([
|
2973 | context_1.Bean('gridOptionsWrapper')
|
2974 | ], GridOptionsWrapper);
|
2975 | return GridOptionsWrapper;
|
2976 | var GridOptionsWrapper_1;
|
2977 | }());
|
2978 | exports.GridOptionsWrapper = GridOptionsWrapper;
|
2979 |
|
2980 |
|
2981 | }),
|
2982 |
|
2983 | (function(module, exports, __webpack_require__) {
|
2984 |
|
2985 | "use strict";
|
2986 |
|
2987 |
|
2988 |
|
2989 |
|
2990 |
|
2991 |
|
2992 |
|
2993 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
2994 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
2995 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
2996 | 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;
|
2997 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
2998 | };
|
2999 | var __metadata = (this && this.__metadata) || function (k, v) {
|
3000 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
3001 | };
|
3002 | var __param = (this && this.__param) || function (paramIndex, decorator) {
|
3003 | return function (target, key) { decorator(target, key, paramIndex); }
|
3004 | };
|
3005 | Object.defineProperty(exports, "__esModule", { value: true });
|
3006 | var logger_1 = __webpack_require__(12);
|
3007 | var utils_1 = __webpack_require__(1);
|
3008 | var context_1 = __webpack_require__(0);
|
3009 | var context_2 = __webpack_require__(0);
|
3010 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
3011 | var EventService = (function () {
|
3012 | function EventService() {
|
3013 | this.allSyncListeners = {};
|
3014 | this.allAsyncListeners = {};
|
3015 | this.globalSyncListeners = [];
|
3016 | this.globalAsyncListeners = [];
|
3017 | this.asyncFunctionsQueue = [];
|
3018 | this.scheduled = false;
|
3019 | }
|
3020 | EventService_1 = EventService;
|
3021 |
|
3022 |
|
3023 |
|
3024 |
|
3025 |
|
3026 |
|
3027 |
|
3028 |
|
3029 |
|
3030 | EventService.prototype.setBeans = function (loggerFactory, gridOptionsWrapper, globalEventListener) {
|
3031 | if (globalEventListener === void 0) { globalEventListener = null; }
|
3032 | this.logger = loggerFactory.create('EventService');
|
3033 | if (globalEventListener) {
|
3034 | var async = gridOptionsWrapper.useAsyncEvents();
|
3035 | this.addGlobalListener(globalEventListener, async);
|
3036 | }
|
3037 | };
|
3038 | EventService.prototype.getListenerList = function (eventType, async) {
|
3039 | var listenerMap = async ? this.allAsyncListeners : this.allSyncListeners;
|
3040 | var listenerList = listenerMap[eventType];
|
3041 | if (!listenerList) {
|
3042 | listenerList = [];
|
3043 | listenerMap[eventType] = listenerList;
|
3044 | }
|
3045 | return listenerList;
|
3046 | };
|
3047 | EventService.prototype.addEventListener = function (eventType, listener, async) {
|
3048 | if (async === void 0) { async = false; }
|
3049 | var listenerList = this.getListenerList(eventType, async);
|
3050 | if (listenerList.indexOf(listener) < 0) {
|
3051 | listenerList.push(listener);
|
3052 | }
|
3053 | };
|
3054 |
|
3055 |
|
3056 |
|
3057 | EventService.prototype.addModalPriorityEventListener = function (eventType, listener, async) {
|
3058 | if (async === void 0) { async = false; }
|
3059 | this.addEventListener(eventType + EventService_1.PRIORITY, listener, async);
|
3060 | };
|
3061 | EventService.prototype.addGlobalListener = function (listener, async) {
|
3062 | if (async === void 0) { async = false; }
|
3063 | if (async) {
|
3064 | this.globalAsyncListeners.push(listener);
|
3065 | }
|
3066 | else {
|
3067 | this.globalSyncListeners.push(listener);
|
3068 | }
|
3069 | };
|
3070 | EventService.prototype.removeEventListener = function (eventType, listener, async) {
|
3071 | if (async === void 0) { async = false; }
|
3072 | var listenerList = this.getListenerList(eventType, async);
|
3073 | utils_1.Utils.removeFromArray(listenerList, listener);
|
3074 | };
|
3075 | EventService.prototype.removeGlobalListener = function (listener, async) {
|
3076 | if (async === void 0) { async = false; }
|
3077 | if (async) {
|
3078 | utils_1.Utils.removeFromArray(this.globalAsyncListeners, listener);
|
3079 | }
|
3080 | else {
|
3081 | utils_1.Utils.removeFromArray(this.globalSyncListeners, listener);
|
3082 | }
|
3083 | };
|
3084 |
|
3085 |
|
3086 | EventService.prototype.dispatchEvent = function (event) {
|
3087 |
|
3088 | this.dispatchToListeners(event, true);
|
3089 | this.dispatchToListeners(event, false);
|
3090 | };
|
3091 | EventService.prototype.dispatchToListeners = function (event, async) {
|
3092 | var _this = this;
|
3093 | var globalListeners = async ? this.globalAsyncListeners : this.globalSyncListeners;
|
3094 | var eventType = event.type;
|
3095 |
|
3096 | var p1ListenerList = this.getListenerList(eventType + EventService_1.PRIORITY, async);
|
3097 | utils_1.Utils.forEachSnapshotFirst(p1ListenerList, function (listener) {
|
3098 | if (async) {
|
3099 | _this.dispatchAsync(function () { return listener(event); });
|
3100 | }
|
3101 | else {
|
3102 | listener(event);
|
3103 | }
|
3104 | });
|
3105 | var listenerList = this.getListenerList(eventType, async);
|
3106 | utils_1.Utils.forEachSnapshotFirst(listenerList, function (listener) {
|
3107 | if (async) {
|
3108 | _this.dispatchAsync(function () { return listener(event); });
|
3109 | }
|
3110 | else {
|
3111 | listener(event);
|
3112 | }
|
3113 | });
|
3114 | utils_1.Utils.forEachSnapshotFirst(globalListeners, function (listener) {
|
3115 | if (async) {
|
3116 | _this.dispatchAsync(function () { return listener(eventType, event); });
|
3117 | }
|
3118 | else {
|
3119 | listener(eventType, event);
|
3120 | }
|
3121 | });
|
3122 | };
|
3123 |
|
3124 |
|
3125 |
|
3126 |
|
3127 | EventService.prototype.dispatchAsync = function (func) {
|
3128 |
|
3129 | this.asyncFunctionsQueue.push(func);
|
3130 |
|
3131 |
|
3132 |
|
3133 |
|
3134 | if (!this.scheduled) {
|
3135 |
|
3136 | setTimeout(this.flushAsyncQueue.bind(this), 0);
|
3137 |
|
3138 | this.scheduled = true;
|
3139 | }
|
3140 | };
|
3141 |
|
3142 | EventService.prototype.flushAsyncQueue = function () {
|
3143 | this.scheduled = false;
|
3144 |
|
3145 |
|
3146 |
|
3147 |
|
3148 |
|
3149 | var queueCopy = this.asyncFunctionsQueue.slice();
|
3150 | this.asyncFunctionsQueue = [];
|
3151 |
|
3152 | queueCopy.forEach(function (func) { return func(); });
|
3153 | };
|
3154 |
|
3155 |
|
3156 | EventService.PRIORITY = '-P1';
|
3157 | __decorate([
|
3158 | __param(0, context_2.Qualifier('loggerFactory')),
|
3159 | __param(1, context_2.Qualifier('gridOptionsWrapper')),
|
3160 | __param(2, context_2.Qualifier('globalEventListener')),
|
3161 | __metadata("design:type", Function),
|
3162 | __metadata("design:paramtypes", [logger_1.LoggerFactory,
|
3163 | gridOptionsWrapper_1.GridOptionsWrapper,
|
3164 | Function]),
|
3165 | __metadata("design:returntype", void 0)
|
3166 | ], EventService.prototype, "setBeans", null);
|
3167 | EventService = EventService_1 = __decorate([
|
3168 | context_1.Bean('eventService')
|
3169 | ], EventService);
|
3170 | return EventService;
|
3171 | var EventService_1;
|
3172 | }());
|
3173 | exports.EventService = EventService;
|
3174 |
|
3175 |
|
3176 | }),
|
3177 |
|
3178 | (function(module, exports, __webpack_require__) {
|
3179 |
|
3180 | "use strict";
|
3181 |
|
3182 |
|
3183 |
|
3184 |
|
3185 |
|
3186 |
|
3187 |
|
3188 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
3189 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
3190 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
3191 | 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;
|
3192 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
3193 | };
|
3194 | var __metadata = (this && this.__metadata) || function (k, v) {
|
3195 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
3196 | };
|
3197 | var __param = (this && this.__param) || function (paramIndex, decorator) {
|
3198 | return function (target, key) { decorator(target, key, paramIndex); }
|
3199 | };
|
3200 | Object.defineProperty(exports, "__esModule", { value: true });
|
3201 | var utils_1 = __webpack_require__(1);
|
3202 | var columnGroup_1 = __webpack_require__(26);
|
3203 | var column_1 = __webpack_require__(10);
|
3204 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
3205 | var expressionService_1 = __webpack_require__(19);
|
3206 | var balancedColumnTreeBuilder_1 = __webpack_require__(38);
|
3207 | var displayedGroupCreator_1 = __webpack_require__(48);
|
3208 | var autoWidthCalculator_1 = __webpack_require__(39);
|
3209 | var eventService_1 = __webpack_require__(3);
|
3210 | var columnUtils_1 = __webpack_require__(31);
|
3211 | var logger_1 = __webpack_require__(12);
|
3212 | var events_1 = __webpack_require__(5);
|
3213 | var originalColumnGroup_1 = __webpack_require__(32);
|
3214 | var groupInstanceIdCreator_1 = __webpack_require__(83);
|
3215 | var context_1 = __webpack_require__(0);
|
3216 | var columnAnimationService_1 = __webpack_require__(53);
|
3217 | var autoGroupColService_1 = __webpack_require__(104);
|
3218 | var valueCache_1 = __webpack_require__(33);
|
3219 | var gridApi_1 = __webpack_require__(6);
|
3220 | var columnApi_1 = __webpack_require__(7);
|
3221 | var ColumnController = (function () {
|
3222 | function ColumnController() {
|
3223 |
|
3224 | this.primaryHeaderRowCount = 0;
|
3225 | this.secondaryHeaderRowCount = 0;
|
3226 | this.secondaryColumnsPresent = false;
|
3227 |
|
3228 | this.gridHeaderRowCount = 0;
|
3229 |
|
3230 |
|
3231 | this.displayedLeftColumns = [];
|
3232 | this.displayedRightColumns = [];
|
3233 | this.displayedCenterColumns = [];
|
3234 |
|
3235 | this.allDisplayedColumns = [];
|
3236 |
|
3237 | this.allDisplayedVirtualColumns = [];
|
3238 | this.allDisplayedCenterVirtualColumns = [];
|
3239 | this.rowGroupColumns = [];
|
3240 | this.valueColumns = [];
|
3241 | this.pivotColumns = [];
|
3242 | this.ready = false;
|
3243 | this.autoGroupsNeedBuilding = false;
|
3244 | this.pivotMode = false;
|
3245 | this.bodyWidth = 0;
|
3246 | this.leftWidth = 0;
|
3247 | this.rightWidth = 0;
|
3248 | this.bodyWidthDirty = true;
|
3249 | }
|
3250 | ColumnController.prototype.init = function () {
|
3251 | var pivotMode = this.gridOptionsWrapper.isPivotMode();
|
3252 | this.suppressColumnVirtualisation = this.gridOptionsWrapper.isSuppressColumnVirtualisation();
|
3253 | if (this.isPivotSettingAllowed(pivotMode)) {
|
3254 | this.pivotMode = pivotMode;
|
3255 | }
|
3256 | this.usingTreeData = this.gridOptionsWrapper.isTreeData();
|
3257 | };
|
3258 | ColumnController.prototype.isAutoRowHeightActive = function () {
|
3259 | return this.autoRowHeightColumns && this.autoRowHeightColumns.length > 0;
|
3260 | };
|
3261 | ColumnController.prototype.getAllAutoRowHeightCols = function () {
|
3262 | return this.autoRowHeightColumns;
|
3263 | };
|
3264 | ColumnController.prototype.setVirtualViewportLeftAndRight = function () {
|
3265 | if (this.gridOptionsWrapper.isEnableRtl()) {
|
3266 | this.viewportLeft = this.bodyWidth - this.scrollPosition - this.scrollWidth;
|
3267 | this.viewportRight = this.bodyWidth - this.scrollPosition;
|
3268 | }
|
3269 | else {
|
3270 | this.viewportLeft = this.scrollPosition;
|
3271 | this.viewportRight = this.scrollWidth + this.scrollPosition;
|
3272 | }
|
3273 | };
|
3274 |
|
3275 | ColumnController.prototype.getDisplayedColumnsStartingAt = function (column) {
|
3276 | var currentColumn = column;
|
3277 | var result = [];
|
3278 | while (utils_1.Utils.exists(currentColumn)) {
|
3279 | result.push(currentColumn);
|
3280 | currentColumn = this.getDisplayedColAfter(currentColumn);
|
3281 | }
|
3282 | return result;
|
3283 | };
|
3284 |
|
3285 |
|
3286 |
|
3287 | ColumnController.prototype.checkDisplayedVirtualColumns = function () {
|
3288 |
|
3289 | if (utils_1.Utils.exists(this.displayedCenterColumns)) {
|
3290 | var hashBefore = this.allDisplayedVirtualColumns.map(function (column) { return column.getId(); }).join('#');
|
3291 | this.updateVirtualSets();
|
3292 | var hashAfter = this.allDisplayedVirtualColumns.map(function (column) { return column.getId(); }).join('#');
|
3293 | if (hashBefore !== hashAfter) {
|
3294 | var event_1 = {
|
3295 | type: events_1.Events.EVENT_VIRTUAL_COLUMNS_CHANGED,
|
3296 | api: this.gridApi,
|
3297 | columnApi: this.columnApi
|
3298 | };
|
3299 | this.eventService.dispatchEvent(event_1);
|
3300 | }
|
3301 | }
|
3302 | };
|
3303 | ColumnController.prototype.setVirtualViewportPosition = function (scrollWidth, scrollPosition) {
|
3304 | if (scrollWidth !== this.scrollWidth || scrollPosition !== this.scrollPosition || this.bodyWidthDirty) {
|
3305 | this.scrollWidth = scrollWidth;
|
3306 | this.scrollPosition = scrollPosition;
|
3307 |
|
3308 |
|
3309 |
|
3310 | this.bodyWidthDirty = true;
|
3311 | this.setVirtualViewportLeftAndRight();
|
3312 | if (this.ready) {
|
3313 | this.checkDisplayedVirtualColumns();
|
3314 | }
|
3315 | }
|
3316 | };
|
3317 | ColumnController.prototype.isPivotMode = function () {
|
3318 | return this.pivotMode;
|
3319 | };
|
3320 | ColumnController.prototype.isPivotSettingAllowed = function (pivot) {
|
3321 | if (pivot) {
|
3322 | if (this.gridOptionsWrapper.isTreeData()) {
|
3323 | console.warn("ag-Grid: Pivot mode not available in conjunction Tree Data i.e. 'gridOptions.treeData: true'");
|
3324 | return false;
|
3325 | }
|
3326 | else {
|
3327 | return true;
|
3328 | }
|
3329 | }
|
3330 | else {
|
3331 | return true;
|
3332 | }
|
3333 | };
|
3334 | ColumnController.prototype.setPivotMode = function (pivotMode, source) {
|
3335 | if (source === void 0) { source = "api"; }
|
3336 | if (pivotMode === this.pivotMode) {
|
3337 | return;
|
3338 | }
|
3339 | if (!this.isPivotSettingAllowed(this.pivotMode)) {
|
3340 | return;
|
3341 | }
|
3342 | this.pivotMode = pivotMode;
|
3343 | this.updateDisplayedColumns(source);
|
3344 | var event = {
|
3345 | type: events_1.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,
|
3346 | api: this.gridApi,
|
3347 | columnApi: this.columnApi
|
3348 | };
|
3349 | this.eventService.dispatchEvent(event);
|
3350 | };
|
3351 | ColumnController.prototype.getSecondaryPivotColumn = function (pivotKeys, valueColKey) {
|
3352 | if (!this.secondaryColumnsPresent) {
|
3353 | return null;
|
3354 | }
|
3355 | var valueColumnToFind = this.getPrimaryColumn(valueColKey);
|
3356 | var foundColumn = null;
|
3357 | this.secondaryColumns.forEach(function (column) {
|
3358 | var thisPivotKeys = column.getColDef().pivotKeys;
|
3359 | var pivotValueColumn = column.getColDef().pivotValueColumn;
|
3360 | var pivotKeyMatches = utils_1.Utils.compareArrays(thisPivotKeys, pivotKeys);
|
3361 | var pivotValueMatches = pivotValueColumn === valueColumnToFind;
|
3362 | if (pivotKeyMatches && pivotValueMatches) {
|
3363 | foundColumn = column;
|
3364 | }
|
3365 | });
|
3366 | return foundColumn;
|
3367 | };
|
3368 | ColumnController.prototype.setBeans = function (loggerFactory) {
|
3369 | this.logger = loggerFactory.create('ColumnController');
|
3370 | };
|
3371 | ColumnController.prototype.setFirstRightAndLastLeftPinned = function (source) {
|
3372 | var lastLeft;
|
3373 | var firstRight;
|
3374 | if (this.gridOptionsWrapper.isEnableRtl()) {
|
3375 | lastLeft = this.displayedLeftColumns ? this.displayedLeftColumns[0] : null;
|
3376 | firstRight = this.displayedRightColumns ? this.displayedRightColumns[this.displayedRightColumns.length - 1] : null;
|
3377 | }
|
3378 | else {
|
3379 | lastLeft = this.displayedLeftColumns ? this.displayedLeftColumns[this.displayedLeftColumns.length - 1] : null;
|
3380 | firstRight = this.displayedRightColumns ? this.displayedRightColumns[0] : null;
|
3381 | }
|
3382 | this.gridColumns.forEach(function (column) {
|
3383 | column.setLastLeftPinned(column === lastLeft, source);
|
3384 | column.setFirstRightPinned(column === firstRight, source);
|
3385 | });
|
3386 | };
|
3387 | ColumnController.prototype.autoSizeColumns = function (keys, source) {
|
3388 |
|
3389 |
|
3390 |
|
3391 |
|
3392 |
|
3393 |
|
3394 |
|
3395 | var _this = this;
|
3396 | if (source === void 0) { source = "api"; }
|
3397 |
|
3398 | var columnsAutosized = [];
|
3399 |
|
3400 | var changesThisTimeAround = -1;
|
3401 | while (changesThisTimeAround !== 0) {
|
3402 | changesThisTimeAround = 0;
|
3403 | this.actionOnGridColumns(keys, function (column) {
|
3404 |
|
3405 | if (columnsAutosized.indexOf(column) >= 0) {
|
3406 | return;
|
3407 | }
|
3408 |
|
3409 | var preferredWidth = _this.autoWidthCalculator.getPreferredWidthForColumn(column);
|
3410 |
|
3411 | if (preferredWidth > 0) {
|
3412 | var newWidth = _this.normaliseColumnWidth(column, preferredWidth);
|
3413 | column.setActualWidth(newWidth, source);
|
3414 | columnsAutosized.push(column);
|
3415 | changesThisTimeAround++;
|
3416 | }
|
3417 | return true;
|
3418 | }, source);
|
3419 | }
|
3420 | if (columnsAutosized.length > 0) {
|
3421 | var event_2 = {
|
3422 | type: events_1.Events.EVENT_COLUMN_RESIZED,
|
3423 | columns: columnsAutosized,
|
3424 | column: columnsAutosized.length === 1 ? columnsAutosized[0] : null,
|
3425 | finished: true,
|
3426 | api: this.gridApi,
|
3427 | columnApi: this.columnApi,
|
3428 | source: "autosizeColumns"
|
3429 | };
|
3430 | this.eventService.dispatchEvent(event_2);
|
3431 | }
|
3432 | };
|
3433 | ColumnController.prototype.autoSizeColumn = function (key, source) {
|
3434 | if (source === void 0) { source = "api"; }
|
3435 | this.autoSizeColumns([key], source);
|
3436 | };
|
3437 | ColumnController.prototype.autoSizeAllColumns = function (source) {
|
3438 | if (source === void 0) { source = "api"; }
|
3439 | var allDisplayedColumns = this.getAllDisplayedColumns();
|
3440 | this.autoSizeColumns(allDisplayedColumns, source);
|
3441 | };
|
3442 | ColumnController.prototype.getColumnsFromTree = function (rootColumns) {
|
3443 | var result = [];
|
3444 | recursiveFindColumns(rootColumns);
|
3445 | return result;
|
3446 | function recursiveFindColumns(childColumns) {
|
3447 | for (var i = 0; i < childColumns.length; i++) {
|
3448 | var child = childColumns[i];
|
3449 | if (child instanceof column_1.Column) {
|
3450 | result.push(child);
|
3451 | }
|
3452 | else if (child instanceof originalColumnGroup_1.OriginalColumnGroup) {
|
3453 | recursiveFindColumns(child.getChildren());
|
3454 | }
|
3455 | }
|
3456 | }
|
3457 | };
|
3458 | ColumnController.prototype.getAllDisplayedColumnGroups = function () {
|
3459 | if (this.displayedLeftColumnTree && this.displayedRightColumnTree && this.displayedCentreColumnTree) {
|
3460 | return this.displayedLeftColumnTree
|
3461 | .concat(this.displayedCentreColumnTree)
|
3462 | .concat(this.displayedRightColumnTree);
|
3463 | }
|
3464 | else {
|
3465 | return null;
|
3466 | }
|
3467 | };
|
3468 |
|
3469 | ColumnController.prototype.getPrimaryColumnTree = function () {
|
3470 | return this.primaryBalancedTree;
|
3471 | };
|
3472 |
|
3473 | ColumnController.prototype.getHeaderRowCount = function () {
|
3474 | return this.gridHeaderRowCount;
|
3475 | };
|
3476 |
|
3477 | ColumnController.prototype.getLeftDisplayedColumnGroups = function () {
|
3478 | return this.displayedLeftColumnTree;
|
3479 | };
|
3480 |
|
3481 | ColumnController.prototype.getRightDisplayedColumnGroups = function () {
|
3482 | return this.displayedRightColumnTree;
|
3483 | };
|
3484 |
|
3485 | ColumnController.prototype.getCenterDisplayedColumnGroups = function () {
|
3486 | return this.displayedCentreColumnTree;
|
3487 | };
|
3488 | ColumnController.prototype.getDisplayedColumnGroups = function (type) {
|
3489 | switch (type) {
|
3490 | case column_1.Column.PINNED_LEFT: return this.getLeftDisplayedColumnGroups();
|
3491 | case column_1.Column.PINNED_RIGHT: return this.getRightDisplayedColumnGroups();
|
3492 | default: return this.getCenterDisplayedColumnGroups();
|
3493 | }
|
3494 | };
|
3495 |
|
3496 | ColumnController.prototype.isColumnDisplayed = function (column) {
|
3497 | return this.getAllDisplayedColumns().indexOf(column) >= 0;
|
3498 | };
|
3499 |
|
3500 | ColumnController.prototype.getAllDisplayedColumns = function () {
|
3501 | return this.allDisplayedColumns;
|
3502 | };
|
3503 | ColumnController.prototype.getAllDisplayedVirtualColumns = function () {
|
3504 | return this.allDisplayedVirtualColumns;
|
3505 | };
|
3506 | ColumnController.prototype.getDisplayedLeftColumnsForRow = function (rowNode) {
|
3507 | if (!this.colSpanActive) {
|
3508 | return this.displayedLeftColumns;
|
3509 | }
|
3510 | else {
|
3511 | return this.getDisplayedColumnsForRow(rowNode, this.displayedLeftColumns);
|
3512 | }
|
3513 | };
|
3514 | ColumnController.prototype.getDisplayedRightColumnsForRow = function (rowNode) {
|
3515 | if (!this.colSpanActive) {
|
3516 | return this.displayedRightColumns;
|
3517 | }
|
3518 | else {
|
3519 | return this.getDisplayedColumnsForRow(rowNode, this.displayedRightColumns);
|
3520 | }
|
3521 | };
|
3522 | ColumnController.prototype.getDisplayedColumnsForRow = function (rowNode, displayedColumns, filterCallback, emptySpaceBeforeColumn) {
|
3523 | var result = [];
|
3524 | var lastConsideredCol = null;
|
3525 | var _loop_1 = function (i) {
|
3526 | var col = displayedColumns[i];
|
3527 | var colSpan = col.getColSpan(rowNode);
|
3528 | var columnsToCheckFilter = [col];
|
3529 | if (colSpan > 1) {
|
3530 | var colsToRemove = colSpan - 1;
|
3531 | for (var j = 1; j <= colsToRemove; j++) {
|
3532 | columnsToCheckFilter.push(displayedColumns[i + j]);
|
3533 | }
|
3534 | i += colsToRemove;
|
3535 | }
|
3536 |
|
3537 | var filterPasses;
|
3538 | if (filterCallback) {
|
3539 |
|
3540 |
|
3541 |
|
3542 |
|
3543 |
|
3544 | filterPasses = false;
|
3545 | columnsToCheckFilter.forEach(function (colForFilter) {
|
3546 | if (filterCallback(colForFilter))
|
3547 | filterPasses = true;
|
3548 | });
|
3549 | }
|
3550 | else {
|
3551 | filterPasses = true;
|
3552 | }
|
3553 | if (filterPasses) {
|
3554 | if (result.length === 0 && lastConsideredCol) {
|
3555 | var gapBeforeColumn = emptySpaceBeforeColumn ? emptySpaceBeforeColumn(col) : false;
|
3556 | if (gapBeforeColumn) {
|
3557 | result.push(lastConsideredCol);
|
3558 | }
|
3559 | }
|
3560 | result.push(col);
|
3561 | }
|
3562 | lastConsideredCol = col;
|
3563 | out_i_1 = i;
|
3564 | };
|
3565 | var out_i_1;
|
3566 | for (var i = 0; i < displayedColumns.length; i++) {
|
3567 | _loop_1(i);
|
3568 | i = out_i_1;
|
3569 | }
|
3570 | return result;
|
3571 | };
|
3572 |
|
3573 |
|
3574 |
|
3575 |
|
3576 | ColumnController.prototype.getAllDisplayedCenterVirtualColumnsForRow = function (rowNode) {
|
3577 | var _this = this;
|
3578 | if (!this.colSpanActive) {
|
3579 | return this.allDisplayedCenterVirtualColumns;
|
3580 | }
|
3581 | var emptySpaceBeforeColumn = function (col) { return col.getLeft() > _this.viewportLeft; };
|
3582 |
|
3583 | var filterCallback = this.suppressColumnVirtualisation ? null : this.isColumnInViewport.bind(this);
|
3584 | return this.getDisplayedColumnsForRow(rowNode, this.displayedCenterColumns, filterCallback, emptySpaceBeforeColumn);
|
3585 | };
|
3586 | ColumnController.prototype.isColumnInViewport = function (col) {
|
3587 | var columnLeft = col.getLeft();
|
3588 | var columnRight = col.getLeft() + col.getActualWidth();
|
3589 | var columnToMuchLeft = columnLeft < this.viewportLeft && columnRight < this.viewportLeft;
|
3590 | var columnToMuchRight = columnLeft > this.viewportRight && columnRight > this.viewportRight;
|
3591 | return !columnToMuchLeft && !columnToMuchRight;
|
3592 | };
|
3593 |
|
3594 |
|
3595 |
|
3596 | ColumnController.prototype.getPinnedLeftContainerWidth = function () {
|
3597 | return this.getWidthOfColsInList(this.displayedLeftColumns);
|
3598 | };
|
3599 |
|
3600 | ColumnController.prototype.getPinnedRightContainerWidth = function () {
|
3601 | return this.getWidthOfColsInList(this.displayedRightColumns);
|
3602 | };
|
3603 | ColumnController.prototype.updatePrimaryColumnList = function (keys, masterList, actionIsAdd, columnCallback, eventType, source) {
|
3604 | var _this = this;
|
3605 | if (source === void 0) { source = "api"; }
|
3606 | if (utils_1.Utils.missingOrEmpty(keys)) {
|
3607 | return;
|
3608 | }
|
3609 | var atLeastOne = false;
|
3610 | keys.forEach(function (key) {
|
3611 | var columnToAdd = _this.getPrimaryColumn(key);
|
3612 | if (!columnToAdd) {
|
3613 | return;
|
3614 | }
|
3615 | if (actionIsAdd) {
|
3616 | if (masterList.indexOf(columnToAdd) >= 0) {
|
3617 | return;
|
3618 | }
|
3619 | masterList.push(columnToAdd);
|
3620 | }
|
3621 | else {
|
3622 | if (masterList.indexOf(columnToAdd) < 0) {
|
3623 | return;
|
3624 | }
|
3625 | utils_1.Utils.removeFromArray(masterList, columnToAdd);
|
3626 | }
|
3627 | columnCallback(columnToAdd);
|
3628 | atLeastOne = true;
|
3629 | });
|
3630 | if (!atLeastOne) {
|
3631 | return;
|
3632 | }
|
3633 | if (this.autoGroupsNeedBuilding) {
|
3634 | this.updateGridColumns();
|
3635 | }
|
3636 | this.updateDisplayedColumns(source);
|
3637 | var event = {
|
3638 | type: eventType,
|
3639 | columns: masterList,
|
3640 | column: masterList.length === 1 ? masterList[0] : null,
|
3641 | api: this.gridApi,
|
3642 | columnApi: this.columnApi,
|
3643 | source: source
|
3644 | };
|
3645 | this.eventService.dispatchEvent(event);
|
3646 | };
|
3647 | ColumnController.prototype.setRowGroupColumns = function (colKeys, source) {
|
3648 | if (source === void 0) { source = "api"; }
|
3649 | this.autoGroupsNeedBuilding = true;
|
3650 | this.setPrimaryColumnList(colKeys, this.rowGroupColumns, events_1.Events.EVENT_COLUMN_ROW_GROUP_CHANGED, this.setRowGroupActive.bind(this), source);
|
3651 | };
|
3652 | ColumnController.prototype.setRowGroupActive = function (active, column, source) {
|
3653 | if (active === column.isRowGroupActive()) {
|
3654 | return;
|
3655 | }
|
3656 | column.setRowGroupActive(active, source);
|
3657 | if (!active && !this.gridOptionsWrapper.isSuppressMakeColumnVisibleAfterUnGroup()) {
|
3658 | column.setVisible(true, source);
|
3659 | }
|
3660 | };
|
3661 | ColumnController.prototype.addRowGroupColumn = function (key, source) {
|
3662 | if (source === void 0) { source = "api"; }
|
3663 | this.addRowGroupColumns([key], source);
|
3664 | };
|
3665 | ColumnController.prototype.addRowGroupColumns = function (keys, source) {
|
3666 | if (source === void 0) { source = "api"; }
|
3667 | this.autoGroupsNeedBuilding = true;
|
3668 | this.updatePrimaryColumnList(keys, this.rowGroupColumns, true, this.setRowGroupActive.bind(this, true), events_1.Events.EVENT_COLUMN_ROW_GROUP_CHANGED, source);
|
3669 | };
|
3670 | ColumnController.prototype.removeRowGroupColumns = function (keys, source) {
|
3671 | if (source === void 0) { source = "api"; }
|
3672 | this.autoGroupsNeedBuilding = true;
|
3673 | this.updatePrimaryColumnList(keys, this.rowGroupColumns, false, this.setRowGroupActive.bind(this, false), events_1.Events.EVENT_COLUMN_ROW_GROUP_CHANGED, source);
|
3674 | };
|
3675 | ColumnController.prototype.removeRowGroupColumn = function (key, source) {
|
3676 | if (source === void 0) { source = "api"; }
|
3677 | this.removeRowGroupColumns([key], source);
|
3678 | };
|
3679 | ColumnController.prototype.addPivotColumns = function (keys, source) {
|
3680 | if (source === void 0) { source = "api"; }
|
3681 | this.updatePrimaryColumnList(keys, this.pivotColumns, true, function (column) { return column.setPivotActive(true, source); }, events_1.Events.EVENT_COLUMN_PIVOT_CHANGED, source);
|
3682 | };
|
3683 | ColumnController.prototype.setPivotColumns = function (colKeys, source) {
|
3684 | if (source === void 0) { source = "api"; }
|
3685 | this.setPrimaryColumnList(colKeys, this.pivotColumns, events_1.Events.EVENT_COLUMN_PIVOT_CHANGED, function (added, column) {
|
3686 | column.setPivotActive(added, source);
|
3687 | }, source);
|
3688 | };
|
3689 | ColumnController.prototype.addPivotColumn = function (key, source) {
|
3690 | if (source === void 0) { source = "api"; }
|
3691 | this.addPivotColumns([key], source);
|
3692 | };
|
3693 | ColumnController.prototype.removePivotColumns = function (keys, source) {
|
3694 | if (source === void 0) { source = "api"; }
|
3695 | this.updatePrimaryColumnList(keys, this.pivotColumns, false, function (column) { return column.setPivotActive(false, source); }, events_1.Events.EVENT_COLUMN_PIVOT_CHANGED, source);
|
3696 | };
|
3697 | ColumnController.prototype.removePivotColumn = function (key, source) {
|
3698 | if (source === void 0) { source = "api"; }
|
3699 | this.removePivotColumns([key], source);
|
3700 | };
|
3701 | ColumnController.prototype.setPrimaryColumnList = function (colKeys, masterList, eventName, columnCallback, source) {
|
3702 | var _this = this;
|
3703 | masterList.length = 0;
|
3704 | if (utils_1.Utils.exists(colKeys)) {
|
3705 | colKeys.forEach(function (key) {
|
3706 | var column = _this.getPrimaryColumn(key);
|
3707 | masterList.push(column);
|
3708 | });
|
3709 | }
|
3710 | this.primaryColumns.forEach(function (column) {
|
3711 | var added = masterList.indexOf(column) >= 0;
|
3712 | columnCallback(added, column);
|
3713 | });
|
3714 | if (this.autoGroupsNeedBuilding) {
|
3715 | this.updateGridColumns();
|
3716 | }
|
3717 | this.updateDisplayedColumns(source);
|
3718 | var event = {
|
3719 | type: eventName,
|
3720 | columns: masterList,
|
3721 | column: masterList.length === 1 ? masterList[0] : null,
|
3722 | api: this.gridApi,
|
3723 | columnApi: this.columnApi,
|
3724 | source: source
|
3725 | };
|
3726 | this.eventService.dispatchEvent(event);
|
3727 | };
|
3728 | ColumnController.prototype.setValueColumns = function (colKeys, source) {
|
3729 | if (source === void 0) { source = "api"; }
|
3730 | this.setPrimaryColumnList(colKeys, this.valueColumns, events_1.Events.EVENT_COLUMN_VALUE_CHANGED, this.setValueActive.bind(this), source);
|
3731 | };
|
3732 | ColumnController.prototype.setValueActive = function (active, column, source) {
|
3733 | if (active === column.isValueActive()) {
|
3734 | return;
|
3735 | }
|
3736 | column.setValueActive(active, source);
|
3737 | if (active && !column.getAggFunc()) {
|
3738 | var defaultAggFunc = this.aggFuncService.getDefaultAggFunc(column);
|
3739 | column.setAggFunc(defaultAggFunc);
|
3740 | }
|
3741 | };
|
3742 | ColumnController.prototype.addValueColumns = function (keys, source) {
|
3743 | if (source === void 0) { source = "api"; }
|
3744 | this.updatePrimaryColumnList(keys, this.valueColumns, true, this.setValueActive.bind(this, true), events_1.Events.EVENT_COLUMN_VALUE_CHANGED, source);
|
3745 | };
|
3746 | ColumnController.prototype.addValueColumn = function (colKey, source) {
|
3747 | if (source === void 0) { source = "api"; }
|
3748 | this.addValueColumns([colKey], source);
|
3749 | };
|
3750 | ColumnController.prototype.removeValueColumn = function (colKey, source) {
|
3751 | if (source === void 0) { source = "api"; }
|
3752 | this.removeValueColumns([colKey], source);
|
3753 | };
|
3754 | ColumnController.prototype.removeValueColumns = function (keys, source) {
|
3755 | if (source === void 0) { source = "api"; }
|
3756 | this.updatePrimaryColumnList(keys, this.valueColumns, false, this.setValueActive.bind(this, false), events_1.Events.EVENT_COLUMN_VALUE_CHANGED, source);
|
3757 | };
|
3758 |
|
3759 | ColumnController.prototype.normaliseColumnWidth = function (column, newWidth) {
|
3760 | if (newWidth < column.getMinWidth()) {
|
3761 | newWidth = column.getMinWidth();
|
3762 | }
|
3763 | if (column.isGreaterThanMax(newWidth)) {
|
3764 | newWidth = column.getMaxWidth();
|
3765 | }
|
3766 | return newWidth;
|
3767 | };
|
3768 | ColumnController.prototype.getPrimaryOrGridColumn = function (key) {
|
3769 | var column = this.getPrimaryColumn(key);
|
3770 | if (column) {
|
3771 | return column;
|
3772 | }
|
3773 | else {
|
3774 | return this.getGridColumn(key);
|
3775 | }
|
3776 | };
|
3777 | ColumnController.prototype.setColumnWidth = function (key, // @key - the column who's size we want to change
|
3778 | newWidth,
|
3779 | shiftKey,
|
3780 | finished,
|
3781 | source) {
|
3782 | if (source === void 0) { source = "api"; }
|
3783 | var col = this.getPrimaryOrGridColumn(key);
|
3784 | if (!col) {
|
3785 | return;
|
3786 | }
|
3787 | var sets = [];
|
3788 | sets.push({
|
3789 | width: newWidth,
|
3790 | ratios: [1],
|
3791 | columns: [col]
|
3792 | });
|
3793 |
|
3794 | var defaultIsShift = this.gridOptionsWrapper.getColResizeDefault() === 'shift';
|
3795 | if (defaultIsShift) {
|
3796 | shiftKey = !shiftKey;
|
3797 | }
|
3798 | if (shiftKey) {
|
3799 | var otherCol = this.getDisplayedColAfter(col);
|
3800 | if (!otherCol) {
|
3801 | return;
|
3802 | }
|
3803 | var widthDiff = col.getActualWidth() - newWidth;
|
3804 | var otherColWidth = otherCol.getActualWidth() + widthDiff;
|
3805 | sets.push({
|
3806 | width: otherColWidth,
|
3807 | ratios: [1],
|
3808 | columns: [otherCol]
|
3809 | });
|
3810 | }
|
3811 | this.resizeColumnSets(sets, finished, source);
|
3812 | };
|
3813 | ColumnController.prototype.checkMinAndMaxWidthsForSet = function (columnResizeSet) {
|
3814 | var columns = columnResizeSet.columns, width = columnResizeSet.width;
|
3815 |
|
3816 |
|
3817 | var minWidthAccumulated = 0;
|
3818 | var maxWidthAccumulated = 0;
|
3819 | var maxWidthActive = true;
|
3820 | columns.forEach(function (col) {
|
3821 | minWidthAccumulated += col.getMinWidth();
|
3822 | if (col.getMaxWidth() > 0) {
|
3823 | maxWidthAccumulated += col.getMaxWidth();
|
3824 | }
|
3825 | else {
|
3826 |
|
3827 |
|
3828 | maxWidthActive = false;
|
3829 | }
|
3830 | });
|
3831 | var minWidthPasses = width >= minWidthAccumulated;
|
3832 | var maxWidthPasses = !maxWidthActive || (width <= maxWidthAccumulated);
|
3833 | return minWidthPasses && maxWidthPasses;
|
3834 | };
|
3835 |
|
3836 |
|
3837 |
|
3838 |
|
3839 | ColumnController.prototype.resizeColumnSets = function (resizeSets, finished, source) {
|
3840 | var passMinMaxCheck = utils_1.Utils.every(resizeSets, this.checkMinAndMaxWidthsForSet.bind(this));
|
3841 | if (!passMinMaxCheck) {
|
3842 | return;
|
3843 | }
|
3844 | var changedCols = [];
|
3845 | var allCols = [];
|
3846 | resizeSets.forEach(function (set) {
|
3847 | var width = set.width, columns = set.columns, ratios = set.ratios;
|
3848 | // keep track of pixels used, and last column gets the remaining,
|
3849 | // to cater for rounding errors, and min width adjustments
|
3850 | var newWidths = {};
|
3851 | var finishedCols = {};
|
3852 | columns.forEach(function (col) { return allCols.push(col); });
|
3853 |
|
3854 |
|
3855 |
|
3856 |
|
3857 |
|
3858 |
|
3859 |
|
3860 |
|
3861 |
|
3862 |
|
3863 | var finishedColsGrew = true;
|
3864 | var loopCount = 0;
|
3865 | var _loop_2 = function () {
|
3866 | loopCount++;
|
3867 | if (loopCount > 1000) {
|
3868 |
|
3869 |
|
3870 | console.error('ag-Grid: infinite loop in resizeColumnSets');
|
3871 | return "break";
|
3872 | }
|
3873 | finishedColsGrew = false;
|
3874 | var subsetCols = [];
|
3875 | var subsetRatios = [];
|
3876 | var subsetRatioTotal = 0;
|
3877 | var pixelsToDistribute = width;
|
3878 | columns.forEach(function (col, index) {
|
3879 | var thisColFinished = finishedCols[col.getId()];
|
3880 | if (thisColFinished) {
|
3881 | pixelsToDistribute -= newWidths[col.getId()];
|
3882 | }
|
3883 | else {
|
3884 | subsetCols.push(col);
|
3885 | var ratioThisCol = ratios[index];
|
3886 | subsetRatioTotal += ratioThisCol;
|
3887 | subsetRatios.push(ratioThisCol);
|
3888 | }
|
3889 | });
|
3890 |
|
3891 |
|
3892 |
|
3893 | var ratioScale = 1 / subsetRatioTotal;
|
3894 | subsetCols.forEach(function (col, index) {
|
3895 | var lastCol = index === (subsetCols.length - 1);
|
3896 | var colNewWidth;
|
3897 | if (lastCol) {
|
3898 | colNewWidth = pixelsToDistribute;
|
3899 | }
|
3900 | else {
|
3901 | colNewWidth = Math.round(ratios[index] * width * ratioScale);
|
3902 | pixelsToDistribute -= colNewWidth;
|
3903 | }
|
3904 | if (colNewWidth < col.getMinWidth()) {
|
3905 | colNewWidth = col.getMinWidth();
|
3906 | finishedCols[col.getId()] = true;
|
3907 | finishedColsGrew = true;
|
3908 | }
|
3909 | else if (col.getMaxWidth() > 0 && colNewWidth > col.getMaxWidth()) {
|
3910 | colNewWidth = col.getMaxWidth();
|
3911 | finishedCols[col.getId()] = true;
|
3912 | finishedColsGrew = true;
|
3913 | }
|
3914 | newWidths[col.getId()] = colNewWidth;
|
3915 | });
|
3916 | };
|
3917 | while (finishedColsGrew) {
|
3918 | var state_1 = _loop_2();
|
3919 | if (state_1 === "break")
|
3920 | break;
|
3921 | }
|
3922 | columns.forEach(function (col) {
|
3923 | var newWidth = newWidths[col.getId()];
|
3924 | if (col.getActualWidth() !== newWidth) {
|
3925 | col.setActualWidth(newWidth);
|
3926 | changedCols.push(col);
|
3927 | }
|
3928 | });
|
3929 | });
|
3930 |
|
3931 | var atLeastOneColChanged = changedCols.length > 0;
|
3932 | if (atLeastOneColChanged) {
|
3933 | this.setLeftValues(source);
|
3934 | this.updateBodyWidths();
|
3935 | this.checkDisplayedVirtualColumns();
|
3936 | }
|
3937 |
|
3938 |
|
3939 |
|
3940 |
|
3941 |
|
3942 | if (atLeastOneColChanged || finished) {
|
3943 | var event_3 = {
|
3944 | type: events_1.Events.EVENT_COLUMN_RESIZED,
|
3945 | columns: allCols,
|
3946 | column: allCols.length === 1 ? allCols[0] : null,
|
3947 | finished: finished,
|
3948 | api: this.gridApi,
|
3949 | columnApi: this.columnApi,
|
3950 | source: source
|
3951 | };
|
3952 | this.eventService.dispatchEvent(event_3);
|
3953 | }
|
3954 | };
|
3955 | ColumnController.prototype.setColumnAggFunc = function (column, aggFunc, source) {
|
3956 | if (source === void 0) { source = "api"; }
|
3957 | column.setAggFunc(aggFunc);
|
3958 | var event = {
|
3959 | type: events_1.Events.EVENT_COLUMN_VALUE_CHANGED,
|
3960 | columns: [column],
|
3961 | column: column,
|
3962 | api: this.gridApi,
|
3963 | columnApi: this.columnApi,
|
3964 | source: source
|
3965 | };
|
3966 | this.eventService.dispatchEvent(event);
|
3967 | };
|
3968 | ColumnController.prototype.moveRowGroupColumn = function (fromIndex, toIndex, source) {
|
3969 | if (source === void 0) { source = "api"; }
|
3970 | var column = this.rowGroupColumns[fromIndex];
|
3971 | this.rowGroupColumns.splice(fromIndex, 1);
|
3972 | this.rowGroupColumns.splice(toIndex, 0, column);
|
3973 | var event = {
|
3974 | type: events_1.Events.EVENT_COLUMN_ROW_GROUP_CHANGED,
|
3975 | columns: this.rowGroupColumns,
|
3976 | column: this.rowGroupColumns.length === 1 ? this.rowGroupColumns[0] : null,
|
3977 | api: this.gridApi,
|
3978 | columnApi: this.columnApi,
|
3979 | source: source
|
3980 | };
|
3981 | this.eventService.dispatchEvent(event);
|
3982 | };
|
3983 | ColumnController.prototype.moveColumns = function (columnsToMoveKeys, toIndex, source) {
|
3984 | if (source === void 0) { source = "api"; }
|
3985 | this.columnAnimationService.start();
|
3986 | if (toIndex > this.gridColumns.length - columnsToMoveKeys.length) {
|
3987 | console.warn('ag-Grid: tried to insert columns in invalid location, toIndex = ' + toIndex);
|
3988 | console.warn('ag-Grid: remember that you should not count the moving columns when calculating the new index');
|
3989 | return;
|
3990 | }
|
3991 |
|
3992 | var columnsToMove = this.getGridColumns(columnsToMoveKeys);
|
3993 | var failedRules = !this.doesMovePassRules(columnsToMove, toIndex);
|
3994 | if (failedRules) {
|
3995 | return;
|
3996 | }
|
3997 | utils_1.Utils.moveInArray(this.gridColumns, columnsToMove, toIndex);
|
3998 | this.updateDisplayedColumns(source);
|
3999 | var event = {
|
4000 | type: events_1.Events.EVENT_COLUMN_MOVED,
|
4001 | columns: columnsToMove,
|
4002 | column: columnsToMove.length === 1 ? columnsToMove[0] : null,
|
4003 | toIndex: toIndex,
|
4004 | api: this.gridApi,
|
4005 | columnApi: this.columnApi,
|
4006 | source: source
|
4007 | };
|
4008 | this.eventService.dispatchEvent(event);
|
4009 | this.columnAnimationService.finish();
|
4010 | };
|
4011 | ColumnController.prototype.doesMovePassRules = function (columnsToMove, toIndex) {
|
4012 |
|
4013 | var proposedColumnOrder = this.gridColumns.slice();
|
4014 | utils_1.Utils.moveInArray(proposedColumnOrder, columnsToMove, toIndex);
|
4015 |
|
4016 | if (!this.doesMovePassMarryChildren(proposedColumnOrder)) {
|
4017 | return false;
|
4018 | }
|
4019 | if (!this.doesMovePassLockedPositions(proposedColumnOrder)) {
|
4020 | return false;
|
4021 | }
|
4022 | return true;
|
4023 | };
|
4024 | ColumnController.prototype.doesMovePassLockedPositions = function (proposedColumnOrder) {
|
4025 | var foundNonLocked = false;
|
4026 | var rulePassed = true;
|
4027 |
|
4028 | proposedColumnOrder.forEach(function (col) {
|
4029 | if (col.isLockPosition()) {
|
4030 | if (foundNonLocked) {
|
4031 | rulePassed = false;
|
4032 | }
|
4033 | }
|
4034 | else {
|
4035 | foundNonLocked = true;
|
4036 | }
|
4037 | });
|
4038 | return rulePassed;
|
4039 | };
|
4040 | ColumnController.prototype.doesMovePassMarryChildren = function (allColumnsCopy) {
|
4041 | var rulePassed = true;
|
4042 | this.columnUtils.depthFirstOriginalTreeSearch(this.gridBalancedTree, function (child) {
|
4043 | if (!(child instanceof originalColumnGroup_1.OriginalColumnGroup)) {
|
4044 | return;
|
4045 | }
|
4046 | var columnGroup = child;
|
4047 | var marryChildren = columnGroup.getColGroupDef() && columnGroup.getColGroupDef().marryChildren;
|
4048 | if (!marryChildren) {
|
4049 | return;
|
4050 | }
|
4051 | var newIndexes = [];
|
4052 | columnGroup.getLeafColumns().forEach(function (col) {
|
4053 | var newColIndex = allColumnsCopy.indexOf(col);
|
4054 | newIndexes.push(newColIndex);
|
4055 | });
|
4056 | var maxIndex = Math.max.apply(Math, newIndexes);
|
4057 | var minIndex = Math.min.apply(Math, newIndexes);
|
4058 |
|
4059 | var spread = maxIndex - minIndex;
|
4060 | var maxSpread = columnGroup.getLeafColumns().length - 1;
|
4061 |
|
4062 | if (spread > maxSpread) {
|
4063 | rulePassed = false;
|
4064 | }
|
4065 |
|
4066 |
|
4067 | });
|
4068 | return rulePassed;
|
4069 | };
|
4070 | ColumnController.prototype.moveColumn = function (key, toIndex, source) {
|
4071 | if (source === void 0) { source = "api"; }
|
4072 | this.moveColumns([key], toIndex, source);
|
4073 | };
|
4074 | ColumnController.prototype.moveColumnByIndex = function (fromIndex, toIndex, source) {
|
4075 | if (source === void 0) { source = "api"; }
|
4076 | var column = this.gridColumns[fromIndex];
|
4077 | this.moveColumn(column, toIndex, source);
|
4078 | };
|
4079 |
|
4080 |
|
4081 |
|
4082 |
|
4083 | ColumnController.prototype.getBodyContainerWidth = function () {
|
4084 | return this.bodyWidth;
|
4085 | };
|
4086 | ColumnController.prototype.getContainerWidth = function (pinned) {
|
4087 | switch (pinned) {
|
4088 | case column_1.Column.PINNED_LEFT: return this.leftWidth;
|
4089 | case column_1.Column.PINNED_RIGHT: return this.rightWidth;
|
4090 | default: return this.bodyWidth;
|
4091 | }
|
4092 | };
|
4093 |
|
4094 | ColumnController.prototype.updateBodyWidths = function () {
|
4095 | var newBodyWidth = this.getWidthOfColsInList(this.displayedCenterColumns);
|
4096 | var newLeftWidth = this.getWidthOfColsInList(this.displayedLeftColumns);
|
4097 | var newRightWidth = this.getWidthOfColsInList(this.displayedRightColumns);
|
4098 |
|
4099 |
|
4100 | this.bodyWidthDirty = this.bodyWidth !== newBodyWidth;
|
4101 | var atLeastOneChanged = this.bodyWidth !== newBodyWidth || this.leftWidth !== newLeftWidth || this.rightWidth !== newRightWidth;
|
4102 | if (atLeastOneChanged) {
|
4103 | this.bodyWidth = newBodyWidth;
|
4104 | this.leftWidth = newLeftWidth;
|
4105 | this.rightWidth = newRightWidth;
|
4106 |
|
4107 |
|
4108 | var event_4 = {
|
4109 | type: events_1.Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,
|
4110 | api: this.gridApi,
|
4111 | columnApi: this.columnApi
|
4112 | };
|
4113 | this.eventService.dispatchEvent(event_4);
|
4114 | }
|
4115 | };
|
4116 |
|
4117 | ColumnController.prototype.getValueColumns = function () {
|
4118 | return this.valueColumns ? this.valueColumns : [];
|
4119 | };
|
4120 |
|
4121 | ColumnController.prototype.getPivotColumns = function () {
|
4122 | return this.pivotColumns ? this.pivotColumns : [];
|
4123 | };
|
4124 |
|
4125 | ColumnController.prototype.isPivotActive = function () {
|
4126 | return this.pivotColumns && this.pivotColumns.length > 0 && this.pivotMode;
|
4127 | };
|
4128 |
|
4129 | ColumnController.prototype.getRowGroupColumns = function () {
|
4130 | return this.rowGroupColumns ? this.rowGroupColumns : [];
|
4131 | };
|
4132 |
|
4133 | ColumnController.prototype.getDisplayedCenterColumns = function () {
|
4134 | return this.displayedCenterColumns;
|
4135 | };
|
4136 |
|
4137 | ColumnController.prototype.getDisplayedLeftColumns = function () {
|
4138 | return this.displayedLeftColumns;
|
4139 | };
|
4140 | ColumnController.prototype.getDisplayedRightColumns = function () {
|
4141 | return this.displayedRightColumns;
|
4142 | };
|
4143 | ColumnController.prototype.getDisplayedColumns = function (type) {
|
4144 | switch (type) {
|
4145 | case column_1.Column.PINNED_LEFT: return this.getDisplayedLeftColumns();
|
4146 | case column_1.Column.PINNED_RIGHT: return this.getDisplayedRightColumns();
|
4147 | default: return this.getDisplayedCenterColumns();
|
4148 | }
|
4149 | };
|
4150 |
|
4151 |
|
4152 |
|
4153 | ColumnController.prototype.getAllPrimaryColumns = function () {
|
4154 | return this.primaryColumns;
|
4155 | };
|
4156 | ColumnController.prototype.getAllColumnsForQuickFilter = function () {
|
4157 | return this.columnsForQuickFilter;
|
4158 | };
|
4159 |
|
4160 | ColumnController.prototype.getAllGridColumns = function () {
|
4161 | return this.gridColumns;
|
4162 | };
|
4163 | ColumnController.prototype.isEmpty = function () {
|
4164 | return utils_1.Utils.missingOrEmpty(this.gridColumns);
|
4165 | };
|
4166 | ColumnController.prototype.isRowGroupEmpty = function () {
|
4167 | return utils_1.Utils.missingOrEmpty(this.rowGroupColumns);
|
4168 | };
|
4169 | ColumnController.prototype.setColumnVisible = function (key, visible, source) {
|
4170 | if (source === void 0) { source = "api"; }
|
4171 | this.setColumnsVisible([key], visible, source);
|
4172 | };
|
4173 | ColumnController.prototype.setColumnsVisible = function (keys, visible, source) {
|
4174 | var _this = this;
|
4175 | if (source === void 0) { source = "api"; }
|
4176 | this.columnAnimationService.start();
|
4177 | this.actionOnGridColumns(keys, function (column) {
|
4178 | if (column.isVisible() !== visible) {
|
4179 | column.setVisible(visible, source);
|
4180 | return true;
|
4181 | }
|
4182 | else {
|
4183 | return false;
|
4184 | }
|
4185 | }, source, function () {
|
4186 | var event = {
|
4187 | type: events_1.Events.EVENT_COLUMN_VISIBLE,
|
4188 | visible: visible,
|
4189 | column: null,
|
4190 | columns: null,
|
4191 | api: _this.gridApi,
|
4192 | columnApi: _this.columnApi,
|
4193 | source: source
|
4194 | };
|
4195 | return event;
|
4196 | });
|
4197 | this.columnAnimationService.finish();
|
4198 | };
|
4199 | ColumnController.prototype.setColumnPinned = function (key, pinned, source) {
|
4200 | if (source === void 0) { source = "api"; }
|
4201 | this.setColumnsPinned([key], pinned, source);
|
4202 | };
|
4203 | ColumnController.prototype.setColumnsPinned = function (keys, pinned, source) {
|
4204 | var _this = this;
|
4205 | if (source === void 0) { source = "api"; }
|
4206 | this.columnAnimationService.start();
|
4207 | var actualPinned;
|
4208 | if (pinned === true || pinned === column_1.Column.PINNED_LEFT) {
|
4209 | actualPinned = column_1.Column.PINNED_LEFT;
|
4210 | }
|
4211 | else if (pinned === column_1.Column.PINNED_RIGHT) {
|
4212 | actualPinned = column_1.Column.PINNED_RIGHT;
|
4213 | }
|
4214 | else {
|
4215 | actualPinned = null;
|
4216 | }
|
4217 | this.actionOnGridColumns(keys, function (col) {
|
4218 | if (col.getPinned() !== actualPinned) {
|
4219 | col.setPinned(actualPinned);
|
4220 | return true;
|
4221 | }
|
4222 | else {
|
4223 | return false;
|
4224 | }
|
4225 | }, source, function () {
|
4226 | var event = {
|
4227 | type: events_1.Events.EVENT_COLUMN_PINNED,
|
4228 | pinned: actualPinned,
|
4229 | column: null,
|
4230 | columns: null,
|
4231 | api: _this.gridApi,
|
4232 | columnApi: _this.columnApi,
|
4233 | source: source
|
4234 | };
|
4235 | return event;
|
4236 | });
|
4237 | this.columnAnimationService.finish();
|
4238 | };
|
4239 |
|
4240 |
|
4241 |
|
4242 |
|
4243 | ColumnController.prototype.actionOnGridColumns = function (// the column keys this action will be on
|
4244 | keys,
|
4245 | // the action to do - if this returns false, the column was skipped
|
4246 | // and won't be included in the event
|
4247 | action,
|
4248 |
|
4249 | source, createEvent) {
|
4250 | var _this = this;
|
4251 | if (utils_1.Utils.missingOrEmpty(keys)) {
|
4252 | return;
|
4253 | }
|
4254 | var updatedColumns = [];
|
4255 | keys.forEach(function (key) {
|
4256 | var column = _this.getGridColumn(key);
|
4257 | if (!column) {
|
4258 | return;
|
4259 | }
|
4260 |
|
4261 |
|
4262 | var resultOfAction = action(column);
|
4263 | if (resultOfAction !== false) {
|
4264 | updatedColumns.push(column);
|
4265 | }
|
4266 | });
|
4267 | if (updatedColumns.length === 0) {
|
4268 | return;
|
4269 | }
|
4270 | this.updateDisplayedColumns(source);
|
4271 | if (utils_1.Utils.exists(createEvent)) {
|
4272 | var event_5 = createEvent();
|
4273 | event_5.columns = updatedColumns;
|
4274 | event_5.column = updatedColumns.length === 1 ? updatedColumns[0] : null;
|
4275 | this.eventService.dispatchEvent(event_5);
|
4276 | }
|
4277 | };
|
4278 | ColumnController.prototype.getDisplayedColBefore = function (col) {
|
4279 | var allDisplayedColumns = this.getAllDisplayedColumns();
|
4280 | var oldIndex = allDisplayedColumns.indexOf(col);
|
4281 | if (oldIndex > 0) {
|
4282 | return allDisplayedColumns[oldIndex - 1];
|
4283 | }
|
4284 | else {
|
4285 | return null;
|
4286 | }
|
4287 | };
|
4288 |
|
4289 |
|
4290 | ColumnController.prototype.getDisplayedColAfter = function (col) {
|
4291 | var allDisplayedColumns = this.getAllDisplayedColumns();
|
4292 | var oldIndex = allDisplayedColumns.indexOf(col);
|
4293 | if (oldIndex < (allDisplayedColumns.length - 1)) {
|
4294 | return allDisplayedColumns[oldIndex + 1];
|
4295 | }
|
4296 | else {
|
4297 | return null;
|
4298 | }
|
4299 | };
|
4300 | ColumnController.prototype.getDisplayedGroupAfter = function (columnGroup) {
|
4301 |
|
4302 | var col = columnGroup.getDisplayedLeafColumns()[0];
|
4303 | var requiredLevel = columnGroup.getOriginalColumnGroup().getLevel();
|
4304 | while (true) {
|
4305 |
|
4306 | col = this.getDisplayedColAfter(col);
|
4307 |
|
4308 | if (!col) {
|
4309 | return null;
|
4310 | }
|
4311 |
|
4312 | var groupPointer = col.getParent();
|
4313 | while (groupPointer.getOriginalColumnGroup().getLevel() !== requiredLevel) {
|
4314 | groupPointer = groupPointer.getParent();
|
4315 | }
|
4316 | if (groupPointer !== columnGroup) {
|
4317 | return groupPointer;
|
4318 | }
|
4319 | }
|
4320 | };
|
4321 | ColumnController.prototype.isPinningLeft = function () {
|
4322 | return this.displayedLeftColumns.length > 0;
|
4323 | };
|
4324 | ColumnController.prototype.isPinningRight = function () {
|
4325 | return this.displayedRightColumns.length > 0;
|
4326 | };
|
4327 | ColumnController.prototype.getPrimaryAndSecondaryAndAutoColumns = function () {
|
4328 | var result = this.primaryColumns ? this.primaryColumns.slice(0) : [];
|
4329 | if (utils_1.Utils.exists(this.groupAutoColumns)) {
|
4330 | this.groupAutoColumns.forEach(function (col) { return result.push(col); });
|
4331 | }
|
4332 | if (this.secondaryColumnsPresent) {
|
4333 | this.secondaryColumns.forEach(function (column) { return result.push(column); });
|
4334 | }
|
4335 | return result;
|
4336 | };
|
4337 | ColumnController.prototype.createStateItemFromColumn = function (column) {
|
4338 | var rowGroupIndex = column.isRowGroupActive() ? this.rowGroupColumns.indexOf(column) : null;
|
4339 | var pivotIndex = column.isPivotActive() ? this.pivotColumns.indexOf(column) : null;
|
4340 | var aggFunc = column.isValueActive() ? column.getAggFunc() : null;
|
4341 | return {
|
4342 | colId: column.getColId(),
|
4343 | hide: !column.isVisible(),
|
4344 | aggFunc: aggFunc,
|
4345 | width: column.getActualWidth(),
|
4346 | pivotIndex: pivotIndex,
|
4347 | pinned: column.getPinned(),
|
4348 | rowGroupIndex: rowGroupIndex
|
4349 | };
|
4350 | };
|
4351 | ColumnController.prototype.getColumnState = function () {
|
4352 | if (utils_1.Utils.missing(this.primaryColumns)) {
|
4353 | return [];
|
4354 | }
|
4355 | var columnStateList = this.primaryColumns.map(this.createStateItemFromColumn.bind(this));
|
4356 | if (!this.pivotMode) {
|
4357 | this.orderColumnStateList(columnStateList);
|
4358 | }
|
4359 | return columnStateList;
|
4360 | };
|
4361 | ColumnController.prototype.orderColumnStateList = function (columnStateList) {
|
4362 | var gridColumnIds = this.gridColumns.map(function (column) { return column.getColId(); });
|
4363 | columnStateList.sort(function (itemA, itemB) {
|
4364 | var posA = gridColumnIds.indexOf(itemA.colId);
|
4365 | var posB = gridColumnIds.indexOf(itemB.colId);
|
4366 | return posA - posB;
|
4367 | });
|
4368 | };
|
4369 | ColumnController.prototype.resetColumnState = function (source) {
|
4370 | if (source === void 0) { source = "api"; }
|
4371 |
|
4372 | var primaryColumns = this.getColumnsFromTree(this.primaryBalancedTree);
|
4373 | var state = [];
|
4374 | if (primaryColumns) {
|
4375 | primaryColumns.forEach(function (column) {
|
4376 | state.push({
|
4377 | colId: column.getColId(),
|
4378 | aggFunc: column.getColDef().aggFunc,
|
4379 | hide: column.getColDef().hide,
|
4380 | pinned: column.getColDef().pinned,
|
4381 | rowGroupIndex: column.getColDef().rowGroupIndex,
|
4382 | pivotIndex: column.getColDef().pivotIndex,
|
4383 | width: column.getColDef().width
|
4384 | });
|
4385 | });
|
4386 | }
|
4387 | this.setColumnState(state, source);
|
4388 | };
|
4389 | ColumnController.prototype.setColumnState = function (columnState, source) {
|
4390 | var _this = this;
|
4391 | if (source === void 0) { source = "api"; }
|
4392 | if (utils_1.Utils.missingOrEmpty(this.primaryColumns)) {
|
4393 | return false;
|
4394 | }
|
4395 | this.autoGroupsNeedBuilding = true;
|
4396 |
|
4397 | var columnsWithNoState = this.primaryColumns.slice();
|
4398 | this.rowGroupColumns = [];
|
4399 | this.valueColumns = [];
|
4400 | this.pivotColumns = [];
|
4401 | var success = true;
|
4402 | var rowGroupIndexes = {};
|
4403 | var pivotIndexes = {};
|
4404 | if (columnState) {
|
4405 | columnState.forEach(function (stateItem) {
|
4406 | var column = _this.getPrimaryColumn(stateItem.colId);
|
4407 | if (!column) {
|
4408 | console.warn('ag-grid: column ' + stateItem.colId + ' not found');
|
4409 | success = false;
|
4410 | }
|
4411 | else {
|
4412 | _this.syncColumnWithStateItem(column, stateItem, rowGroupIndexes, pivotIndexes, source);
|
4413 | utils_1.Utils.removeFromArray(columnsWithNoState, column);
|
4414 | }
|
4415 | });
|
4416 | }
|
4417 |
|
4418 | columnsWithNoState.forEach(this.syncColumnWithNoState.bind(this));
|
4419 |
|
4420 | this.rowGroupColumns.sort(this.sortColumnListUsingIndexes.bind(this, rowGroupIndexes));
|
4421 | this.pivotColumns.sort(this.sortColumnListUsingIndexes.bind(this, pivotIndexes));
|
4422 | this.updateGridColumns();
|
4423 | if (columnState) {
|
4424 | var orderOfColIds_1 = columnState.map(function (stateItem) { return stateItem.colId; });
|
4425 | this.gridColumns.sort(function (colA, colB) {
|
4426 | var indexA = orderOfColIds_1.indexOf(colA.getId());
|
4427 | var indexB = orderOfColIds_1.indexOf(colB.getId());
|
4428 | return indexA - indexB;
|
4429 | });
|
4430 | }
|
4431 | this.updateDisplayedColumns(source);
|
4432 | var event = {
|
4433 | type: events_1.Events.EVENT_COLUMN_EVERYTHING_CHANGED,
|
4434 | api: this.gridApi,
|
4435 | columnApi: this.columnApi,
|
4436 | source: source
|
4437 | };
|
4438 | this.eventService.dispatchEvent(event);
|
4439 | return success;
|
4440 | };
|
4441 | ColumnController.prototype.sortColumnListUsingIndexes = function (indexes, colA, colB) {
|
4442 | var indexA = indexes[colA.getId()];
|
4443 | var indexB = indexes[colB.getId()];
|
4444 | return indexA - indexB;
|
4445 | };
|
4446 | ColumnController.prototype.syncColumnWithNoState = function (column, source) {
|
4447 | column.setVisible(false, source);
|
4448 | column.setAggFunc(null);
|
4449 | column.setPinned(null);
|
4450 | column.setRowGroupActive(false, source);
|
4451 | column.setPivotActive(false, source);
|
4452 | column.setValueActive(false, source);
|
4453 | };
|
4454 | ColumnController.prototype.syncColumnWithStateItem = function (column, stateItem, rowGroupIndexes, pivotIndexes, source) {
|
4455 |
|
4456 | column.setVisible(!stateItem.hide, source);
|
4457 |
|
4458 | column.setPinned(stateItem.pinned);
|
4459 |
|
4460 | if (stateItem.width >= this.gridOptionsWrapper.getMinColWidth()) {
|
4461 | column.setActualWidth(stateItem.width, source);
|
4462 | }
|
4463 | if (typeof stateItem.aggFunc === 'string') {
|
4464 | column.setAggFunc(stateItem.aggFunc);
|
4465 | column.setValueActive(true, source);
|
4466 | this.valueColumns.push(column);
|
4467 | }
|
4468 | else {
|
4469 | if (utils_1.Utils.exists(stateItem.aggFunc)) {
|
4470 | console.warn('ag-Grid: stateItem.aggFunc must be a string. if using your own aggregation ' +
|
4471 | 'functions, register the functions first before using them in get/set state. This is because it is' +
|
4472 | 'intended for the column state to be stored and retrieved as simple JSON.');
|
4473 | }
|
4474 | column.setAggFunc(null);
|
4475 | column.setValueActive(false, source);
|
4476 | }
|
4477 | if (typeof stateItem.rowGroupIndex === 'number') {
|
4478 | this.rowGroupColumns.push(column);
|
4479 | column.setRowGroupActive(true, source);
|
4480 | rowGroupIndexes[column.getId()] = stateItem.rowGroupIndex;
|
4481 | }
|
4482 | else {
|
4483 | column.setRowGroupActive(false, source);
|
4484 | }
|
4485 | if (typeof stateItem.pivotIndex === 'number') {
|
4486 | this.pivotColumns.push(column);
|
4487 | column.setPivotActive(true, source);
|
4488 | pivotIndexes[column.getId()] = stateItem.pivotIndex;
|
4489 | }
|
4490 | else {
|
4491 | column.setPivotActive(false, source);
|
4492 | }
|
4493 | };
|
4494 | ColumnController.prototype.getGridColumns = function (keys) {
|
4495 | return this.getColumns(keys, this.getGridColumn.bind(this));
|
4496 | };
|
4497 | ColumnController.prototype.getColumns = function (keys, columnLookupCallback) {
|
4498 | var foundColumns = [];
|
4499 | if (keys) {
|
4500 | keys.forEach(function (key) {
|
4501 | var column = columnLookupCallback(key);
|
4502 | if (column) {
|
4503 | foundColumns.push(column);
|
4504 | }
|
4505 | });
|
4506 | }
|
4507 | return foundColumns;
|
4508 | };
|
4509 |
|
4510 | ColumnController.prototype.getColumnWithValidation = function (key) {
|
4511 | var column = this.getPrimaryColumn(key);
|
4512 | if (!column) {
|
4513 | console.warn('ag-Grid: could not find column ' + column);
|
4514 | }
|
4515 | return column;
|
4516 | };
|
4517 | ColumnController.prototype.getPrimaryColumn = function (key) {
|
4518 | return this.getColumn(key, this.primaryColumns);
|
4519 | };
|
4520 | ColumnController.prototype.getGridColumn = function (key) {
|
4521 | return this.getColumn(key, this.gridColumns);
|
4522 | };
|
4523 | ColumnController.prototype.getColumn = function (key, columnList) {
|
4524 | if (!key) {
|
4525 | return null;
|
4526 | }
|
4527 | for (var i = 0; i < columnList.length; i++) {
|
4528 | if (this.columnsMatch(columnList[i], key)) {
|
4529 | return columnList[i];
|
4530 | }
|
4531 | }
|
4532 | return this.getAutoColumn(key);
|
4533 | };
|
4534 | ColumnController.prototype.getAutoColumn = function (key) {
|
4535 | var _this = this;
|
4536 | if (!utils_1.Utils.exists(this.groupAutoColumns) || utils_1.Utils.missing(this.groupAutoColumns)) {
|
4537 | return null;
|
4538 | }
|
4539 | return utils_1.Utils.find(this.groupAutoColumns, function (groupCol) {
|
4540 | return _this.columnsMatch(groupCol, key);
|
4541 | });
|
4542 | };
|
4543 | ColumnController.prototype.columnsMatch = function (column, key) {
|
4544 | var columnMatches = column === key;
|
4545 | var colDefMatches = column.getColDef() === key;
|
4546 | var idMatches = column.getColId() == key;
|
4547 | return columnMatches || colDefMatches || idMatches;
|
4548 | };
|
4549 | ColumnController.prototype.getDisplayNameForColumn = function (column, location, includeAggFunc) {
|
4550 | if (includeAggFunc === void 0) { includeAggFunc = false; }
|
4551 | var headerName = this.getHeaderName(column.getColDef(), column, null, null, location);
|
4552 | if (includeAggFunc) {
|
4553 | return this.wrapHeaderNameWithAggFunc(column, headerName);
|
4554 | }
|
4555 | else {
|
4556 | return headerName;
|
4557 | }
|
4558 | };
|
4559 | ColumnController.prototype.getDisplayNameForOriginalColumnGroup = function (columnGroup, originalColumnGroup, location) {
|
4560 | var colGroupDef = originalColumnGroup.getColGroupDef();
|
4561 | if (colGroupDef) {
|
4562 | return this.getHeaderName(colGroupDef, null, columnGroup, originalColumnGroup, location);
|
4563 | }
|
4564 | else {
|
4565 | return null;
|
4566 | }
|
4567 | };
|
4568 | ColumnController.prototype.getDisplayNameForColumnGroup = function (columnGroup, location) {
|
4569 | return this.getDisplayNameForOriginalColumnGroup(columnGroup, columnGroup.getOriginalColumnGroup(), location);
|
4570 | };
|
4571 |
|
4572 | ColumnController.prototype.getHeaderName = function (colDef, column, columnGroup, originalColumnGroup, location) {
|
4573 | var headerValueGetter = colDef.headerValueGetter;
|
4574 | if (headerValueGetter) {
|
4575 | var params = {
|
4576 | colDef: colDef,
|
4577 | column: column,
|
4578 | columnGroup: columnGroup,
|
4579 | originalColumnGroup: originalColumnGroup,
|
4580 | location: location,
|
4581 | api: this.gridOptionsWrapper.getApi(),
|
4582 | context: this.gridOptionsWrapper.getContext()
|
4583 | };
|
4584 | if (typeof headerValueGetter === 'function') {
|
4585 |
|
4586 | return headerValueGetter(params);
|
4587 | }
|
4588 | else if (typeof headerValueGetter === 'string') {
|
4589 |
|
4590 | return this.expressionService.evaluate(headerValueGetter, params);
|
4591 | }
|
4592 | else {
|
4593 | console.warn('ag-grid: headerValueGetter must be a function or a string');
|
4594 | return '';
|
4595 | }
|
4596 | }
|
4597 | else if (colDef.headerName != null) {
|
4598 | return colDef.headerName;
|
4599 | }
|
4600 | else if (colDef.field) {
|
4601 | return utils_1.Utils.camelCaseToHumanText(colDef.field);
|
4602 | }
|
4603 | else {
|
4604 | return '';
|
4605 | }
|
4606 | };
|
4607 | |
4608 |
|
4609 |
|
4610 |
|
4611 |
|
4612 |
|
4613 |
|
4614 |
|
4615 |
|
4616 |
|
4617 |
|
4618 |
|
4619 |
|
4620 |
|
4621 |
|
4622 |
|
4623 |
|
4624 |
|
4625 |
|
4626 |
|
4627 |
|
4628 |
|
4629 |
|
4630 |
|
4631 |
|
4632 |
|
4633 |
|
4634 |
|
4635 | ColumnController.prototype.wrapHeaderNameWithAggFunc = function (column, headerName) {
|
4636 | if (this.gridOptionsWrapper.isSuppressAggFuncInHeader()) {
|
4637 | return headerName;
|
4638 | }
|
4639 |
|
4640 | var pivotValueColumn = column.getColDef().pivotValueColumn;
|
4641 | var pivotActiveOnThisColumn = utils_1.Utils.exists(pivotValueColumn);
|
4642 | var aggFunc = null;
|
4643 | var aggFuncFound;
|
4644 |
|
4645 | if (pivotActiveOnThisColumn) {
|
4646 | aggFunc = pivotValueColumn.getAggFunc();
|
4647 | aggFuncFound = true;
|
4648 | }
|
4649 | else {
|
4650 | var measureActive = column.isValueActive();
|
4651 | var aggregationPresent = this.pivotMode || !this.isRowGroupEmpty();
|
4652 | if (measureActive && aggregationPresent) {
|
4653 | aggFunc = column.getAggFunc();
|
4654 | aggFuncFound = true;
|
4655 | }
|
4656 | else {
|
4657 | aggFuncFound = false;
|
4658 | }
|
4659 | }
|
4660 | if (aggFuncFound) {
|
4661 | var aggFuncString = (typeof aggFunc === 'string') ? aggFunc : 'func';
|
4662 | var localeTextFunc = this.gridOptionsWrapper.getLocaleTextFunc();
|
4663 | var aggFuncStringTranslated = localeTextFunc(aggFuncString, aggFuncString);
|
4664 | return aggFuncStringTranslated + "(" + headerName + ")";
|
4665 | }
|
4666 | else {
|
4667 | return headerName;
|
4668 | }
|
4669 | };
|
4670 |
|
4671 |
|
4672 | ColumnController.prototype.getColumnGroup = function (colId, instanceId) {
|
4673 | if (!colId) {
|
4674 | return null;
|
4675 | }
|
4676 | if (colId instanceof columnGroup_1.ColumnGroup) {
|
4677 | return colId;
|
4678 | }
|
4679 | var allColumnGroups = this.getAllDisplayedColumnGroups();
|
4680 | var checkInstanceId = typeof instanceId === 'number';
|
4681 | var result = null;
|
4682 | this.columnUtils.depthFirstAllColumnTreeSearch(allColumnGroups, function (child) {
|
4683 | if (child instanceof columnGroup_1.ColumnGroup) {
|
4684 | var columnGroup = child;
|
4685 | var matched = void 0;
|
4686 | if (checkInstanceId) {
|
4687 | matched = colId === columnGroup.getGroupId() && instanceId === columnGroup.getInstanceId();
|
4688 | }
|
4689 | else {
|
4690 | matched = colId === columnGroup.getGroupId();
|
4691 | }
|
4692 | if (matched) {
|
4693 | result = columnGroup;
|
4694 | }
|
4695 | }
|
4696 | });
|
4697 | return result;
|
4698 | };
|
4699 | ColumnController.prototype.setColumnDefs = function (columnDefs, source) {
|
4700 | if (source === void 0) { source = "api"; }
|
4701 |
|
4702 |
|
4703 | this.valueCache.expire();
|
4704 |
|
4705 |
|
4706 |
|
4707 | this.autoGroupsNeedBuilding = true;
|
4708 | var balancedTreeResult = this.balancedColumnTreeBuilder.createBalancedColumnGroups(columnDefs, true);
|
4709 | this.primaryBalancedTree = balancedTreeResult.balancedTree;
|
4710 | this.primaryHeaderRowCount = balancedTreeResult.treeDept + 1;
|
4711 | this.primaryColumns = this.getColumnsFromTree(this.primaryBalancedTree);
|
4712 | this.autoRowHeightColumns = this.primaryColumns.filter(function (col) { return col.getColDef().autoHeight; });
|
4713 | this.extractRowGroupColumns(source);
|
4714 | this.extractPivotColumns(source);
|
4715 | this.createValueColumns(source);
|
4716 | this.updateGridColumns();
|
4717 | this.updateDisplayedColumns(source);
|
4718 | this.checkDisplayedVirtualColumns();
|
4719 | this.ready = true;
|
4720 | var eventEverythingChanged = {
|
4721 | type: events_1.Events.EVENT_COLUMN_EVERYTHING_CHANGED,
|
4722 | api: this.gridApi,
|
4723 | columnApi: this.columnApi,
|
4724 | source: source
|
4725 | };
|
4726 | this.eventService.dispatchEvent(eventEverythingChanged);
|
4727 | var newColumnsLoadedEvent = {
|
4728 | type: events_1.Events.EVENT_NEW_COLUMNS_LOADED,
|
4729 | api: this.gridApi,
|
4730 | columnApi: this.columnApi
|
4731 | };
|
4732 | this.eventService.dispatchEvent(newColumnsLoadedEvent);
|
4733 | };
|
4734 | ColumnController.prototype.isReady = function () {
|
4735 | return this.ready;
|
4736 | };
|
4737 | ColumnController.prototype.extractRowGroupColumns = function (source) {
|
4738 | var _this = this;
|
4739 | this.rowGroupColumns.forEach(function (column) { return column.setRowGroupActive(false, source); });
|
4740 | this.rowGroupColumns = [];
|
4741 |
|
4742 | this.primaryColumns.forEach(function (column) {
|
4743 | if (typeof column.getColDef().rowGroupIndex === 'number') {
|
4744 | _this.rowGroupColumns.push(column);
|
4745 | column.setRowGroupActive(true, source);
|
4746 | }
|
4747 | });
|
4748 |
|
4749 | this.rowGroupColumns.sort(function (colA, colB) {
|
4750 | return colA.getColDef().rowGroupIndex - colB.getColDef().rowGroupIndex;
|
4751 | });
|
4752 |
|
4753 |
|
4754 | this.primaryColumns.forEach(function (column) {
|
4755 | if (column.getColDef().rowGroup) {
|
4756 |
|
4757 | if (_this.rowGroupColumns.indexOf(column) >= 0) {
|
4758 | return;
|
4759 | }
|
4760 | _this.rowGroupColumns.push(column);
|
4761 | column.setRowGroupActive(true, source);
|
4762 | }
|
4763 | });
|
4764 | };
|
4765 | ColumnController.prototype.extractPivotColumns = function (source) {
|
4766 | var _this = this;
|
4767 | this.pivotColumns.forEach(function (column) { return column.setPivotActive(false, source); });
|
4768 | this.pivotColumns = [];
|
4769 |
|
4770 | this.primaryColumns.forEach(function (column) {
|
4771 | if (typeof column.getColDef().pivotIndex === 'number') {
|
4772 | _this.pivotColumns.push(column);
|
4773 | column.setPivotActive(true, source);
|
4774 | }
|
4775 | });
|
4776 |
|
4777 | this.pivotColumns.sort(function (colA, colB) {
|
4778 | return colA.getColDef().pivotIndex - colB.getColDef().pivotIndex;
|
4779 | });
|
4780 |
|
4781 | this.primaryColumns.forEach(function (column) {
|
4782 | if (column.getColDef().pivot) {
|
4783 |
|
4784 | if (_this.pivotColumns.indexOf(column) >= 0) {
|
4785 | return;
|
4786 | }
|
4787 | _this.pivotColumns.push(column);
|
4788 | column.setPivotActive(true, source);
|
4789 | }
|
4790 | });
|
4791 | };
|
4792 | ColumnController.prototype.resetColumnGroupState = function (source) {
|
4793 | if (source === void 0) { source = "api"; }
|
4794 | var stateItems = [];
|
4795 | this.columnUtils.depthFirstOriginalTreeSearch(this.primaryBalancedTree, function (child) {
|
4796 | if (child instanceof originalColumnGroup_1.OriginalColumnGroup) {
|
4797 | var groupState = {
|
4798 | groupId: child.getGroupId(),
|
4799 | open: child.getColGroupDef().openByDefault
|
4800 | };
|
4801 | stateItems.push(groupState);
|
4802 | }
|
4803 | });
|
4804 | this.setColumnGroupState(stateItems, source);
|
4805 | };
|
4806 | ColumnController.prototype.getColumnGroupState = function () {
|
4807 | var columnGroupState = [];
|
4808 | this.columnUtils.depthFirstOriginalTreeSearch(this.gridBalancedTree, function (node) {
|
4809 | if (node instanceof originalColumnGroup_1.OriginalColumnGroup) {
|
4810 | var originalColumnGroup = node;
|
4811 | columnGroupState.push({
|
4812 | groupId: originalColumnGroup.getGroupId(),
|
4813 | open: originalColumnGroup.isExpanded()
|
4814 | });
|
4815 | }
|
4816 | });
|
4817 | return columnGroupState;
|
4818 | };
|
4819 | ColumnController.prototype.setColumnGroupState = function (stateItems, source) {
|
4820 | var _this = this;
|
4821 | if (source === void 0) { source = "api"; }
|
4822 | this.columnAnimationService.start();
|
4823 | var impactedGroups = [];
|
4824 | stateItems.forEach(function (stateItem) {
|
4825 | var groupKey = stateItem.groupId;
|
4826 | var newValue = stateItem.open;
|
4827 | var originalColumnGroup = _this.getOriginalColumnGroup(groupKey);
|
4828 | if (!originalColumnGroup) {
|
4829 | return;
|
4830 | }
|
4831 | if (originalColumnGroup.isExpanded() === newValue) {
|
4832 | return;
|
4833 | }
|
4834 | _this.logger.log('columnGroupOpened(' + originalColumnGroup.getGroupId() + ',' + newValue + ')');
|
4835 | originalColumnGroup.setExpanded(newValue);
|
4836 | impactedGroups.push(originalColumnGroup);
|
4837 | });
|
4838 | this.updateGroupsAndDisplayedColumns(source);
|
4839 | impactedGroups.forEach(function (originalColumnGroup) {
|
4840 | var event = {
|
4841 | type: events_1.Events.EVENT_COLUMN_GROUP_OPENED,
|
4842 | columnGroup: originalColumnGroup,
|
4843 | api: _this.gridApi,
|
4844 | columnApi: _this.columnApi
|
4845 | };
|
4846 | _this.eventService.dispatchEvent(event);
|
4847 | });
|
4848 | this.columnAnimationService.finish();
|
4849 | };
|
4850 |
|
4851 | ColumnController.prototype.setColumnGroupOpened = function (key, newValue, source) {
|
4852 | if (source === void 0) { source = "api"; }
|
4853 | var keyAsString;
|
4854 | if (key instanceof originalColumnGroup_1.OriginalColumnGroup) {
|
4855 | keyAsString = key.getId();
|
4856 | }
|
4857 | else {
|
4858 | keyAsString = key;
|
4859 | }
|
4860 | this.setColumnGroupState([{ groupId: keyAsString, open: newValue }], source);
|
4861 | };
|
4862 | ColumnController.prototype.getOriginalColumnGroup = function (key) {
|
4863 | if (key instanceof originalColumnGroup_1.OriginalColumnGroup) {
|
4864 | return key;
|
4865 | }
|
4866 | if (typeof key !== 'string') {
|
4867 | console.error('ag-Grid: group key must be a string');
|
4868 | }
|
4869 |
|
4870 | var res = null;
|
4871 | this.columnUtils.depthFirstOriginalTreeSearch(this.gridBalancedTree, function (node) {
|
4872 | if (node instanceof originalColumnGroup_1.OriginalColumnGroup) {
|
4873 | var originalColumnGroup = node;
|
4874 | if (originalColumnGroup.getId() === key) {
|
4875 | res = originalColumnGroup;
|
4876 | }
|
4877 | }
|
4878 | });
|
4879 | return res;
|
4880 | };
|
4881 | ColumnController.prototype.calculateColumnsForDisplay = function () {
|
4882 | var _this = this;
|
4883 | var columnsForDisplay;
|
4884 | if (this.pivotMode && !this.secondaryColumnsPresent) {
|
4885 |
|
4886 |
|
4887 | columnsForDisplay = utils_1.Utils.filter(this.gridColumns, function (column) {
|
4888 | var isAutoGroupCol = _this.groupAutoColumns && _this.groupAutoColumns.indexOf(column) >= 0;
|
4889 | var isValueCol = _this.valueColumns && _this.valueColumns.indexOf(column) >= 0;
|
4890 | return isAutoGroupCol || isValueCol;
|
4891 | });
|
4892 | }
|
4893 | else {
|
4894 |
|
4895 |
|
4896 | columnsForDisplay = utils_1.Utils.filter(this.gridColumns, function (column) {
|
4897 |
|
4898 | var isAutoGroupCol = _this.groupAutoColumns && _this.groupAutoColumns.indexOf(column) >= 0;
|
4899 | return isAutoGroupCol || column.isVisible();
|
4900 | });
|
4901 | }
|
4902 | return columnsForDisplay;
|
4903 | };
|
4904 | ColumnController.prototype.checkColSpanActiveInCols = function (columns) {
|
4905 | var result = false;
|
4906 | columns.forEach(function (col) {
|
4907 | if (utils_1.Utils.exists(col.getColDef().colSpan)) {
|
4908 | result = true;
|
4909 | }
|
4910 | });
|
4911 | return result;
|
4912 | };
|
4913 | ColumnController.prototype.calculateColumnsForGroupDisplay = function () {
|
4914 | var _this = this;
|
4915 | this.groupDisplayColumns = [];
|
4916 | var checkFunc = function (col) {
|
4917 | var colDef = col.getColDef();
|
4918 | if (colDef && utils_1.Utils.exists(colDef.showRowGroup)) {
|
4919 | _this.groupDisplayColumns.push(col);
|
4920 | }
|
4921 | };
|
4922 | this.gridColumns.forEach(checkFunc);
|
4923 | if (this.groupAutoColumns) {
|
4924 | this.groupAutoColumns.forEach(checkFunc);
|
4925 | }
|
4926 | };
|
4927 | ColumnController.prototype.getGroupDisplayColumns = function () {
|
4928 | return this.groupDisplayColumns;
|
4929 | };
|
4930 | ColumnController.prototype.updateDisplayedColumns = function (source) {
|
4931 | var columnsForDisplay = this.calculateColumnsForDisplay();
|
4932 | this.buildDisplayedTrees(columnsForDisplay);
|
4933 | this.calculateColumnsForGroupDisplay();
|
4934 |
|
4935 | this.updateGroupsAndDisplayedColumns(source);
|
4936 | this.setFirstRightAndLastLeftPinned(source);
|
4937 | };
|
4938 | ColumnController.prototype.isSecondaryColumnsPresent = function () {
|
4939 | return this.secondaryColumnsPresent;
|
4940 | };
|
4941 | ColumnController.prototype.setSecondaryColumns = function (colDefs, source) {
|
4942 | if (source === void 0) { source = "api"; }
|
4943 | var newColsPresent = colDefs && colDefs.length > 0;
|
4944 |
|
4945 | if (!newColsPresent && !this.secondaryColumnsPresent) {
|
4946 | return;
|
4947 | }
|
4948 | if (newColsPresent) {
|
4949 | this.processSecondaryColumnDefinitions(colDefs);
|
4950 | var balancedTreeResult = this.balancedColumnTreeBuilder.createBalancedColumnGroups(colDefs, false);
|
4951 | this.secondaryBalancedTree = balancedTreeResult.balancedTree;
|
4952 | this.secondaryHeaderRowCount = balancedTreeResult.treeDept + 1;
|
4953 | this.secondaryColumns = this.getColumnsFromTree(this.secondaryBalancedTree);
|
4954 | this.secondaryColumnsPresent = true;
|
4955 | }
|
4956 | else {
|
4957 | this.secondaryBalancedTree = null;
|
4958 | this.secondaryHeaderRowCount = -1;
|
4959 | this.secondaryColumns = null;
|
4960 | this.secondaryColumnsPresent = false;
|
4961 | }
|
4962 | this.updateGridColumns();
|
4963 | this.updateDisplayedColumns(source);
|
4964 | };
|
4965 | ColumnController.prototype.processSecondaryColumnDefinitions = function (colDefs) {
|
4966 | var columnCallback = this.gridOptionsWrapper.getProcessSecondaryColDefFunc();
|
4967 | var groupCallback = this.gridOptionsWrapper.getProcessSecondaryColGroupDefFunc();
|
4968 | if (!columnCallback && !groupCallback) {
|
4969 | return;
|
4970 | }
|
4971 | searchForColDefs(colDefs);
|
4972 | function searchForColDefs(colDefs2) {
|
4973 | colDefs2.forEach(function (abstractColDef) {
|
4974 | var isGroup = utils_1.Utils.exists(abstractColDef.children);
|
4975 | if (isGroup) {
|
4976 | var colGroupDef = abstractColDef;
|
4977 | if (groupCallback) {
|
4978 | groupCallback(colGroupDef);
|
4979 | }
|
4980 | searchForColDefs(colGroupDef.children);
|
4981 | }
|
4982 | else {
|
4983 | var colDef = abstractColDef;
|
4984 | if (columnCallback) {
|
4985 | columnCallback(colDef);
|
4986 | }
|
4987 | }
|
4988 | });
|
4989 | }
|
4990 | };
|
4991 |
|
4992 | ColumnController.prototype.updateGridColumns = function () {
|
4993 | if (this.gridColsArePrimary) {
|
4994 | this.lastPrimaryOrder = this.gridColumns;
|
4995 | }
|
4996 | if (this.secondaryColumns) {
|
4997 | this.gridBalancedTree = this.secondaryBalancedTree.slice();
|
4998 | this.gridHeaderRowCount = this.secondaryHeaderRowCount;
|
4999 | this.gridColumns = this.secondaryColumns.slice();
|
5000 | this.gridColsArePrimary = false;
|
5001 | }
|
5002 | else {
|
5003 | this.gridBalancedTree = this.primaryBalancedTree.slice();
|
5004 | this.gridHeaderRowCount = this.primaryHeaderRowCount;
|
5005 | this.gridColumns = this.primaryColumns.slice();
|
5006 | this.gridColsArePrimary = true;
|
5007 |
|
5008 |
|
5009 |
|
5010 | this.orderGridColsLikeLastPrimary();
|
5011 | }
|
5012 | this.addAutoGroupToGridColumns();
|
5013 | this.putFixedColumnsFirst();
|
5014 | this.setupQuickFilterColumns();
|
5015 | this.clearDisplayedColumns();
|
5016 | this.colSpanActive = this.checkColSpanActiveInCols(this.gridColumns);
|
5017 | var event = {
|
5018 | type: events_1.Events.EVENT_GRID_COLUMNS_CHANGED,
|
5019 | api: this.gridApi,
|
5020 | columnApi: this.columnApi
|
5021 | };
|
5022 | this.eventService.dispatchEvent(event);
|
5023 | };
|
5024 | ColumnController.prototype.orderGridColsLikeLastPrimary = function () {
|
5025 | var _this = this;
|
5026 | if (utils_1.Utils.missing(this.lastPrimaryOrder)) {
|
5027 | return;
|
5028 | }
|
5029 |
|
5030 |
|
5031 | var oneMissing = false;
|
5032 | this.gridColumns.forEach(function (col) {
|
5033 | if (_this.lastPrimaryOrder.indexOf(col) < 0) {
|
5034 | oneMissing = true;
|
5035 | }
|
5036 | });
|
5037 | if (oneMissing) {
|
5038 | return;
|
5039 | }
|
5040 | this.gridColumns.sort(function (colA, colB) {
|
5041 | var indexA = _this.lastPrimaryOrder.indexOf(colA);
|
5042 | var indexB = _this.lastPrimaryOrder.indexOf(colB);
|
5043 | return indexA - indexB;
|
5044 | });
|
5045 | };
|
5046 | ColumnController.prototype.isPrimaryColumnGroupsPresent = function () {
|
5047 | return this.primaryHeaderRowCount > 1;
|
5048 | };
|
5049 |
|
5050 |
|
5051 |
|
5052 |
|
5053 |
|
5054 | ColumnController.prototype.setupQuickFilterColumns = function () {
|
5055 | if (this.groupAutoColumns) {
|
5056 | this.columnsForQuickFilter = this.primaryColumns.concat(this.groupAutoColumns);
|
5057 | }
|
5058 | else {
|
5059 | this.columnsForQuickFilter = this.primaryColumns;
|
5060 | }
|
5061 | };
|
5062 | ColumnController.prototype.putFixedColumnsFirst = function () {
|
5063 | var locked = this.gridColumns.filter(function (c) { return c.isLockPosition(); });
|
5064 | var unlocked = this.gridColumns.filter(function (c) { return !c.isLockPosition(); });
|
5065 | this.gridColumns = locked.concat(unlocked);
|
5066 | };
|
5067 | ColumnController.prototype.addAutoGroupToGridColumns = function () {
|
5068 |
|
5069 | this.createGroupAutoColumnsIfNeeded();
|
5070 | if (utils_1.Utils.missing(this.groupAutoColumns)) {
|
5071 | return;
|
5072 | }
|
5073 | this.gridColumns = this.groupAutoColumns.concat(this.gridColumns);
|
5074 | var autoColBalancedTree = this.balancedColumnTreeBuilder.createForAutoGroups(this.groupAutoColumns, this.gridBalancedTree);
|
5075 | this.gridBalancedTree = autoColBalancedTree.concat(this.gridBalancedTree);
|
5076 | };
|
5077 |
|
5078 |
|
5079 |
|
5080 |
|
5081 |
|
5082 | ColumnController.prototype.clearDisplayedColumns = function () {
|
5083 | this.displayedLeftColumnTree = [];
|
5084 | this.displayedRightColumnTree = [];
|
5085 | this.displayedCentreColumnTree = [];
|
5086 | this.displayedLeftHeaderRows = {};
|
5087 | this.displayedRightHeaderRows = {};
|
5088 | this.displayedCentreHeaderRows = {};
|
5089 | this.displayedLeftColumns = [];
|
5090 | this.displayedRightColumns = [];
|
5091 | this.displayedCenterColumns = [];
|
5092 | this.allDisplayedColumns = [];
|
5093 | this.allDisplayedVirtualColumns = [];
|
5094 | };
|
5095 | ColumnController.prototype.updateGroupsAndDisplayedColumns = function (source) {
|
5096 | this.updateOpenClosedVisibilityInColumnGroups();
|
5097 | this.updateDisplayedColumnsFromTrees(source);
|
5098 | this.updateVirtualSets();
|
5099 | this.updateBodyWidths();
|
5100 |
|
5101 | var event = {
|
5102 | type: events_1.Events.EVENT_DISPLAYED_COLUMNS_CHANGED,
|
5103 | api: this.gridApi,
|
5104 | columnApi: this.columnApi
|
5105 | };
|
5106 | this.eventService.dispatchEvent(event);
|
5107 | };
|
5108 | ColumnController.prototype.updateDisplayedColumnsFromTrees = function (source) {
|
5109 | this.addToDisplayedColumns(this.displayedLeftColumnTree, this.displayedLeftColumns);
|
5110 | this.addToDisplayedColumns(this.displayedCentreColumnTree, this.displayedCenterColumns);
|
5111 | this.addToDisplayedColumns(this.displayedRightColumnTree, this.displayedRightColumns);
|
5112 | this.setupAllDisplayedColumns();
|
5113 | this.setLeftValues(source);
|
5114 | };
|
5115 | ColumnController.prototype.setupAllDisplayedColumns = function () {
|
5116 | if (this.gridOptionsWrapper.isEnableRtl()) {
|
5117 | this.allDisplayedColumns = this.displayedRightColumns
|
5118 | .concat(this.displayedCenterColumns)
|
5119 | .concat(this.displayedLeftColumns);
|
5120 | }
|
5121 | else {
|
5122 | this.allDisplayedColumns = this.displayedLeftColumns
|
5123 | .concat(this.displayedCenterColumns)
|
5124 | .concat(this.displayedRightColumns);
|
5125 | }
|
5126 | };
|
5127 |
|
5128 | ColumnController.prototype.setLeftValues = function (source) {
|
5129 | this.setLeftValuesOfColumns(source);
|
5130 | this.setLeftValuesOfGroups();
|
5131 | };
|
5132 | ColumnController.prototype.setLeftValuesOfColumns = function (source) {
|
5133 | var _this = this;
|
5134 |
|
5135 | var allColumns = this.primaryColumns.slice(0);
|
5136 |
|
5137 | var doingRtl = this.gridOptionsWrapper.isEnableRtl();
|
5138 | [this.displayedLeftColumns, this.displayedRightColumns, this.displayedCenterColumns].forEach(function (columns) {
|
5139 | if (doingRtl) {
|
5140 |
|
5141 | var left_1 = _this.getWidthOfColsInList(columns);
|
5142 | columns.forEach(function (column) {
|
5143 | left_1 -= column.getActualWidth();
|
5144 | column.setLeft(left_1, source);
|
5145 | });
|
5146 | }
|
5147 | else {
|
5148 |
|
5149 | var left_2 = 0;
|
5150 | columns.forEach(function (column) {
|
5151 | column.setLeft(left_2, source);
|
5152 | left_2 += column.getActualWidth();
|
5153 | });
|
5154 | }
|
5155 | utils_1.Utils.removeAllFromArray(allColumns, columns);
|
5156 | });
|
5157 |
|
5158 |
|
5159 |
|
5160 | allColumns.forEach(function (column) {
|
5161 | column.setLeft(null, source);
|
5162 | });
|
5163 | };
|
5164 | ColumnController.prototype.setLeftValuesOfGroups = function () {
|
5165 |
|
5166 | [this.displayedLeftColumnTree, this.displayedRightColumnTree, this.displayedCentreColumnTree].forEach(function (columns) {
|
5167 | columns.forEach(function (column) {
|
5168 | if (column instanceof columnGroup_1.ColumnGroup) {
|
5169 | var columnGroup = column;
|
5170 | columnGroup.checkLeft();
|
5171 | }
|
5172 | });
|
5173 | });
|
5174 | };
|
5175 | ColumnController.prototype.addToDisplayedColumns = function (displayedColumnTree, displayedColumns) {
|
5176 | displayedColumns.length = 0;
|
5177 | this.columnUtils.depthFirstDisplayedColumnTreeSearch(displayedColumnTree, function (child) {
|
5178 | if (child instanceof column_1.Column) {
|
5179 | displayedColumns.push(child);
|
5180 | }
|
5181 | });
|
5182 | };
|
5183 | ColumnController.prototype.updateDisplayedCenterVirtualColumns = function () {
|
5184 | if (this.suppressColumnVirtualisation) {
|
5185 |
|
5186 | this.allDisplayedCenterVirtualColumns = this.displayedCenterColumns;
|
5187 | }
|
5188 | else {
|
5189 |
|
5190 | this.allDisplayedCenterVirtualColumns = this.filterOutColumnsWithinViewport();
|
5191 | }
|
5192 | this.allDisplayedVirtualColumns = this.allDisplayedCenterVirtualColumns
|
5193 | .concat(this.displayedLeftColumns)
|
5194 | .concat(this.displayedRightColumns);
|
5195 |
|
5196 |
|
5197 | var result = {};
|
5198 | this.allDisplayedVirtualColumns.forEach(function (col) {
|
5199 | result[col.getId()] = true;
|
5200 | });
|
5201 | return result;
|
5202 | };
|
5203 | ColumnController.prototype.getVirtualHeaderGroupRow = function (type, dept) {
|
5204 | var result;
|
5205 | switch (type) {
|
5206 | case column_1.Column.PINNED_LEFT:
|
5207 | result = this.displayedLeftHeaderRows[dept];
|
5208 | break;
|
5209 | case column_1.Column.PINNED_RIGHT:
|
5210 | result = this.displayedRightHeaderRows[dept];
|
5211 | break;
|
5212 | default:
|
5213 | result = this.displayedCentreHeaderRows[dept];
|
5214 | break;
|
5215 | }
|
5216 | if (utils_1.Utils.missing(result)) {
|
5217 | result = [];
|
5218 | }
|
5219 | return result;
|
5220 | };
|
5221 | ColumnController.prototype.updateDisplayedVirtualGroups = function (virtualColIds) {
|
5222 |
|
5223 |
|
5224 | this.displayedLeftHeaderRows = {};
|
5225 | this.displayedRightHeaderRows = {};
|
5226 | this.displayedCentreHeaderRows = {};
|
5227 | testGroup(this.displayedLeftColumnTree, this.displayedLeftHeaderRows, 0);
|
5228 | testGroup(this.displayedRightColumnTree, this.displayedRightHeaderRows, 0);
|
5229 | testGroup(this.displayedCentreColumnTree, this.displayedCentreHeaderRows, 0);
|
5230 | function testGroup(children, result, dept) {
|
5231 | var returnValue = false;
|
5232 | for (var i = 0; i < children.length; i++) {
|
5233 |
|
5234 | var child = children[i];
|
5235 | var addThisItem = void 0;
|
5236 | if (child instanceof column_1.Column) {
|
5237 |
|
5238 | addThisItem = virtualColIds[child.getId()] === true;
|
5239 | }
|
5240 | else {
|
5241 |
|
5242 | var columnGroup = child;
|
5243 | addThisItem = testGroup(columnGroup.getDisplayedChildren(), result, dept + 1);
|
5244 | }
|
5245 | if (addThisItem) {
|
5246 | returnValue = true;
|
5247 | if (!result[dept]) {
|
5248 | result[dept] = [];
|
5249 | }
|
5250 | result[dept].push(child);
|
5251 | }
|
5252 | }
|
5253 | return returnValue;
|
5254 | }
|
5255 | };
|
5256 | ColumnController.prototype.updateVirtualSets = function () {
|
5257 | var virtualColIds = this.updateDisplayedCenterVirtualColumns();
|
5258 | this.updateDisplayedVirtualGroups(virtualColIds);
|
5259 | };
|
5260 | ColumnController.prototype.filterOutColumnsWithinViewport = function () {
|
5261 | return utils_1.Utils.filter(this.displayedCenterColumns, this.isColumnInViewport.bind(this));
|
5262 | };
|
5263 |
|
5264 | ColumnController.prototype.sizeColumnsToFit = function (gridWidth, source) {
|
5265 | var _this = this;
|
5266 | if (source === void 0) { source = "api"; }
|
5267 |
|
5268 | var allDisplayedColumns = this.getAllDisplayedColumns();
|
5269 | if (gridWidth <= 0 || allDisplayedColumns.length === 0) {
|
5270 | return;
|
5271 | }
|
5272 | var colsToNotSpread = utils_1.Utils.filter(allDisplayedColumns, function (column) {
|
5273 | return column.getColDef().suppressSizeToFit === true;
|
5274 | });
|
5275 | var colsToSpread = utils_1.Utils.filter(allDisplayedColumns, function (column) {
|
5276 | return column.getColDef().suppressSizeToFit !== true;
|
5277 | });
|
5278 |
|
5279 | var colsToFireEventFor = colsToSpread.slice(0);
|
5280 | var finishedResizing = false;
|
5281 | while (!finishedResizing) {
|
5282 | finishedResizing = true;
|
5283 | var availablePixels = gridWidth - this.getWidthOfColsInList(colsToNotSpread);
|
5284 | if (availablePixels <= 0) {
|
5285 |
|
5286 | colsToSpread.forEach(function (column) {
|
5287 | column.setMinimum(source);
|
5288 | });
|
5289 | }
|
5290 | else {
|
5291 | var scale = availablePixels / this.getWidthOfColsInList(colsToSpread);
|
5292 |
|
5293 |
|
5294 | var pixelsForLastCol = availablePixels;
|
5295 |
|
5296 | for (var i = colsToSpread.length - 1; i >= 0; i--) {
|
5297 | var column = colsToSpread[i];
|
5298 | var newWidth = Math.round(column.getActualWidth() * scale);
|
5299 | if (newWidth < column.getMinWidth()) {
|
5300 | column.setMinimum(source);
|
5301 | moveToNotSpread(column);
|
5302 | finishedResizing = false;
|
5303 | }
|
5304 | else if (column.isGreaterThanMax(newWidth)) {
|
5305 | column.setActualWidth(column.getMaxWidth(), source);
|
5306 | moveToNotSpread(column);
|
5307 | finishedResizing = false;
|
5308 | }
|
5309 | else {
|
5310 | var onLastCol = i === 0;
|
5311 | if (onLastCol) {
|
5312 | column.setActualWidth(pixelsForLastCol, source);
|
5313 | }
|
5314 | else {
|
5315 | column.setActualWidth(newWidth, source);
|
5316 | }
|
5317 | }
|
5318 | pixelsForLastCol -= newWidth;
|
5319 | }
|
5320 | }
|
5321 | }
|
5322 | this.setLeftValues(source);
|
5323 | this.updateBodyWidths();
|
5324 | colsToFireEventFor.forEach(function (column) {
|
5325 | var event = {
|
5326 | type: events_1.Events.EVENT_COLUMN_RESIZED,
|
5327 | column: column,
|
5328 | columns: [column],
|
5329 | finished: true,
|
5330 | api: _this.gridApi,
|
5331 | columnApi: _this.columnApi,
|
5332 | source: "sizeColumnsToFit"
|
5333 | };
|
5334 | _this.eventService.dispatchEvent(event);
|
5335 | });
|
5336 | function moveToNotSpread(column) {
|
5337 | utils_1.Utils.removeFromArray(colsToSpread, column);
|
5338 | colsToNotSpread.push(column);
|
5339 | }
|
5340 | };
|
5341 | ColumnController.prototype.buildDisplayedTrees = function (visibleColumns) {
|
5342 | var leftVisibleColumns = utils_1.Utils.filter(visibleColumns, function (column) {
|
5343 | return column.getPinned() === 'left';
|
5344 | });
|
5345 | var rightVisibleColumns = utils_1.Utils.filter(visibleColumns, function (column) {
|
5346 | return column.getPinned() === 'right';
|
5347 | });
|
5348 | var centerVisibleColumns = utils_1.Utils.filter(visibleColumns, function (column) {
|
5349 | return column.getPinned() !== 'left' && column.getPinned() !== 'right';
|
5350 | });
|
5351 | var groupInstanceIdCreator = new groupInstanceIdCreator_1.GroupInstanceIdCreator();
|
5352 | this.displayedLeftColumnTree = this.displayedGroupCreator.createDisplayedGroups(leftVisibleColumns, this.gridBalancedTree, groupInstanceIdCreator, this.displayedLeftColumnTree);
|
5353 | this.displayedRightColumnTree = this.displayedGroupCreator.createDisplayedGroups(rightVisibleColumns, this.gridBalancedTree, groupInstanceIdCreator, this.displayedRightColumnTree);
|
5354 | this.displayedCentreColumnTree = this.displayedGroupCreator.createDisplayedGroups(centerVisibleColumns, this.gridBalancedTree, groupInstanceIdCreator, this.displayedCentreColumnTree);
|
5355 | };
|
5356 | ColumnController.prototype.updateOpenClosedVisibilityInColumnGroups = function () {
|
5357 | var allColumnGroups = this.getAllDisplayedColumnGroups();
|
5358 | this.columnUtils.depthFirstAllColumnTreeSearch(allColumnGroups, function (child) {
|
5359 | if (child instanceof columnGroup_1.ColumnGroup) {
|
5360 | var columnGroup = child;
|
5361 | columnGroup.calculateDisplayedColumns();
|
5362 | }
|
5363 | });
|
5364 | };
|
5365 | ColumnController.prototype.getGroupAutoColumns = function () {
|
5366 | return this.groupAutoColumns;
|
5367 | };
|
5368 | ColumnController.prototype.createGroupAutoColumnsIfNeeded = function () {
|
5369 | if (!this.autoGroupsNeedBuilding) {
|
5370 | return;
|
5371 | }
|
5372 | this.autoGroupsNeedBuilding = false;
|
5373 |
|
5374 | var needAutoColumns = (this.rowGroupColumns.length > 0 || this.usingTreeData)
|
5375 | && !this.gridOptionsWrapper.isGroupSuppressAutoColumn()
|
5376 | && !this.gridOptionsWrapper.isGroupUseEntireRow()
|
5377 | && !this.gridOptionsWrapper.isGroupSuppressRow();
|
5378 | if (needAutoColumns) {
|
5379 | this.groupAutoColumns = this.autoGroupColService.createAutoGroupColumns(this.rowGroupColumns);
|
5380 | }
|
5381 | else {
|
5382 | this.groupAutoColumns = null;
|
5383 | }
|
5384 | };
|
5385 | ColumnController.prototype.createValueColumns = function (source) {
|
5386 | this.valueColumns.forEach(function (column) { return column.setValueActive(false, source); });
|
5387 | this.valueColumns = [];
|
5388 |
|
5389 | for (var i = 0; i < this.primaryColumns.length; i++) {
|
5390 | var column = this.primaryColumns[i];
|
5391 | if (column.getColDef().aggFunc) {
|
5392 | column.setAggFunc(column.getColDef().aggFunc);
|
5393 | this.valueColumns.push(column);
|
5394 | column.setValueActive(true, source);
|
5395 | }
|
5396 | }
|
5397 | };
|
5398 | ColumnController.prototype.getWidthOfColsInList = function (columnList) {
|
5399 | var result = 0;
|
5400 | for (var i = 0; i < columnList.length; i++) {
|
5401 | result += columnList[i].getActualWidth();
|
5402 | }
|
5403 | return result;
|
5404 | };
|
5405 | ColumnController.prototype.getGridBalancedTree = function () {
|
5406 | return this.gridBalancedTree;
|
5407 | };
|
5408 | __decorate([
|
5409 | context_1.Autowired('gridOptionsWrapper'),
|
5410 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
5411 | ], ColumnController.prototype, "gridOptionsWrapper", void 0);
|
5412 | __decorate([
|
5413 | context_1.Autowired('expressionService'),
|
5414 | __metadata("design:type", expressionService_1.ExpressionService)
|
5415 | ], ColumnController.prototype, "expressionService", void 0);
|
5416 | __decorate([
|
5417 | context_1.Autowired('balancedColumnTreeBuilder'),
|
5418 | __metadata("design:type", balancedColumnTreeBuilder_1.BalancedColumnTreeBuilder)
|
5419 | ], ColumnController.prototype, "balancedColumnTreeBuilder", void 0);
|
5420 | __decorate([
|
5421 | context_1.Autowired('displayedGroupCreator'),
|
5422 | __metadata("design:type", displayedGroupCreator_1.DisplayedGroupCreator)
|
5423 | ], ColumnController.prototype, "displayedGroupCreator", void 0);
|
5424 | __decorate([
|
5425 | context_1.Autowired('autoWidthCalculator'),
|
5426 | __metadata("design:type", autoWidthCalculator_1.AutoWidthCalculator)
|
5427 | ], ColumnController.prototype, "autoWidthCalculator", void 0);
|
5428 | __decorate([
|
5429 | context_1.Autowired('eventService'),
|
5430 | __metadata("design:type", eventService_1.EventService)
|
5431 | ], ColumnController.prototype, "eventService", void 0);
|
5432 | __decorate([
|
5433 | context_1.Autowired('columnUtils'),
|
5434 | __metadata("design:type", columnUtils_1.ColumnUtils)
|
5435 | ], ColumnController.prototype, "columnUtils", void 0);
|
5436 | __decorate([
|
5437 | context_1.Autowired('context'),
|
5438 | __metadata("design:type", context_1.Context)
|
5439 | ], ColumnController.prototype, "context", void 0);
|
5440 | __decorate([
|
5441 | context_1.Autowired('columnAnimationService'),
|
5442 | __metadata("design:type", columnAnimationService_1.ColumnAnimationService)
|
5443 | ], ColumnController.prototype, "columnAnimationService", void 0);
|
5444 | __decorate([
|
5445 | context_1.Autowired('autoGroupColService'),
|
5446 | __metadata("design:type", autoGroupColService_1.AutoGroupColService)
|
5447 | ], ColumnController.prototype, "autoGroupColService", void 0);
|
5448 | __decorate([
|
5449 | context_1.Optional('aggFuncService'),
|
5450 | __metadata("design:type", Object)
|
5451 | ], ColumnController.prototype, "aggFuncService", void 0);
|
5452 | __decorate([
|
5453 | context_1.Optional('valueCache'),
|
5454 | __metadata("design:type", valueCache_1.ValueCache)
|
5455 | ], ColumnController.prototype, "valueCache", void 0);
|
5456 | __decorate([
|
5457 | context_1.Autowired('columnApi'),
|
5458 | __metadata("design:type", columnApi_1.ColumnApi)
|
5459 | ], ColumnController.prototype, "columnApi", void 0);
|
5460 | __decorate([
|
5461 | context_1.Autowired('gridApi'),
|
5462 | __metadata("design:type", gridApi_1.GridApi)
|
5463 | ], ColumnController.prototype, "gridApi", void 0);
|
5464 | __decorate([
|
5465 | context_1.PostConstruct,
|
5466 | __metadata("design:type", Function),
|
5467 | __metadata("design:paramtypes", []),
|
5468 | __metadata("design:returntype", void 0)
|
5469 | ], ColumnController.prototype, "init", null);
|
5470 | __decorate([
|
5471 | __param(0, context_1.Qualifier('loggerFactory')),
|
5472 | __metadata("design:type", Function),
|
5473 | __metadata("design:paramtypes", [logger_1.LoggerFactory]),
|
5474 | __metadata("design:returntype", void 0)
|
5475 | ], ColumnController.prototype, "setBeans", null);
|
5476 | ColumnController = __decorate([
|
5477 | context_1.Bean('columnController')
|
5478 | ], ColumnController);
|
5479 | return ColumnController;
|
5480 | }());
|
5481 | exports.ColumnController = ColumnController;
|
5482 |
|
5483 |
|
5484 | }),
|
5485 |
|
5486 | (function(module, exports, __webpack_require__) {
|
5487 |
|
5488 | "use strict";
|
5489 |
|
5490 |
|
5491 |
|
5492 |
|
5493 |
|
5494 |
|
5495 |
|
5496 | Object.defineProperty(exports, "__esModule", { value: true });
|
5497 | var eventKeys_1 = __webpack_require__(25);
|
5498 | exports.Events = eventKeys_1.Events;
|
5499 |
|
5500 |
|
5501 | }),
|
5502 |
|
5503 | (function(module, exports, __webpack_require__) {
|
5504 |
|
5505 | "use strict";
|
5506 |
|
5507 |
|
5508 |
|
5509 |
|
5510 |
|
5511 |
|
5512 |
|
5513 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
5514 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
5515 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
5516 | 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;
|
5517 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
5518 | };
|
5519 | var __metadata = (this && this.__metadata) || function (k, v) {
|
5520 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
5521 | };
|
5522 | Object.defineProperty(exports, "__esModule", { value: true });
|
5523 | var csvCreator_1 = __webpack_require__(47);
|
5524 | var rowRenderer_1 = __webpack_require__(20);
|
5525 | var filterManager_1 = __webpack_require__(18);
|
5526 | var columnController_1 = __webpack_require__(4);
|
5527 | var selectionController_1 = __webpack_require__(17);
|
5528 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
5529 | var valueService_1 = __webpack_require__(15);
|
5530 | var eventService_1 = __webpack_require__(3);
|
5531 | var constants_1 = __webpack_require__(9);
|
5532 | var context_1 = __webpack_require__(0);
|
5533 | var gridCore_1 = __webpack_require__(42);
|
5534 | var sortController_1 = __webpack_require__(24);
|
5535 | var focusedCellController_1 = __webpack_require__(22);
|
5536 | var gridCell_1 = __webpack_require__(23);
|
5537 | var utils_1 = __webpack_require__(1);
|
5538 | var cellRendererFactory_1 = __webpack_require__(55);
|
5539 | var cellEditorFactory_1 = __webpack_require__(54);
|
5540 | var paginationProxy_1 = __webpack_require__(29);
|
5541 | var immutableService_1 = __webpack_require__(105);
|
5542 | var valueCache_1 = __webpack_require__(33);
|
5543 | var alignedGridsService_1 = __webpack_require__(58);
|
5544 | var pinnedRowModel_1 = __webpack_require__(30);
|
5545 | var animationFrameService_1 = __webpack_require__(37);
|
5546 | var GridApi = (function () {
|
5547 | function GridApi() {
|
5548 | this.detailGridInfoMap = {};
|
5549 | |
5550 |
|
5551 |
|
5552 |
|
5553 |
|
5554 |
|
5555 |
|
5556 |
|
5557 |
|
5558 |
|
5559 | }
|
5560 | GridApi.prototype.registerGridComp = function (gridPanel) {
|
5561 | this.gridPanel = gridPanel;
|
5562 | };
|
5563 | GridApi.prototype.registerHeaderRootComp = function (headerRootComp) {
|
5564 | this.headerRootComp = headerRootComp;
|
5565 | };
|
5566 | GridApi.prototype.init = function () {
|
5567 | switch (this.rowModel.getType()) {
|
5568 | case constants_1.Constants.ROW_MODEL_TYPE_CLIENT_SIDE:
|
5569 | this.clientSideRowModel = this.rowModel;
|
5570 | break;
|
5571 | case constants_1.Constants.ROW_MODEL_TYPE_INFINITE:
|
5572 | this.infinitePageRowModel = this.rowModel;
|
5573 | break;
|
5574 | case constants_1.Constants.ROW_MODEL_TYPE_SERVER_SIDE:
|
5575 | this.serverSideRowModel = this.rowModel;
|
5576 | break;
|
5577 | }
|
5578 | };
|
5579 |
|
5580 | GridApi.prototype.__getAlignedGridService = function () {
|
5581 | return this.alignedGridsService;
|
5582 | };
|
5583 | GridApi.prototype.addDetailGridInfo = function (id, gridInfo) {
|
5584 | this.detailGridInfoMap[id] = gridInfo;
|
5585 | };
|
5586 | GridApi.prototype.removeDetailGridInfo = function (id) {
|
5587 | this.detailGridInfoMap[id] = undefined;
|
5588 | };
|
5589 | GridApi.prototype.getDetailGridInfo = function (id) {
|
5590 | return this.detailGridInfoMap[id];
|
5591 | };
|
5592 | GridApi.prototype.forEachDetailGridInfo = function (callback) {
|
5593 | var index = 0;
|
5594 | utils_1.Utils.iterateObject(this.detailGridInfoMap, function (id, gridInfo) {
|
5595 |
|
5596 | if (utils_1.Utils.exists(gridInfo)) {
|
5597 | callback(gridInfo, index);
|
5598 | index++;
|
5599 | }
|
5600 | });
|
5601 | };
|
5602 | GridApi.prototype.getDataAsCsv = function (params) {
|
5603 | return this.csvCreator.getDataAsCsv(params);
|
5604 | };
|
5605 | GridApi.prototype.exportDataAsCsv = function (params) {
|
5606 | this.csvCreator.exportDataAsCsv(params);
|
5607 | };
|
5608 | GridApi.prototype.getDataAsExcel = function (params) {
|
5609 | if (!this.excelCreator) {
|
5610 | console.warn('ag-Grid: Excel export is only available in ag-Grid Enterprise');
|
5611 | }
|
5612 | return this.excelCreator.getDataAsExcelXml(params);
|
5613 | };
|
5614 | GridApi.prototype.exportDataAsExcel = function (params) {
|
5615 | if (!this.excelCreator) {
|
5616 | console.warn('ag-Grid: Excel export is only available in ag-Grid Enterprise');
|
5617 | }
|
5618 | this.excelCreator.exportDataAsExcel(params);
|
5619 | };
|
5620 |
|
5621 | GridApi.prototype.setEnterpriseDatasource = function (datasource) {
|
5622 | console.warn("ag-grid: since version 18.x, api.setEnterpriseDatasource() should be replaced with api.setServerSideDatasource()");
|
5623 | this.setServerSideDatasource(datasource);
|
5624 | };
|
5625 | GridApi.prototype.setServerSideDatasource = function (datasource) {
|
5626 | if (this.gridOptionsWrapper.isRowModelServerSide()) {
|
5627 |
|
5628 | this.rowModel.setDatasource(datasource);
|
5629 | }
|
5630 | else {
|
5631 | console.warn("ag-Grid: you can only use an enterprise datasource when gridOptions.rowModelType is '" + constants_1.Constants.ROW_MODEL_TYPE_SERVER_SIDE + "'");
|
5632 | }
|
5633 | };
|
5634 | GridApi.prototype.setDatasource = function (datasource) {
|
5635 | if (this.gridOptionsWrapper.isRowModelInfinite()) {
|
5636 | this.rowModel.setDatasource(datasource);
|
5637 | }
|
5638 | else {
|
5639 | console.warn("ag-Grid: you can only use a datasource when gridOptions.rowModelType is '" + constants_1.Constants.ROW_MODEL_TYPE_INFINITE + "'");
|
5640 | }
|
5641 | };
|
5642 | GridApi.prototype.setViewportDatasource = function (viewportDatasource) {
|
5643 | if (this.gridOptionsWrapper.isRowModelViewport()) {
|
5644 |
|
5645 |
|
5646 |
|
5647 | this.rowModel.setViewportDatasource(viewportDatasource);
|
5648 | }
|
5649 | else {
|
5650 | console.warn("ag-Grid: you can only use a viewport datasource when gridOptions.rowModelType is '" + constants_1.Constants.ROW_MODEL_TYPE_VIEWPORT + "'");
|
5651 | }
|
5652 | };
|
5653 | GridApi.prototype.setRowData = function (rowData) {
|
5654 | if (this.gridOptionsWrapper.isRowModelDefault()) {
|
5655 | if (this.gridOptionsWrapper.isDeltaRowDataMode()) {
|
5656 | var _a = this.immutableService.createTransactionForRowData(rowData), transaction = _a[0], orderIdMap = _a[1];
|
5657 | this.clientSideRowModel.updateRowData(transaction, orderIdMap);
|
5658 | }
|
5659 | else {
|
5660 | this.selectionController.reset();
|
5661 | this.clientSideRowModel.setRowData(rowData);
|
5662 | }
|
5663 | }
|
5664 | else {
|
5665 | console.log('cannot call setRowData unless using normal row model');
|
5666 | }
|
5667 | };
|
5668 |
|
5669 | GridApi.prototype.setFloatingTopRowData = function (rows) {
|
5670 | console.warn('ag-Grid: since v12, api.setFloatingTopRowData() is now api.setPinnedTopRowData()');
|
5671 | this.setPinnedTopRowData(rows);
|
5672 | };
|
5673 |
|
5674 | GridApi.prototype.setFloatingBottomRowData = function (rows) {
|
5675 | console.warn('ag-Grid: since v12, api.setFloatingBottomRowData() is now api.setPinnedBottomRowData()');
|
5676 | this.setPinnedBottomRowData(rows);
|
5677 | };
|
5678 |
|
5679 | GridApi.prototype.getFloatingTopRowCount = function () {
|
5680 | console.warn('ag-Grid: since v12, api.getFloatingTopRowCount() is now api.getPinnedTopRowCount()');
|
5681 | return this.getPinnedTopRowCount();
|
5682 | };
|
5683 |
|
5684 | GridApi.prototype.getFloatingBottomRowCount = function () {
|
5685 | console.warn('ag-Grid: since v12, api.getFloatingBottomRowCount() is now api.getPinnedBottomRowCount()');
|
5686 | return this.getPinnedBottomRowCount();
|
5687 | };
|
5688 |
|
5689 | GridApi.prototype.getFloatingTopRow = function (index) {
|
5690 | console.warn('ag-Grid: since v12, api.getFloatingTopRow() is now api.getPinnedTopRow()');
|
5691 | return this.getPinnedTopRow(index);
|
5692 | };
|
5693 |
|
5694 | GridApi.prototype.getFloatingBottomRow = function (index) {
|
5695 | console.warn('ag-Grid: since v12, api.getFloatingBottomRow() is now api.getPinnedBottomRow()');
|
5696 | return this.getPinnedBottomRow(index);
|
5697 | };
|
5698 | GridApi.prototype.setPinnedTopRowData = function (rows) {
|
5699 | this.pinnedRowModel.setPinnedTopRowData(rows);
|
5700 | };
|
5701 | GridApi.prototype.setPinnedBottomRowData = function (rows) {
|
5702 | this.pinnedRowModel.setPinnedBottomRowData(rows);
|
5703 | };
|
5704 | GridApi.prototype.getPinnedTopRowCount = function () {
|
5705 | return this.pinnedRowModel.getPinnedTopRowCount();
|
5706 | };
|
5707 | GridApi.prototype.getPinnedBottomRowCount = function () {
|
5708 | return this.pinnedRowModel.getPinnedBottomRowCount();
|
5709 | };
|
5710 | GridApi.prototype.getPinnedTopRow = function (index) {
|
5711 | return this.pinnedRowModel.getPinnedTopRow(index);
|
5712 | };
|
5713 | GridApi.prototype.getPinnedBottomRow = function (index) {
|
5714 | return this.pinnedRowModel.getPinnedBottomRow(index);
|
5715 | };
|
5716 | GridApi.prototype.setColumnDefs = function (colDefs, source) {
|
5717 | if (source === void 0) { source = "api"; }
|
5718 | this.columnController.setColumnDefs(colDefs, source);
|
5719 | };
|
5720 | GridApi.prototype.expireValueCache = function () {
|
5721 | this.valueCache.expire();
|
5722 | };
|
5723 | GridApi.prototype.getVerticalPixelRange = function () {
|
5724 | return this.gridPanel.getVScrollPosition();
|
5725 | };
|
5726 | GridApi.prototype.refreshToolPanel = function () {
|
5727 | if (this.toolPanelComp) {
|
5728 | this.toolPanelComp.refresh();
|
5729 | }
|
5730 | };
|
5731 | GridApi.prototype.refreshCells = function (params) {
|
5732 | if (params === void 0) { params = {}; }
|
5733 | if (Array.isArray(params)) {
|
5734 |
|
5735 | console.warn('since ag-Grid v11.1, refreshCells() now takes parameters, please see the documentation.');
|
5736 | return;
|
5737 | }
|
5738 | this.rowRenderer.refreshCells(params);
|
5739 | };
|
5740 | GridApi.prototype.flashCells = function (params) {
|
5741 | if (params === void 0) { params = {}; }
|
5742 | this.rowRenderer.flashCells(params);
|
5743 | };
|
5744 | GridApi.prototype.redrawRows = function (params) {
|
5745 | if (params === void 0) { params = {}; }
|
5746 | if (params && params.rowNodes) {
|
5747 | this.rowRenderer.redrawRows(params.rowNodes);
|
5748 | }
|
5749 | else {
|
5750 | this.rowRenderer.redrawAfterModelUpdate();
|
5751 | }
|
5752 | };
|
5753 | GridApi.prototype.timeFullRedraw = function (count) {
|
5754 | if (count === void 0) { count = 1; }
|
5755 | var iterationCount = 0;
|
5756 | var totalProcessing = 0;
|
5757 | var totalReflow = 0;
|
5758 | var that = this;
|
5759 | doOneIteration();
|
5760 | function doOneIteration() {
|
5761 | var start = (new Date()).getTime();
|
5762 | that.rowRenderer.redrawAfterModelUpdate();
|
5763 | var endProcessing = (new Date()).getTime();
|
5764 | setTimeout(function () {
|
5765 | var endReflow = (new Date()).getTime();
|
5766 | var durationProcessing = endProcessing - start;
|
5767 | var durationReflow = endReflow - endProcessing;
|
5768 | console.log('duration: processing = ' + durationProcessing + 'ms, reflow = ' + durationReflow + 'ms');
|
5769 | iterationCount++;
|
5770 | totalProcessing += durationProcessing;
|
5771 | totalReflow += durationReflow;
|
5772 | if (iterationCount < count) {
|
5773 |
|
5774 | setTimeout(doOneIteration, 1000);
|
5775 | }
|
5776 | else {
|
5777 | finish();
|
5778 | }
|
5779 | }, 0);
|
5780 | }
|
5781 | function finish() {
|
5782 | console.log('tests complete. iteration count = ' + iterationCount);
|
5783 | console.log('average processing = ' + (totalProcessing / iterationCount) + 'ms');
|
5784 | console.log('average reflow = ' + (totalReflow / iterationCount) + 'ms');
|
5785 | }
|
5786 | };
|
5787 |
|
5788 | GridApi.prototype.refreshView = function () {
|
5789 | console.warn('ag-Grid: since v11.1, refreshView() is deprecated, please call refreshCells() or redrawRows() instead');
|
5790 | this.redrawRows();
|
5791 | };
|
5792 |
|
5793 | GridApi.prototype.refreshRows = function (rowNodes) {
|
5794 | console.warn('since ag-Grid v11.1, refreshRows() is deprecated, please use refreshCells({rowNodes: rows}) or redrawRows({rowNodes: rows}) instead');
|
5795 | this.refreshCells({ rowNodes: rowNodes });
|
5796 | };
|
5797 |
|
5798 | GridApi.prototype.rowDataChanged = function (rows) {
|
5799 | console.log('ag-Grid: rowDataChanged is deprecated, either call refreshView() to refresh everything, or call rowNode.setRowData(newData) to set value on a particular node');
|
5800 | this.redrawRows();
|
5801 | };
|
5802 |
|
5803 | GridApi.prototype.softRefreshView = function () {
|
5804 | console.error('ag-Grid: since v16, softRefreshView() is no longer supported. Please check the documentation on how to refresh.');
|
5805 | };
|
5806 |
|
5807 | GridApi.prototype.refreshGroupRows = function () {
|
5808 | console.warn('ag-Grid: since v11.1, refreshGroupRows() is no longer supported, call refreshCells() instead. ' +
|
5809 | 'Because refreshCells() now does dirty checking, it will only refresh cells that have changed, so it should ' +
|
5810 | 'not be necessary to only refresh the group rows.');
|
5811 | this.refreshCells();
|
5812 | };
|
5813 | GridApi.prototype.setFunctionsReadOnly = function (readOnly) {
|
5814 | this.gridOptionsWrapper.setProperty('functionsReadOnly', readOnly);
|
5815 | };
|
5816 | GridApi.prototype.refreshHeader = function () {
|
5817 | this.headerRootComp.refreshHeader();
|
5818 | this.gridPanel.setBodyAndHeaderHeights();
|
5819 | };
|
5820 | GridApi.prototype.isAnyFilterPresent = function () {
|
5821 | return this.filterManager.isAnyFilterPresent();
|
5822 | };
|
5823 | GridApi.prototype.isAdvancedFilterPresent = function () {
|
5824 | return this.filterManager.isAdvancedFilterPresent();
|
5825 | };
|
5826 | GridApi.prototype.isQuickFilterPresent = function () {
|
5827 | return this.filterManager.isQuickFilterPresent();
|
5828 | };
|
5829 | GridApi.prototype.getModel = function () {
|
5830 | return this.rowModel;
|
5831 | };
|
5832 | GridApi.prototype.onGroupExpandedOrCollapsed = function (deprecated_refreshFromIndex) {
|
5833 | if (utils_1.Utils.missing(this.clientSideRowModel)) {
|
5834 | console.log('ag-Grid: cannot call onGroupExpandedOrCollapsed unless using normal row model');
|
5835 | }
|
5836 | if (utils_1.Utils.exists(deprecated_refreshFromIndex)) {
|
5837 | console.log('ag-Grid: api.onGroupExpandedOrCollapsed - refreshFromIndex parameter is no longer used, the grid will refresh all rows');
|
5838 | }
|
5839 |
|
5840 |
|
5841 |
|
5842 |
|
5843 | this.clientSideRowModel.refreshModel({ step: constants_1.Constants.STEP_MAP });
|
5844 | };
|
5845 | GridApi.prototype.refreshInMemoryRowModel = function (step) {
|
5846 | console.warn("ag-grid: since version 18.x, api.refreshInMemoryRowModel() should be replaced with api.refreshClientSideRowModel()");
|
5847 | this.refreshClientSideRowModel(step);
|
5848 | };
|
5849 | GridApi.prototype.refreshClientSideRowModel = function (step) {
|
5850 | if (utils_1.Utils.missing(this.clientSideRowModel)) {
|
5851 | console.log('cannot call refreshClientSideRowModel unless using normal row model');
|
5852 | }
|
5853 | var paramsStep = constants_1.Constants.STEP_EVERYTHING;
|
5854 | var stepsMapped = {
|
5855 | group: constants_1.Constants.STEP_EVERYTHING,
|
5856 | filter: constants_1.Constants.STEP_FILTER,
|
5857 | map: constants_1.Constants.STEP_MAP,
|
5858 | aggregate: constants_1.Constants.STEP_AGGREGATE,
|
5859 | sort: constants_1.Constants.STEP_SORT,
|
5860 | pivot: constants_1.Constants.STEP_PIVOT
|
5861 | };
|
5862 | if (utils_1.Utils.exists(step)) {
|
5863 | paramsStep = stepsMapped[step];
|
5864 | }
|
5865 | if (utils_1.Utils.missing(paramsStep)) {
|
5866 | console.error("ag-Grid: invalid step " + step + ", available steps are " + Object.keys(stepsMapped).join(', '));
|
5867 | return;
|
5868 | }
|
5869 | var modelParams = {
|
5870 | step: paramsStep,
|
5871 | keepRenderedRows: true,
|
5872 | animate: true,
|
5873 | keepEditingRows: true
|
5874 | };
|
5875 | this.clientSideRowModel.refreshModel(modelParams);
|
5876 | };
|
5877 | GridApi.prototype.isAnimationFrameQueueEmpty = function () {
|
5878 | return this.animationFrameService.isQueueEmpty();
|
5879 | };
|
5880 | GridApi.prototype.getRowNode = function (id) {
|
5881 | return this.rowModel.getRowNode(id);
|
5882 | };
|
5883 | GridApi.prototype.expandAll = function () {
|
5884 | if (utils_1.Utils.missing(this.clientSideRowModel)) {
|
5885 | console.warn('ag-Grid: cannot call expandAll unless using normal row model');
|
5886 | return;
|
5887 | }
|
5888 | this.clientSideRowModel.expandOrCollapseAll(true);
|
5889 | };
|
5890 | GridApi.prototype.collapseAll = function () {
|
5891 | if (utils_1.Utils.missing(this.clientSideRowModel)) {
|
5892 | console.warn('ag-Grid: cannot call collapseAll unless using normal row model');
|
5893 | return;
|
5894 | }
|
5895 | this.clientSideRowModel.expandOrCollapseAll(false);
|
5896 | };
|
5897 | GridApi.prototype.addVirtualRowListener = function (eventName, rowIndex, callback) {
|
5898 | if (typeof eventName !== 'string') {
|
5899 | console.log('ag-Grid: addVirtualRowListener is deprecated, please use addRenderedRowListener.');
|
5900 | }
|
5901 | this.addRenderedRowListener(eventName, rowIndex, callback);
|
5902 | };
|
5903 | GridApi.prototype.addRenderedRowListener = function (eventName, rowIndex, callback) {
|
5904 | if (eventName === 'virtualRowSelected') {
|
5905 | console.log('ag-Grid: event virtualRowSelected is deprecated, to register for individual row ' +
|
5906 | 'selection events, add a listener directly to the row node.');
|
5907 | }
|
5908 | this.rowRenderer.addRenderedRowListener(eventName, rowIndex, callback);
|
5909 | };
|
5910 | GridApi.prototype.setQuickFilter = function (newFilter) {
|
5911 | this.filterManager.setQuickFilter(newFilter);
|
5912 | };
|
5913 | GridApi.prototype.selectIndex = function (index, tryMulti, suppressEvents) {
|
5914 | console.log('ag-Grid: do not use api for selection, call node.setSelected(value) instead');
|
5915 | if (suppressEvents) {
|
5916 | console.log('ag-Grid: suppressEvents is no longer supported, stop listening for the event if you no longer want it');
|
5917 | }
|
5918 | this.selectionController.selectIndex(index, tryMulti);
|
5919 | };
|
5920 | GridApi.prototype.deselectIndex = function (index, suppressEvents) {
|
5921 | if (suppressEvents === void 0) { suppressEvents = false; }
|
5922 | console.log('ag-Grid: do not use api for selection, call node.setSelected(value) instead');
|
5923 | if (suppressEvents) {
|
5924 | console.log('ag-Grid: suppressEvents is no longer supported, stop listening for the event if you no longer want it');
|
5925 | }
|
5926 | this.selectionController.deselectIndex(index);
|
5927 | };
|
5928 | GridApi.prototype.selectNode = function (node, tryMulti, suppressEvents) {
|
5929 | if (tryMulti === void 0) { tryMulti = false; }
|
5930 | if (suppressEvents === void 0) { suppressEvents = false; }
|
5931 | console.log('ag-Grid: API for selection is deprecated, call node.setSelected(value) instead');
|
5932 | if (suppressEvents) {
|
5933 | console.log('ag-Grid: suppressEvents is no longer supported, stop listening for the event if you no longer want it');
|
5934 | }
|
5935 | node.setSelectedParams({ newValue: true, clearSelection: !tryMulti });
|
5936 | };
|
5937 | GridApi.prototype.deselectNode = function (node, suppressEvents) {
|
5938 | if (suppressEvents === void 0) { suppressEvents = false; }
|
5939 | console.log('ag-Grid: API for selection is deprecated, call node.setSelected(value) instead');
|
5940 | if (suppressEvents) {
|
5941 | console.log('ag-Grid: suppressEvents is no longer supported, stop listening for the event if you no longer want it');
|
5942 | }
|
5943 | node.setSelectedParams({ newValue: false });
|
5944 | };
|
5945 | GridApi.prototype.selectAll = function () {
|
5946 | this.selectionController.selectAllRowNodes();
|
5947 | };
|
5948 | GridApi.prototype.deselectAll = function () {
|
5949 | this.selectionController.deselectAllRowNodes();
|
5950 | };
|
5951 | GridApi.prototype.selectAllFiltered = function () {
|
5952 | this.selectionController.selectAllRowNodes(true);
|
5953 | };
|
5954 | GridApi.prototype.deselectAllFiltered = function () {
|
5955 | this.selectionController.deselectAllRowNodes(true);
|
5956 | };
|
5957 | GridApi.prototype.recomputeAggregates = function () {
|
5958 | if (utils_1.Utils.missing(this.clientSideRowModel)) {
|
5959 | console.warn('cannot call recomputeAggregates unless using normal row model');
|
5960 | }
|
5961 | console.warn("recomputeAggregates is deprecated, please call api.refreshClientSideRowModel('aggregate') instead");
|
5962 | this.clientSideRowModel.refreshModel({ step: constants_1.Constants.STEP_AGGREGATE });
|
5963 | };
|
5964 | GridApi.prototype.sizeColumnsToFit = function () {
|
5965 | this.gridPanel.sizeColumnsToFit();
|
5966 | };
|
5967 | GridApi.prototype.showLoadingOverlay = function () {
|
5968 | this.gridPanel.showLoadingOverlay();
|
5969 | };
|
5970 | GridApi.prototype.showNoRowsOverlay = function () {
|
5971 | this.gridPanel.showNoRowsOverlay();
|
5972 | };
|
5973 | GridApi.prototype.hideOverlay = function () {
|
5974 | this.gridPanel.hideOverlay();
|
5975 | };
|
5976 | GridApi.prototype.isNodeSelected = function (node) {
|
5977 | console.log('ag-Grid: no need to call api.isNodeSelected(), just call node.isSelected() instead');
|
5978 | return node.isSelected();
|
5979 | };
|
5980 | GridApi.prototype.getSelectedNodesById = function () {
|
5981 | console.error('ag-Grid: since version 3.4, getSelectedNodesById no longer exists, use getSelectedNodes() instead');
|
5982 | return null;
|
5983 | };
|
5984 | GridApi.prototype.getSelectedNodes = function () {
|
5985 | return this.selectionController.getSelectedNodes();
|
5986 | };
|
5987 | GridApi.prototype.getSelectedRows = function () {
|
5988 | return this.selectionController.getSelectedRows();
|
5989 | };
|
5990 | GridApi.prototype.getBestCostNodeSelection = function () {
|
5991 | return this.selectionController.getBestCostNodeSelection();
|
5992 | };
|
5993 | GridApi.prototype.getRenderedNodes = function () {
|
5994 | return this.rowRenderer.getRenderedNodes();
|
5995 | };
|
5996 | GridApi.prototype.ensureColIndexVisible = function (index) {
|
5997 | console.warn('ag-Grid: ensureColIndexVisible(index) no longer supported, use ensureColumnVisible(colKey) instead.');
|
5998 | };
|
5999 | GridApi.prototype.ensureColumnVisible = function (key) {
|
6000 | this.gridPanel.ensureColumnVisible(key);
|
6001 | };
|
6002 |
|
6003 | GridApi.prototype.ensureIndexVisible = function (index, position) {
|
6004 | this.gridPanel.ensureIndexVisible(index, position);
|
6005 | };
|
6006 |
|
6007 | GridApi.prototype.ensureNodeVisible = function (comparator, position) {
|
6008 | this.gridCore.ensureNodeVisible(comparator, position);
|
6009 | };
|
6010 | GridApi.prototype.forEachLeafNode = function (callback) {
|
6011 | if (utils_1.Utils.missing(this.clientSideRowModel)) {
|
6012 | console.log('cannot call forEachNode unless using normal row model');
|
6013 | }
|
6014 | this.clientSideRowModel.forEachLeafNode(callback);
|
6015 | };
|
6016 | GridApi.prototype.forEachNode = function (callback) {
|
6017 | this.rowModel.forEachNode(callback);
|
6018 | };
|
6019 | GridApi.prototype.forEachNodeAfterFilter = function (callback) {
|
6020 | if (utils_1.Utils.missing(this.clientSideRowModel)) {
|
6021 | console.log('cannot call forEachNodeAfterFilter unless using normal row model');
|
6022 | }
|
6023 | this.clientSideRowModel.forEachNodeAfterFilter(callback);
|
6024 | };
|
6025 | GridApi.prototype.forEachNodeAfterFilterAndSort = function (callback) {
|
6026 | if (utils_1.Utils.missing(this.clientSideRowModel)) {
|
6027 | console.log('cannot call forEachNodeAfterFilterAndSort unless using normal row model');
|
6028 | }
|
6029 | this.clientSideRowModel.forEachNodeAfterFilterAndSort(callback);
|
6030 | };
|
6031 | GridApi.prototype.getFilterApiForColDef = function (colDef) {
|
6032 | console.warn('ag-grid API method getFilterApiForColDef deprecated, use getFilterApi instead');
|
6033 | return this.getFilterInstance(colDef);
|
6034 | };
|
6035 | GridApi.prototype.getFilterInstance = function (key) {
|
6036 | var column = this.columnController.getPrimaryColumn(key);
|
6037 | if (column) {
|
6038 | return this.filterManager.getFilterComponent(column).resolveNow(null, function (filterComp) { return filterComp; });
|
6039 | }
|
6040 | };
|
6041 | GridApi.prototype.getFilterApi = function (key) {
|
6042 | console.warn('ag-Grid: getFilterApi is deprecated, use getFilterInstance instead');
|
6043 | return this.getFilterInstance(key);
|
6044 | };
|
6045 | GridApi.prototype.destroyFilter = function (key) {
|
6046 | var column = this.columnController.getPrimaryColumn(key);
|
6047 | if (column) {
|
6048 | return this.filterManager.destroyFilter(column, "filterDestroyed");
|
6049 | }
|
6050 | };
|
6051 | GridApi.prototype.getColumnDef = function (key) {
|
6052 | var column = this.columnController.getPrimaryColumn(key);
|
6053 | if (column) {
|
6054 | return column.getColDef();
|
6055 | }
|
6056 | else {
|
6057 | return null;
|
6058 | }
|
6059 | };
|
6060 | GridApi.prototype.onFilterChanged = function () {
|
6061 | this.filterManager.onFilterChanged();
|
6062 | };
|
6063 | GridApi.prototype.onSortChanged = function () {
|
6064 | this.sortController.onSortChanged();
|
6065 | };
|
6066 | GridApi.prototype.setSortModel = function (sortModel, source) {
|
6067 | if (source === void 0) { source = "api"; }
|
6068 | this.sortController.setSortModel(sortModel, source);
|
6069 | };
|
6070 | GridApi.prototype.getSortModel = function () {
|
6071 | return this.sortController.getSortModel();
|
6072 | };
|
6073 | GridApi.prototype.setFilterModel = function (model) {
|
6074 | this.filterManager.setFilterModel(model);
|
6075 | };
|
6076 | GridApi.prototype.getFilterModel = function () {
|
6077 | return this.filterManager.getFilterModel();
|
6078 | };
|
6079 | GridApi.prototype.getFocusedCell = function () {
|
6080 | return this.focusedCellController.getFocusedCell();
|
6081 | };
|
6082 | GridApi.prototype.clearFocusedCell = function () {
|
6083 | return this.focusedCellController.clearFocusedCell();
|
6084 | };
|
6085 | GridApi.prototype.setFocusedCell = function (rowIndex, colKey, floating) {
|
6086 | this.focusedCellController.setFocusedCell(rowIndex, colKey, floating, true);
|
6087 | };
|
6088 | GridApi.prototype.setSuppressRowDrag = function (value) {
|
6089 | this.gridOptionsWrapper.setProperty(gridOptionsWrapper_1.GridOptionsWrapper.PROP_SUPPRESS_ROW_DRAG, value);
|
6090 | };
|
6091 | GridApi.prototype.setHeaderHeight = function (headerHeight) {
|
6092 | this.gridOptionsWrapper.setProperty(gridOptionsWrapper_1.GridOptionsWrapper.PROP_HEADER_HEIGHT, headerHeight);
|
6093 | this.doLayout();
|
6094 | };
|
6095 | GridApi.prototype.setGridAutoHeight = function (gridAutoHeight) {
|
6096 | this.gridOptionsWrapper.setProperty(gridOptionsWrapper_1.GridOptionsWrapper.PROP_GRID_AUTO_HEIGHT, gridAutoHeight);
|
6097 | };
|
6098 | GridApi.prototype.getPreferredWidth = function () {
|
6099 | return this.gridCore.getPreferredWidth();
|
6100 | };
|
6101 | GridApi.prototype.setGroupHeaderHeight = function (headerHeight) {
|
6102 | this.gridOptionsWrapper.setProperty(gridOptionsWrapper_1.GridOptionsWrapper.PROP_GROUP_HEADER_HEIGHT, headerHeight);
|
6103 | this.doLayout();
|
6104 | };
|
6105 | GridApi.prototype.setFloatingFiltersHeight = function (headerHeight) {
|
6106 | this.gridOptionsWrapper.setProperty(gridOptionsWrapper_1.GridOptionsWrapper.PROP_FLOATING_FILTERS_HEIGHT, headerHeight);
|
6107 | this.doLayout();
|
6108 | };
|
6109 | GridApi.prototype.setPivotGroupHeaderHeight = function (headerHeight) {
|
6110 | this.gridOptionsWrapper.setProperty(gridOptionsWrapper_1.GridOptionsWrapper.PROP_PIVOT_GROUP_HEADER_HEIGHT, headerHeight);
|
6111 | this.doLayout();
|
6112 | };
|
6113 | GridApi.prototype.setPivotHeaderHeight = function (headerHeight) {
|
6114 | this.gridOptionsWrapper.setProperty(gridOptionsWrapper_1.GridOptionsWrapper.PROP_PIVOT_HEADER_HEIGHT, headerHeight);
|
6115 | this.doLayout();
|
6116 | };
|
6117 | GridApi.prototype.showToolPanel = function (show) {
|
6118 | this.gridCore.showToolPanel(show);
|
6119 | };
|
6120 | GridApi.prototype.setSuppressClipboardPaste = function (value) {
|
6121 | this.gridOptionsWrapper.setProperty(gridOptionsWrapper_1.GridOptionsWrapper.PROP_SUPPRESS_CLIPBOARD_PASTE, value);
|
6122 | };
|
6123 | GridApi.prototype.isToolPanelShowing = function () {
|
6124 | return this.gridCore.isToolPanelShowing();
|
6125 | };
|
6126 | GridApi.prototype.doLayout = function () {
|
6127 | this.gridPanel.checkViewportAndScrolls();
|
6128 | };
|
6129 | GridApi.prototype.resetRowHeights = function () {
|
6130 | if (utils_1.Utils.exists(this.clientSideRowModel)) {
|
6131 | this.clientSideRowModel.resetRowHeights();
|
6132 | }
|
6133 | };
|
6134 | GridApi.prototype.setGroupRemoveSingleChildren = function (value) {
|
6135 | this.gridOptionsWrapper.setProperty(gridOptionsWrapper_1.GridOptionsWrapper.PROP_GROUP_REMOVE_SINGLE_CHILDREN, value);
|
6136 | };
|
6137 | GridApi.prototype.setGroupRemoveLowestSingleChildren = function (value) {
|
6138 | this.gridOptionsWrapper.setProperty(gridOptionsWrapper_1.GridOptionsWrapper.PROP_GROUP_REMOVE_LOWEST_SINGLE_CHILDREN, value);
|
6139 | };
|
6140 | GridApi.prototype.onRowHeightChanged = function () {
|
6141 | if (utils_1.Utils.exists(this.clientSideRowModel)) {
|
6142 | this.clientSideRowModel.onRowHeightChanged();
|
6143 | }
|
6144 | };
|
6145 | GridApi.prototype.getValue = function (colKey, rowNode) {
|
6146 | var column = this.columnController.getPrimaryColumn(colKey);
|
6147 | if (utils_1.Utils.missing(column)) {
|
6148 | column = this.columnController.getGridColumn(colKey);
|
6149 | }
|
6150 | if (utils_1.Utils.missing(column)) {
|
6151 | return null;
|
6152 | }
|
6153 | else {
|
6154 | return this.valueService.getValue(column, rowNode);
|
6155 | }
|
6156 | };
|
6157 | GridApi.prototype.addEventListener = function (eventType, listener) {
|
6158 | var async = this.gridOptionsWrapper.useAsyncEvents();
|
6159 | this.eventService.addEventListener(eventType, listener, async);
|
6160 | };
|
6161 | GridApi.prototype.addGlobalListener = function (listener) {
|
6162 | var async = this.gridOptionsWrapper.useAsyncEvents();
|
6163 | this.eventService.addGlobalListener(listener, async);
|
6164 | };
|
6165 | GridApi.prototype.removeEventListener = function (eventType, listener) {
|
6166 | var async = this.gridOptionsWrapper.useAsyncEvents();
|
6167 | this.eventService.removeEventListener(eventType, listener, async);
|
6168 | };
|
6169 | GridApi.prototype.removeGlobalListener = function (listener) {
|
6170 | var async = this.gridOptionsWrapper.useAsyncEvents();
|
6171 | this.eventService.removeGlobalListener(listener, async);
|
6172 | };
|
6173 | GridApi.prototype.dispatchEvent = function (event) {
|
6174 | this.eventService.dispatchEvent(event);
|
6175 | };
|
6176 | GridApi.prototype.destroy = function () {
|
6177 | this.context.destroy();
|
6178 | };
|
6179 | GridApi.prototype.resetQuickFilter = function () {
|
6180 | this.rowModel.forEachNode(function (node) { return node.quickFilterAggregateText = null; });
|
6181 | };
|
6182 | GridApi.prototype.getRangeSelections = function () {
|
6183 | if (this.rangeController) {
|
6184 | return this.rangeController.getCellRanges();
|
6185 | }
|
6186 | else {
|
6187 | console.warn('ag-Grid: cell range selection is only available in ag-Grid Enterprise');
|
6188 | return null;
|
6189 | }
|
6190 | };
|
6191 | GridApi.prototype.camelCaseToHumanReadable = function (camelCase) {
|
6192 | return utils_1.Utils.camelCaseToHumanText(camelCase);
|
6193 | };
|
6194 | GridApi.prototype.addRangeSelection = function (rangeSelection) {
|
6195 | if (!this.rangeController) {
|
6196 | console.warn('ag-Grid: cell range selection is only available in ag-Grid Enterprise');
|
6197 | }
|
6198 | this.rangeController.addRange(rangeSelection);
|
6199 | };
|
6200 | GridApi.prototype.clearRangeSelection = function () {
|
6201 | if (!this.rangeController) {
|
6202 | console.warn('ag-Grid: cell range selection is only available in ag-Grid Enterprise');
|
6203 | }
|
6204 | this.rangeController.clearSelection();
|
6205 | };
|
6206 | GridApi.prototype.copySelectedRowsToClipboard = function (includeHeader, columnKeys) {
|
6207 | if (!this.clipboardService) {
|
6208 | console.warn('ag-Grid: clipboard is only available in ag-Grid Enterprise');
|
6209 | }
|
6210 | this.clipboardService.copySelectedRowsToClipboard(includeHeader, columnKeys);
|
6211 | };
|
6212 | GridApi.prototype.copySelectedRangeToClipboard = function (includeHeader) {
|
6213 | if (!this.clipboardService) {
|
6214 | console.warn('ag-Grid: clipboard is only available in ag-Grid Enterprise');
|
6215 | }
|
6216 | this.clipboardService.copySelectedRangeToClipboard(includeHeader);
|
6217 | };
|
6218 | GridApi.prototype.copySelectedRangeDown = function () {
|
6219 | if (!this.clipboardService) {
|
6220 | console.warn('ag-Grid: clipboard is only available in ag-Grid Enterprise');
|
6221 | }
|
6222 | this.clipboardService.copyRangeDown();
|
6223 | };
|
6224 | GridApi.prototype.showColumnMenuAfterButtonClick = function (colKey, buttonElement) {
|
6225 | var column = this.columnController.getPrimaryColumn(colKey);
|
6226 | this.menuFactory.showMenuAfterButtonClick(column, buttonElement);
|
6227 | };
|
6228 | GridApi.prototype.showColumnMenuAfterMouseClick = function (colKey, mouseEvent) {
|
6229 | var column = this.columnController.getPrimaryColumn(colKey);
|
6230 | this.menuFactory.showMenuAfterMouseEvent(column, mouseEvent);
|
6231 | };
|
6232 | GridApi.prototype.hidePopupMenu = function () {
|
6233 |
|
6234 | if (this.contextMenuFactory) {
|
6235 | this.contextMenuFactory.hideActiveMenu();
|
6236 | }
|
6237 |
|
6238 | this.menuFactory.hideActiveMenu();
|
6239 | };
|
6240 | GridApi.prototype.setPopupParent = function (ePopupParent) {
|
6241 | this.gridOptionsWrapper.setProperty(gridOptionsWrapper_1.GridOptionsWrapper.PROP_POPUP_PARENT, ePopupParent);
|
6242 | };
|
6243 | GridApi.prototype.tabToNextCell = function () {
|
6244 | return this.rowRenderer.tabToNextCell(false);
|
6245 | };
|
6246 | GridApi.prototype.tabToPreviousCell = function () {
|
6247 | return this.rowRenderer.tabToNextCell(true);
|
6248 | };
|
6249 | GridApi.prototype.getCellRendererInstances = function (params) {
|
6250 | if (params === void 0) { params = {}; }
|
6251 | return this.rowRenderer.getCellRendererInstances(params);
|
6252 | };
|
6253 | GridApi.prototype.getCellEditorInstances = function (params) {
|
6254 | if (params === void 0) { params = {}; }
|
6255 | return this.rowRenderer.getCellEditorInstances(params);
|
6256 | };
|
6257 | GridApi.prototype.getEditingCells = function () {
|
6258 | return this.rowRenderer.getEditingCells();
|
6259 | };
|
6260 | GridApi.prototype.stopEditing = function (cancel) {
|
6261 | if (cancel === void 0) { cancel = false; }
|
6262 | this.rowRenderer.stopEditing(cancel);
|
6263 | };
|
6264 | GridApi.prototype.startEditingCell = function (params) {
|
6265 | var column = this.columnController.getGridColumn(params.colKey);
|
6266 | if (!column) {
|
6267 | console.warn("ag-Grid: no column found for " + params.colKey);
|
6268 | return;
|
6269 | }
|
6270 | var gridCellDef = {
|
6271 | rowIndex: params.rowIndex,
|
6272 | floating: params.rowPinned,
|
6273 | column: column
|
6274 | };
|
6275 | var gridCell = new gridCell_1.GridCell(gridCellDef);
|
6276 | var notPinned = utils_1.Utils.missing(params.rowPinned);
|
6277 | if (notPinned) {
|
6278 | this.gridPanel.ensureIndexVisible(params.rowIndex);
|
6279 | }
|
6280 | this.rowRenderer.startEditingCell(gridCell, params.keyPress, params.charPress);
|
6281 | };
|
6282 | GridApi.prototype.addAggFunc = function (key, aggFunc) {
|
6283 | if (this.aggFuncService) {
|
6284 | this.aggFuncService.addAggFunc(key, aggFunc);
|
6285 | }
|
6286 | };
|
6287 | GridApi.prototype.addAggFuncs = function (aggFuncs) {
|
6288 | if (this.aggFuncService) {
|
6289 | this.aggFuncService.addAggFuncs(aggFuncs);
|
6290 | }
|
6291 | };
|
6292 | GridApi.prototype.clearAggFuncs = function () {
|
6293 | if (this.aggFuncService) {
|
6294 | this.aggFuncService.clear();
|
6295 | }
|
6296 | };
|
6297 | GridApi.prototype.updateRowData = function (rowDataTransaction) {
|
6298 | var res = null;
|
6299 | if (this.clientSideRowModel) {
|
6300 | res = this.clientSideRowModel.updateRowData(rowDataTransaction);
|
6301 | }
|
6302 | else if (this.infinitePageRowModel) {
|
6303 | this.infinitePageRowModel.updateRowData(rowDataTransaction);
|
6304 | }
|
6305 | else {
|
6306 | console.error('ag-Grid: updateRowData() only works with ClientSideRowModel and InfiniteRowModel.');
|
6307 | }
|
6308 |
|
6309 | if (!this.gridOptionsWrapper.isSuppressChangeDetection()) {
|
6310 | this.rowRenderer.refreshCells();
|
6311 | }
|
6312 | return res;
|
6313 | };
|
6314 | GridApi.prototype.batchUpdateRowData = function (rowDataTransaction, callback) {
|
6315 | if (!this.clientSideRowModel) {
|
6316 | console.error('ag-Grid: api.batchUpdateRowData() only works with ClientSideRowModel.');
|
6317 | return;
|
6318 | }
|
6319 | this.clientSideRowModel.batchUpdateRowData(rowDataTransaction, callback);
|
6320 | };
|
6321 | GridApi.prototype.insertItemsAtIndex = function (index, items, skipRefresh) {
|
6322 | if (skipRefresh === void 0) { skipRefresh = false; }
|
6323 | console.warn('ag-Grid: insertItemsAtIndex() is deprecated, use updateRowData(transaction) instead.');
|
6324 | this.updateRowData({ add: items, addIndex: index, update: null, remove: null });
|
6325 | };
|
6326 | GridApi.prototype.removeItems = function (rowNodes, skipRefresh) {
|
6327 | if (skipRefresh === void 0) { skipRefresh = false; }
|
6328 | console.warn('ag-Grid: removeItems() is deprecated, use updateRowData(transaction) instead.');
|
6329 | var dataToRemove = rowNodes.map(function (rowNode) { return rowNode.data; });
|
6330 | this.updateRowData({ add: null, addIndex: null, update: null, remove: dataToRemove });
|
6331 | };
|
6332 | GridApi.prototype.addItems = function (items, skipRefresh) {
|
6333 | if (skipRefresh === void 0) { skipRefresh = false; }
|
6334 | console.warn('ag-Grid: addItems() is deprecated, use updateRowData(transaction) instead.');
|
6335 | this.updateRowData({ add: items, addIndex: null, update: null, remove: null });
|
6336 | };
|
6337 | GridApi.prototype.refreshVirtualPageCache = function () {
|
6338 | console.warn('ag-Grid: refreshVirtualPageCache() is now called refreshInfiniteCache(), please call refreshInfiniteCache() instead');
|
6339 | this.refreshInfiniteCache();
|
6340 | };
|
6341 | GridApi.prototype.refreshInfinitePageCache = function () {
|
6342 | console.warn('ag-Grid: refreshInfinitePageCache() is now called refreshInfiniteCache(), please call refreshInfiniteCache() instead');
|
6343 | this.refreshInfiniteCache();
|
6344 | };
|
6345 | GridApi.prototype.refreshInfiniteCache = function () {
|
6346 | if (this.infinitePageRowModel) {
|
6347 | this.infinitePageRowModel.refreshCache();
|
6348 | }
|
6349 | else {
|
6350 | console.warn("ag-Grid: api.refreshInfiniteCache is only available when rowModelType='infinite'.");
|
6351 | }
|
6352 | };
|
6353 | GridApi.prototype.purgeVirtualPageCache = function () {
|
6354 | console.warn('ag-Grid: purgeVirtualPageCache() is now called purgeInfiniteCache(), please call purgeInfiniteCache() instead');
|
6355 | this.purgeInfinitePageCache();
|
6356 | };
|
6357 | GridApi.prototype.purgeInfinitePageCache = function () {
|
6358 | console.warn('ag-Grid: purgeInfinitePageCache() is now called purgeInfiniteCache(), please call purgeInfiniteCache() instead');
|
6359 | this.purgeInfiniteCache();
|
6360 | };
|
6361 | GridApi.prototype.purgeInfiniteCache = function () {
|
6362 | if (this.infinitePageRowModel) {
|
6363 | this.infinitePageRowModel.purgeCache();
|
6364 | }
|
6365 | else {
|
6366 | console.warn("ag-Grid: api.purgeInfiniteCache is only available when rowModelType='infinite'.");
|
6367 | }
|
6368 | };
|
6369 |
|
6370 | GridApi.prototype.purgeEnterpriseCache = function (route) {
|
6371 | console.warn("ag-grid: since version 18.x, api.purgeEnterpriseCache() should be replaced with api.purgeServerSideCache()");
|
6372 | this.purgeServerSideCache(route);
|
6373 | };
|
6374 | GridApi.prototype.purgeServerSideCache = function (route) {
|
6375 | if (this.serverSideRowModel) {
|
6376 | this.serverSideRowModel.purgeCache(route);
|
6377 | }
|
6378 | else {
|
6379 | console.warn("ag-Grid: api.purgeServerSideCache is only available when rowModelType='enterprise'.");
|
6380 | }
|
6381 | };
|
6382 |
|
6383 |
|
6384 |
|
6385 |
|
6386 |
|
6387 |
|
6388 |
|
6389 |
|
6390 |
|
6391 |
|
6392 |
|
6393 |
|
6394 |
|
6395 |
|
6396 |
|
6397 | GridApi.prototype.getVirtualRowCount = function () {
|
6398 | console.warn('ag-Grid: getVirtualRowCount() is now called getInfiniteRowCount(), please call getInfiniteRowCount() instead');
|
6399 | return this.getInfiniteRowCount();
|
6400 | };
|
6401 | GridApi.prototype.getInfiniteRowCount = function () {
|
6402 | if (this.infinitePageRowModel) {
|
6403 | return this.infinitePageRowModel.getVirtualRowCount();
|
6404 | }
|
6405 | else {
|
6406 | console.warn("ag-Grid: api.getVirtualRowCount is only available when rowModelType='virtual'.");
|
6407 | }
|
6408 | };
|
6409 | GridApi.prototype.isMaxRowFound = function () {
|
6410 | if (this.infinitePageRowModel) {
|
6411 | return this.infinitePageRowModel.isMaxRowFound();
|
6412 | }
|
6413 | else {
|
6414 | console.warn("ag-Grid: api.isMaxRowFound is only available when rowModelType='virtual'.");
|
6415 | }
|
6416 | };
|
6417 | GridApi.prototype.setVirtualRowCount = function (rowCount, maxRowFound) {
|
6418 | console.warn('ag-Grid: setVirtualRowCount() is now called setInfiniteRowCount(), please call setInfiniteRowCount() instead');
|
6419 | this.setInfiniteRowCount(rowCount, maxRowFound);
|
6420 | };
|
6421 | GridApi.prototype.setInfiniteRowCount = function (rowCount, maxRowFound) {
|
6422 | if (this.infinitePageRowModel) {
|
6423 | this.infinitePageRowModel.setVirtualRowCount(rowCount, maxRowFound);
|
6424 | }
|
6425 | else {
|
6426 | console.warn("ag-Grid: api.setVirtualRowCount is only available when rowModelType='virtual'.");
|
6427 | }
|
6428 | };
|
6429 | GridApi.prototype.getVirtualPageState = function () {
|
6430 | console.warn('ag-Grid: getVirtualPageState() is now called getCacheBlockState(), please call getCacheBlockState() instead');
|
6431 | return this.getCacheBlockState();
|
6432 | };
|
6433 | GridApi.prototype.getInfinitePageState = function () {
|
6434 | console.warn('ag-Grid: getInfinitePageState() is now called getCacheBlockState(), please call getCacheBlockState() instead');
|
6435 | return this.getCacheBlockState();
|
6436 | };
|
6437 | GridApi.prototype.getCacheBlockState = function () {
|
6438 | if (this.infinitePageRowModel) {
|
6439 | return this.infinitePageRowModel.getBlockState();
|
6440 | }
|
6441 | else if (this.serverSideRowModel) {
|
6442 | return this.serverSideRowModel.getBlockState();
|
6443 | }
|
6444 | else {
|
6445 | console.warn("ag-Grid: api.getCacheBlockState() is only available when rowModelType='infinite' or rowModelType='serverSide'.");
|
6446 | }
|
6447 | };
|
6448 | GridApi.prototype.checkGridSize = function () {
|
6449 | this.gridPanel.setBodyAndHeaderHeights();
|
6450 | };
|
6451 | GridApi.prototype.getFirstRenderedRow = function () {
|
6452 | console.log('in ag-Grid v12, getFirstRenderedRow() was renamed to getFirstDisplayedRow()');
|
6453 | return this.getFirstDisplayedRow();
|
6454 | };
|
6455 | GridApi.prototype.getFirstDisplayedRow = function () {
|
6456 | return this.rowRenderer.getFirstVirtualRenderedRow();
|
6457 | };
|
6458 | GridApi.prototype.getLastRenderedRow = function () {
|
6459 | console.log('in ag-Grid v12, getLastRenderedRow() was renamed to getLastDisplayedRow()');
|
6460 | return this.getLastDisplayedRow();
|
6461 | };
|
6462 | GridApi.prototype.getLastDisplayedRow = function () {
|
6463 | return this.rowRenderer.getLastVirtualRenderedRow();
|
6464 | };
|
6465 | GridApi.prototype.getDisplayedRowAtIndex = function (index) {
|
6466 | return this.rowModel.getRow(index);
|
6467 | };
|
6468 | GridApi.prototype.getDisplayedRowCount = function () {
|
6469 | return this.rowModel.getRowCount();
|
6470 | };
|
6471 | GridApi.prototype.paginationIsLastPageFound = function () {
|
6472 | return this.paginationProxy.isLastPageFound();
|
6473 | };
|
6474 | GridApi.prototype.paginationGetPageSize = function () {
|
6475 | return this.paginationProxy.getPageSize();
|
6476 | };
|
6477 | GridApi.prototype.paginationSetPageSize = function (size) {
|
6478 | this.gridOptionsWrapper.setProperty('paginationPageSize', size);
|
6479 | };
|
6480 | GridApi.prototype.paginationGetCurrentPage = function () {
|
6481 | return this.paginationProxy.getCurrentPage();
|
6482 | };
|
6483 | GridApi.prototype.paginationGetTotalPages = function () {
|
6484 | return this.paginationProxy.getTotalPages();
|
6485 | };
|
6486 | GridApi.prototype.paginationGetRowCount = function () {
|
6487 | return this.paginationProxy.getTotalRowCount();
|
6488 | };
|
6489 | GridApi.prototype.paginationGoToNextPage = function () {
|
6490 | this.paginationProxy.goToNextPage();
|
6491 | };
|
6492 | GridApi.prototype.paginationGoToPreviousPage = function () {
|
6493 | this.paginationProxy.goToPreviousPage();
|
6494 | };
|
6495 | GridApi.prototype.paginationGoToFirstPage = function () {
|
6496 | this.paginationProxy.goToFirstPage();
|
6497 | };
|
6498 | GridApi.prototype.paginationGoToLastPage = function () {
|
6499 | this.paginationProxy.goToLastPage();
|
6500 | };
|
6501 | GridApi.prototype.paginationGoToPage = function (page) {
|
6502 | this.paginationProxy.goToPage(page);
|
6503 | };
|
6504 | __decorate([
|
6505 | context_1.Autowired('immutableService'),
|
6506 | __metadata("design:type", immutableService_1.ImmutableService)
|
6507 | ], GridApi.prototype, "immutableService", void 0);
|
6508 | __decorate([
|
6509 | context_1.Autowired('csvCreator'),
|
6510 | __metadata("design:type", csvCreator_1.CsvCreator)
|
6511 | ], GridApi.prototype, "csvCreator", void 0);
|
6512 | __decorate([
|
6513 | context_1.Optional('excelCreator'),
|
6514 | __metadata("design:type", Object)
|
6515 | ], GridApi.prototype, "excelCreator", void 0);
|
6516 | __decorate([
|
6517 | context_1.Autowired('gridCore'),
|
6518 | __metadata("design:type", gridCore_1.GridCore)
|
6519 | ], GridApi.prototype, "gridCore", void 0);
|
6520 | __decorate([
|
6521 | context_1.Autowired('rowRenderer'),
|
6522 | __metadata("design:type", rowRenderer_1.RowRenderer)
|
6523 | ], GridApi.prototype, "rowRenderer", void 0);
|
6524 | __decorate([
|
6525 | context_1.Autowired('filterManager'),
|
6526 | __metadata("design:type", filterManager_1.FilterManager)
|
6527 | ], GridApi.prototype, "filterManager", void 0);
|
6528 | __decorate([
|
6529 | context_1.Autowired('columnController'),
|
6530 | __metadata("design:type", columnController_1.ColumnController)
|
6531 | ], GridApi.prototype, "columnController", void 0);
|
6532 | __decorate([
|
6533 | context_1.Autowired('selectionController'),
|
6534 | __metadata("design:type", selectionController_1.SelectionController)
|
6535 | ], GridApi.prototype, "selectionController", void 0);
|
6536 | __decorate([
|
6537 | context_1.Autowired('gridOptionsWrapper'),
|
6538 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
6539 | ], GridApi.prototype, "gridOptionsWrapper", void 0);
|
6540 | __decorate([
|
6541 | context_1.Autowired('valueService'),
|
6542 | __metadata("design:type", valueService_1.ValueService)
|
6543 | ], GridApi.prototype, "valueService", void 0);
|
6544 | __decorate([
|
6545 | context_1.Autowired('alignedGridsService'),
|
6546 | __metadata("design:type", alignedGridsService_1.AlignedGridsService)
|
6547 | ], GridApi.prototype, "alignedGridsService", void 0);
|
6548 | __decorate([
|
6549 | context_1.Autowired('eventService'),
|
6550 | __metadata("design:type", eventService_1.EventService)
|
6551 | ], GridApi.prototype, "eventService", void 0);
|
6552 | __decorate([
|
6553 | context_1.Autowired('pinnedRowModel'),
|
6554 | __metadata("design:type", pinnedRowModel_1.PinnedRowModel)
|
6555 | ], GridApi.prototype, "pinnedRowModel", void 0);
|
6556 | __decorate([
|
6557 | context_1.Autowired('context'),
|
6558 | __metadata("design:type", context_1.Context)
|
6559 | ], GridApi.prototype, "context", void 0);
|
6560 | __decorate([
|
6561 | context_1.Autowired('rowModel'),
|
6562 | __metadata("design:type", Object)
|
6563 | ], GridApi.prototype, "rowModel", void 0);
|
6564 | __decorate([
|
6565 | context_1.Autowired('sortController'),
|
6566 | __metadata("design:type", sortController_1.SortController)
|
6567 | ], GridApi.prototype, "sortController", void 0);
|
6568 | __decorate([
|
6569 | context_1.Autowired('paginationProxy'),
|
6570 | __metadata("design:type", paginationProxy_1.PaginationProxy)
|
6571 | ], GridApi.prototype, "paginationProxy", void 0);
|
6572 | __decorate([
|
6573 | context_1.Autowired('focusedCellController'),
|
6574 | __metadata("design:type", focusedCellController_1.FocusedCellController)
|
6575 | ], GridApi.prototype, "focusedCellController", void 0);
|
6576 | __decorate([
|
6577 | context_1.Optional('rangeController'),
|
6578 | __metadata("design:type", Object)
|
6579 | ], GridApi.prototype, "rangeController", void 0);
|
6580 | __decorate([
|
6581 | context_1.Optional('clipboardService'),
|
6582 | __metadata("design:type", Object)
|
6583 | ], GridApi.prototype, "clipboardService", void 0);
|
6584 | __decorate([
|
6585 | context_1.Optional('aggFuncService'),
|
6586 | __metadata("design:type", Object)
|
6587 | ], GridApi.prototype, "aggFuncService", void 0);
|
6588 | __decorate([
|
6589 | context_1.Autowired('menuFactory'),
|
6590 | __metadata("design:type", Object)
|
6591 | ], GridApi.prototype, "menuFactory", void 0);
|
6592 | __decorate([
|
6593 | context_1.Optional('contextMenuFactory'),
|
6594 | __metadata("design:type", Object)
|
6595 | ], GridApi.prototype, "contextMenuFactory", void 0);
|
6596 | __decorate([
|
6597 | context_1.Autowired('cellRendererFactory'),
|
6598 | __metadata("design:type", cellRendererFactory_1.CellRendererFactory)
|
6599 | ], GridApi.prototype, "cellRendererFactory", void 0);
|
6600 | __decorate([
|
6601 | context_1.Autowired('cellEditorFactory'),
|
6602 | __metadata("design:type", cellEditorFactory_1.CellEditorFactory)
|
6603 | ], GridApi.prototype, "cellEditorFactory", void 0);
|
6604 | __decorate([
|
6605 | context_1.Autowired('valueCache'),
|
6606 | __metadata("design:type", valueCache_1.ValueCache)
|
6607 | ], GridApi.prototype, "valueCache", void 0);
|
6608 | __decorate([
|
6609 | context_1.Optional('toolPanelComp'),
|
6610 | __metadata("design:type", Object)
|
6611 | ], GridApi.prototype, "toolPanelComp", void 0);
|
6612 | __decorate([
|
6613 | context_1.Autowired('animationFrameService'),
|
6614 | __metadata("design:type", animationFrameService_1.AnimationFrameService)
|
6615 | ], GridApi.prototype, "animationFrameService", void 0);
|
6616 | __decorate([
|
6617 | context_1.PostConstruct,
|
6618 | __metadata("design:type", Function),
|
6619 | __metadata("design:paramtypes", []),
|
6620 | __metadata("design:returntype", void 0)
|
6621 | ], GridApi.prototype, "init", null);
|
6622 | GridApi = __decorate([
|
6623 | context_1.Bean('gridApi')
|
6624 | ], GridApi);
|
6625 | return GridApi;
|
6626 | }());
|
6627 | exports.GridApi = GridApi;
|
6628 |
|
6629 |
|
6630 | }),
|
6631 |
|
6632 | (function(module, exports, __webpack_require__) {
|
6633 |
|
6634 | "use strict";
|
6635 |
|
6636 |
|
6637 |
|
6638 |
|
6639 |
|
6640 |
|
6641 |
|
6642 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
6643 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
6644 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
6645 | 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;
|
6646 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
6647 | };
|
6648 | var __metadata = (this && this.__metadata) || function (k, v) {
|
6649 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
6650 | };
|
6651 | Object.defineProperty(exports, "__esModule", { value: true });
|
6652 | var columnController_1 = __webpack_require__(4);
|
6653 | var context_1 = __webpack_require__(0);
|
6654 | var ColumnApi = (function () {
|
6655 | function ColumnApi() {
|
6656 | }
|
6657 | ColumnApi.prototype.sizeColumnsToFit = function (gridWidth) { this.columnController.sizeColumnsToFit(gridWidth, 'api'); };
|
6658 | ColumnApi.prototype.setColumnGroupOpened = function (group, newValue) { this.columnController.setColumnGroupOpened(group, newValue, 'api'); };
|
6659 | ColumnApi.prototype.getColumnGroup = function (name, instanceId) { return this.columnController.getColumnGroup(name, instanceId); };
|
6660 | ColumnApi.prototype.getOriginalColumnGroup = function (name) { return this.columnController.getOriginalColumnGroup(name); };
|
6661 | ColumnApi.prototype.getDisplayNameForColumn = function (column, location) { return this.columnController.getDisplayNameForColumn(column, location); };
|
6662 | ColumnApi.prototype.getDisplayNameForColumnGroup = function (columnGroup, location) { return this.columnController.getDisplayNameForColumnGroup(columnGroup, location); };
|
6663 | ColumnApi.prototype.getColumn = function (key) { return this.columnController.getPrimaryColumn(key); };
|
6664 | ColumnApi.prototype.setColumnState = function (columnState) { return this.columnController.setColumnState(columnState, 'api'); };
|
6665 | ColumnApi.prototype.getColumnState = function () { return this.columnController.getColumnState(); };
|
6666 | ColumnApi.prototype.resetColumnState = function () { this.columnController.resetColumnState('api'); };
|
6667 | ColumnApi.prototype.getColumnGroupState = function () { return this.columnController.getColumnGroupState(); };
|
6668 | ColumnApi.prototype.setColumnGroupState = function (stateItems) { this.columnController.setColumnGroupState(stateItems, 'api'); };
|
6669 | ColumnApi.prototype.resetColumnGroupState = function () { this.columnController.resetColumnGroupState('api'); };
|
6670 | ColumnApi.prototype.isPinning = function () { return this.columnController.isPinningLeft() || this.columnController.isPinningRight(); };
|
6671 | ColumnApi.prototype.isPinningLeft = function () { return this.columnController.isPinningLeft(); };
|
6672 | ColumnApi.prototype.isPinningRight = function () { return this.columnController.isPinningRight(); };
|
6673 | ColumnApi.prototype.getDisplayedColAfter = function (col) { return this.columnController.getDisplayedColAfter(col); };
|
6674 | ColumnApi.prototype.getDisplayedColBefore = function (col) { return this.columnController.getDisplayedColBefore(col); };
|
6675 | ColumnApi.prototype.setColumnVisible = function (key, visible) { this.columnController.setColumnVisible(key, visible, 'api'); };
|
6676 | ColumnApi.prototype.setColumnsVisible = function (keys, visible) { this.columnController.setColumnsVisible(keys, visible, 'api'); };
|
6677 | ColumnApi.prototype.setColumnPinned = function (key, pinned) { this.columnController.setColumnPinned(key, pinned, 'api'); };
|
6678 | ColumnApi.prototype.setColumnsPinned = function (keys, pinned) { this.columnController.setColumnsPinned(keys, pinned, 'api'); };
|
6679 | ColumnApi.prototype.getAllColumns = function () { return this.columnController.getAllPrimaryColumns(); };
|
6680 | ColumnApi.prototype.getAllGridColumns = function () { return this.columnController.getAllGridColumns(); };
|
6681 | ColumnApi.prototype.getDisplayedLeftColumns = function () { return this.columnController.getDisplayedLeftColumns(); };
|
6682 | ColumnApi.prototype.getDisplayedCenterColumns = function () { return this.columnController.getDisplayedCenterColumns(); };
|
6683 | ColumnApi.prototype.getDisplayedRightColumns = function () { return this.columnController.getDisplayedRightColumns(); };
|
6684 | ColumnApi.prototype.getAllDisplayedColumns = function () { return this.columnController.getAllDisplayedColumns(); };
|
6685 | ColumnApi.prototype.getAllDisplayedVirtualColumns = function () { return this.columnController.getAllDisplayedVirtualColumns(); };
|
6686 | ColumnApi.prototype.moveColumn = function (key, toIndex) {
|
6687 | if (typeof key === 'number') {
|
6688 |
|
6689 | console.log('ag-Grid: you are using moveColumn(fromIndex, toIndex) - moveColumn takes a column key and a destination index, not two indexes, to move with indexes use moveColumnByIndex(from,to) instead');
|
6690 | this.columnController.moveColumnByIndex(key, toIndex, 'api');
|
6691 | }
|
6692 | else {
|
6693 | this.columnController.moveColumn(key, toIndex, 'api');
|
6694 | }
|
6695 | };
|
6696 | ColumnApi.prototype.moveColumnByIndex = function (fromIndex, toIndex) { this.columnController.moveColumnByIndex(fromIndex, toIndex, 'api'); };
|
6697 | ColumnApi.prototype.moveColumns = function (columnsToMoveKeys, toIndex) { this.columnController.moveColumns(columnsToMoveKeys, toIndex, 'api'); };
|
6698 | ColumnApi.prototype.moveRowGroupColumn = function (fromIndex, toIndex) { this.columnController.moveRowGroupColumn(fromIndex, toIndex); };
|
6699 | ColumnApi.prototype.setColumnAggFunc = function (column, aggFunc) { this.columnController.setColumnAggFunc(column, aggFunc); };
|
6700 | ColumnApi.prototype.setColumnWidth = function (key, newWidth, finished) {
|
6701 | if (finished === void 0) { finished = true; }
|
6702 | this.columnController.setColumnWidth(key, newWidth, false, finished);
|
6703 | };
|
6704 | ColumnApi.prototype.setPivotMode = function (pivotMode) { this.columnController.setPivotMode(pivotMode); };
|
6705 | ColumnApi.prototype.isPivotMode = function () { return this.columnController.isPivotMode(); };
|
6706 | ColumnApi.prototype.getSecondaryPivotColumn = function (pivotKeys, valueColKey) { return this.columnController.getSecondaryPivotColumn(pivotKeys, valueColKey); };
|
6707 | ColumnApi.prototype.setValueColumns = function (colKeys) { this.columnController.setValueColumns(colKeys, 'api'); };
|
6708 | ColumnApi.prototype.getValueColumns = function () { return this.columnController.getValueColumns(); };
|
6709 | ColumnApi.prototype.removeValueColumn = function (colKey) { this.columnController.removeValueColumn(colKey, 'api'); };
|
6710 | ColumnApi.prototype.removeValueColumns = function (colKeys) { this.columnController.removeValueColumns(colKeys, 'api'); };
|
6711 | ColumnApi.prototype.addValueColumn = function (colKey) { this.columnController.addValueColumn(colKey, 'api'); };
|
6712 | ColumnApi.prototype.addValueColumns = function (colKeys) { this.columnController.addValueColumns(colKeys, 'api'); };
|
6713 | ColumnApi.prototype.setRowGroupColumns = function (colKeys) { this.columnController.setRowGroupColumns(colKeys, 'api'); };
|
6714 | ColumnApi.prototype.removeRowGroupColumn = function (colKey) { this.columnController.removeRowGroupColumn(colKey, 'api'); };
|
6715 | ColumnApi.prototype.removeRowGroupColumns = function (colKeys) { this.columnController.removeRowGroupColumns(colKeys, 'api'); };
|
6716 | ColumnApi.prototype.addRowGroupColumn = function (colKey) { this.columnController.addRowGroupColumn(colKey, 'api'); };
|
6717 | ColumnApi.prototype.addRowGroupColumns = function (colKeys) { this.columnController.addRowGroupColumns(colKeys, 'api'); };
|
6718 | ColumnApi.prototype.getRowGroupColumns = function () { return this.columnController.getRowGroupColumns(); };
|
6719 | ColumnApi.prototype.setPivotColumns = function (colKeys) { this.columnController.setPivotColumns(colKeys, 'api'); };
|
6720 | ColumnApi.prototype.removePivotColumn = function (colKey) { this.columnController.removePivotColumn(colKey, 'api'); };
|
6721 | ColumnApi.prototype.removePivotColumns = function (colKeys) { this.columnController.removePivotColumns(colKeys, 'api'); };
|
6722 | ColumnApi.prototype.addPivotColumn = function (colKey) { this.columnController.addPivotColumn(colKey, 'api'); };
|
6723 | ColumnApi.prototype.addPivotColumns = function (colKeys) { this.columnController.addPivotColumns(colKeys, 'api'); };
|
6724 | ColumnApi.prototype.getPivotColumns = function () { return this.columnController.getPivotColumns(); };
|
6725 | ColumnApi.prototype.getLeftDisplayedColumnGroups = function () { return this.columnController.getLeftDisplayedColumnGroups(); };
|
6726 | ColumnApi.prototype.getCenterDisplayedColumnGroups = function () { return this.columnController.getCenterDisplayedColumnGroups(); };
|
6727 | ColumnApi.prototype.getRightDisplayedColumnGroups = function () { return this.columnController.getRightDisplayedColumnGroups(); };
|
6728 | ColumnApi.prototype.getAllDisplayedColumnGroups = function () { return this.columnController.getAllDisplayedColumnGroups(); };
|
6729 | ColumnApi.prototype.autoSizeColumn = function (key) { return this.columnController.autoSizeColumn(key, 'api'); };
|
6730 | ColumnApi.prototype.autoSizeColumns = function (keys) { return this.columnController.autoSizeColumns(keys, 'api'); };
|
6731 | ColumnApi.prototype.autoSizeAllColumns = function () { this.columnController.autoSizeAllColumns('api'); };
|
6732 | ColumnApi.prototype.setSecondaryColumns = function (colDefs) { this.columnController.setSecondaryColumns(colDefs, 'api'); };
|
6733 |
|
6734 | ColumnApi.prototype.columnGroupOpened = function (group, newValue) {
|
6735 | console.error('ag-Grid: columnGroupOpened no longer exists, use setColumnGroupOpened');
|
6736 | this.setColumnGroupOpened(group, newValue);
|
6737 | };
|
6738 | ColumnApi.prototype.hideColumns = function (colIds, hide) {
|
6739 | console.error('ag-Grid: hideColumns is deprecated, use setColumnsVisible');
|
6740 | this.columnController.setColumnsVisible(colIds, !hide, 'api');
|
6741 | };
|
6742 | ColumnApi.prototype.hideColumn = function (colId, hide) {
|
6743 | console.error('ag-Grid: hideColumn is deprecated, use setColumnVisible');
|
6744 | this.columnController.setColumnVisible(colId, !hide, 'api');
|
6745 | };
|
6746 | ColumnApi.prototype.setState = function (columnState) {
|
6747 | console.error('ag-Grid: setState is deprecated, use setColumnState');
|
6748 | return this.setColumnState(columnState);
|
6749 | };
|
6750 | ColumnApi.prototype.getState = function () {
|
6751 | console.error('ag-Grid: getState is deprecated, use getColumnState');
|
6752 | return this.getColumnState();
|
6753 | };
|
6754 | ColumnApi.prototype.resetState = function () {
|
6755 | console.error('ag-Grid: resetState is deprecated, use resetColumnState');
|
6756 | this.resetColumnState();
|
6757 | };
|
6758 | ColumnApi.prototype.getAggregationColumns = function () {
|
6759 | console.error('ag-Grid: getAggregationColumns is deprecated, use getValueColumns');
|
6760 | return this.columnController.getValueColumns();
|
6761 | };
|
6762 | ColumnApi.prototype.removeAggregationColumn = function (colKey) {
|
6763 | console.error('ag-Grid: removeAggregationColumn is deprecated, use removeValueColumn');
|
6764 | this.columnController.removeValueColumn(colKey, 'api');
|
6765 | };
|
6766 | ColumnApi.prototype.removeAggregationColumns = function (colKeys) {
|
6767 | console.error('ag-Grid: removeAggregationColumns is deprecated, use removeValueColumns');
|
6768 | this.columnController.removeValueColumns(colKeys, 'api');
|
6769 | };
|
6770 | ColumnApi.prototype.addAggregationColumn = function (colKey) {
|
6771 | console.error('ag-Grid: addAggregationColumn is deprecated, use addValueColumn');
|
6772 | this.columnController.addValueColumn(colKey, 'api');
|
6773 | };
|
6774 | ColumnApi.prototype.addAggregationColumns = function (colKeys) {
|
6775 | console.error('ag-Grid: addAggregationColumns is deprecated, use addValueColumns');
|
6776 | this.columnController.addValueColumns(colKeys, 'api');
|
6777 | };
|
6778 | ColumnApi.prototype.setColumnAggFunction = function (column, aggFunc) {
|
6779 | console.error('ag-Grid: setColumnAggFunction is deprecated, use setColumnAggFunc');
|
6780 | this.columnController.setColumnAggFunc(column, aggFunc, 'api');
|
6781 | };
|
6782 | ColumnApi.prototype.getDisplayNameForCol = function (column) {
|
6783 | console.error('ag-Grid: getDisplayNameForCol is deprecated, use getDisplayNameForColumn');
|
6784 | return this.getDisplayNameForColumn(column, null);
|
6785 | };
|
6786 | __decorate([
|
6787 | context_1.Autowired('columnController'),
|
6788 | __metadata("design:type", columnController_1.ColumnController)
|
6789 | ], ColumnApi.prototype, "columnController", void 0);
|
6790 | ColumnApi = __decorate([
|
6791 | context_1.Bean('columnApi')
|
6792 | ], ColumnApi);
|
6793 | return ColumnApi;
|
6794 | }());
|
6795 | exports.ColumnApi = ColumnApi;
|
6796 |
|
6797 |
|
6798 | }),
|
6799 |
|
6800 | (function(module, exports, __webpack_require__) {
|
6801 |
|
6802 | "use strict";
|
6803 |
|
6804 |
|
6805 |
|
6806 |
|
6807 |
|
6808 |
|
6809 |
|
6810 | var __extends = (this && this.__extends) || (function () {
|
6811 | var extendStatics = Object.setPrototypeOf ||
|
6812 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
6813 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
6814 | return function (d, b) {
|
6815 | extendStatics(d, b);
|
6816 | function __() { this.constructor = d; }
|
6817 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
6818 | };
|
6819 | })();
|
6820 | Object.defineProperty(exports, "__esModule", { value: true });
|
6821 | var utils_1 = __webpack_require__(1);
|
6822 | var beanStub_1 = __webpack_require__(13);
|
6823 | var compIdSequence = new utils_1.NumberSequence();
|
6824 | var Component = (function (_super) {
|
6825 | __extends(Component, _super);
|
6826 | function Component(template) {
|
6827 | var _this = _super.call(this) || this;
|
6828 | _this.childComponents = [];
|
6829 | _this.annotatedEventListeners = [];
|
6830 | _this.visible = true;
|
6831 |
|
6832 |
|
6833 |
|
6834 | _this.compId = compIdSequence.next();
|
6835 | if (template) {
|
6836 | _this.setTemplate(template);
|
6837 | }
|
6838 | return _this;
|
6839 | }
|
6840 | Component.prototype.getCompId = function () {
|
6841 | return this.compId;
|
6842 | };
|
6843 | Component.prototype.instantiate = function (context) {
|
6844 | this.instantiateRecurse(this.getGui(), context);
|
6845 | };
|
6846 | Component.prototype.instantiateRecurse = function (parentNode, context) {
|
6847 | var _this = this;
|
6848 |
|
6849 |
|
6850 | var childNodeList = utils_1.Utils.copyNodeList(parentNode.childNodes);
|
6851 | childNodeList.forEach(function (childNode) {
|
6852 | var childComp = context.createComponent(childNode, function (childComp) {
|
6853 | var attrList = _this.getAttrLists(childNode);
|
6854 | _this.copyAttributesFromNode(attrList, childComp.getGui());
|
6855 | _this.createChildAttributes(attrList, childComp);
|
6856 | _this.addEventListenersToComponent(attrList, childComp);
|
6857 | });
|
6858 | if (childComp) {
|
6859 | _this.swapComponentForNode(childComp, parentNode, childNode);
|
6860 | }
|
6861 | else {
|
6862 | if (childNode.childNodes) {
|
6863 | _this.instantiateRecurse(childNode, context);
|
6864 | }
|
6865 | if (childNode instanceof HTMLElement) {
|
6866 | var attrList = _this.getAttrLists(childNode);
|
6867 | _this.addEventListenersToElement(attrList, childNode);
|
6868 | }
|
6869 | }
|
6870 | });
|
6871 | };
|
6872 | Component.prototype.getAttrLists = function (child) {
|
6873 | var res = {
|
6874 | bindings: [],
|
6875 | events: [],
|
6876 | normal: []
|
6877 | };
|
6878 | utils_1.Utils.iterateNamedNodeMap(child.attributes, function (name, value) {
|
6879 | var firstCharacter = name.substr(0, 1);
|
6880 | if (firstCharacter === '(') {
|
6881 | var eventName = name.replace('(', '').replace(')', '');
|
6882 | res.events.push({
|
6883 | name: eventName,
|
6884 | value: value
|
6885 | });
|
6886 | }
|
6887 | else if (firstCharacter === '[') {
|
6888 | var bindingName = name.replace('[', '').replace(']', '');
|
6889 | res.bindings.push({
|
6890 | name: bindingName,
|
6891 | value: value
|
6892 | });
|
6893 | }
|
6894 | else {
|
6895 | res.normal.push({
|
6896 | name: name,
|
6897 | value: value
|
6898 | });
|
6899 | }
|
6900 | });
|
6901 | return res;
|
6902 | };
|
6903 | Component.prototype.addEventListenersToElement = function (attrLists, element) {
|
6904 | var _this = this;
|
6905 | this.addEventListenerCommon(attrLists, function (eventName, listener) {
|
6906 | _this.addDestroyableEventListener(element, eventName, listener);
|
6907 | });
|
6908 | };
|
6909 | Component.prototype.addEventListenersToComponent = function (attrLists, component) {
|
6910 | var _this = this;
|
6911 | this.addEventListenerCommon(attrLists, function (eventName, listener) {
|
6912 | _this.addDestroyableEventListener(component, eventName, listener);
|
6913 | });
|
6914 | };
|
6915 | Component.prototype.addEventListenerCommon = function (attrLists, callback) {
|
6916 | var _this = this;
|
6917 | var methodAliases = this.getAgComponentMetaData('methods');
|
6918 | attrLists.events.forEach(function (nameValue) {
|
6919 | var methodName = nameValue.value;
|
6920 | var methodAlias = utils_1.Utils.find(methodAliases, 'alias', methodName);
|
6921 | var methodNameToUse = utils_1.Utils.exists(methodAlias) ? methodAlias.methodName : methodName;
|
6922 | var listener = _this[methodNameToUse];
|
6923 | if (typeof listener !== 'function') {
|
6924 | console.warn('ag-Grid: count not find callback ' + methodName);
|
6925 | return;
|
6926 | }
|
6927 | var eventCamelCase = utils_1.Utils.hyphenToCamelCase(nameValue.name);
|
6928 | callback(eventCamelCase, listener.bind(_this));
|
6929 | });
|
6930 | };
|
6931 | Component.prototype.createChildAttributes = function (attrLists, child) {
|
6932 | var _this = this;
|
6933 | var childAttributes = {};
|
6934 | attrLists.normal.forEach(function (nameValue) {
|
6935 | var nameCamelCase = utils_1.Utils.hyphenToCamelCase(nameValue.name);
|
6936 | childAttributes[nameCamelCase] = nameValue.value;
|
6937 | });
|
6938 | attrLists.bindings.forEach(function (nameValue) {
|
6939 | var nameCamelCase = utils_1.Utils.hyphenToCamelCase(nameValue.name);
|
6940 | childAttributes[nameCamelCase] = _this[nameValue.value];
|
6941 | });
|
6942 | child.props = childAttributes;
|
6943 | };
|
6944 | Component.prototype.copyAttributesFromNode = function (attrLists, childNode) {
|
6945 | attrLists.normal.forEach(function (nameValue) {
|
6946 | childNode.setAttribute(nameValue.name, nameValue.value);
|
6947 | });
|
6948 | };
|
6949 | Component.prototype.swapComponentForNode = function (newComponent, parentNode, childNode) {
|
6950 | var eComponent = newComponent.getGui();
|
6951 | parentNode.replaceChild(eComponent, childNode);
|
6952 | parentNode.insertBefore(document.createComment(childNode.nodeName), eComponent);
|
6953 | this.childComponents.push(newComponent);
|
6954 | this.swapInComponentForQuerySelectors(newComponent, childNode);
|
6955 | };
|
6956 | Component.prototype.swapInComponentForQuerySelectors = function (newComponent, childNode) {
|
6957 | var thisProto = Object.getPrototypeOf(this);
|
6958 | var thisNoType = this;
|
6959 | while (thisProto != null) {
|
6960 | var metaData = thisProto.__agComponentMetaData;
|
6961 | var currentProtoName = (thisProto.constructor).name;
|
6962 | if (metaData && metaData[currentProtoName] && metaData[currentProtoName].querySelectors) {
|
6963 | metaData[currentProtoName].querySelectors.forEach(function (querySelector) {
|
6964 | if (thisNoType[querySelector.attributeName] === childNode) {
|
6965 | thisNoType[querySelector.attributeName] = newComponent;
|
6966 | }
|
6967 | });
|
6968 | }
|
6969 | thisProto = Object.getPrototypeOf(thisProto);
|
6970 | }
|
6971 | };
|
6972 | Component.prototype.setTemplate = function (template) {
|
6973 | var eGui = utils_1.Utils.loadTemplate(template);
|
6974 | this.setTemplateFromElement(eGui);
|
6975 | };
|
6976 | Component.prototype.setTemplateFromElement = function (element) {
|
6977 | this.eGui = element;
|
6978 | this.eGui.__agComponent = this;
|
6979 | this.addAnnotatedEventListeners();
|
6980 | this.wireQuerySelectors();
|
6981 | };
|
6982 | Component.prototype.wireQuerySelectors = function () {
|
6983 | var _this = this;
|
6984 | if (!this.eGui) {
|
6985 | return;
|
6986 | }
|
6987 | var thisProto = Object.getPrototypeOf(this);
|
6988 | var _loop_1 = function () {
|
6989 | var metaData = thisProto.__agComponentMetaData;
|
6990 | var currentProtoName = (thisProto.constructor).name;
|
6991 | if (metaData && metaData[currentProtoName] && metaData[currentProtoName].querySelectors) {
|
6992 | var thisNoType_1 = this_1;
|
6993 | metaData[currentProtoName].querySelectors.forEach(function (querySelector) {
|
6994 | var resultOfQuery = _this.eGui.querySelector(querySelector.querySelector);
|
6995 | if (resultOfQuery) {
|
6996 | var backingComponent = resultOfQuery.__agComponent;
|
6997 | if (backingComponent) {
|
6998 | thisNoType_1[querySelector.attributeName] = backingComponent;
|
6999 | }
|
7000 | else {
|
7001 | thisNoType_1[querySelector.attributeName] = resultOfQuery;
|
7002 | }
|
7003 | }
|
7004 | else {
|
7005 |
|
7006 | }
|
7007 | });
|
7008 | }
|
7009 | thisProto = Object.getPrototypeOf(thisProto);
|
7010 | };
|
7011 | var this_1 = this;
|
7012 | while (thisProto != null) {
|
7013 | _loop_1();
|
7014 | }
|
7015 | };
|
7016 | Component.prototype.addAnnotatedEventListeners = function () {
|
7017 | var _this = this;
|
7018 | this.removeAnnotatedEventListeners();
|
7019 | if (!this.eGui) {
|
7020 | return;
|
7021 | }
|
7022 | var listenerMethods = this.getAgComponentMetaData('listenerMethods');
|
7023 | if (utils_1.Utils.missingOrEmpty(listenerMethods)) {
|
7024 | return;
|
7025 | }
|
7026 | if (!this.annotatedEventListeners) {
|
7027 | this.annotatedEventListeners = [];
|
7028 | }
|
7029 | listenerMethods.forEach(function (eventListener) {
|
7030 | var listener = _this[eventListener.methodName].bind(_this);
|
7031 | _this.eGui.addEventListener(eventListener.eventName, listener);
|
7032 | _this.annotatedEventListeners.push({ eventName: eventListener.eventName, listener: listener });
|
7033 | });
|
7034 | };
|
7035 | Component.prototype.getAgComponentMetaData = function (key) {
|
7036 | var res = [];
|
7037 | var thisProto = Object.getPrototypeOf(this);
|
7038 | while (thisProto != null) {
|
7039 | var metaData = thisProto.__agComponentMetaData;
|
7040 | var currentProtoName = (thisProto.constructor).name;
|
7041 | if (metaData && metaData[currentProtoName] && metaData[currentProtoName][key]) {
|
7042 | res = res.concat(metaData[currentProtoName][key]);
|
7043 | }
|
7044 | thisProto = Object.getPrototypeOf(thisProto);
|
7045 | }
|
7046 | return res;
|
7047 | };
|
7048 | Component.prototype.removeAnnotatedEventListeners = function () {
|
7049 | var _this = this;
|
7050 | if (!this.annotatedEventListeners) {
|
7051 | return;
|
7052 | }
|
7053 | if (!this.eGui) {
|
7054 | return;
|
7055 | }
|
7056 | this.annotatedEventListeners.forEach(function (eventListener) {
|
7057 | _this.eGui.removeEventListener(eventListener.eventName, eventListener.listener);
|
7058 | });
|
7059 | this.annotatedEventListeners = null;
|
7060 | };
|
7061 | Component.prototype.getGui = function () {
|
7062 | return this.eGui;
|
7063 | };
|
7064 |
|
7065 |
|
7066 | Component.prototype.setGui = function (eGui) {
|
7067 | this.eGui = eGui;
|
7068 | };
|
7069 | Component.prototype.queryForHtmlElement = function (cssSelector) {
|
7070 | return this.eGui.querySelector(cssSelector);
|
7071 | };
|
7072 | Component.prototype.queryForHtmlInputElement = function (cssSelector) {
|
7073 | return this.eGui.querySelector(cssSelector);
|
7074 | };
|
7075 | Component.prototype.appendChild = function (newChild) {
|
7076 | if (utils_1.Utils.isNodeOrElement(newChild)) {
|
7077 | this.eGui.appendChild(newChild);
|
7078 | }
|
7079 | else {
|
7080 | var childComponent = newChild;
|
7081 | this.eGui.appendChild(childComponent.getGui());
|
7082 | this.childComponents.push(childComponent);
|
7083 | }
|
7084 | };
|
7085 | Component.prototype.addFeature = function (context, feature) {
|
7086 | context.wireBean(feature);
|
7087 | if (feature.destroy) {
|
7088 | this.addDestroyFunc(feature.destroy.bind(feature));
|
7089 | }
|
7090 | };
|
7091 | Component.prototype.isVisible = function () {
|
7092 | return this.visible;
|
7093 | };
|
7094 | Component.prototype.setVisible = function (visible) {
|
7095 | if (visible !== this.visible) {
|
7096 | this.visible = visible;
|
7097 | utils_1.Utils.addOrRemoveCssClass(this.eGui, 'ag-hidden', !visible);
|
7098 | var event_1 = {
|
7099 | type: Component.EVENT_VISIBLE_CHANGED,
|
7100 | visible: this.visible
|
7101 | };
|
7102 | this.dispatchEvent(event_1);
|
7103 | }
|
7104 | };
|
7105 | Component.prototype.addOrRemoveCssClass = function (className, addOrRemove) {
|
7106 | utils_1.Utils.addOrRemoveCssClass(this.eGui, className, addOrRemove);
|
7107 | };
|
7108 | Component.prototype.destroy = function () {
|
7109 | _super.prototype.destroy.call(this);
|
7110 | this.childComponents.forEach(function (childComponent) { return childComponent.destroy(); });
|
7111 | this.childComponents.length = 0;
|
7112 | this.removeAnnotatedEventListeners();
|
7113 | };
|
7114 | Component.prototype.addGuiEventListener = function (event, listener) {
|
7115 | var _this = this;
|
7116 | this.getGui().addEventListener(event, listener);
|
7117 | this.addDestroyFunc(function () { return _this.getGui().removeEventListener(event, listener); });
|
7118 | };
|
7119 | Component.prototype.addCssClass = function (className) {
|
7120 | utils_1.Utils.addCssClass(this.getGui(), className);
|
7121 | };
|
7122 | Component.prototype.removeCssClass = function (className) {
|
7123 | utils_1.Utils.removeCssClass(this.getGui(), className);
|
7124 | };
|
7125 | Component.prototype.getAttribute = function (key) {
|
7126 | var eGui = this.getGui();
|
7127 | if (eGui) {
|
7128 | return eGui.getAttribute(key);
|
7129 | }
|
7130 | else {
|
7131 | return null;
|
7132 | }
|
7133 | };
|
7134 | Component.prototype.getRefElement = function (refName) {
|
7135 | return this.queryForHtmlElement('[ref="' + refName + '"]');
|
7136 | };
|
7137 | Component.EVENT_VISIBLE_CHANGED = 'visibleChanged';
|
7138 | return Component;
|
7139 | }(beanStub_1.BeanStub));
|
7140 | exports.Component = Component;
|
7141 |
|
7142 |
|
7143 | }),
|
7144 |
|
7145 | (function(module, exports, __webpack_require__) {
|
7146 |
|
7147 | "use strict";
|
7148 |
|
7149 |
|
7150 |
|
7151 |
|
7152 |
|
7153 |
|
7154 |
|
7155 | Object.defineProperty(exports, "__esModule", { value: true });
|
7156 | var Constants = (function () {
|
7157 | function Constants() {
|
7158 | }
|
7159 | Constants.STEP_EVERYTHING = 0;
|
7160 | Constants.STEP_FILTER = 1;
|
7161 | Constants.STEP_SORT = 2;
|
7162 | Constants.STEP_MAP = 3;
|
7163 | Constants.STEP_AGGREGATE = 4;
|
7164 | Constants.STEP_PIVOT = 5;
|
7165 | Constants.ROW_BUFFER_SIZE = 10;
|
7166 | Constants.LAYOUT_INTERVAL = 500;
|
7167 | Constants.BATCH_WAIT_MILLIS = 50;
|
7168 | Constants.EXPORT_TYPE_DRAG_COPY = 'dragCopy';
|
7169 | Constants.EXPORT_TYPE_CLIPBOARD = 'clipboard';
|
7170 | Constants.EXPORT_TYPE_EXCEL = 'excel';
|
7171 | Constants.EXPORT_TYPE_CSV = 'csv';
|
7172 | Constants.KEY_BACKSPACE = 8;
|
7173 | Constants.KEY_TAB = 9;
|
7174 | Constants.KEY_NEW_LINE = 10;
|
7175 | Constants.KEY_ENTER = 13;
|
7176 | Constants.KEY_SHIFT = 16;
|
7177 | Constants.KEY_ESCAPE = 27;
|
7178 | Constants.KEY_SPACE = 32;
|
7179 | Constants.KEY_LEFT = 37;
|
7180 | Constants.KEY_UP = 38;
|
7181 | Constants.KEY_RIGHT = 39;
|
7182 | Constants.KEY_DOWN = 40;
|
7183 | Constants.KEY_DELETE = 46;
|
7184 | Constants.KEY_A = 65;
|
7185 | Constants.KEY_C = 67;
|
7186 | Constants.KEY_V = 86;
|
7187 | Constants.KEY_D = 68;
|
7188 | Constants.KEY_F2 = 113;
|
7189 | Constants.KEY_PAGE_UP = 33;
|
7190 | Constants.KEY_PAGE_DOWN = 34;
|
7191 | Constants.KEY_PAGE_HOME = 36;
|
7192 | Constants.KEY_PAGE_END = 35;
|
7193 | Constants.ROW_MODEL_TYPE_INFINITE = 'infinite';
|
7194 | Constants.ROW_MODEL_TYPE_VIEWPORT = 'viewport';
|
7195 | Constants.ROW_MODEL_TYPE_CLIENT_SIDE = 'clientSide';
|
7196 | Constants.ROW_MODEL_TYPE_SERVER_SIDE = 'serverSide';
|
7197 | Constants.DEPRECATED_ROW_MODEL_TYPE_NORMAL = 'normal';
|
7198 | Constants.ALWAYS = 'always';
|
7199 | Constants.ONLY_WHEN_GROUPING = 'onlyWhenGrouping';
|
7200 | Constants.PINNED_TOP = 'top';
|
7201 | Constants.PINNED_BOTTOM = 'bottom';
|
7202 | return Constants;
|
7203 | }());
|
7204 | exports.Constants = Constants;
|
7205 |
|
7206 |
|
7207 | }),
|
7208 |
|
7209 | (function(module, exports, __webpack_require__) {
|
7210 |
|
7211 | "use strict";
|
7212 |
|
7213 |
|
7214 |
|
7215 |
|
7216 |
|
7217 |
|
7218 |
|
7219 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
7220 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
7221 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
7222 | 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;
|
7223 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7224 | };
|
7225 | var __metadata = (this && this.__metadata) || function (k, v) {
|
7226 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
7227 | };
|
7228 | Object.defineProperty(exports, "__esModule", { value: true });
|
7229 | var eventService_1 = __webpack_require__(3);
|
7230 | var utils_1 = __webpack_require__(1);
|
7231 | var context_1 = __webpack_require__(0);
|
7232 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
7233 | var columnUtils_1 = __webpack_require__(31);
|
7234 | var columnApi_1 = __webpack_require__(7);
|
7235 | var gridApi_1 = __webpack_require__(6);
|
7236 |
|
7237 |
|
7238 |
|
7239 |
|
7240 |
|
7241 |
|
7242 | var Column = (function () {
|
7243 | function Column(colDef, colId, primary) {
|
7244 | this.moving = false;
|
7245 | this.menuVisible = false;
|
7246 | this.filterActive = false;
|
7247 | this.eventService = new eventService_1.EventService();
|
7248 | this.rowGroupActive = false;
|
7249 | this.pivotActive = false;
|
7250 | this.aggregationActive = false;
|
7251 | this.colDef = colDef;
|
7252 | this.visible = !colDef.hide;
|
7253 | this.sort = colDef.sort;
|
7254 | this.sortedAt = colDef.sortedAt;
|
7255 | this.colId = colId;
|
7256 | this.primary = primary;
|
7257 | this.lockPosition = colDef.lockPosition === true;
|
7258 | this.lockPinned = colDef.lockPinned === true;
|
7259 | this.lockVisible = colDef.lockVisible === true;
|
7260 | }
|
7261 | Column.prototype.isLockPosition = function () {
|
7262 | return this.lockPosition;
|
7263 | };
|
7264 | Column.prototype.isLockVisible = function () {
|
7265 | return this.lockVisible;
|
7266 | };
|
7267 | Column.prototype.isLockPinned = function () {
|
7268 | return this.lockPinned;
|
7269 | };
|
7270 | Column.prototype.setParent = function (parent) {
|
7271 | this.parent = parent;
|
7272 | };
|
7273 | Column.prototype.getParent = function () {
|
7274 | return this.parent;
|
7275 | };
|
7276 |
|
7277 | Column.prototype.initialise = function () {
|
7278 | this.setPinned(this.colDef.pinned);
|
7279 | var minColWidth = this.gridOptionsWrapper.getMinColWidth();
|
7280 | var maxColWidth = this.gridOptionsWrapper.getMaxColWidth();
|
7281 | if (this.colDef.minWidth) {
|
7282 | this.minWidth = this.colDef.minWidth;
|
7283 | }
|
7284 | else {
|
7285 | this.minWidth = minColWidth;
|
7286 | }
|
7287 | if (this.colDef.maxWidth) {
|
7288 | this.maxWidth = this.colDef.maxWidth;
|
7289 | }
|
7290 | else {
|
7291 | this.maxWidth = maxColWidth;
|
7292 | }
|
7293 | this.actualWidth = this.columnUtils.calculateColInitialWidth(this.colDef);
|
7294 | var suppressDotNotation = this.gridOptionsWrapper.isSuppressFieldDotNotation();
|
7295 | this.fieldContainsDots = utils_1.Utils.exists(this.colDef.field) && this.colDef.field.indexOf('.') >= 0 && !suppressDotNotation;
|
7296 | this.tooltipFieldContainsDots = utils_1.Utils.exists(this.colDef.tooltipField) && this.colDef.tooltipField.indexOf('.') >= 0 && !suppressDotNotation;
|
7297 | this.validate();
|
7298 | };
|
7299 | Column.prototype.isEmptyGroup = function () {
|
7300 | return false;
|
7301 | };
|
7302 | Column.prototype.isRowGroupDisplayed = function (colId) {
|
7303 | if (utils_1.Utils.missing(this.colDef) || utils_1.Utils.missing(this.colDef.showRowGroup)) {
|
7304 | return false;
|
7305 | }
|
7306 | var showingAllGroups = this.colDef.showRowGroup === true;
|
7307 | var showingThisGroup = this.colDef.showRowGroup === colId;
|
7308 | return showingAllGroups || showingThisGroup;
|
7309 | };
|
7310 | Column.prototype.getUniqueId = function () {
|
7311 | return this.getId();
|
7312 | };
|
7313 | Column.prototype.isPrimary = function () {
|
7314 | return this.primary;
|
7315 | };
|
7316 | Column.prototype.isFilterAllowed = function () {
|
7317 | return this.primary && !this.colDef.suppressFilter;
|
7318 | };
|
7319 | Column.prototype.isFieldContainsDots = function () {
|
7320 | return this.fieldContainsDots;
|
7321 | };
|
7322 | Column.prototype.isTooltipFieldContainsDots = function () {
|
7323 | return this.tooltipFieldContainsDots;
|
7324 | };
|
7325 | Column.prototype.validate = function () {
|
7326 | var colDefAny = this.colDef;
|
7327 | if (!this.gridOptionsWrapper.isEnterprise()) {
|
7328 | var itemsNotAllowedWithoutEnterprise = ['enableRowGroup', 'rowGroup', 'rowGroupIndex', 'enablePivot', 'pivot', 'pivotIndex', 'aggFunc'];
|
7329 | itemsNotAllowedWithoutEnterprise.forEach(function (item) {
|
7330 | if (utils_1.Utils.exists(colDefAny[item])) {
|
7331 | console.warn("ag-Grid: " + item + " is only valid in ag-Grid-Enterprise, your column definition should not have " + item);
|
7332 | }
|
7333 | });
|
7334 | }
|
7335 | if (this.gridOptionsWrapper.isTreeData()) {
|
7336 | var itemsNotAllowedWithTreeData = ['enableRowGroup', 'rowGroup', 'rowGroupIndex', 'enablePivot', 'pivot', 'pivotIndex'];
|
7337 | itemsNotAllowedWithTreeData.forEach(function (item) {
|
7338 | if (utils_1.Utils.exists(colDefAny[item])) {
|
7339 | console.warn("ag-Grid: " + item + " is not possible when doing tree data, your column definition should not have " + item);
|
7340 | }
|
7341 | });
|
7342 | }
|
7343 | if (utils_1.Utils.exists(this.colDef.width) && typeof this.colDef.width !== 'number') {
|
7344 | console.warn('ag-Grid: colDef.width should be a number, not ' + typeof this.colDef.width);
|
7345 | }
|
7346 | if (utils_1.Utils.get(this, 'colDef.cellRendererParams.restrictToOneGroup', null)) {
|
7347 | console.warn('ag-Grid: Since ag-grid 11.0.0 cellRendererParams.restrictToOneGroup is deprecated. You should use showRowGroup');
|
7348 | }
|
7349 | if (utils_1.Utils.get(this, 'colDef.cellRendererParams.keyMap', null)) {
|
7350 | console.warn('ag-Grid: Since ag-grid 11.0.0 cellRendererParams.keyMap is deprecated. You should use colDef.keyCreator');
|
7351 | }
|
7352 | if (utils_1.Utils.get(this, 'colDef.cellRendererParams.keyMap', null)) {
|
7353 | console.warn('ag-Grid: Since ag-grid 11.0.0 cellRendererParams.keyMap is deprecated. You should use colDef.keyCreator');
|
7354 | }
|
7355 | if (colDefAny.floatingCellRenderer) {
|
7356 | console.warn('ag-Grid: since v11, floatingCellRenderer is now pinnedRowCellRenderer');
|
7357 | this.colDef.pinnedRowCellRenderer = colDefAny.floatingCellRenderer;
|
7358 | }
|
7359 | if (colDefAny.floatingRendererFramework) {
|
7360 | console.warn('ag-Grid: since v11, floatingRendererFramework is now pinnedRowCellRendererFramework');
|
7361 | this.colDef.pinnedRowCellRendererFramework = colDefAny.floatingRendererFramework;
|
7362 | }
|
7363 | if (colDefAny.floatingRendererParams) {
|
7364 | console.warn('ag-Grid: since v11, floatingRendererParams is now pinnedRowCellRendererParams');
|
7365 | this.colDef.pinnedRowCellRendererParams = colDefAny.floatingRendererParams;
|
7366 | }
|
7367 | if (colDefAny.floatingValueFormatter) {
|
7368 | console.warn('ag-Grid: since v11, floatingValueFormatter is now pinnedRowValueFormatter');
|
7369 | this.colDef.pinnedRowValueFormatter = colDefAny.floatingValueFormatter;
|
7370 | }
|
7371 | if (colDefAny.cellFormatter) {
|
7372 | console.warn('ag-Grid: since v12, cellFormatter is now valueFormatter');
|
7373 | if (utils_1.Utils.missing(this.colDef.valueFormatter)) {
|
7374 | this.colDef.valueFormatter = colDefAny.cellFormatter;
|
7375 | }
|
7376 | }
|
7377 | if (colDefAny.headerCellTemplate) {
|
7378 | console.warn('ag-Grid: since v15, headerCellTemplate is gone, use header component instead.');
|
7379 | }
|
7380 | if (colDefAny.headerCellRenderer) {
|
7381 | console.warn('ag-Grid: since v15, headerCellRenderer is gone, use header component instead.');
|
7382 | }
|
7383 | if (colDefAny.volatile) {
|
7384 | console.warn('ag-Grid: since v16, colDef.volatile is gone, please check refresh docs on how to refresh specific cells.');
|
7385 | }
|
7386 | };
|
7387 | Column.prototype.addEventListener = function (eventType, listener) {
|
7388 | this.eventService.addEventListener(eventType, listener);
|
7389 | };
|
7390 | Column.prototype.removeEventListener = function (eventType, listener) {
|
7391 | this.eventService.removeEventListener(eventType, listener);
|
7392 | };
|
7393 | Column.prototype.createIsColumnFuncParams = function (rowNode) {
|
7394 | return {
|
7395 | node: rowNode,
|
7396 | data: rowNode.data,
|
7397 | column: this,
|
7398 | colDef: this.colDef,
|
7399 | context: this.gridOptionsWrapper.getContext(),
|
7400 | api: this.gridOptionsWrapper.getApi(),
|
7401 | columnApi: this.gridOptionsWrapper.getColumnApi()
|
7402 | };
|
7403 | };
|
7404 | Column.prototype.isSuppressNavigable = function (rowNode) {
|
7405 |
|
7406 | if (typeof this.colDef.suppressNavigable === 'boolean') {
|
7407 | return this.colDef.suppressNavigable;
|
7408 | }
|
7409 |
|
7410 | if (typeof this.colDef.suppressNavigable === 'function') {
|
7411 | var params = this.createIsColumnFuncParams(rowNode);
|
7412 | var userFunc = this.colDef.suppressNavigable;
|
7413 | return userFunc(params);
|
7414 | }
|
7415 | return false;
|
7416 | };
|
7417 | Column.prototype.isCellEditable = function (rowNode) {
|
7418 |
|
7419 | if (rowNode.group && !this.gridOptionsWrapper.isEnableGroupEdit()) {
|
7420 | return false;
|
7421 | }
|
7422 | return this.isColumnFunc(rowNode, this.colDef.editable);
|
7423 | };
|
7424 | Column.prototype.isRowDrag = function (rowNode) {
|
7425 | return this.isColumnFunc(rowNode, this.colDef.rowDrag);
|
7426 | };
|
7427 | Column.prototype.isCellCheckboxSelection = function (rowNode) {
|
7428 | return this.isColumnFunc(rowNode, this.colDef.checkboxSelection);
|
7429 | };
|
7430 | Column.prototype.isSuppressPaste = function (rowNode) {
|
7431 | return this.isColumnFunc(rowNode, this.colDef ? this.colDef.suppressPaste : null);
|
7432 | };
|
7433 | Column.prototype.isResizable = function () {
|
7434 | var enableColResize = this.gridOptionsWrapper.isEnableColResize();
|
7435 | var suppressResize = this.colDef && this.colDef.suppressResize;
|
7436 | return enableColResize && !suppressResize;
|
7437 | };
|
7438 | Column.prototype.isColumnFunc = function (rowNode, value) {
|
7439 |
|
7440 | if (typeof value === 'boolean') {
|
7441 | return value;
|
7442 | }
|
7443 |
|
7444 | if (typeof value === 'function') {
|
7445 | var params = this.createIsColumnFuncParams(rowNode);
|
7446 | var editableFunc = value;
|
7447 | return editableFunc(params);
|
7448 | }
|
7449 | return false;
|
7450 | };
|
7451 | Column.prototype.setMoving = function (moving, source) {
|
7452 | if (source === void 0) { source = "api"; }
|
7453 | this.moving = moving;
|
7454 | this.eventService.dispatchEvent(this.createColumnEvent(Column.EVENT_MOVING_CHANGED, source));
|
7455 | };
|
7456 | Column.prototype.createColumnEvent = function (type, source) {
|
7457 | return {
|
7458 | api: this.gridApi,
|
7459 | columnApi: this.columnApi,
|
7460 | type: type,
|
7461 | column: this,
|
7462 | columns: [this],
|
7463 | source: source
|
7464 | };
|
7465 | };
|
7466 | Column.prototype.isMoving = function () {
|
7467 | return this.moving;
|
7468 | };
|
7469 | Column.prototype.getSort = function () {
|
7470 | return this.sort;
|
7471 | };
|
7472 | Column.prototype.setSort = function (sort, source) {
|
7473 | if (source === void 0) { source = "api"; }
|
7474 | if (this.sort !== sort) {
|
7475 | this.sort = sort;
|
7476 | this.eventService.dispatchEvent(this.createColumnEvent(Column.EVENT_SORT_CHANGED, source));
|
7477 | }
|
7478 | };
|
7479 | Column.prototype.setMenuVisible = function (visible, source) {
|
7480 | if (source === void 0) { source = "api"; }
|
7481 | if (this.menuVisible !== visible) {
|
7482 | this.menuVisible = visible;
|
7483 | this.eventService.dispatchEvent(this.createColumnEvent(Column.EVENT_MENU_VISIBLE_CHANGED, source));
|
7484 | }
|
7485 | };
|
7486 | Column.prototype.isMenuVisible = function () {
|
7487 | return this.menuVisible;
|
7488 | };
|
7489 | Column.prototype.isSortAscending = function () {
|
7490 | return this.sort === Column.SORT_ASC;
|
7491 | };
|
7492 | Column.prototype.isSortDescending = function () {
|
7493 | return this.sort === Column.SORT_DESC;
|
7494 | };
|
7495 | Column.prototype.isSortNone = function () {
|
7496 | return utils_1.Utils.missing(this.sort);
|
7497 | };
|
7498 | Column.prototype.isSorting = function () {
|
7499 | return utils_1.Utils.exists(this.sort);
|
7500 | };
|
7501 | Column.prototype.getSortedAt = function () {
|
7502 | return this.sortedAt;
|
7503 | };
|
7504 | Column.prototype.setSortedAt = function (sortedAt) {
|
7505 | this.sortedAt = sortedAt;
|
7506 | };
|
7507 | Column.prototype.setAggFunc = function (aggFunc) {
|
7508 | this.aggFunc = aggFunc;
|
7509 | };
|
7510 | Column.prototype.getAggFunc = function () {
|
7511 | return this.aggFunc;
|
7512 | };
|
7513 | Column.prototype.getLeft = function () {
|
7514 | return this.left;
|
7515 | };
|
7516 | Column.prototype.getOldLeft = function () {
|
7517 | return this.oldLeft;
|
7518 | };
|
7519 | Column.prototype.getRight = function () {
|
7520 | return this.left + this.actualWidth;
|
7521 | };
|
7522 | Column.prototype.setLeft = function (left, source) {
|
7523 | if (source === void 0) { source = "api"; }
|
7524 | this.oldLeft = this.left;
|
7525 | if (this.left !== left) {
|
7526 | this.left = left;
|
7527 | this.eventService.dispatchEvent(this.createColumnEvent(Column.EVENT_LEFT_CHANGED, source));
|
7528 | }
|
7529 | };
|
7530 | Column.prototype.isFilterActive = function () {
|
7531 | return this.filterActive;
|
7532 | };
|
7533 | Column.prototype.setFilterActive = function (active, source) {
|
7534 | if (source === void 0) { source = "api"; }
|
7535 | if (this.filterActive !== active) {
|
7536 | this.filterActive = active;
|
7537 | this.eventService.dispatchEvent(this.createColumnEvent(Column.EVENT_FILTER_ACTIVE_CHANGED, source));
|
7538 | }
|
7539 | this.eventService.dispatchEvent(this.createColumnEvent(Column.EVENT_FILTER_CHANGED, source));
|
7540 | };
|
7541 | Column.prototype.setPinned = function (pinned) {
|
7542 | if (pinned === true || pinned === Column.PINNED_LEFT) {
|
7543 | this.pinned = Column.PINNED_LEFT;
|
7544 | }
|
7545 | else if (pinned === Column.PINNED_RIGHT) {
|
7546 | this.pinned = Column.PINNED_RIGHT;
|
7547 | }
|
7548 | else {
|
7549 | this.pinned = null;
|
7550 | }
|
7551 | };
|
7552 | Column.prototype.setFirstRightPinned = function (firstRightPinned, source) {
|
7553 | if (source === void 0) { source = "api"; }
|
7554 | if (this.firstRightPinned !== firstRightPinned) {
|
7555 | this.firstRightPinned = firstRightPinned;
|
7556 | this.eventService.dispatchEvent(this.createColumnEvent(Column.EVENT_FIRST_RIGHT_PINNED_CHANGED, source));
|
7557 | }
|
7558 | };
|
7559 | Column.prototype.setLastLeftPinned = function (lastLeftPinned, source) {
|
7560 | if (source === void 0) { source = "api"; }
|
7561 | if (this.lastLeftPinned !== lastLeftPinned) {
|
7562 | this.lastLeftPinned = lastLeftPinned;
|
7563 | this.eventService.dispatchEvent(this.createColumnEvent(Column.EVENT_LAST_LEFT_PINNED_CHANGED, source));
|
7564 | }
|
7565 | };
|
7566 | Column.prototype.isFirstRightPinned = function () {
|
7567 | return this.firstRightPinned;
|
7568 | };
|
7569 | Column.prototype.isLastLeftPinned = function () {
|
7570 | return this.lastLeftPinned;
|
7571 | };
|
7572 | Column.prototype.isPinned = function () {
|
7573 | return this.pinned === Column.PINNED_LEFT || this.pinned === Column.PINNED_RIGHT;
|
7574 | };
|
7575 | Column.prototype.isPinnedLeft = function () {
|
7576 | return this.pinned === Column.PINNED_LEFT;
|
7577 | };
|
7578 | Column.prototype.isPinnedRight = function () {
|
7579 | return this.pinned === Column.PINNED_RIGHT;
|
7580 | };
|
7581 | Column.prototype.getPinned = function () {
|
7582 | return this.pinned;
|
7583 | };
|
7584 | Column.prototype.setVisible = function (visible, source) {
|
7585 | if (source === void 0) { source = "api"; }
|
7586 | var newValue = visible === true;
|
7587 | if (this.visible !== newValue) {
|
7588 | this.visible = newValue;
|
7589 | this.eventService.dispatchEvent(this.createColumnEvent(Column.EVENT_VISIBLE_CHANGED, source));
|
7590 | }
|
7591 | };
|
7592 | Column.prototype.isVisible = function () {
|
7593 | return this.visible;
|
7594 | };
|
7595 | Column.prototype.getColDef = function () {
|
7596 | return this.colDef;
|
7597 | };
|
7598 | Column.prototype.getColumnGroupShow = function () {
|
7599 | return this.colDef.columnGroupShow;
|
7600 | };
|
7601 | Column.prototype.getColId = function () {
|
7602 | return this.colId;
|
7603 | };
|
7604 | Column.prototype.getId = function () {
|
7605 | return this.getColId();
|
7606 | };
|
7607 | Column.prototype.getDefinition = function () {
|
7608 | return this.colDef;
|
7609 | };
|
7610 | Column.prototype.getActualWidth = function () {
|
7611 | return this.actualWidth;
|
7612 | };
|
7613 | Column.prototype.createBaseColDefParams = function (rowNode) {
|
7614 | var params = {
|
7615 | node: rowNode,
|
7616 | data: rowNode.data,
|
7617 | colDef: this.colDef,
|
7618 | column: this,
|
7619 | api: this.gridOptionsWrapper.getApi(),
|
7620 | columnApi: this.gridOptionsWrapper.getColumnApi(),
|
7621 | context: this.gridOptionsWrapper.getContext()
|
7622 | };
|
7623 | return params;
|
7624 | };
|
7625 | Column.prototype.getColSpan = function (rowNode) {
|
7626 | if (utils_1.Utils.missing(this.colDef.colSpan)) {
|
7627 | return 1;
|
7628 | }
|
7629 | else {
|
7630 | var params = this.createBaseColDefParams(rowNode);
|
7631 | var colSpan = this.colDef.colSpan(params);
|
7632 |
|
7633 | if (colSpan > 1) {
|
7634 | return colSpan;
|
7635 | }
|
7636 | else {
|
7637 | return 1;
|
7638 | }
|
7639 | }
|
7640 | };
|
7641 | Column.prototype.getRowSpan = function (rowNode) {
|
7642 | if (utils_1.Utils.missing(this.colDef.rowSpan)) {
|
7643 | return 1;
|
7644 | }
|
7645 | else {
|
7646 | var params = this.createBaseColDefParams(rowNode);
|
7647 | var rowSpan = this.colDef.rowSpan(params);
|
7648 |
|
7649 | if (rowSpan > 1) {
|
7650 | return rowSpan;
|
7651 | }
|
7652 | else {
|
7653 | return 1;
|
7654 | }
|
7655 | }
|
7656 | };
|
7657 | Column.prototype.setActualWidth = function (actualWidth, source) {
|
7658 | if (source === void 0) { source = "api"; }
|
7659 | if (this.actualWidth !== actualWidth) {
|
7660 | this.actualWidth = actualWidth;
|
7661 | this.eventService.dispatchEvent(this.createColumnEvent(Column.EVENT_WIDTH_CHANGED, source));
|
7662 | }
|
7663 | };
|
7664 | Column.prototype.isGreaterThanMax = function (width) {
|
7665 | if (this.maxWidth) {
|
7666 | return width > this.maxWidth;
|
7667 | }
|
7668 | else {
|
7669 | return false;
|
7670 | }
|
7671 | };
|
7672 | Column.prototype.getMinWidth = function () {
|
7673 | return this.minWidth;
|
7674 | };
|
7675 | Column.prototype.getMaxWidth = function () {
|
7676 | return this.maxWidth;
|
7677 | };
|
7678 | Column.prototype.setMinimum = function (source) {
|
7679 | if (source === void 0) { source = "api"; }
|
7680 | this.setActualWidth(this.minWidth, source);
|
7681 | };
|
7682 | Column.prototype.setRowGroupActive = function (rowGroup, source) {
|
7683 | if (source === void 0) { source = "api"; }
|
7684 | if (this.rowGroupActive !== rowGroup) {
|
7685 | this.rowGroupActive = rowGroup;
|
7686 | this.eventService.dispatchEvent(this.createColumnEvent(Column.EVENT_ROW_GROUP_CHANGED, source));
|
7687 | }
|
7688 | };
|
7689 | Column.prototype.isRowGroupActive = function () {
|
7690 | return this.rowGroupActive;
|
7691 | };
|
7692 | Column.prototype.setPivotActive = function (pivot, source) {
|
7693 | if (source === void 0) { source = "api"; }
|
7694 | if (this.pivotActive !== pivot) {
|
7695 | this.pivotActive = pivot;
|
7696 | this.eventService.dispatchEvent(this.createColumnEvent(Column.EVENT_PIVOT_CHANGED, source));
|
7697 | }
|
7698 | };
|
7699 | Column.prototype.isPivotActive = function () {
|
7700 | return this.pivotActive;
|
7701 | };
|
7702 | Column.prototype.isAnyFunctionActive = function () {
|
7703 | return this.isPivotActive() || this.isRowGroupActive() || this.isValueActive();
|
7704 | };
|
7705 | Column.prototype.isAnyFunctionAllowed = function () {
|
7706 | return this.isAllowPivot() || this.isAllowRowGroup() || this.isAllowValue();
|
7707 | };
|
7708 | Column.prototype.setValueActive = function (value, source) {
|
7709 | if (source === void 0) { source = "api"; }
|
7710 | if (this.aggregationActive !== value) {
|
7711 | this.aggregationActive = value;
|
7712 | this.eventService.dispatchEvent(this.createColumnEvent(Column.EVENT_VALUE_CHANGED, source));
|
7713 | }
|
7714 | };
|
7715 | Column.prototype.isValueActive = function () {
|
7716 | return this.aggregationActive;
|
7717 | };
|
7718 | Column.prototype.isAllowPivot = function () {
|
7719 | return this.colDef.enablePivot === true;
|
7720 | };
|
7721 | Column.prototype.isAllowValue = function () {
|
7722 | return this.colDef.enableValue === true;
|
7723 | };
|
7724 | Column.prototype.isAllowRowGroup = function () {
|
7725 | return this.colDef.enableRowGroup === true;
|
7726 | };
|
7727 | Column.prototype.getMenuTabs = function (defaultValues) {
|
7728 | var menuTabs = this.getColDef().menuTabs;
|
7729 | if (menuTabs == null) {
|
7730 | menuTabs = defaultValues;
|
7731 | }
|
7732 | return menuTabs;
|
7733 | };
|
7734 |
|
7735 | Column.EVENT_MOVING_CHANGED = 'movingChanged';
|
7736 |
|
7737 | Column.EVENT_LEFT_CHANGED = 'leftChanged';
|
7738 |
|
7739 | Column.EVENT_WIDTH_CHANGED = 'widthChanged';
|
7740 |
|
7741 | Column.EVENT_LAST_LEFT_PINNED_CHANGED = 'lastLeftPinnedChanged';
|
7742 | Column.EVENT_FIRST_RIGHT_PINNED_CHANGED = 'firstRightPinnedChanged';
|
7743 |
|
7744 | Column.EVENT_VISIBLE_CHANGED = 'visibleChanged';
|
7745 |
|
7746 | Column.EVENT_FILTER_CHANGED = 'filterChanged';
|
7747 |
|
7748 | Column.EVENT_FILTER_ACTIVE_CHANGED = 'filterActiveChanged';
|
7749 |
|
7750 | Column.EVENT_SORT_CHANGED = 'sortChanged';
|
7751 | Column.EVENT_MENU_VISIBLE_CHANGED = 'menuVisibleChanged';
|
7752 |
|
7753 | Column.EVENT_ROW_GROUP_CHANGED = 'columnRowGroupChanged';
|
7754 |
|
7755 | Column.EVENT_PIVOT_CHANGED = 'columnPivotChanged';
|
7756 |
|
7757 | Column.EVENT_VALUE_CHANGED = 'columnValueChanged';
|
7758 | Column.PINNED_RIGHT = 'right';
|
7759 | Column.PINNED_LEFT = 'left';
|
7760 | Column.SORT_ASC = 'asc';
|
7761 | Column.SORT_DESC = 'desc';
|
7762 | __decorate([
|
7763 | context_1.Autowired('gridOptionsWrapper'),
|
7764 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
7765 | ], Column.prototype, "gridOptionsWrapper", void 0);
|
7766 | __decorate([
|
7767 | context_1.Autowired('columnUtils'),
|
7768 | __metadata("design:type", columnUtils_1.ColumnUtils)
|
7769 | ], Column.prototype, "columnUtils", void 0);
|
7770 | __decorate([
|
7771 | context_1.Autowired('frameworkFactory'),
|
7772 | __metadata("design:type", Object)
|
7773 | ], Column.prototype, "frameworkFactory", void 0);
|
7774 | __decorate([
|
7775 | context_1.Autowired('columnApi'),
|
7776 | __metadata("design:type", columnApi_1.ColumnApi)
|
7777 | ], Column.prototype, "columnApi", void 0);
|
7778 | __decorate([
|
7779 | context_1.Autowired('gridApi'),
|
7780 | __metadata("design:type", gridApi_1.GridApi)
|
7781 | ], Column.prototype, "gridApi", void 0);
|
7782 | __decorate([
|
7783 | context_1.PostConstruct,
|
7784 | __metadata("design:type", Function),
|
7785 | __metadata("design:paramtypes", []),
|
7786 | __metadata("design:returntype", void 0)
|
7787 | ], Column.prototype, "initialise", null);
|
7788 | return Column;
|
7789 | }());
|
7790 | exports.Column = Column;
|
7791 |
|
7792 |
|
7793 | }),
|
7794 |
|
7795 | (function(module, exports, __webpack_require__) {
|
7796 |
|
7797 | "use strict";
|
7798 |
|
7799 |
|
7800 |
|
7801 |
|
7802 |
|
7803 |
|
7804 |
|
7805 | Object.defineProperty(exports, "__esModule", { value: true });
|
7806 | function QuerySelector(selector) {
|
7807 | return querySelectorFunc.bind(this, selector);
|
7808 | }
|
7809 | exports.QuerySelector = QuerySelector;
|
7810 | function RefSelector(ref) {
|
7811 | return querySelectorFunc.bind(this, "[ref=" + ref + "]");
|
7812 | }
|
7813 | exports.RefSelector = RefSelector;
|
7814 | function querySelectorFunc(selector, classPrototype, methodOrAttributeName, index) {
|
7815 | if (selector === null) {
|
7816 | console.error("ag-Grid: QuerySelector selector should not be null");
|
7817 | return;
|
7818 | }
|
7819 | if (typeof index === "number") {
|
7820 | console.error("ag-Grid: QuerySelector should be on an attribute");
|
7821 | return;
|
7822 | }
|
7823 | addToObjectProps(classPrototype, 'querySelectors', {
|
7824 | attributeName: methodOrAttributeName,
|
7825 | querySelector: selector
|
7826 | });
|
7827 | }
|
7828 |
|
7829 | function Listener(eventName) {
|
7830 | return listenerFunc.bind(this, eventName);
|
7831 | }
|
7832 | exports.Listener = Listener;
|
7833 | function listenerFunc(eventName, target, methodName) {
|
7834 | if (eventName === null) {
|
7835 | console.error("ag-Grid: EventListener eventName should not be null");
|
7836 | return;
|
7837 | }
|
7838 | addToObjectProps(target, 'listenerMethods', {
|
7839 | methodName: methodName,
|
7840 | eventName: eventName
|
7841 | });
|
7842 | }
|
7843 |
|
7844 | function Method(eventName) {
|
7845 | return methodFunc.bind(this, eventName);
|
7846 | }
|
7847 | exports.Method = Method;
|
7848 | function methodFunc(alias, target, methodName) {
|
7849 | if (alias === null) {
|
7850 | console.error("ag-Grid: EventListener eventName should not be null");
|
7851 | return;
|
7852 | }
|
7853 | addToObjectProps(target, 'methods', {
|
7854 | methodName: methodName,
|
7855 | alias: alias
|
7856 | });
|
7857 | }
|
7858 | function addToObjectProps(target, key, value) {
|
7859 |
|
7860 | var props = getOrCreateProps(target, target.constructor.name);
|
7861 | if (!props[key]) {
|
7862 | props[key] = [];
|
7863 | }
|
7864 | props[key].push(value);
|
7865 | }
|
7866 | function getOrCreateProps(target, instanceName) {
|
7867 | if (!target.__agComponentMetaData) {
|
7868 | target.__agComponentMetaData = {};
|
7869 | }
|
7870 | if (!target.__agComponentMetaData[instanceName]) {
|
7871 | target.__agComponentMetaData[instanceName] = {};
|
7872 | }
|
7873 | return target.__agComponentMetaData[instanceName];
|
7874 | }
|
7875 |
|
7876 |
|
7877 | }),
|
7878 |
|
7879 | (function(module, exports, __webpack_require__) {
|
7880 |
|
7881 | "use strict";
|
7882 |
|
7883 |
|
7884 |
|
7885 |
|
7886 |
|
7887 |
|
7888 |
|
7889 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
7890 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
7891 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
7892 | 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;
|
7893 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7894 | };
|
7895 | var __metadata = (this && this.__metadata) || function (k, v) {
|
7896 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
7897 | };
|
7898 | var __param = (this && this.__param) || function (paramIndex, decorator) {
|
7899 | return function (target, key) { decorator(target, key, paramIndex); }
|
7900 | };
|
7901 | Object.defineProperty(exports, "__esModule", { value: true });
|
7902 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
7903 | var context_1 = __webpack_require__(0);
|
7904 | var context_2 = __webpack_require__(0);
|
7905 | var LoggerFactory = (function () {
|
7906 | function LoggerFactory() {
|
7907 | }
|
7908 | LoggerFactory.prototype.setBeans = function (gridOptionsWrapper) {
|
7909 | this.logging = gridOptionsWrapper.isDebug();
|
7910 | };
|
7911 | LoggerFactory.prototype.create = function (name) {
|
7912 | return new Logger(name, this.isLogging.bind(this));
|
7913 | };
|
7914 | LoggerFactory.prototype.isLogging = function () {
|
7915 | return this.logging;
|
7916 | };
|
7917 | __decorate([
|
7918 | __param(0, context_2.Qualifier('gridOptionsWrapper')),
|
7919 | __metadata("design:type", Function),
|
7920 | __metadata("design:paramtypes", [gridOptionsWrapper_1.GridOptionsWrapper]),
|
7921 | __metadata("design:returntype", void 0)
|
7922 | ], LoggerFactory.prototype, "setBeans", null);
|
7923 | LoggerFactory = __decorate([
|
7924 | context_1.Bean('loggerFactory')
|
7925 | ], LoggerFactory);
|
7926 | return LoggerFactory;
|
7927 | }());
|
7928 | exports.LoggerFactory = LoggerFactory;
|
7929 | var Logger = (function () {
|
7930 | function Logger(name, isLoggingFunc) {
|
7931 | this.name = name;
|
7932 | this.isLoggingFunc = isLoggingFunc;
|
7933 | }
|
7934 | Logger.prototype.isLogging = function () {
|
7935 | return this.isLoggingFunc();
|
7936 | };
|
7937 | Logger.prototype.log = function (message) {
|
7938 | if (this.isLoggingFunc()) {
|
7939 | console.log('ag-Grid.' + this.name + ': ' + message);
|
7940 | }
|
7941 | };
|
7942 | return Logger;
|
7943 | }());
|
7944 | exports.Logger = Logger;
|
7945 |
|
7946 |
|
7947 | }),
|
7948 |
|
7949 | (function(module, exports, __webpack_require__) {
|
7950 |
|
7951 | "use strict";
|
7952 |
|
7953 |
|
7954 |
|
7955 |
|
7956 |
|
7957 |
|
7958 |
|
7959 | Object.defineProperty(exports, "__esModule", { value: true });
|
7960 | var eventService_1 = __webpack_require__(3);
|
7961 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
7962 | var utils_1 = __webpack_require__(1);
|
7963 | var BeanStub = (function () {
|
7964 | function BeanStub() {
|
7965 | this.destroyFunctions = [];
|
7966 | this.destroyed = false;
|
7967 | }
|
7968 | BeanStub.prototype.destroy = function () {
|
7969 | this.destroyFunctions.forEach(function (func) { return func(); });
|
7970 | this.destroyFunctions.length = 0;
|
7971 | this.destroyed = true;
|
7972 | this.dispatchEvent({ type: BeanStub.EVENT_DESTROYED });
|
7973 | };
|
7974 | BeanStub.prototype.addEventListener = function (eventType, listener) {
|
7975 | if (!this.localEventService) {
|
7976 | this.localEventService = new eventService_1.EventService();
|
7977 | }
|
7978 | this.localEventService.addEventListener(eventType, listener);
|
7979 | };
|
7980 | BeanStub.prototype.removeEventListener = function (eventType, listener) {
|
7981 | if (this.localEventService) {
|
7982 | this.localEventService.removeEventListener(eventType, listener);
|
7983 | }
|
7984 | };
|
7985 | BeanStub.prototype.dispatchEventAsync = function (event) {
|
7986 | var _this = this;
|
7987 | setTimeout(function () { return _this.dispatchEvent(event); }, 0);
|
7988 | };
|
7989 | BeanStub.prototype.dispatchEvent = function (event) {
|
7990 | if (this.localEventService) {
|
7991 | this.localEventService.dispatchEvent(event);
|
7992 | }
|
7993 | };
|
7994 | BeanStub.prototype.addDestroyableEventListener = function (eElement, event, listener) {
|
7995 | if (this.destroyed) {
|
7996 | return;
|
7997 | }
|
7998 | if (eElement instanceof HTMLElement) {
|
7999 | utils_1._.addSafePassiveEventListener(eElement, event, listener);
|
8000 | }
|
8001 | else if (eElement instanceof Window) {
|
8002 | eElement.addEventListener(event, listener);
|
8003 | }
|
8004 | else if (eElement instanceof gridOptionsWrapper_1.GridOptionsWrapper) {
|
8005 | eElement.addEventListener(event, listener);
|
8006 | }
|
8007 | else {
|
8008 | eElement.addEventListener(event, listener);
|
8009 | }
|
8010 | this.destroyFunctions.push(function () {
|
8011 | if (eElement instanceof HTMLElement) {
|
8012 | eElement.removeEventListener(event, listener);
|
8013 | }
|
8014 | else if (eElement instanceof Window) {
|
8015 | eElement.removeEventListener(event, listener);
|
8016 | }
|
8017 | else if (eElement instanceof gridOptionsWrapper_1.GridOptionsWrapper) {
|
8018 | eElement.removeEventListener(event, listener);
|
8019 | }
|
8020 | else {
|
8021 | eElement.removeEventListener(event, listener);
|
8022 | }
|
8023 | });
|
8024 | };
|
8025 | BeanStub.prototype.isAlive = function () {
|
8026 | return !this.destroyed;
|
8027 | };
|
8028 | BeanStub.prototype.addDestroyFunc = function (func) {
|
8029 |
|
8030 | if (this.isAlive()) {
|
8031 | this.destroyFunctions.push(func);
|
8032 | }
|
8033 | else {
|
8034 | func();
|
8035 | }
|
8036 | };
|
8037 | BeanStub.EVENT_DESTROYED = 'destroyed';
|
8038 | return BeanStub;
|
8039 | }());
|
8040 | exports.BeanStub = BeanStub;
|
8041 |
|
8042 |
|
8043 | }),
|
8044 |
|
8045 | (function(module, exports, __webpack_require__) {
|
8046 |
|
8047 | "use strict";
|
8048 |
|
8049 |
|
8050 |
|
8051 |
|
8052 |
|
8053 |
|
8054 |
|
8055 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
8056 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
8057 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
8058 | 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;
|
8059 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
8060 | };
|
8061 | var __metadata = (this && this.__metadata) || function (k, v) {
|
8062 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
8063 | };
|
8064 | var __param = (this && this.__param) || function (paramIndex, decorator) {
|
8065 | return function (target, key) { decorator(target, key, paramIndex); }
|
8066 | };
|
8067 | Object.defineProperty(exports, "__esModule", { value: true });
|
8068 | var logger_1 = __webpack_require__(12);
|
8069 | var context_1 = __webpack_require__(0);
|
8070 | var utils_1 = __webpack_require__(1);
|
8071 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
8072 | var dragService_1 = __webpack_require__(40);
|
8073 | var columnController_1 = __webpack_require__(4);
|
8074 | var environment_1 = __webpack_require__(41);
|
8075 | var DragSourceType;
|
8076 | (function (DragSourceType) {
|
8077 | DragSourceType[DragSourceType["ToolPanel"] = 0] = "ToolPanel";
|
8078 | DragSourceType[DragSourceType["HeaderCell"] = 1] = "HeaderCell";
|
8079 | DragSourceType[DragSourceType["RowDrag"] = 2] = "RowDrag";
|
8080 | })(DragSourceType = exports.DragSourceType || (exports.DragSourceType = {}));
|
8081 | var VDirection;
|
8082 | (function (VDirection) {
|
8083 | VDirection[VDirection["Up"] = 0] = "Up";
|
8084 | VDirection[VDirection["Down"] = 1] = "Down";
|
8085 | })(VDirection = exports.VDirection || (exports.VDirection = {}));
|
8086 | var HDirection;
|
8087 | (function (HDirection) {
|
8088 | HDirection[HDirection["Left"] = 0] = "Left";
|
8089 | HDirection[HDirection["Right"] = 1] = "Right";
|
8090 | })(HDirection = exports.HDirection || (exports.HDirection = {}));
|
8091 | var DragAndDropService = (function () {
|
8092 | function DragAndDropService() {
|
8093 | this.dragSourceAndParamsList = [];
|
8094 | this.dropTargets = [];
|
8095 | }
|
8096 | DragAndDropService_1 = DragAndDropService;
|
8097 | DragAndDropService.prototype.init = function () {
|
8098 | this.ePinnedIcon = utils_1.Utils.createIcon('columnMovePin', this.gridOptionsWrapper, null);
|
8099 | this.ePlusIcon = utils_1.Utils.createIcon('columnMoveAdd', this.gridOptionsWrapper, null);
|
8100 | this.eHiddenIcon = utils_1.Utils.createIcon('columnMoveHide', this.gridOptionsWrapper, null);
|
8101 | this.eMoveIcon = utils_1.Utils.createIcon('columnMoveMove', this.gridOptionsWrapper, null);
|
8102 | this.eLeftIcon = utils_1.Utils.createIcon('columnMoveLeft', this.gridOptionsWrapper, null);
|
8103 | this.eRightIcon = utils_1.Utils.createIcon('columnMoveRight', this.gridOptionsWrapper, null);
|
8104 | this.eGroupIcon = utils_1.Utils.createIcon('columnMoveGroup', this.gridOptionsWrapper, null);
|
8105 | this.eAggregateIcon = utils_1.Utils.createIcon('columnMoveValue', this.gridOptionsWrapper, null);
|
8106 | this.ePivotIcon = utils_1.Utils.createIcon('columnMovePivot', this.gridOptionsWrapper, null);
|
8107 | this.eDropNotAllowedIcon = utils_1.Utils.createIcon('dropNotAllowed', this.gridOptionsWrapper, null);
|
8108 | };
|
8109 | DragAndDropService.prototype.setBeans = function (loggerFactory) {
|
8110 | this.logger = loggerFactory.create('OldToolPanelDragAndDropService');
|
8111 | };
|
8112 | DragAndDropService.prototype.getStringType = function (type) {
|
8113 | switch (type) {
|
8114 | case DragSourceType.RowDrag: return 'row';
|
8115 | case DragSourceType.HeaderCell: return 'headerCell';
|
8116 | case DragSourceType.ToolPanel: return 'toolPanel';
|
8117 | default:
|
8118 | console.warn("ag-Grid: bug - unknown drag type " + type);
|
8119 | return null;
|
8120 | }
|
8121 | };
|
8122 | DragAndDropService.prototype.addDragSource = function (dragSource, allowTouch) {
|
8123 | if (allowTouch === void 0) { allowTouch = false; }
|
8124 | var params = {
|
8125 | eElement: dragSource.eElement,
|
8126 | dragStartPixels: dragSource.dragStartPixels,
|
8127 | onDragStart: this.onDragStart.bind(this, dragSource),
|
8128 | onDragStop: this.onDragStop.bind(this),
|
8129 | onDragging: this.onDragging.bind(this)
|
8130 | };
|
8131 | this.dragSourceAndParamsList.push({ params: params, dragSource: dragSource });
|
8132 | this.dragService.addDragSource(params, allowTouch);
|
8133 | };
|
8134 | DragAndDropService.prototype.removeDragSource = function (dragSource) {
|
8135 | var sourceAndParams = utils_1.Utils.find(this.dragSourceAndParamsList, function (item) { return item.dragSource === dragSource; });
|
8136 | if (sourceAndParams) {
|
8137 | this.dragService.removeDragSource(sourceAndParams.params);
|
8138 | utils_1.Utils.removeFromArray(this.dragSourceAndParamsList, sourceAndParams);
|
8139 | }
|
8140 | };
|
8141 | DragAndDropService.prototype.destroy = function () {
|
8142 | var _this = this;
|
8143 | this.dragSourceAndParamsList.forEach(function (sourceAndParams) {
|
8144 | _this.dragService.removeDragSource(sourceAndParams.params);
|
8145 | });
|
8146 | this.dragSourceAndParamsList.length = 0;
|
8147 | };
|
8148 | DragAndDropService.prototype.nudge = function () {
|
8149 | if (this.dragging) {
|
8150 | this.onDragging(this.eventLastTime, true);
|
8151 | }
|
8152 | };
|
8153 | DragAndDropService.prototype.onDragStart = function (dragSource, mouseEvent) {
|
8154 | this.dragging = true;
|
8155 | this.dragSource = dragSource;
|
8156 | this.eventLastTime = mouseEvent;
|
8157 | this.dragItem = this.dragSource.dragItemCallback();
|
8158 | this.lastDropTarget = this.dragSource.dragSourceDropTarget;
|
8159 | if (this.dragSource.dragStarted) {
|
8160 | this.dragSource.dragStarted();
|
8161 | }
|
8162 | this.createGhost();
|
8163 | };
|
8164 | DragAndDropService.prototype.onDragStop = function (mouseEvent) {
|
8165 | this.eventLastTime = null;
|
8166 | this.dragging = false;
|
8167 | if (this.dragSource.dragStopped) {
|
8168 | this.dragSource.dragStopped();
|
8169 | }
|
8170 | if (this.lastDropTarget && this.lastDropTarget.onDragStop) {
|
8171 | var draggingEvent = this.createDropTargetEvent(this.lastDropTarget, mouseEvent, null, null, false);
|
8172 | this.lastDropTarget.onDragStop(draggingEvent);
|
8173 | }
|
8174 | this.lastDropTarget = null;
|
8175 | this.dragItem = null;
|
8176 | this.removeGhost();
|
8177 | };
|
8178 | DragAndDropService.prototype.onDragging = function (mouseEvent, fromNudge) {
|
8179 | var hDirection = this.workOutHDirection(mouseEvent);
|
8180 | var vDirection = this.workOutVDirection(mouseEvent);
|
8181 | this.eventLastTime = mouseEvent;
|
8182 | this.positionGhost(mouseEvent);
|
8183 |
|
8184 | var dropTarget = utils_1.Utils.find(this.dropTargets, this.isMouseOnDropTarget.bind(this, mouseEvent));
|
8185 | if (dropTarget !== this.lastDropTarget) {
|
8186 | this.leaveLastTargetIfExists(mouseEvent, hDirection, vDirection, fromNudge);
|
8187 | this.enterDragTargetIfExists(dropTarget, mouseEvent, hDirection, vDirection, fromNudge);
|
8188 | this.lastDropTarget = dropTarget;
|
8189 | }
|
8190 | else if (dropTarget) {
|
8191 | var draggingEvent = this.createDropTargetEvent(dropTarget, mouseEvent, hDirection, vDirection, fromNudge);
|
8192 | dropTarget.onDragging(draggingEvent);
|
8193 | }
|
8194 | };
|
8195 | DragAndDropService.prototype.enterDragTargetIfExists = function (dropTarget, mouseEvent, hDirection, vDirection, fromNudge) {
|
8196 | if (!dropTarget) {
|
8197 | return;
|
8198 | }
|
8199 | var dragEnterEvent = this.createDropTargetEvent(dropTarget, mouseEvent, hDirection, vDirection, fromNudge);
|
8200 | dropTarget.onDragEnter(dragEnterEvent);
|
8201 | this.setGhostIcon(dropTarget.getIconName ? dropTarget.getIconName() : null);
|
8202 | };
|
8203 | DragAndDropService.prototype.leaveLastTargetIfExists = function (mouseEvent, hDirection, vDirection, fromNudge) {
|
8204 | if (!this.lastDropTarget) {
|
8205 | return;
|
8206 | }
|
8207 | var dragLeaveEvent = this.createDropTargetEvent(this.lastDropTarget, mouseEvent, hDirection, vDirection, fromNudge);
|
8208 | this.lastDropTarget.onDragLeave(dragLeaveEvent);
|
8209 | this.setGhostIcon(null);
|
8210 | };
|
8211 | DragAndDropService.prototype.getAllContainersFromDropTarget = function (dropTarget) {
|
8212 | var containers = [dropTarget.getContainer()];
|
8213 | var secondaryContainers = dropTarget.getSecondaryContainers ? dropTarget.getSecondaryContainers() : null;
|
8214 | if (secondaryContainers) {
|
8215 | containers = containers.concat(secondaryContainers);
|
8216 | }
|
8217 | return containers;
|
8218 | };
|
8219 |
|
8220 | DragAndDropService.prototype.isMouseOnDropTarget = function (mouseEvent, dropTarget) {
|
8221 | var allContainers = this.getAllContainersFromDropTarget(dropTarget);
|
8222 | var mouseOverTarget = false;
|
8223 | allContainers.forEach(function (eContainer) {
|
8224 | if (!eContainer) {
|
8225 | return;
|
8226 | }
|
8227 | var rect = eContainer.getBoundingClientRect();
|
8228 |
|
8229 | if (rect.width === 0 || rect.height === 0) {
|
8230 | return;
|
8231 | }
|
8232 | var horizontalFit = mouseEvent.clientX >= rect.left && mouseEvent.clientX <= rect.right;
|
8233 | var verticalFit = mouseEvent.clientY >= rect.top && mouseEvent.clientY <= rect.bottom;
|
8234 |
|
8235 | if (horizontalFit && verticalFit) {
|
8236 | mouseOverTarget = true;
|
8237 | }
|
8238 | });
|
8239 | if (mouseOverTarget) {
|
8240 | var mouseOverTargetAndInterested = dropTarget.isInterestedIn(this.dragSource.type);
|
8241 | return mouseOverTargetAndInterested;
|
8242 | }
|
8243 | else {
|
8244 | return false;
|
8245 | }
|
8246 | };
|
8247 | DragAndDropService.prototype.addDropTarget = function (dropTarget) {
|
8248 | this.dropTargets.push(dropTarget);
|
8249 | };
|
8250 | DragAndDropService.prototype.workOutHDirection = function (event) {
|
8251 | if (this.eventLastTime.clientX > event.clientX) {
|
8252 | return HDirection.Left;
|
8253 | }
|
8254 | else if (this.eventLastTime.clientX < event.clientX) {
|
8255 | return HDirection.Right;
|
8256 | }
|
8257 | else {
|
8258 | return null;
|
8259 | }
|
8260 | };
|
8261 | DragAndDropService.prototype.workOutVDirection = function (event) {
|
8262 | if (this.eventLastTime.clientY > event.clientY) {
|
8263 | return VDirection.Up;
|
8264 | }
|
8265 | else if (this.eventLastTime.clientY < event.clientY) {
|
8266 | return VDirection.Down;
|
8267 | }
|
8268 | else {
|
8269 | return null;
|
8270 | }
|
8271 | };
|
8272 | DragAndDropService.prototype.createDropTargetEvent = function (dropTarget, event, hDirection, vDirection, fromNudge) {
|
8273 |
|
8274 | var rect = dropTarget.getContainer().getBoundingClientRect();
|
8275 | var x = event.clientX - rect.left;
|
8276 | var y = event.clientY - rect.top;
|
8277 | var dropTargetEvent = {
|
8278 | event: event,
|
8279 | x: x,
|
8280 | y: y,
|
8281 | vDirection: vDirection,
|
8282 | hDirection: hDirection,
|
8283 | dragSource: this.dragSource,
|
8284 | fromNudge: fromNudge,
|
8285 | dragItem: this.dragItem
|
8286 | };
|
8287 | return dropTargetEvent;
|
8288 | };
|
8289 | DragAndDropService.prototype.positionGhost = function (event) {
|
8290 | var ghostRect = this.eGhost.getBoundingClientRect();
|
8291 | var ghostHeight = ghostRect.height;
|
8292 |
|
8293 |
|
8294 |
|
8295 | var browserWidth = utils_1.Utils.getBodyWidth() - 2;
|
8296 | var browserHeight = utils_1.Utils.getBodyHeight() - 2;
|
8297 |
|
8298 | var top = event.pageY - (ghostHeight / 2);
|
8299 |
|
8300 | var left = event.pageX - 30;
|
8301 | var usrDocument = this.gridOptionsWrapper.getDocument();
|
8302 | var windowScrollY = window.pageYOffset || usrDocument.documentElement.scrollTop;
|
8303 | var windowScrollX = window.pageXOffset || usrDocument.documentElement.scrollLeft;
|
8304 |
|
8305 | if (browserWidth > 0) {
|
8306 | if ((left + this.eGhost.clientWidth) > (browserWidth + windowScrollX)) {
|
8307 | left = browserWidth + windowScrollX - this.eGhost.clientWidth;
|
8308 | }
|
8309 | }
|
8310 | if (left < 0) {
|
8311 | left = 0;
|
8312 | }
|
8313 | if (browserHeight > 0) {
|
8314 | if ((top + this.eGhost.clientHeight) > (browserHeight + windowScrollY)) {
|
8315 | top = browserHeight + windowScrollY - this.eGhost.clientHeight;
|
8316 | }
|
8317 | }
|
8318 | if (top < 0) {
|
8319 | top = 0;
|
8320 | }
|
8321 | this.eGhost.style.left = left + 'px';
|
8322 | this.eGhost.style.top = top + 'px';
|
8323 | };
|
8324 | DragAndDropService.prototype.removeGhost = function () {
|
8325 | if (this.eGhost && this.eGhostParent) {
|
8326 | this.eGhostParent.removeChild(this.eGhost);
|
8327 | }
|
8328 | this.eGhost = null;
|
8329 | };
|
8330 | DragAndDropService.prototype.createGhost = function () {
|
8331 | this.eGhost = utils_1.Utils.loadTemplate(DragAndDropService_1.GHOST_TEMPLATE);
|
8332 | utils_1.Utils.addCssClass(this.eGhost, this.environment.getTheme());
|
8333 | this.eGhostIcon = this.eGhost.querySelector('.ag-dnd-ghost-icon');
|
8334 | this.setGhostIcon(null);
|
8335 | var eText = this.eGhost.querySelector('.ag-dnd-ghost-label');
|
8336 | eText.innerHTML = this.dragSource.dragItemName;
|
8337 | this.eGhost.style.height = '25px';
|
8338 | this.eGhost.style.top = '20px';
|
8339 | this.eGhost.style.left = '20px';
|
8340 | var usrDocument = this.gridOptionsWrapper.getDocument();
|
8341 | this.eGhostParent = usrDocument.querySelector('body');
|
8342 | if (!this.eGhostParent) {
|
8343 | console.warn('ag-Grid: could not find document body, it is needed for dragging columns');
|
8344 | }
|
8345 | else {
|
8346 | this.eGhostParent.appendChild(this.eGhost);
|
8347 | }
|
8348 | };
|
8349 | DragAndDropService.prototype.setGhostIcon = function (iconName, shake) {
|
8350 | if (shake === void 0) { shake = false; }
|
8351 | utils_1.Utils.removeAllChildren(this.eGhostIcon);
|
8352 | var eIcon;
|
8353 | switch (iconName) {
|
8354 | case DragAndDropService_1.ICON_ADD:
|
8355 | eIcon = this.ePlusIcon;
|
8356 | break;
|
8357 | case DragAndDropService_1.ICON_PINNED:
|
8358 | eIcon = this.ePinnedIcon;
|
8359 | break;
|
8360 | case DragAndDropService_1.ICON_MOVE:
|
8361 | eIcon = this.eMoveIcon;
|
8362 | break;
|
8363 | case DragAndDropService_1.ICON_LEFT:
|
8364 | eIcon = this.eLeftIcon;
|
8365 | break;
|
8366 | case DragAndDropService_1.ICON_RIGHT:
|
8367 | eIcon = this.eRightIcon;
|
8368 | break;
|
8369 | case DragAndDropService_1.ICON_GROUP:
|
8370 | eIcon = this.eGroupIcon;
|
8371 | break;
|
8372 | case DragAndDropService_1.ICON_AGGREGATE:
|
8373 | eIcon = this.eAggregateIcon;
|
8374 | break;
|
8375 | case DragAndDropService_1.ICON_PIVOT:
|
8376 | eIcon = this.ePivotIcon;
|
8377 | break;
|
8378 | case DragAndDropService_1.ICON_NOT_ALLOWED:
|
8379 | eIcon = this.eDropNotAllowedIcon;
|
8380 | break;
|
8381 | default:
|
8382 | eIcon = this.eHiddenIcon;
|
8383 | break;
|
8384 | }
|
8385 | this.eGhostIcon.appendChild(eIcon);
|
8386 | utils_1.Utils.addOrRemoveCssClass(this.eGhostIcon, 'ag-shake-left-to-right', shake);
|
8387 | };
|
8388 | DragAndDropService.ICON_PINNED = 'pinned';
|
8389 | DragAndDropService.ICON_ADD = 'add';
|
8390 | DragAndDropService.ICON_MOVE = 'move';
|
8391 | DragAndDropService.ICON_LEFT = 'left';
|
8392 | DragAndDropService.ICON_RIGHT = 'right';
|
8393 | DragAndDropService.ICON_GROUP = 'group';
|
8394 | DragAndDropService.ICON_AGGREGATE = 'aggregate';
|
8395 | DragAndDropService.ICON_PIVOT = 'pivot';
|
8396 | DragAndDropService.ICON_NOT_ALLOWED = 'notAllowed';
|
8397 | DragAndDropService.GHOST_TEMPLATE = '<div class="ag-dnd-ghost">' +
|
8398 | ' <span class="ag-dnd-ghost-icon ag-shake-left-to-right"></span>' +
|
8399 | ' <div class="ag-dnd-ghost-label">' +
|
8400 | ' </div>' +
|
8401 | '</div>';
|
8402 | __decorate([
|
8403 | context_1.Autowired('gridOptionsWrapper'),
|
8404 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
8405 | ], DragAndDropService.prototype, "gridOptionsWrapper", void 0);
|
8406 | __decorate([
|
8407 | context_1.Autowired('dragService'),
|
8408 | __metadata("design:type", dragService_1.DragService)
|
8409 | ], DragAndDropService.prototype, "dragService", void 0);
|
8410 | __decorate([
|
8411 | context_1.Autowired('environment'),
|
8412 | __metadata("design:type", environment_1.Environment)
|
8413 | ], DragAndDropService.prototype, "environment", void 0);
|
8414 | __decorate([
|
8415 | context_1.Autowired('columnController'),
|
8416 | __metadata("design:type", columnController_1.ColumnController)
|
8417 | ], DragAndDropService.prototype, "columnController", void 0);
|
8418 | __decorate([
|
8419 | context_1.PostConstruct,
|
8420 | __metadata("design:type", Function),
|
8421 | __metadata("design:paramtypes", []),
|
8422 | __metadata("design:returntype", void 0)
|
8423 | ], DragAndDropService.prototype, "init", null);
|
8424 | __decorate([
|
8425 | __param(0, context_1.Qualifier('loggerFactory')),
|
8426 | __metadata("design:type", Function),
|
8427 | __metadata("design:paramtypes", [logger_1.LoggerFactory]),
|
8428 | __metadata("design:returntype", void 0)
|
8429 | ], DragAndDropService.prototype, "setBeans", null);
|
8430 | __decorate([
|
8431 | context_1.PreDestroy,
|
8432 | __metadata("design:type", Function),
|
8433 | __metadata("design:paramtypes", []),
|
8434 | __metadata("design:returntype", void 0)
|
8435 | ], DragAndDropService.prototype, "destroy", null);
|
8436 | DragAndDropService = DragAndDropService_1 = __decorate([
|
8437 | context_1.Bean('dragAndDropService')
|
8438 | ], DragAndDropService);
|
8439 | return DragAndDropService;
|
8440 | var DragAndDropService_1;
|
8441 | }());
|
8442 | exports.DragAndDropService = DragAndDropService;
|
8443 |
|
8444 |
|
8445 | }),
|
8446 |
|
8447 | (function(module, exports, __webpack_require__) {
|
8448 |
|
8449 | "use strict";
|
8450 |
|
8451 |
|
8452 |
|
8453 |
|
8454 |
|
8455 |
|
8456 |
|
8457 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
8458 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
8459 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
8460 | 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;
|
8461 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
8462 | };
|
8463 | var __metadata = (this && this.__metadata) || function (k, v) {
|
8464 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
8465 | };
|
8466 | Object.defineProperty(exports, "__esModule", { value: true });
|
8467 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
8468 | var expressionService_1 = __webpack_require__(19);
|
8469 | var columnController_1 = __webpack_require__(4);
|
8470 | var context_1 = __webpack_require__(0);
|
8471 | var utils_1 = __webpack_require__(1);
|
8472 | var events_1 = __webpack_require__(5);
|
8473 | var eventService_1 = __webpack_require__(3);
|
8474 | var valueCache_1 = __webpack_require__(33);
|
8475 | var ValueService = (function () {
|
8476 | function ValueService() {
|
8477 | this.initialised = false;
|
8478 | }
|
8479 | ValueService.prototype.init = function () {
|
8480 | this.cellExpressions = this.gridOptionsWrapper.isEnableCellExpressions();
|
8481 | this.initialised = true;
|
8482 | };
|
8483 | ValueService.prototype.getValue = function (column, rowNode, forFilter, ignoreAggData) {
|
8484 |
|
8485 | if (forFilter === void 0) { forFilter = false; }
|
8486 | if (ignoreAggData === void 0) { ignoreAggData = false; }
|
8487 |
|
8488 |
|
8489 | if (!this.initialised) {
|
8490 | this.init();
|
8491 | }
|
8492 |
|
8493 | var colDef = column.getColDef();
|
8494 | var field = colDef.field;
|
8495 | var colId = column.getId();
|
8496 | var data = rowNode.data;
|
8497 | var result;
|
8498 |
|
8499 | var groupDataExists = rowNode.groupData && rowNode.groupData[colId] !== undefined;
|
8500 | var aggDataExists = !ignoreAggData && rowNode.aggData && rowNode.aggData[colId] !== undefined;
|
8501 | if (forFilter && colDef.filterValueGetter) {
|
8502 | result = this.executeValueGetter(colDef.filterValueGetter, data, column, rowNode);
|
8503 | }
|
8504 | else if (groupDataExists) {
|
8505 | result = rowNode.groupData[colId];
|
8506 | }
|
8507 | else if (aggDataExists) {
|
8508 | result = rowNode.aggData[colId];
|
8509 | }
|
8510 | else if (colDef.valueGetter) {
|
8511 | result = this.executeValueGetter(colDef.valueGetter, data, column, rowNode);
|
8512 | }
|
8513 | else if (field && data) {
|
8514 | result = utils_1._.getValueUsingField(data, field, column.isFieldContainsDots());
|
8515 | }
|
8516 | else {
|
8517 | result = undefined;
|
8518 | }
|
8519 |
|
8520 | if (this.cellExpressions && (typeof result === 'string') && result.indexOf('=') === 0) {
|
8521 | var cellValueGetter = result.substring(1);
|
8522 | result = this.executeValueGetter(cellValueGetter, data, column, rowNode);
|
8523 | }
|
8524 | return result;
|
8525 | };
|
8526 | ValueService.prototype.setValue = function (rowNode, colKey, newValue) {
|
8527 | var column = this.columnController.getPrimaryColumn(colKey);
|
8528 | if (!rowNode || !column) {
|
8529 | return;
|
8530 | }
|
8531 |
|
8532 |
|
8533 | var data = rowNode.data;
|
8534 | if (utils_1._.missing(data)) {
|
8535 | rowNode.data = {};
|
8536 | }
|
8537 |
|
8538 | var _a = column.getColDef(), field = _a.field, newValueHandler = _a.newValueHandler, valueSetter = _a.valueSetter;
|
8539 |
|
8540 | if (utils_1._.missing(field) && utils_1._.missing(newValueHandler) && utils_1._.missing(valueSetter)) {
|
8541 |
|
8542 | console.warn("ag-Grid: you need either field or valueSetter set on colDef for editing to work");
|
8543 | return;
|
8544 | }
|
8545 | var params = {
|
8546 | node: rowNode,
|
8547 | data: rowNode.data,
|
8548 | oldValue: this.getValue(column, rowNode),
|
8549 | newValue: newValue,
|
8550 | colDef: column.getColDef(),
|
8551 | column: column,
|
8552 | api: this.gridOptionsWrapper.getApi(),
|
8553 | columnApi: this.gridOptionsWrapper.getColumnApi(),
|
8554 | context: this.gridOptionsWrapper.getContext()
|
8555 | };
|
8556 | params.newValue = newValue;
|
8557 | var valueWasDifferent;
|
8558 | if (utils_1._.exists(newValueHandler)) {
|
8559 | valueWasDifferent = newValueHandler(params);
|
8560 | }
|
8561 | else if (utils_1._.exists(valueSetter)) {
|
8562 | valueWasDifferent = this.expressionService.evaluate(valueSetter, params);
|
8563 | }
|
8564 | else {
|
8565 | valueWasDifferent = this.setValueUsingField(data, field, newValue, column.isFieldContainsDots());
|
8566 | }
|
8567 |
|
8568 |
|
8569 |
|
8570 | if (valueWasDifferent === undefined) {
|
8571 | valueWasDifferent = true;
|
8572 | }
|
8573 |
|
8574 |
|
8575 |
|
8576 | if (!valueWasDifferent) {
|
8577 | return;
|
8578 | }
|
8579 |
|
8580 | rowNode.resetQuickFilterAggregateText();
|
8581 | this.valueCache.onDataChanged();
|
8582 | params.newValue = this.getValue(column, rowNode);
|
8583 | if (typeof column.getColDef().onCellValueChanged === 'function') {
|
8584 |
|
8585 | setTimeout(function () { return column.getColDef().onCellValueChanged(params); }, 0);
|
8586 | }
|
8587 | var event = {
|
8588 | type: events_1.Events.EVENT_CELL_VALUE_CHANGED,
|
8589 | event: null,
|
8590 | rowIndex: rowNode.rowIndex,
|
8591 | rowPinned: rowNode.rowPinned,
|
8592 | column: params.column,
|
8593 | api: params.api,
|
8594 | colDef: params.colDef,
|
8595 | columnApi: params.columnApi,
|
8596 | context: params.context,
|
8597 | data: rowNode.data,
|
8598 | node: rowNode,
|
8599 | oldValue: params.oldValue,
|
8600 | newValue: params.newValue,
|
8601 | value: params.newValue
|
8602 | };
|
8603 | this.eventService.dispatchEvent(event);
|
8604 | };
|
8605 | ValueService.prototype.setValueUsingField = function (data, field, newValue, isFieldContainsDots) {
|
8606 |
|
8607 | var valuesAreSame;
|
8608 | if (!isFieldContainsDots) {
|
8609 | data[field] = newValue;
|
8610 | }
|
8611 | else {
|
8612 |
|
8613 | var fieldPieces = field.split('.');
|
8614 | var currentObject = data;
|
8615 | while (fieldPieces.length > 0 && currentObject) {
|
8616 | var fieldPiece = fieldPieces.shift();
|
8617 | if (fieldPieces.length === 0) {
|
8618 | currentObject[fieldPiece] = newValue;
|
8619 | }
|
8620 | else {
|
8621 | currentObject = currentObject[fieldPiece];
|
8622 | }
|
8623 | }
|
8624 | }
|
8625 | return !valuesAreSame;
|
8626 | };
|
8627 | ValueService.prototype.executeValueGetter = function (filterValueGetter, data, column, rowNode) {
|
8628 | var colId = column.getId();
|
8629 |
|
8630 | var valueFromCache = this.valueCache.getValue(rowNode, colId);
|
8631 | if (valueFromCache !== undefined) {
|
8632 | return valueFromCache;
|
8633 | }
|
8634 | var params = {
|
8635 | data: data,
|
8636 | node: rowNode,
|
8637 | column: column,
|
8638 | colDef: column.getColDef(),
|
8639 | api: this.gridOptionsWrapper.getApi(),
|
8640 | columnApi: this.gridOptionsWrapper.getColumnApi(),
|
8641 | context: this.gridOptionsWrapper.getContext(),
|
8642 | getValue: this.getValueCallback.bind(this, rowNode)
|
8643 | };
|
8644 | var result = this.expressionService.evaluate(filterValueGetter, params);
|
8645 |
|
8646 | this.valueCache.setValue(rowNode, colId, result);
|
8647 | return result;
|
8648 | };
|
8649 | ValueService.prototype.getValueCallback = function (node, field) {
|
8650 | var otherColumn = this.columnController.getPrimaryColumn(field);
|
8651 | if (otherColumn) {
|
8652 | return this.getValue(otherColumn, node);
|
8653 | }
|
8654 | else {
|
8655 | return null;
|
8656 | }
|
8657 | };
|
8658 |
|
8659 | ValueService.prototype.getKeyForNode = function (col, rowNode) {
|
8660 | var value = this.getValue(col, rowNode);
|
8661 | var result;
|
8662 | var keyCreator = col.getColDef().keyCreator;
|
8663 | if (keyCreator) {
|
8664 | result = keyCreator({ value: value });
|
8665 | }
|
8666 | else {
|
8667 | result = value;
|
8668 | }
|
8669 |
|
8670 | if (typeof result === 'string' || result === null || result === undefined) {
|
8671 | return result;
|
8672 | }
|
8673 | result = String(result);
|
8674 | if (result === '[object Object]') {
|
8675 | utils_1._.doOnce(function () {
|
8676 | console.warn('ag-Grid: a column you are grouping or pivoting by has objects as values. If you want to group by complex objects then either a) use a colDef.keyCreator (se ag-Grid docs) or b) to toString() on the object to return a key');
|
8677 | }, 'getKeyForNode - warn about [object,object]');
|
8678 | }
|
8679 | return result;
|
8680 | };
|
8681 | __decorate([
|
8682 | context_1.Autowired('gridOptionsWrapper'),
|
8683 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
8684 | ], ValueService.prototype, "gridOptionsWrapper", void 0);
|
8685 | __decorate([
|
8686 | context_1.Autowired('expressionService'),
|
8687 | __metadata("design:type", expressionService_1.ExpressionService)
|
8688 | ], ValueService.prototype, "expressionService", void 0);
|
8689 | __decorate([
|
8690 | context_1.Autowired('columnController'),
|
8691 | __metadata("design:type", columnController_1.ColumnController)
|
8692 | ], ValueService.prototype, "columnController", void 0);
|
8693 | __decorate([
|
8694 | context_1.Autowired('eventService'),
|
8695 | __metadata("design:type", eventService_1.EventService)
|
8696 | ], ValueService.prototype, "eventService", void 0);
|
8697 | __decorate([
|
8698 | context_1.Autowired('valueCache'),
|
8699 | __metadata("design:type", valueCache_1.ValueCache)
|
8700 | ], ValueService.prototype, "valueCache", void 0);
|
8701 | __decorate([
|
8702 | context_1.PostConstruct,
|
8703 | __metadata("design:type", Function),
|
8704 | __metadata("design:paramtypes", []),
|
8705 | __metadata("design:returntype", void 0)
|
8706 | ], ValueService.prototype, "init", null);
|
8707 | ValueService = __decorate([
|
8708 | context_1.Bean('valueService')
|
8709 | ], ValueService);
|
8710 | return ValueService;
|
8711 | }());
|
8712 | exports.ValueService = ValueService;
|
8713 |
|
8714 |
|
8715 | }),
|
8716 |
|
8717 | (function(module, exports, __webpack_require__) {
|
8718 |
|
8719 | "use strict";
|
8720 |
|
8721 |
|
8722 |
|
8723 |
|
8724 |
|
8725 |
|
8726 |
|
8727 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
8728 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
8729 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
8730 | 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;
|
8731 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
8732 | };
|
8733 | var __metadata = (this && this.__metadata) || function (k, v) {
|
8734 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
8735 | };
|
8736 | Object.defineProperty(exports, "__esModule", { value: true });
|
8737 | var eventService_1 = __webpack_require__(3);
|
8738 | var events_1 = __webpack_require__(5);
|
8739 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
8740 | var selectionController_1 = __webpack_require__(17);
|
8741 | var valueService_1 = __webpack_require__(15);
|
8742 | var columnController_1 = __webpack_require__(4);
|
8743 | var columnApi_1 = __webpack_require__(7);
|
8744 | var context_1 = __webpack_require__(0);
|
8745 | var constants_1 = __webpack_require__(9);
|
8746 | var utils_1 = __webpack_require__(1);
|
8747 | var valueCache_1 = __webpack_require__(33);
|
8748 | var gridApi_1 = __webpack_require__(6);
|
8749 | var RowNode = (function () {
|
8750 | function RowNode() {
|
8751 |
|
8752 | this.childrenMapped = {};
|
8753 |
|
8754 | this.selectable = true;
|
8755 | this.selected = false;
|
8756 | }
|
8757 | RowNode.prototype.setData = function (data) {
|
8758 | var oldData = this.data;
|
8759 | this.data = data;
|
8760 | this.valueCache.onDataChanged();
|
8761 | this.updateDataOnDetailNode();
|
8762 | this.checkRowSelectable();
|
8763 | var event = this.createDataChangedEvent(data, oldData, false);
|
8764 | this.dispatchLocalEvent(event);
|
8765 | };
|
8766 |
|
8767 |
|
8768 |
|
8769 | RowNode.prototype.updateDataOnDetailNode = function () {
|
8770 | if (this.detailNode) {
|
8771 | this.detailNode.data = this.data;
|
8772 | }
|
8773 | };
|
8774 | RowNode.prototype.createDataChangedEvent = function (newData, oldData, update) {
|
8775 | return {
|
8776 | type: RowNode.EVENT_DATA_CHANGED,
|
8777 | node: this,
|
8778 | oldData: oldData,
|
8779 | newData: newData,
|
8780 | update: update
|
8781 | };
|
8782 | };
|
8783 | RowNode.prototype.createLocalRowEvent = function (type) {
|
8784 | return {
|
8785 | type: type,
|
8786 | node: this
|
8787 | };
|
8788 | };
|
8789 |
|
8790 |
|
8791 |
|
8792 |
|
8793 |
|
8794 | RowNode.prototype.updateData = function (data) {
|
8795 | var oldData = this.data;
|
8796 | this.data = data;
|
8797 | this.updateDataOnDetailNode();
|
8798 | this.checkRowSelectable();
|
8799 | this.updateDataOnDetailNode();
|
8800 | var event = this.createDataChangedEvent(data, oldData, true);
|
8801 | this.dispatchLocalEvent(event);
|
8802 | };
|
8803 | RowNode.prototype.getRowIndexString = function () {
|
8804 | if (this.rowPinned === constants_1.Constants.PINNED_TOP) {
|
8805 | return 't-' + this.rowIndex;
|
8806 | }
|
8807 | else if (this.rowPinned === constants_1.Constants.PINNED_BOTTOM) {
|
8808 | return 'b-' + this.rowIndex;
|
8809 | }
|
8810 | else {
|
8811 | return this.rowIndex.toString();
|
8812 | }
|
8813 | };
|
8814 | RowNode.prototype.createDaemonNode = function () {
|
8815 | var oldNode = new RowNode();
|
8816 | this.context.wireBean(oldNode);
|
8817 |
|
8818 |
|
8819 |
|
8820 | oldNode.id = this.id;
|
8821 | oldNode.data = this.data;
|
8822 | oldNode.daemon = true;
|
8823 | oldNode.selected = this.selected;
|
8824 | oldNode.level = this.level;
|
8825 | return oldNode;
|
8826 | };
|
8827 | RowNode.prototype.setDataAndId = function (data, id) {
|
8828 | var oldNode = utils_1.Utils.exists(this.id) ? this.createDaemonNode() : null;
|
8829 | var oldData = this.data;
|
8830 | this.data = data;
|
8831 | this.updateDataOnDetailNode();
|
8832 | this.setId(id);
|
8833 | this.selectionController.syncInRowNode(this, oldNode);
|
8834 | this.checkRowSelectable();
|
8835 | var event = this.createDataChangedEvent(data, oldData, false);
|
8836 | this.dispatchLocalEvent(event);
|
8837 | };
|
8838 | RowNode.prototype.checkRowSelectable = function () {
|
8839 | var isRowSelectableFunc = this.gridOptionsWrapper.getIsRowSelectableFunc();
|
8840 | var shouldInvokeIsRowSelectable = isRowSelectableFunc && utils_1.Utils.exists(this);
|
8841 | this.setRowSelectable(shouldInvokeIsRowSelectable ? isRowSelectableFunc(this) : true);
|
8842 | };
|
8843 | RowNode.prototype.setRowSelectable = function (newVal) {
|
8844 | if (this.selectable !== newVal) {
|
8845 | this.selectable = newVal;
|
8846 | if (this.eventService) {
|
8847 | this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_SELECTABLE_CHANGED));
|
8848 | }
|
8849 | }
|
8850 | };
|
8851 | RowNode.prototype.setId = function (id) {
|
8852 |
|
8853 | var getRowNodeId = this.gridOptionsWrapper.getRowNodeIdFunc();
|
8854 | if (getRowNodeId) {
|
8855 |
|
8856 |
|
8857 | if (this.data) {
|
8858 | this.id = getRowNodeId(this.data);
|
8859 | }
|
8860 | else {
|
8861 |
|
8862 |
|
8863 |
|
8864 | this.id = undefined;
|
8865 | }
|
8866 | }
|
8867 | else {
|
8868 | this.id = id;
|
8869 | }
|
8870 | };
|
8871 | RowNode.prototype.isPixelInRange = function (pixel) {
|
8872 | return pixel >= this.rowTop && pixel < (this.rowTop + this.rowHeight);
|
8873 | };
|
8874 | RowNode.prototype.clearRowTop = function () {
|
8875 | this.oldRowTop = this.rowTop;
|
8876 | this.setRowTop(null);
|
8877 | };
|
8878 | RowNode.prototype.setFirstChild = function (firstChild) {
|
8879 | if (this.firstChild === firstChild) {
|
8880 | return;
|
8881 | }
|
8882 | this.firstChild = firstChild;
|
8883 | if (this.eventService) {
|
8884 | this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_FIRST_CHILD_CHANGED));
|
8885 | }
|
8886 | };
|
8887 | RowNode.prototype.setLastChild = function (lastChild) {
|
8888 | if (this.lastChild === lastChild) {
|
8889 | return;
|
8890 | }
|
8891 | this.lastChild = lastChild;
|
8892 | if (this.eventService) {
|
8893 | this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_LAST_CHILD_CHANGED));
|
8894 | }
|
8895 | };
|
8896 | RowNode.prototype.setChildIndex = function (childIndex) {
|
8897 | if (this.childIndex === childIndex) {
|
8898 | return;
|
8899 | }
|
8900 | this.childIndex = childIndex;
|
8901 | if (this.eventService) {
|
8902 | this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_CHILD_INDEX_CHANGED));
|
8903 | }
|
8904 | };
|
8905 | RowNode.prototype.setRowTop = function (rowTop) {
|
8906 | if (this.rowTop === rowTop) {
|
8907 | return;
|
8908 | }
|
8909 | this.rowTop = rowTop;
|
8910 | if (this.eventService) {
|
8911 | this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_TOP_CHANGED));
|
8912 | }
|
8913 | };
|
8914 | RowNode.prototype.setDragging = function (dragging) {
|
8915 | if (this.dragging === dragging) {
|
8916 | return;
|
8917 | }
|
8918 | this.dragging = dragging;
|
8919 | if (this.eventService) {
|
8920 | this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_DRAGGING_CHANGED));
|
8921 | }
|
8922 | };
|
8923 | RowNode.prototype.setAllChildrenCount = function (allChildrenCount) {
|
8924 | if (this.allChildrenCount === allChildrenCount) {
|
8925 | return;
|
8926 | }
|
8927 | this.allChildrenCount = allChildrenCount;
|
8928 | if (this.eventService) {
|
8929 | this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_ALL_CHILDREN_COUNT_CHANGED));
|
8930 | }
|
8931 | };
|
8932 | RowNode.prototype.setRowHeight = function (rowHeight) {
|
8933 | this.rowHeight = rowHeight;
|
8934 | if (this.eventService) {
|
8935 | this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_HEIGHT_CHANGED));
|
8936 | }
|
8937 | };
|
8938 | RowNode.prototype.setRowIndex = function (rowIndex) {
|
8939 | this.rowIndex = rowIndex;
|
8940 | if (this.eventService) {
|
8941 | this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_ROW_INDEX_CHANGED));
|
8942 | }
|
8943 | };
|
8944 | RowNode.prototype.setUiLevel = function (uiLevel) {
|
8945 | if (this.uiLevel === uiLevel) {
|
8946 | return;
|
8947 | }
|
8948 | this.uiLevel = uiLevel;
|
8949 | if (this.eventService) {
|
8950 | this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_UI_LEVEL_CHANGED));
|
8951 | }
|
8952 | };
|
8953 | RowNode.prototype.setExpanded = function (expanded) {
|
8954 | if (this.expanded === expanded) {
|
8955 | return;
|
8956 | }
|
8957 | this.expanded = expanded;
|
8958 | if (this.eventService) {
|
8959 | this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_EXPANDED_CHANGED));
|
8960 | }
|
8961 | var event = this.createGlobalRowEvent(events_1.Events.EVENT_ROW_GROUP_OPENED);
|
8962 | this.mainEventService.dispatchEvent(event);
|
8963 | if (this.gridOptionsWrapper.isGroupIncludeFooter()) {
|
8964 | this.gridApi.redrawRows({ rowNodes: [this] });
|
8965 | }
|
8966 | };
|
8967 | RowNode.prototype.createGlobalRowEvent = function (type) {
|
8968 | var event = {
|
8969 | type: type,
|
8970 | node: this,
|
8971 | data: this.data,
|
8972 | rowIndex: this.rowIndex,
|
8973 | rowPinned: this.rowPinned,
|
8974 | context: this.gridOptionsWrapper.getContext(),
|
8975 | api: this.gridOptionsWrapper.getApi(),
|
8976 | columnApi: this.gridOptionsWrapper.getColumnApi()
|
8977 | };
|
8978 | return event;
|
8979 | };
|
8980 | RowNode.prototype.dispatchLocalEvent = function (event) {
|
8981 | if (this.eventService) {
|
8982 | this.eventService.dispatchEvent(event);
|
8983 | }
|
8984 | };
|
8985 |
|
8986 |
|
8987 |
|
8988 |
|
8989 |
|
8990 | RowNode.prototype.setDataValue = function (colKey, newValue) {
|
8991 | var column = this.columnController.getPrimaryColumn(colKey);
|
8992 | this.valueService.setValue(this, column, newValue);
|
8993 | this.dispatchCellChangedEvent(column, newValue);
|
8994 | };
|
8995 | RowNode.prototype.setGroupValue = function (colKey, newValue) {
|
8996 | var column = this.columnController.getGridColumn(colKey);
|
8997 | if (utils_1.Utils.missing(this.groupData)) {
|
8998 | this.groupData = {};
|
8999 | }
|
9000 | this.groupData[column.getColId()] = newValue;
|
9001 | this.dispatchCellChangedEvent(column, newValue);
|
9002 | };
|
9003 |
|
9004 | RowNode.prototype.setAggData = function (newAggData) {
|
9005 | var _this = this;
|
9006 |
|
9007 | var colIds = utils_1.Utils.getAllKeysInObjects([this.aggData, newAggData]);
|
9008 | this.aggData = newAggData;
|
9009 |
|
9010 | if (this.eventService) {
|
9011 | colIds.forEach(function (colId) {
|
9012 | var column = _this.columnController.getGridColumn(colId);
|
9013 | var value = _this.aggData ? _this.aggData[colId] : undefined;
|
9014 | _this.dispatchCellChangedEvent(column, value);
|
9015 | });
|
9016 | }
|
9017 | };
|
9018 | RowNode.prototype.hasChildren = function () {
|
9019 |
|
9020 |
|
9021 |
|
9022 | return this.group || (this.childrenAfterGroup && this.childrenAfterGroup.length > 0);
|
9023 | };
|
9024 | RowNode.prototype.isEmptyFillerNode = function () {
|
9025 | return this.group && utils_1.Utils.missingOrEmpty(this.childrenAfterGroup);
|
9026 | };
|
9027 | RowNode.prototype.dispatchCellChangedEvent = function (column, newValue) {
|
9028 | var cellChangedEvent = {
|
9029 | type: RowNode.EVENT_CELL_CHANGED,
|
9030 | node: this,
|
9031 | column: column,
|
9032 | newValue: newValue
|
9033 | };
|
9034 | this.dispatchLocalEvent(cellChangedEvent);
|
9035 | };
|
9036 | RowNode.prototype.resetQuickFilterAggregateText = function () {
|
9037 | this.quickFilterAggregateText = null;
|
9038 | };
|
9039 | RowNode.prototype.isExpandable = function () {
|
9040 | return this.hasChildren() || this.master;
|
9041 | };
|
9042 | RowNode.prototype.isSelected = function () {
|
9043 |
|
9044 | if (this.footer) {
|
9045 | return this.sibling.isSelected();
|
9046 | }
|
9047 | return this.selected;
|
9048 | };
|
9049 | RowNode.prototype.depthFirstSearch = function (callback) {
|
9050 | if (this.childrenAfterGroup) {
|
9051 | this.childrenAfterGroup.forEach(function (child) { return child.depthFirstSearch(callback); });
|
9052 | }
|
9053 | callback(this);
|
9054 | };
|
9055 |
|
9056 |
|
9057 | RowNode.prototype.calculateSelectedFromChildren = function () {
|
9058 | var atLeastOneSelected = false;
|
9059 | var atLeastOneDeSelected = false;
|
9060 | var atLeastOneMixed = false;
|
9061 | var newSelectedValue;
|
9062 | if (this.childrenAfterGroup) {
|
9063 | for (var i = 0; i < this.childrenAfterGroup.length; i++) {
|
9064 | var child = this.childrenAfterGroup[i];
|
9065 |
|
9066 | if (!child.selectable)
|
9067 | continue;
|
9068 | var childState = child.isSelected();
|
9069 | switch (childState) {
|
9070 | case true:
|
9071 | atLeastOneSelected = true;
|
9072 | break;
|
9073 | case false:
|
9074 | atLeastOneDeSelected = true;
|
9075 | break;
|
9076 | default:
|
9077 | atLeastOneMixed = true;
|
9078 | break;
|
9079 | }
|
9080 | }
|
9081 | }
|
9082 | if (atLeastOneMixed) {
|
9083 | newSelectedValue = undefined;
|
9084 | }
|
9085 | else if (atLeastOneSelected && !atLeastOneDeSelected) {
|
9086 | newSelectedValue = true;
|
9087 | }
|
9088 | else if (!atLeastOneSelected && atLeastOneDeSelected) {
|
9089 | newSelectedValue = false;
|
9090 | }
|
9091 | else {
|
9092 | newSelectedValue = undefined;
|
9093 | }
|
9094 | this.selectThisNode(newSelectedValue);
|
9095 | };
|
9096 | RowNode.prototype.setSelectedInitialValue = function (selected) {
|
9097 | this.selected = selected;
|
9098 | };
|
9099 | RowNode.prototype.setSelected = function (newValue, clearSelection, suppressFinishActions) {
|
9100 | if (clearSelection === void 0) { clearSelection = false; }
|
9101 | if (suppressFinishActions === void 0) { suppressFinishActions = false; }
|
9102 | this.setSelectedParams({
|
9103 | newValue: newValue,
|
9104 | clearSelection: clearSelection,
|
9105 | suppressFinishActions: suppressFinishActions,
|
9106 | rangeSelect: false
|
9107 | });
|
9108 | };
|
9109 | RowNode.prototype.isRowPinned = function () {
|
9110 | return this.rowPinned === constants_1.Constants.PINNED_TOP || this.rowPinned === constants_1.Constants.PINNED_BOTTOM;
|
9111 | };
|
9112 |
|
9113 | RowNode.prototype.setSelectedParams = function (params) {
|
9114 | var groupSelectsChildren = this.gridOptionsWrapper.isGroupSelectsChildren();
|
9115 | var newValue = params.newValue === true;
|
9116 | var clearSelection = params.clearSelection === true;
|
9117 | var suppressFinishActions = params.suppressFinishActions === true;
|
9118 | var rangeSelect = params.rangeSelect === true;
|
9119 |
|
9120 | var groupSelectsFiltered = groupSelectsChildren && (params.groupSelectsFiltered === true);
|
9121 | if (this.id === undefined) {
|
9122 | console.warn('ag-Grid: cannot select node until id for node is known');
|
9123 | return 0;
|
9124 | }
|
9125 | if (this.rowPinned) {
|
9126 | console.log('ag-Grid: cannot select pinned rows');
|
9127 | return 0;
|
9128 | }
|
9129 |
|
9130 |
|
9131 | if (this.footer) {
|
9132 | var count = this.sibling.setSelectedParams(params);
|
9133 | return count;
|
9134 | }
|
9135 | if (rangeSelect) {
|
9136 | var newRowClicked = this.selectionController.getLastSelectedNode() !== this;
|
9137 | var allowMultiSelect = this.gridOptionsWrapper.isRowSelectionMulti();
|
9138 | if (newRowClicked && allowMultiSelect) {
|
9139 | return this.doRowRangeSelection();
|
9140 | }
|
9141 | }
|
9142 | var updatedCount = 0;
|
9143 |
|
9144 |
|
9145 |
|
9146 |
|
9147 | var skipThisNode = groupSelectsFiltered && this.group;
|
9148 | if (!skipThisNode) {
|
9149 | var thisNodeWasSelected = this.selectThisNode(newValue);
|
9150 | if (thisNodeWasSelected) {
|
9151 | updatedCount++;
|
9152 | }
|
9153 | }
|
9154 | if (groupSelectsChildren && this.group) {
|
9155 | updatedCount += this.selectChildNodes(newValue, groupSelectsFiltered);
|
9156 | }
|
9157 |
|
9158 | if (!suppressFinishActions) {
|
9159 | var clearOtherNodes = newValue && (clearSelection || !this.gridOptionsWrapper.isRowSelectionMulti());
|
9160 | if (clearOtherNodes) {
|
9161 | updatedCount += this.selectionController.clearOtherNodes(this);
|
9162 | }
|
9163 |
|
9164 | if (updatedCount > 0) {
|
9165 | this.selectionController.updateGroupsFromChildrenSelections();
|
9166 |
|
9167 |
|
9168 | var event_1 = {
|
9169 | type: events_1.Events.EVENT_SELECTION_CHANGED,
|
9170 | api: this.gridApi,
|
9171 | columnApi: this.columnApi
|
9172 | };
|
9173 | this.mainEventService.dispatchEvent(event_1);
|
9174 | }
|
9175 |
|
9176 | if (newValue) {
|
9177 | this.selectionController.setLastSelectedNode(this);
|
9178 | }
|
9179 | }
|
9180 | return updatedCount;
|
9181 | };
|
9182 |
|
9183 |
|
9184 |
|
9185 | RowNode.prototype.doRowRangeSelection = function () {
|
9186 | var updatedCount = 0;
|
9187 | var groupsSelectChildren = this.gridOptionsWrapper.isGroupSelectsChildren();
|
9188 | var lastSelectedNode = this.selectionController.getLastSelectedNode();
|
9189 | var nodesToSelect = this.rowModel.getNodesInRangeForSelection(this, lastSelectedNode);
|
9190 | nodesToSelect.forEach(function (rowNode) {
|
9191 | if (rowNode.group && groupsSelectChildren) {
|
9192 | return;
|
9193 | }
|
9194 | var nodeWasSelected = rowNode.selectThisNode(true);
|
9195 | if (nodeWasSelected) {
|
9196 | updatedCount++;
|
9197 | }
|
9198 | });
|
9199 | this.selectionController.updateGroupsFromChildrenSelections();
|
9200 | var event = {
|
9201 | type: events_1.Events.EVENT_SELECTION_CHANGED,
|
9202 | api: this.gridApi,
|
9203 | columnApi: this.columnApi
|
9204 | };
|
9205 | this.mainEventService.dispatchEvent(event);
|
9206 | return updatedCount;
|
9207 | };
|
9208 | RowNode.prototype.isParentOfNode = function (potentialParent) {
|
9209 | var parentNode = this.parent;
|
9210 | while (parentNode) {
|
9211 | if (parentNode === potentialParent) {
|
9212 | return true;
|
9213 | }
|
9214 | parentNode = parentNode.parent;
|
9215 | }
|
9216 | return false;
|
9217 | };
|
9218 | RowNode.prototype.selectThisNode = function (newValue) {
|
9219 | if (!this.selectable || this.selected === newValue)
|
9220 | return false;
|
9221 | this.selected = newValue;
|
9222 | if (this.eventService) {
|
9223 | this.dispatchLocalEvent(this.createLocalRowEvent(RowNode.EVENT_ROW_SELECTED));
|
9224 | }
|
9225 | var event = this.createGlobalRowEvent(events_1.Events.EVENT_ROW_SELECTED);
|
9226 | this.mainEventService.dispatchEvent(event);
|
9227 | return true;
|
9228 | };
|
9229 | RowNode.prototype.selectChildNodes = function (newValue, groupSelectsFiltered) {
|
9230 | var children = groupSelectsFiltered ? this.childrenAfterFilter : this.childrenAfterGroup;
|
9231 | var updatedCount = 0;
|
9232 | if (utils_1.Utils.missing(children)) {
|
9233 | return;
|
9234 | }
|
9235 | for (var i = 0; i < children.length; i++) {
|
9236 | updatedCount += children[i].setSelectedParams({
|
9237 | newValue: newValue,
|
9238 | clearSelection: false,
|
9239 | suppressFinishActions: true,
|
9240 | groupSelectsFiltered: groupSelectsFiltered
|
9241 | });
|
9242 | }
|
9243 | return updatedCount;
|
9244 | };
|
9245 | RowNode.prototype.addEventListener = function (eventType, listener) {
|
9246 | if (!this.eventService) {
|
9247 | this.eventService = new eventService_1.EventService();
|
9248 | }
|
9249 | this.eventService.addEventListener(eventType, listener);
|
9250 | };
|
9251 | RowNode.prototype.removeEventListener = function (eventType, listener) {
|
9252 | this.eventService.removeEventListener(eventType, listener);
|
9253 | };
|
9254 | RowNode.prototype.onMouseEnter = function () {
|
9255 | this.dispatchLocalEvent(this.createLocalRowEvent(RowNode.EVENT_MOUSE_ENTER));
|
9256 | };
|
9257 | RowNode.prototype.onMouseLeave = function () {
|
9258 | this.dispatchLocalEvent(this.createLocalRowEvent(RowNode.EVENT_MOUSE_LEAVE));
|
9259 | };
|
9260 | RowNode.prototype.getFirstChildOfFirstChild = function (rowGroupColumn) {
|
9261 | var currentRowNode = this;
|
9262 |
|
9263 |
|
9264 | var isCandidate = true;
|
9265 | var foundFirstChildPath = false;
|
9266 | var nodeToSwapIn;
|
9267 | while (isCandidate && !foundFirstChildPath) {
|
9268 | var parentRowNode = currentRowNode.parent;
|
9269 | var firstChild = utils_1.Utils.exists(parentRowNode) && currentRowNode.firstChild;
|
9270 | if (firstChild) {
|
9271 | if (parentRowNode.rowGroupColumn === rowGroupColumn) {
|
9272 | foundFirstChildPath = true;
|
9273 | nodeToSwapIn = parentRowNode;
|
9274 | }
|
9275 | }
|
9276 | else {
|
9277 | isCandidate = false;
|
9278 | }
|
9279 | currentRowNode = parentRowNode;
|
9280 | }
|
9281 | return foundFirstChildPath ? nodeToSwapIn : null;
|
9282 | };
|
9283 | RowNode.EVENT_ROW_SELECTED = 'rowSelected';
|
9284 | RowNode.EVENT_DATA_CHANGED = 'dataChanged';
|
9285 | RowNode.EVENT_CELL_CHANGED = 'cellChanged';
|
9286 | RowNode.EVENT_ALL_CHILDREN_COUNT_CHANGED = 'allChildrenCountChanged';
|
9287 | RowNode.EVENT_MOUSE_ENTER = 'mouseEnter';
|
9288 | RowNode.EVENT_MOUSE_LEAVE = 'mouseLeave';
|
9289 | RowNode.EVENT_HEIGHT_CHANGED = 'heightChanged';
|
9290 | RowNode.EVENT_TOP_CHANGED = 'topChanged';
|
9291 | RowNode.EVENT_FIRST_CHILD_CHANGED = 'firstChildChanged';
|
9292 | RowNode.EVENT_LAST_CHILD_CHANGED = 'lastChildChanged';
|
9293 | RowNode.EVENT_CHILD_INDEX_CHANGED = 'childIndexChanged';
|
9294 | RowNode.EVENT_ROW_INDEX_CHANGED = 'rowIndexChanged';
|
9295 | RowNode.EVENT_EXPANDED_CHANGED = 'expandedChanged';
|
9296 | RowNode.EVENT_SELECTABLE_CHANGED = 'selectableChanged';
|
9297 | RowNode.EVENT_UI_LEVEL_CHANGED = 'uiLevelChanged';
|
9298 | RowNode.EVENT_DRAGGING_CHANGED = 'draggingChanged';
|
9299 | __decorate([
|
9300 | context_1.Autowired('eventService'),
|
9301 | __metadata("design:type", eventService_1.EventService)
|
9302 | ], RowNode.prototype, "mainEventService", void 0);
|
9303 | __decorate([
|
9304 | context_1.Autowired('gridOptionsWrapper'),
|
9305 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
9306 | ], RowNode.prototype, "gridOptionsWrapper", void 0);
|
9307 | __decorate([
|
9308 | context_1.Autowired('selectionController'),
|
9309 | __metadata("design:type", selectionController_1.SelectionController)
|
9310 | ], RowNode.prototype, "selectionController", void 0);
|
9311 | __decorate([
|
9312 | context_1.Autowired('columnController'),
|
9313 | __metadata("design:type", columnController_1.ColumnController)
|
9314 | ], RowNode.prototype, "columnController", void 0);
|
9315 | __decorate([
|
9316 | context_1.Autowired('valueService'),
|
9317 | __metadata("design:type", valueService_1.ValueService)
|
9318 | ], RowNode.prototype, "valueService", void 0);
|
9319 | __decorate([
|
9320 | context_1.Autowired('rowModel'),
|
9321 | __metadata("design:type", Object)
|
9322 | ], RowNode.prototype, "rowModel", void 0);
|
9323 | __decorate([
|
9324 | context_1.Autowired('context'),
|
9325 | __metadata("design:type", context_1.Context)
|
9326 | ], RowNode.prototype, "context", void 0);
|
9327 | __decorate([
|
9328 | context_1.Autowired('valueCache'),
|
9329 | __metadata("design:type", valueCache_1.ValueCache)
|
9330 | ], RowNode.prototype, "valueCache", void 0);
|
9331 | __decorate([
|
9332 | context_1.Autowired('columnApi'),
|
9333 | __metadata("design:type", columnApi_1.ColumnApi)
|
9334 | ], RowNode.prototype, "columnApi", void 0);
|
9335 | __decorate([
|
9336 | context_1.Autowired('gridApi'),
|
9337 | __metadata("design:type", gridApi_1.GridApi)
|
9338 | ], RowNode.prototype, "gridApi", void 0);
|
9339 | return RowNode;
|
9340 | }());
|
9341 | exports.RowNode = RowNode;
|
9342 |
|
9343 |
|
9344 | }),
|
9345 |
|
9346 | (function(module, exports, __webpack_require__) {
|
9347 |
|
9348 | "use strict";
|
9349 |
|
9350 |
|
9351 |
|
9352 |
|
9353 |
|
9354 |
|
9355 |
|
9356 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
9357 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
9358 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
9359 | 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;
|
9360 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
9361 | };
|
9362 | var __metadata = (this && this.__metadata) || function (k, v) {
|
9363 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
9364 | };
|
9365 | var __param = (this && this.__param) || function (paramIndex, decorator) {
|
9366 | return function (target, key) { decorator(target, key, paramIndex); }
|
9367 | };
|
9368 | Object.defineProperty(exports, "__esModule", { value: true });
|
9369 | var utils_1 = __webpack_require__(1);
|
9370 | var context_1 = __webpack_require__(0);
|
9371 | var context_2 = __webpack_require__(0);
|
9372 | var logger_1 = __webpack_require__(12);
|
9373 | var eventService_1 = __webpack_require__(3);
|
9374 | var events_1 = __webpack_require__(5);
|
9375 | var context_3 = __webpack_require__(0);
|
9376 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
9377 | var context_4 = __webpack_require__(0);
|
9378 | var constants_1 = __webpack_require__(9);
|
9379 | var columnApi_1 = __webpack_require__(7);
|
9380 | var gridApi_1 = __webpack_require__(6);
|
9381 | var SelectionController = (function () {
|
9382 | function SelectionController() {
|
9383 | }
|
9384 | SelectionController.prototype.setBeans = function (loggerFactory) {
|
9385 | this.logger = loggerFactory.create('SelectionController');
|
9386 | this.reset();
|
9387 | if (this.gridOptionsWrapper.isRowModelDefault()) {
|
9388 | this.eventService.addEventListener(events_1.Events.EVENT_ROW_DATA_CHANGED, this.reset.bind(this));
|
9389 | }
|
9390 | else {
|
9391 | this.logger.log('dont know what to do here');
|
9392 | }
|
9393 | };
|
9394 | SelectionController.prototype.init = function () {
|
9395 | this.groupSelectsChildren = this.gridOptionsWrapper.isGroupSelectsChildren();
|
9396 | this.eventService.addEventListener(events_1.Events.EVENT_ROW_SELECTED, this.onRowSelected.bind(this));
|
9397 | };
|
9398 | SelectionController.prototype.setLastSelectedNode = function (rowNode) {
|
9399 | this.lastSelectedNode = rowNode;
|
9400 | };
|
9401 | SelectionController.prototype.getLastSelectedNode = function () {
|
9402 | return this.lastSelectedNode;
|
9403 | };
|
9404 | SelectionController.prototype.getSelectedNodes = function () {
|
9405 | var selectedNodes = [];
|
9406 | utils_1.Utils.iterateObject(this.selectedNodes, function (key, rowNode) {
|
9407 | if (rowNode) {
|
9408 | selectedNodes.push(rowNode);
|
9409 | }
|
9410 | });
|
9411 | return selectedNodes;
|
9412 | };
|
9413 | SelectionController.prototype.getSelectedRows = function () {
|
9414 | var selectedRows = [];
|
9415 | utils_1.Utils.iterateObject(this.selectedNodes, function (key, rowNode) {
|
9416 | if (rowNode && rowNode.data) {
|
9417 | selectedRows.push(rowNode.data);
|
9418 | }
|
9419 | });
|
9420 | return selectedRows;
|
9421 | };
|
9422 | SelectionController.prototype.removeGroupsFromSelection = function () {
|
9423 | var _this = this;
|
9424 | utils_1.Utils.iterateObject(this.selectedNodes, function (key, rowNode) {
|
9425 | if (rowNode && rowNode.group) {
|
9426 | _this.selectedNodes[rowNode.id] = undefined;
|
9427 | }
|
9428 | });
|
9429 | };
|
9430 |
|
9431 | SelectionController.prototype.updateGroupsFromChildrenSelections = function () {
|
9432 |
|
9433 | if (!this.gridOptionsWrapper.isGroupSelectsChildren()) {
|
9434 | return;
|
9435 | }
|
9436 |
|
9437 | if (this.rowModel.getType() !== constants_1.Constants.ROW_MODEL_TYPE_CLIENT_SIDE) {
|
9438 | return;
|
9439 | }
|
9440 | var clientSideRowModel = this.rowModel;
|
9441 | clientSideRowModel.getTopLevelNodes().forEach(function (rowNode) {
|
9442 | rowNode.depthFirstSearch(function (rowNode) {
|
9443 | if (rowNode.group) {
|
9444 | rowNode.calculateSelectedFromChildren();
|
9445 | }
|
9446 | });
|
9447 | });
|
9448 | };
|
9449 | SelectionController.prototype.getNodeForIdIfSelected = function (id) {
|
9450 | return this.selectedNodes[id];
|
9451 | };
|
9452 | SelectionController.prototype.clearOtherNodes = function (rowNodeToKeepSelected) {
|
9453 | var _this = this;
|
9454 | var groupsToRefresh = {};
|
9455 | var updatedCount = 0;
|
9456 | utils_1.Utils.iterateObject(this.selectedNodes, function (key, otherRowNode) {
|
9457 | if (otherRowNode && otherRowNode.id !== rowNodeToKeepSelected.id) {
|
9458 | var rowNode = _this.selectedNodes[otherRowNode.id];
|
9459 | updatedCount += rowNode.setSelectedParams({ newValue: false, clearSelection: false, suppressFinishActions: true });
|
9460 | if (_this.groupSelectsChildren && otherRowNode.parent) {
|
9461 | groupsToRefresh[otherRowNode.parent.id] = otherRowNode.parent;
|
9462 | }
|
9463 | }
|
9464 | });
|
9465 | utils_1.Utils.iterateObject(groupsToRefresh, function (key, group) {
|
9466 | group.calculateSelectedFromChildren();
|
9467 | });
|
9468 | return updatedCount;
|
9469 | };
|
9470 | SelectionController.prototype.onRowSelected = function (event) {
|
9471 | var rowNode = event.node;
|
9472 |
|
9473 | if (this.groupSelectsChildren && rowNode.group) {
|
9474 | return;
|
9475 | }
|
9476 | if (rowNode.isSelected()) {
|
9477 | this.selectedNodes[rowNode.id] = rowNode;
|
9478 | }
|
9479 | else {
|
9480 | this.selectedNodes[rowNode.id] = undefined;
|
9481 | }
|
9482 | };
|
9483 | SelectionController.prototype.syncInRowNode = function (rowNode, oldNode) {
|
9484 | this.syncInOldRowNode(rowNode, oldNode);
|
9485 | this.syncInNewRowNode(rowNode);
|
9486 | };
|
9487 |
|
9488 |
|
9489 |
|
9490 |
|
9491 |
|
9492 |
|
9493 |
|
9494 |
|
9495 |
|
9496 |
|
9497 |
|
9498 | SelectionController.prototype.syncInOldRowNode = function (rowNode, oldNode) {
|
9499 | var oldNodeHasDifferentId = utils_1.Utils.exists(oldNode) && (rowNode.id !== oldNode.id);
|
9500 | if (oldNodeHasDifferentId) {
|
9501 | var oldNodeSelected = utils_1.Utils.exists(this.selectedNodes[oldNode.id]);
|
9502 | if (oldNodeSelected) {
|
9503 | this.selectedNodes[oldNode.id] = oldNode;
|
9504 | }
|
9505 | }
|
9506 | };
|
9507 | SelectionController.prototype.syncInNewRowNode = function (rowNode) {
|
9508 | if (utils_1.Utils.exists(this.selectedNodes[rowNode.id])) {
|
9509 | rowNode.setSelectedInitialValue(true);
|
9510 | this.selectedNodes[rowNode.id] = rowNode;
|
9511 | }
|
9512 | else {
|
9513 | rowNode.setSelectedInitialValue(false);
|
9514 | }
|
9515 | };
|
9516 | SelectionController.prototype.reset = function () {
|
9517 | this.logger.log('reset');
|
9518 | this.selectedNodes = {};
|
9519 | this.lastSelectedNode = null;
|
9520 | };
|
9521 |
|
9522 |
|
9523 |
|
9524 |
|
9525 |
|
9526 | SelectionController.prototype.getBestCostNodeSelection = function () {
|
9527 | if (this.rowModel.getType() !== constants_1.Constants.ROW_MODEL_TYPE_CLIENT_SIDE) {
|
9528 | console.warn('getBestCostNodeSelection is only avilable when using normal row model');
|
9529 | }
|
9530 | var clientSideRowModel = this.rowModel;
|
9531 | var topLevelNodes = clientSideRowModel.getTopLevelNodes();
|
9532 | if (topLevelNodes === null) {
|
9533 | console.warn('selectAll not available doing rowModel=virtual');
|
9534 | return;
|
9535 | }
|
9536 | var result = [];
|
9537 |
|
9538 | function traverse(nodes) {
|
9539 | for (var i = 0, l = nodes.length; i < l; i++) {
|
9540 | var node = nodes[i];
|
9541 | if (node.isSelected()) {
|
9542 | result.push(node);
|
9543 | }
|
9544 | else {
|
9545 |
|
9546 |
|
9547 | if (node.group && node.children) {
|
9548 | traverse(node.children);
|
9549 | }
|
9550 | }
|
9551 | }
|
9552 | }
|
9553 | traverse(topLevelNodes);
|
9554 | return result;
|
9555 | };
|
9556 | SelectionController.prototype.setRowModel = function (rowModel) {
|
9557 | this.rowModel = rowModel;
|
9558 | };
|
9559 | SelectionController.prototype.isEmpty = function () {
|
9560 | var count = 0;
|
9561 | utils_1.Utils.iterateObject(this.selectedNodes, function (nodeId, rowNode) {
|
9562 | if (rowNode) {
|
9563 | count++;
|
9564 | }
|
9565 | });
|
9566 | return count === 0;
|
9567 | };
|
9568 | SelectionController.prototype.deselectAllRowNodes = function (justFiltered) {
|
9569 | if (justFiltered === void 0) { justFiltered = false; }
|
9570 | var callback = function (rowNode) { return rowNode.selectThisNode(false); };
|
9571 | var rowModelClientSide = this.rowModel.getType() === constants_1.Constants.ROW_MODEL_TYPE_CLIENT_SIDE;
|
9572 | if (justFiltered) {
|
9573 | if (!rowModelClientSide) {
|
9574 | console.error('ag-Grid: selecting just filtered only works with In Memory Row Model');
|
9575 | return;
|
9576 | }
|
9577 | var clientSideRowModel = this.rowModel;
|
9578 | clientSideRowModel.forEachNodeAfterFilter(callback);
|
9579 | }
|
9580 | else {
|
9581 | utils_1.Utils.iterateObject(this.selectedNodes, function (id, rowNode) {
|
9582 |
|
9583 | if (rowNode) {
|
9584 | callback(rowNode);
|
9585 | }
|
9586 | });
|
9587 |
|
9588 | this.reset();
|
9589 | }
|
9590 |
|
9591 | if (rowModelClientSide && this.groupSelectsChildren) {
|
9592 | this.updateGroupsFromChildrenSelections();
|
9593 | }
|
9594 | var event = {
|
9595 | type: events_1.Events.EVENT_SELECTION_CHANGED,
|
9596 | api: this.gridApi,
|
9597 | columnApi: this.columnApi
|
9598 | };
|
9599 | this.eventService.dispatchEvent(event);
|
9600 | };
|
9601 | SelectionController.prototype.selectAllRowNodes = function (justFiltered) {
|
9602 | if (justFiltered === void 0) { justFiltered = false; }
|
9603 | if (this.rowModel.getType() !== constants_1.Constants.ROW_MODEL_TYPE_CLIENT_SIDE) {
|
9604 | throw "selectAll only available with normal row model, ie not " + this.rowModel.getType();
|
9605 | }
|
9606 | var clientSideRowModel = this.rowModel;
|
9607 | var callback = function (rowNode) { return rowNode.selectThisNode(true); };
|
9608 | if (justFiltered) {
|
9609 | clientSideRowModel.forEachNodeAfterFilter(callback);
|
9610 | }
|
9611 | else {
|
9612 | clientSideRowModel.forEachNode(callback);
|
9613 | }
|
9614 |
|
9615 | if (this.rowModel.getType() === constants_1.Constants.ROW_MODEL_TYPE_CLIENT_SIDE && this.groupSelectsChildren) {
|
9616 | this.updateGroupsFromChildrenSelections();
|
9617 | }
|
9618 | var event = {
|
9619 | type: events_1.Events.EVENT_SELECTION_CHANGED,
|
9620 | api: this.gridApi,
|
9621 | columnApi: this.columnApi
|
9622 | };
|
9623 | this.eventService.dispatchEvent(event);
|
9624 | };
|
9625 |
|
9626 | SelectionController.prototype.selectNode = function (rowNode, tryMulti) {
|
9627 | rowNode.setSelectedParams({ newValue: true, clearSelection: !tryMulti });
|
9628 | };
|
9629 |
|
9630 | SelectionController.prototype.deselectIndex = function (rowIndex) {
|
9631 | var node = this.rowModel.getRow(rowIndex);
|
9632 | this.deselectNode(node);
|
9633 | };
|
9634 |
|
9635 | SelectionController.prototype.deselectNode = function (rowNode) {
|
9636 | rowNode.setSelectedParams({ newValue: false, clearSelection: false });
|
9637 | };
|
9638 |
|
9639 | SelectionController.prototype.selectIndex = function (index, tryMulti) {
|
9640 | var node = this.rowModel.getRow(index);
|
9641 | this.selectNode(node, tryMulti);
|
9642 | };
|
9643 | __decorate([
|
9644 | context_3.Autowired('eventService'),
|
9645 | __metadata("design:type", eventService_1.EventService)
|
9646 | ], SelectionController.prototype, "eventService", void 0);
|
9647 | __decorate([
|
9648 | context_3.Autowired('rowModel'),
|
9649 | __metadata("design:type", Object)
|
9650 | ], SelectionController.prototype, "rowModel", void 0);
|
9651 | __decorate([
|
9652 | context_3.Autowired('gridOptionsWrapper'),
|
9653 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
9654 | ], SelectionController.prototype, "gridOptionsWrapper", void 0);
|
9655 | __decorate([
|
9656 | context_3.Autowired('columnApi'),
|
9657 | __metadata("design:type", columnApi_1.ColumnApi)
|
9658 | ], SelectionController.prototype, "columnApi", void 0);
|
9659 | __decorate([
|
9660 | context_3.Autowired('gridApi'),
|
9661 | __metadata("design:type", gridApi_1.GridApi)
|
9662 | ], SelectionController.prototype, "gridApi", void 0);
|
9663 | __decorate([
|
9664 | __param(0, context_2.Qualifier('loggerFactory')),
|
9665 | __metadata("design:type", Function),
|
9666 | __metadata("design:paramtypes", [logger_1.LoggerFactory]),
|
9667 | __metadata("design:returntype", void 0)
|
9668 | ], SelectionController.prototype, "setBeans", null);
|
9669 | __decorate([
|
9670 | context_4.PostConstruct,
|
9671 | __metadata("design:type", Function),
|
9672 | __metadata("design:paramtypes", []),
|
9673 | __metadata("design:returntype", void 0)
|
9674 | ], SelectionController.prototype, "init", null);
|
9675 | SelectionController = __decorate([
|
9676 | context_1.Bean('selectionController')
|
9677 | ], SelectionController);
|
9678 | return SelectionController;
|
9679 | }());
|
9680 | exports.SelectionController = SelectionController;
|
9681 |
|
9682 |
|
9683 | }),
|
9684 |
|
9685 | (function(module, exports, __webpack_require__) {
|
9686 |
|
9687 | "use strict";
|
9688 |
|
9689 |
|
9690 |
|
9691 |
|
9692 |
|
9693 |
|
9694 |
|
9695 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
9696 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
9697 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
9698 | 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;
|
9699 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
9700 | };
|
9701 | var __metadata = (this && this.__metadata) || function (k, v) {
|
9702 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
9703 | };
|
9704 | Object.defineProperty(exports, "__esModule", { value: true });
|
9705 | var utils_1 = __webpack_require__(1);
|
9706 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
9707 | var popupService_1 = __webpack_require__(35);
|
9708 | var valueService_1 = __webpack_require__(15);
|
9709 | var columnController_1 = __webpack_require__(4);
|
9710 | var columnApi_1 = __webpack_require__(7);
|
9711 | var context_1 = __webpack_require__(0);
|
9712 | var eventService_1 = __webpack_require__(3);
|
9713 | var events_1 = __webpack_require__(5);
|
9714 | var gridApi_1 = __webpack_require__(6);
|
9715 | var componentResolver_1 = __webpack_require__(27);
|
9716 | var FilterManager = (function () {
|
9717 | function FilterManager() {
|
9718 | this.allFilters = {};
|
9719 | this.quickFilter = null;
|
9720 | this.quickFilterParts = null;
|
9721 | }
|
9722 | FilterManager_1 = FilterManager;
|
9723 | FilterManager.prototype.init = function () {
|
9724 | this.eventService.addEventListener(events_1.Events.EVENT_ROW_DATA_CHANGED, this.onNewRowsLoaded.bind(this));
|
9725 | this.eventService.addEventListener(events_1.Events.EVENT_NEW_COLUMNS_LOADED, this.onNewColumnsLoaded.bind(this));
|
9726 | this.quickFilter = this.parseQuickFilter(this.gridOptionsWrapper.getQuickFilterText());
|
9727 | this.setQuickFilterParts();
|
9728 |
|
9729 | this.checkExternalFilter();
|
9730 | };
|
9731 | FilterManager.prototype.setQuickFilterParts = function () {
|
9732 | if (this.quickFilter) {
|
9733 | this.quickFilterParts = this.quickFilter.split(' ');
|
9734 | }
|
9735 | else {
|
9736 | this.quickFilterParts = null;
|
9737 | }
|
9738 | };
|
9739 | FilterManager.prototype.setFilterModel = function (model) {
|
9740 | var _this = this;
|
9741 | var allPromises = [];
|
9742 | if (model) {
|
9743 |
|
9744 | var modelKeys_1 = Object.keys(model);
|
9745 | utils_1.Utils.iterateObject(this.allFilters, function (colId, filterWrapper) {
|
9746 | utils_1.Utils.removeFromArray(modelKeys_1, colId);
|
9747 | var newModel = model[colId];
|
9748 | _this.setModelOnFilterWrapper(filterWrapper.filterPromise, newModel);
|
9749 | allPromises.push(filterWrapper.filterPromise);
|
9750 | });
|
9751 |
|
9752 | utils_1.Utils.iterateArray(modelKeys_1, function (colId) {
|
9753 | var column = _this.columnController.getPrimaryColumn(colId);
|
9754 | if (!column) {
|
9755 | console.warn('Warning ag-grid setFilterModel - no column found for colId ' + colId);
|
9756 | return;
|
9757 | }
|
9758 | var filterWrapper = _this.getOrCreateFilterWrapper(column);
|
9759 | _this.setModelOnFilterWrapper(filterWrapper.filterPromise, model[colId]);
|
9760 | allPromises.push(filterWrapper.filterPromise);
|
9761 | });
|
9762 | }
|
9763 | else {
|
9764 | utils_1.Utils.iterateObject(this.allFilters, function (key, filterWrapper) {
|
9765 | _this.setModelOnFilterWrapper(filterWrapper.filterPromise, null);
|
9766 | allPromises.push(filterWrapper.filterPromise);
|
9767 | });
|
9768 | }
|
9769 | utils_1.Promise.all(allPromises).then(function (whatever) {
|
9770 | _this.onFilterChanged();
|
9771 | });
|
9772 | };
|
9773 | FilterManager.prototype.setModelOnFilterWrapper = function (filterPromise, newModel) {
|
9774 | filterPromise.then(function (filter) {
|
9775 | if (typeof filter.setModel !== 'function') {
|
9776 | console.warn('Warning ag-grid - filter missing setModel method, which is needed for setFilterModel');
|
9777 | return;
|
9778 | }
|
9779 | filter.setModel(newModel);
|
9780 | });
|
9781 | };
|
9782 | FilterManager.prototype.getFilterModel = function () {
|
9783 | var result = {};
|
9784 | utils_1.Utils.iterateObject(this.allFilters, function (key, filterWrapper) {
|
9785 |
|
9786 | var filterPromise = filterWrapper.filterPromise;
|
9787 | var filter = filterPromise.resolveNow(null, function (filter) { return filter; });
|
9788 | if (filter == null) {
|
9789 | return null;
|
9790 | }
|
9791 | if (typeof filter.getModel !== 'function') {
|
9792 | console.warn('Warning ag-grid - filter API missing getModel method, which is needed for getFilterModel');
|
9793 | return;
|
9794 | }
|
9795 | var model = filter.getModel();
|
9796 | if (utils_1.Utils.exists(model)) {
|
9797 | result[key] = model;
|
9798 | }
|
9799 | });
|
9800 | return result;
|
9801 | };
|
9802 |
|
9803 | FilterManager.prototype.isAdvancedFilterPresent = function () {
|
9804 | return this.advancedFilterPresent;
|
9805 | };
|
9806 | FilterManager.prototype.setAdvancedFilterPresent = function () {
|
9807 | var atLeastOneActive = false;
|
9808 | utils_1.Utils.iterateObject(this.allFilters, function (key, filterWrapper) {
|
9809 | if (filterWrapper.filterPromise.resolveNow(false, function (filter) { return filter.isFilterActive(); })) {
|
9810 | atLeastOneActive = true;
|
9811 | }
|
9812 | });
|
9813 | this.advancedFilterPresent = atLeastOneActive;
|
9814 | };
|
9815 | FilterManager.prototype.updateFilterFlagInColumns = function (source) {
|
9816 | utils_1.Utils.iterateObject(this.allFilters, function (key, filterWrapper) {
|
9817 | var filterActive = filterWrapper.filterPromise.resolveNow(false, function (filter) { return filter.isFilterActive(); });
|
9818 | filterWrapper.column.setFilterActive(filterActive, source);
|
9819 | });
|
9820 | };
|
9821 |
|
9822 | FilterManager.prototype.isAnyFilterPresent = function () {
|
9823 | return this.isQuickFilterPresent() || this.advancedFilterPresent || this.externalFilterPresent;
|
9824 | };
|
9825 | FilterManager.prototype.doesFilterPass = function (node, filterToSkip) {
|
9826 | var data = node.data;
|
9827 | var colKeys = Object.keys(this.allFilters);
|
9828 | for (var i = 0, l = colKeys.length; i < l; i++) {
|
9829 | var colId = colKeys[i];
|
9830 | var filterWrapper = this.allFilters[colId];
|
9831 |
|
9832 | if (filterWrapper === undefined) {
|
9833 | continue;
|
9834 | }
|
9835 | var filter = filterWrapper.filterPromise.resolveNow(undefined, function (filter) { return filter; });
|
9836 |
|
9837 | if (filter === undefined) {
|
9838 | continue;
|
9839 | }
|
9840 | if (filter === filterToSkip) {
|
9841 | continue;
|
9842 | }
|
9843 |
|
9844 | if (!filter.isFilterActive()) {
|
9845 | continue;
|
9846 | }
|
9847 | if (!filter.doesFilterPass) {
|
9848 | console.error('Filter is missing method doesFilterPass');
|
9849 | }
|
9850 | var params = {
|
9851 | node: node,
|
9852 | data: data
|
9853 | };
|
9854 | if (!filter.doesFilterPass(params)) {
|
9855 | return false;
|
9856 | }
|
9857 | }
|
9858 |
|
9859 | return true;
|
9860 | };
|
9861 | FilterManager.prototype.parseQuickFilter = function (newFilter) {
|
9862 | if (utils_1.Utils.missing(newFilter) || newFilter === "") {
|
9863 | return null;
|
9864 | }
|
9865 | if (this.gridOptionsWrapper.isRowModelInfinite()) {
|
9866 | console.warn('ag-grid: cannot do quick filtering when doing virtual paging');
|
9867 | return null;
|
9868 | }
|
9869 | return newFilter.toUpperCase();
|
9870 | };
|
9871 |
|
9872 | FilterManager.prototype.setQuickFilter = function (newFilter) {
|
9873 | var parsedFilter = this.parseQuickFilter(newFilter);
|
9874 | if (this.quickFilter !== parsedFilter) {
|
9875 | this.quickFilter = parsedFilter;
|
9876 | this.setQuickFilterParts();
|
9877 | this.onFilterChanged();
|
9878 | }
|
9879 | };
|
9880 | FilterManager.prototype.checkExternalFilter = function () {
|
9881 | this.externalFilterPresent = this.gridOptionsWrapper.isExternalFilterPresent();
|
9882 | };
|
9883 | FilterManager.prototype.onFilterChanged = function () {
|
9884 | this.setAdvancedFilterPresent();
|
9885 | this.updateFilterFlagInColumns("filterChanged");
|
9886 | this.checkExternalFilter();
|
9887 | utils_1.Utils.iterateObject(this.allFilters, function (key, filterWrapper) {
|
9888 | filterWrapper.filterPromise.then(function (filter) {
|
9889 | if (filter.onAnyFilterChanged) {
|
9890 | filter.onAnyFilterChanged();
|
9891 | }
|
9892 | });
|
9893 | });
|
9894 | var event = {
|
9895 | type: events_1.Events.EVENT_FILTER_CHANGED,
|
9896 | api: this.gridApi,
|
9897 | columnApi: this.columnApi
|
9898 | };
|
9899 | this.eventService.dispatchEvent(event);
|
9900 | };
|
9901 | FilterManager.prototype.isQuickFilterPresent = function () {
|
9902 | return this.quickFilter !== null;
|
9903 | };
|
9904 | FilterManager.prototype.doesRowPassOtherFilters = function (filterToSkip, node) {
|
9905 | return this.doesRowPassFilter(node, filterToSkip);
|
9906 | };
|
9907 | FilterManager.prototype.doesRowPassQuickFilterNoCache = function (node, filterPart) {
|
9908 | var _this = this;
|
9909 | var columns = this.columnController.getAllColumnsForQuickFilter();
|
9910 | var filterPasses = false;
|
9911 | columns.forEach(function (column) {
|
9912 | if (filterPasses) {
|
9913 | return;
|
9914 | }
|
9915 | var part = _this.getQuickFilterTextForColumn(column, node);
|
9916 | if (utils_1.Utils.exists(part)) {
|
9917 | if (part.indexOf(filterPart) >= 0) {
|
9918 | filterPasses = true;
|
9919 | }
|
9920 | }
|
9921 | });
|
9922 | return filterPasses;
|
9923 | };
|
9924 | FilterManager.prototype.doesRowPassQuickFilterCache = function (node, filterPart) {
|
9925 | if (!node.quickFilterAggregateText) {
|
9926 | this.aggregateRowForQuickFilter(node);
|
9927 | }
|
9928 | var filterPasses = node.quickFilterAggregateText.indexOf(filterPart) >= 0;
|
9929 | return filterPasses;
|
9930 | };
|
9931 | FilterManager.prototype.doesRowPassQuickFilter = function (node) {
|
9932 | var _this = this;
|
9933 | var filterPasses = true;
|
9934 | var usingCache = this.gridOptionsWrapper.isCacheQuickFilter();
|
9935 | this.quickFilterParts.forEach(function (filterPart) {
|
9936 | var partPasses = usingCache ?
|
9937 | _this.doesRowPassQuickFilterCache(node, filterPart) : _this.doesRowPassQuickFilterNoCache(node, filterPart);
|
9938 |
|
9939 | if (!partPasses) {
|
9940 | filterPasses = false;
|
9941 | }
|
9942 | });
|
9943 | return filterPasses;
|
9944 | };
|
9945 | FilterManager.prototype.doesRowPassFilter = function (node, filterToSkip) {
|
9946 |
|
9947 |
|
9948 |
|
9949 |
|
9950 | if (this.isQuickFilterPresent()) {
|
9951 | if (!this.doesRowPassQuickFilter(node)) {
|
9952 | return false;
|
9953 | }
|
9954 | }
|
9955 |
|
9956 | if (this.externalFilterPresent) {
|
9957 | if (!this.gridOptionsWrapper.doesExternalFilterPass(node)) {
|
9958 | return false;
|
9959 | }
|
9960 | }
|
9961 |
|
9962 | if (this.advancedFilterPresent) {
|
9963 | if (!this.doesFilterPass(node, filterToSkip)) {
|
9964 | return false;
|
9965 | }
|
9966 | }
|
9967 |
|
9968 | return true;
|
9969 | };
|
9970 | FilterManager.prototype.getQuickFilterTextForColumn = function (column, rowNode) {
|
9971 | var value = this.valueService.getValue(column, rowNode, true);
|
9972 | var valueAfterCallback;
|
9973 | var colDef = column.getColDef();
|
9974 | if (column.getColDef().getQuickFilterText) {
|
9975 | var params = {
|
9976 | value: value,
|
9977 | node: rowNode,
|
9978 | data: rowNode.data,
|
9979 | column: column,
|
9980 | colDef: colDef
|
9981 | };
|
9982 | valueAfterCallback = column.getColDef().getQuickFilterText(params);
|
9983 | }
|
9984 | else {
|
9985 | valueAfterCallback = value;
|
9986 | }
|
9987 | if (valueAfterCallback && valueAfterCallback !== '') {
|
9988 | return valueAfterCallback.toString().toUpperCase();
|
9989 | }
|
9990 | else {
|
9991 | return null;
|
9992 | }
|
9993 | };
|
9994 | FilterManager.prototype.aggregateRowForQuickFilter = function (node) {
|
9995 | var _this = this;
|
9996 | var stringParts = [];
|
9997 | var columns = this.columnController.getAllColumnsForQuickFilter();
|
9998 | columns.forEach(function (column) {
|
9999 | var part = _this.getQuickFilterTextForColumn(column, node);
|
10000 | if (utils_1.Utils.exists(part)) {
|
10001 | stringParts.push(part);
|
10002 | }
|
10003 | });
|
10004 | node.quickFilterAggregateText = stringParts.join(FilterManager_1.QUICK_FILTER_SEPARATOR);
|
10005 | };
|
10006 | FilterManager.prototype.onNewRowsLoaded = function (source) {
|
10007 | utils_1.Utils.iterateObject(this.allFilters, function (key, filterWrapper) {
|
10008 | filterWrapper.filterPromise.then(function (filter) {
|
10009 | if (filter.onNewRowsLoaded) {
|
10010 | filter.onNewRowsLoaded();
|
10011 | }
|
10012 | });
|
10013 | });
|
10014 | this.updateFilterFlagInColumns(source);
|
10015 | this.setAdvancedFilterPresent();
|
10016 | };
|
10017 | FilterManager.prototype.createValueGetter = function (column) {
|
10018 | var _this = this;
|
10019 | return function (node) {
|
10020 | return _this.valueService.getValue(column, node, true);
|
10021 | };
|
10022 | };
|
10023 | FilterManager.prototype.getFilterComponent = function (column) {
|
10024 | var filterWrapper = this.getOrCreateFilterWrapper(column);
|
10025 | return filterWrapper.filterPromise;
|
10026 | };
|
10027 | FilterManager.prototype.getOrCreateFilterWrapper = function (column) {
|
10028 | var filterWrapper = this.cachedFilter(column);
|
10029 | if (!filterWrapper) {
|
10030 | filterWrapper = this.createFilterWrapper(column);
|
10031 | this.allFilters[column.getColId()] = filterWrapper;
|
10032 | }
|
10033 | return filterWrapper;
|
10034 | };
|
10035 | FilterManager.prototype.cachedFilter = function (column) {
|
10036 | return this.allFilters[column.getColId()];
|
10037 | };
|
10038 | FilterManager.prototype.createFilterInstance = function (column, $scope) {
|
10039 | var _this = this;
|
10040 | var defaultFilter = 'agTextColumnFilter';
|
10041 | if (this.gridOptionsWrapper.isEnterprise()) {
|
10042 | defaultFilter = 'agSetColumnFilter';
|
10043 | }
|
10044 | var sanitisedColDef = utils_1.Utils.cloneObject(column.getColDef());
|
10045 | var event = {
|
10046 | type: events_1.Events.EVENT_FILTER_MODIFIED,
|
10047 | api: this.gridApi,
|
10048 | columnApi: this.columnApi
|
10049 | };
|
10050 | var filterChangedCallback = this.onFilterChanged.bind(this);
|
10051 | var filterModifiedCallback = function () { return _this.eventService.dispatchEvent(event); };
|
10052 | var params = {
|
10053 | column: column,
|
10054 | colDef: sanitisedColDef,
|
10055 | rowModel: this.rowModel,
|
10056 | filterChangedCallback: filterChangedCallback,
|
10057 | filterModifiedCallback: filterModifiedCallback,
|
10058 | valueGetter: this.createValueGetter(column),
|
10059 | context: this.gridOptionsWrapper.getContext(),
|
10060 | doesRowPassOtherFilter: null,
|
10061 | $scope: $scope
|
10062 | };
|
10063 | return this.componentResolver.createAgGridComponent(sanitisedColDef, params, 'filter', {
|
10064 | api: this.gridApi,
|
10065 | columnApi: this.columnApi,
|
10066 | column: column,
|
10067 | colDef: sanitisedColDef
|
10068 | }, defaultFilter, true, function (params, filter) { return utils_1.Utils.assign(params, {
|
10069 | doesRowPassOtherFilter: _this.doesRowPassOtherFilters.bind(_this, filter),
|
10070 | }); });
|
10071 | };
|
10072 | FilterManager.prototype.createFilterWrapper = function (column) {
|
10073 | var filterWrapper = {
|
10074 | column: column,
|
10075 | filterPromise: null,
|
10076 | scope: null,
|
10077 | compiledElement: null,
|
10078 | guiPromise: utils_1.Promise.external()
|
10079 | };
|
10080 | filterWrapper.scope = this.gridOptionsWrapper.isAngularCompileFilters() ? this.$scope.$new() : null;
|
10081 | filterWrapper.filterPromise = this.createFilterInstance(column, filterWrapper.scope);
|
10082 | this.putIntoGui(filterWrapper);
|
10083 | return filterWrapper;
|
10084 | };
|
10085 | FilterManager.prototype.putIntoGui = function (filterWrapper) {
|
10086 | var _this = this;
|
10087 | var eFilterGui = document.createElement('div');
|
10088 | eFilterGui.className = 'ag-filter';
|
10089 | filterWrapper.filterPromise.then(function (filter) {
|
10090 | var guiFromFilter = filter.getGui();
|
10091 | if (utils_1.Utils.missing(guiFromFilter)) {
|
10092 | console.warn("getGui method from filter returned " + guiFromFilter + ", it should be a DOM element or an HTML template string.");
|
10093 | }
|
10094 |
|
10095 |
|
10096 |
|
10097 |
|
10098 | if (typeof guiFromFilter === 'string') {
|
10099 | guiFromFilter = utils_1.Utils.loadTemplate(guiFromFilter);
|
10100 | }
|
10101 | eFilterGui.appendChild(guiFromFilter);
|
10102 | if (filterWrapper.scope) {
|
10103 | var compiledElement = _this.$compile(eFilterGui)(filterWrapper.scope);
|
10104 | filterWrapper.compiledElement = compiledElement;
|
10105 | setTimeout(function () { return filterWrapper.scope.$apply(); }, 0);
|
10106 | }
|
10107 | filterWrapper.guiPromise.resolve(eFilterGui);
|
10108 | });
|
10109 | };
|
10110 | FilterManager.prototype.onNewColumnsLoaded = function () {
|
10111 | this.destroy();
|
10112 | };
|
10113 |
|
10114 | FilterManager.prototype.destroyFilter = function (column, source) {
|
10115 | if (source === void 0) { source = "api"; }
|
10116 | var filterWrapper = this.allFilters[column.getColId()];
|
10117 | if (filterWrapper) {
|
10118 | this.disposeFilterWrapper(filterWrapper, source);
|
10119 | this.onFilterChanged();
|
10120 | }
|
10121 | };
|
10122 | FilterManager.prototype.disposeFilterWrapper = function (filterWrapper, source) {
|
10123 | var _this = this;
|
10124 | filterWrapper.filterPromise.then(function (filter) {
|
10125 | filter.setModel(null);
|
10126 | if (filter.destroy) {
|
10127 | filter.destroy();
|
10128 | }
|
10129 | filterWrapper.column.setFilterActive(false, source);
|
10130 | if (filterWrapper.scope) {
|
10131 | if (filterWrapper.compiledElement) {
|
10132 | filterWrapper.compiledElement.remove();
|
10133 | }
|
10134 | filterWrapper.scope.$destroy();
|
10135 | }
|
10136 | delete _this.allFilters[filterWrapper.column.getColId()];
|
10137 | });
|
10138 | };
|
10139 | FilterManager.prototype.destroy = function () {
|
10140 | var _this = this;
|
10141 | utils_1.Utils.iterateObject(this.allFilters, function (key, filterWrapper) {
|
10142 | _this.disposeFilterWrapper(filterWrapper, "filterDestroyed");
|
10143 | });
|
10144 | };
|
10145 | FilterManager.QUICK_FILTER_SEPARATOR = '\n';
|
10146 | __decorate([
|
10147 | context_1.Autowired('$compile'),
|
10148 | __metadata("design:type", Object)
|
10149 | ], FilterManager.prototype, "$compile", void 0);
|
10150 | __decorate([
|
10151 | context_1.Autowired('$scope'),
|
10152 | __metadata("design:type", Object)
|
10153 | ], FilterManager.prototype, "$scope", void 0);
|
10154 | __decorate([
|
10155 | context_1.Autowired('gridOptionsWrapper'),
|
10156 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
10157 | ], FilterManager.prototype, "gridOptionsWrapper", void 0);
|
10158 | __decorate([
|
10159 | context_1.Autowired('gridCore'),
|
10160 | __metadata("design:type", Object)
|
10161 | ], FilterManager.prototype, "gridCore", void 0);
|
10162 | __decorate([
|
10163 | context_1.Autowired('popupService'),
|
10164 | __metadata("design:type", popupService_1.PopupService)
|
10165 | ], FilterManager.prototype, "popupService", void 0);
|
10166 | __decorate([
|
10167 | context_1.Autowired('valueService'),
|
10168 | __metadata("design:type", valueService_1.ValueService)
|
10169 | ], FilterManager.prototype, "valueService", void 0);
|
10170 | __decorate([
|
10171 | context_1.Autowired('columnController'),
|
10172 | __metadata("design:type", columnController_1.ColumnController)
|
10173 | ], FilterManager.prototype, "columnController", void 0);
|
10174 | __decorate([
|
10175 | context_1.Autowired('rowModel'),
|
10176 | __metadata("design:type", Object)
|
10177 | ], FilterManager.prototype, "rowModel", void 0);
|
10178 | __decorate([
|
10179 | context_1.Autowired('eventService'),
|
10180 | __metadata("design:type", eventService_1.EventService)
|
10181 | ], FilterManager.prototype, "eventService", void 0);
|
10182 | __decorate([
|
10183 | context_1.Autowired('enterprise'),
|
10184 | __metadata("design:type", Boolean)
|
10185 | ], FilterManager.prototype, "enterprise", void 0);
|
10186 | __decorate([
|
10187 | context_1.Autowired('context'),
|
10188 | __metadata("design:type", context_1.Context)
|
10189 | ], FilterManager.prototype, "context", void 0);
|
10190 | __decorate([
|
10191 | context_1.Autowired('columnApi'),
|
10192 | __metadata("design:type", columnApi_1.ColumnApi)
|
10193 | ], FilterManager.prototype, "columnApi", void 0);
|
10194 | __decorate([
|
10195 | context_1.Autowired('gridApi'),
|
10196 | __metadata("design:type", gridApi_1.GridApi)
|
10197 | ], FilterManager.prototype, "gridApi", void 0);
|
10198 | __decorate([
|
10199 | context_1.Autowired('componentResolver'),
|
10200 | __metadata("design:type", componentResolver_1.ComponentResolver)
|
10201 | ], FilterManager.prototype, "componentResolver", void 0);
|
10202 | __decorate([
|
10203 | context_1.PostConstruct,
|
10204 | __metadata("design:type", Function),
|
10205 | __metadata("design:paramtypes", []),
|
10206 | __metadata("design:returntype", void 0)
|
10207 | ], FilterManager.prototype, "init", null);
|
10208 | __decorate([
|
10209 | context_1.PreDestroy,
|
10210 | __metadata("design:type", Function),
|
10211 | __metadata("design:paramtypes", []),
|
10212 | __metadata("design:returntype", void 0)
|
10213 | ], FilterManager.prototype, "destroy", null);
|
10214 | FilterManager = FilterManager_1 = __decorate([
|
10215 | context_1.Bean('filterManager')
|
10216 | ], FilterManager);
|
10217 | return FilterManager;
|
10218 | var FilterManager_1;
|
10219 | }());
|
10220 | exports.FilterManager = FilterManager;
|
10221 |
|
10222 |
|
10223 | }),
|
10224 |
|
10225 | (function(module, exports, __webpack_require__) {
|
10226 |
|
10227 | "use strict";
|
10228 |
|
10229 |
|
10230 |
|
10231 |
|
10232 |
|
10233 |
|
10234 |
|
10235 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
10236 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
10237 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
10238 | 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;
|
10239 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
10240 | };
|
10241 | var __metadata = (this && this.__metadata) || function (k, v) {
|
10242 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
10243 | };
|
10244 | var __param = (this && this.__param) || function (paramIndex, decorator) {
|
10245 | return function (target, key) { decorator(target, key, paramIndex); }
|
10246 | };
|
10247 | Object.defineProperty(exports, "__esModule", { value: true });
|
10248 | var logger_1 = __webpack_require__(12);
|
10249 | var context_1 = __webpack_require__(0);
|
10250 | var context_2 = __webpack_require__(0);
|
10251 | var ExpressionService = (function () {
|
10252 | function ExpressionService() {
|
10253 | this.expressionToFunctionCache = {};
|
10254 | }
|
10255 | ExpressionService.prototype.setBeans = function (loggerFactory) {
|
10256 | this.logger = loggerFactory.create('ExpressionService');
|
10257 | };
|
10258 | ExpressionService.prototype.evaluate = function (expressionOrFunc, params) {
|
10259 | if (typeof expressionOrFunc === 'function') {
|
10260 |
|
10261 | var func = expressionOrFunc;
|
10262 | return func(params);
|
10263 | }
|
10264 | else if (typeof expressionOrFunc === 'string') {
|
10265 |
|
10266 | var expression = expressionOrFunc;
|
10267 | return this.evaluateExpression(expression, params);
|
10268 | }
|
10269 | else {
|
10270 | console.error('ag-Grid: value should be either a string or a function', expressionOrFunc);
|
10271 | }
|
10272 | };
|
10273 | ExpressionService.prototype.evaluateExpression = function (expression, params) {
|
10274 | try {
|
10275 | var javaScriptFunction = this.createExpressionFunction(expression);
|
10276 |
|
10277 |
|
10278 | var result = javaScriptFunction(params.value, params.context, params.oldValue, params.newValue, params.value, params.node, params.data, params.colDef, params.rowIndex, params.api, params.columnApi, params.getValue, params.column, params.columnGroup);
|
10279 | return result;
|
10280 | }
|
10281 | catch (e) {
|
10282 |
|
10283 |
|
10284 | console.log('Processing of the expression failed');
|
10285 | console.log('Expression = ' + expression);
|
10286 | console.log('Exception = ' + e);
|
10287 | return null;
|
10288 | }
|
10289 | };
|
10290 | ExpressionService.prototype.createExpressionFunction = function (expression) {
|
10291 |
|
10292 | if (this.expressionToFunctionCache[expression]) {
|
10293 | return this.expressionToFunctionCache[expression];
|
10294 | }
|
10295 |
|
10296 | var functionBody = this.createFunctionBody(expression);
|
10297 | var theFunction = new Function('x, ctx, oldValue, newValue, value, node, data, colDef, rowIndex, api, columnApi, getValue, column, columnGroup', functionBody);
|
10298 |
|
10299 | this.expressionToFunctionCache[expression] = theFunction;
|
10300 | return theFunction;
|
10301 | };
|
10302 | ExpressionService.prototype.createFunctionBody = function (expression) {
|
10303 |
|
10304 |
|
10305 | if (expression.indexOf('return') >= 0) {
|
10306 | return expression;
|
10307 | }
|
10308 | else {
|
10309 | return 'return ' + expression + ';';
|
10310 | }
|
10311 | };
|
10312 | __decorate([
|
10313 | __param(0, context_2.Qualifier('loggerFactory')),
|
10314 | __metadata("design:type", Function),
|
10315 | __metadata("design:paramtypes", [logger_1.LoggerFactory]),
|
10316 | __metadata("design:returntype", void 0)
|
10317 | ], ExpressionService.prototype, "setBeans", null);
|
10318 | ExpressionService = __decorate([
|
10319 | context_1.Bean('expressionService')
|
10320 | ], ExpressionService);
|
10321 | return ExpressionService;
|
10322 | }());
|
10323 | exports.ExpressionService = ExpressionService;
|
10324 |
|
10325 |
|
10326 | }),
|
10327 |
|
10328 | (function(module, exports, __webpack_require__) {
|
10329 |
|
10330 | "use strict";
|
10331 |
|
10332 |
|
10333 |
|
10334 |
|
10335 |
|
10336 |
|
10337 |
|
10338 | var __extends = (this && this.__extends) || (function () {
|
10339 | var extendStatics = Object.setPrototypeOf ||
|
10340 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
10341 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
10342 | return function (d, b) {
|
10343 | extendStatics(d, b);
|
10344 | function __() { this.constructor = d; }
|
10345 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
10346 | };
|
10347 | })();
|
10348 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
10349 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
10350 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
10351 | 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;
|
10352 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
10353 | };
|
10354 | var __metadata = (this && this.__metadata) || function (k, v) {
|
10355 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
10356 | };
|
10357 | var __param = (this && this.__param) || function (paramIndex, decorator) {
|
10358 | return function (target, key) { decorator(target, key, paramIndex); }
|
10359 | };
|
10360 | Object.defineProperty(exports, "__esModule", { value: true });
|
10361 | var utils_1 = __webpack_require__(1);
|
10362 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
10363 | var expressionService_1 = __webpack_require__(19);
|
10364 | var templateService_1 = __webpack_require__(49);
|
10365 | var valueService_1 = __webpack_require__(15);
|
10366 | var eventService_1 = __webpack_require__(3);
|
10367 | var rowComp_1 = __webpack_require__(50);
|
10368 | var events_1 = __webpack_require__(5);
|
10369 | var constants_1 = __webpack_require__(9);
|
10370 | var cellComp_1 = __webpack_require__(34);
|
10371 | var context_1 = __webpack_require__(0);
|
10372 | var gridCore_1 = __webpack_require__(42);
|
10373 | var columnApi_1 = __webpack_require__(7);
|
10374 | var columnController_1 = __webpack_require__(4);
|
10375 | var logger_1 = __webpack_require__(12);
|
10376 | var focusedCellController_1 = __webpack_require__(22);
|
10377 | var cellNavigationService_1 = __webpack_require__(82);
|
10378 | var gridCell_1 = __webpack_require__(23);
|
10379 | var beanStub_1 = __webpack_require__(13);
|
10380 | var paginationProxy_1 = __webpack_require__(29);
|
10381 | var gridApi_1 = __webpack_require__(6);
|
10382 | var pinnedRowModel_1 = __webpack_require__(30);
|
10383 | var beans_1 = __webpack_require__(28);
|
10384 | var animationFrameService_1 = __webpack_require__(37);
|
10385 | var heightScaler_1 = __webpack_require__(57);
|
10386 | var RowRenderer = (function (_super) {
|
10387 | __extends(RowRenderer, _super);
|
10388 | function RowRenderer() {
|
10389 | var _this = _super !== null && _super.apply(this, arguments) || this;
|
10390 |
|
10391 |
|
10392 | _this.rowCompsByIndex = {};
|
10393 | _this.floatingTopRowComps = [];
|
10394 | _this.floatingBottomRowComps = [];
|
10395 |
|
10396 |
|
10397 |
|
10398 |
|
10399 | _this.refreshInProgress = false;
|
10400 | return _this;
|
10401 | }
|
10402 | RowRenderer.prototype.agWire = function (loggerFactory) {
|
10403 | this.logger = loggerFactory.create("RowRenderer");
|
10404 | };
|
10405 | RowRenderer.prototype.registerGridComp = function (gridPanel) {
|
10406 | this.gridPanel = gridPanel;
|
10407 | this.rowContainers = this.gridPanel.getRowContainers();
|
10408 | this.addDestroyableEventListener(this.eventService, events_1.Events.EVENT_PAGINATION_CHANGED, this.onPageLoaded.bind(this));
|
10409 | this.addDestroyableEventListener(this.eventService, events_1.Events.EVENT_PINNED_ROW_DATA_CHANGED, this.onPinnedRowDataChanged.bind(this));
|
10410 | this.addDestroyableEventListener(this.eventService, events_1.Events.EVENT_DISPLAYED_COLUMNS_CHANGED, this.onDisplayedColumnsChanged.bind(this));
|
10411 | this.addDestroyableEventListener(this.eventService, events_1.Events.EVENT_BODY_SCROLL, this.redrawAfterScroll.bind(this));
|
10412 | this.addDestroyableEventListener(this.eventService, events_1.Events.EVENT_BODY_HEIGHT_CHANGED, this.redrawAfterScroll.bind(this));
|
10413 | this.redrawAfterModelUpdate();
|
10414 | };
|
10415 | RowRenderer.prototype.onPageLoaded = function (refreshEvent) {
|
10416 | if (utils_1.Utils.missing(refreshEvent)) {
|
10417 | refreshEvent = {
|
10418 | type: events_1.Events.EVENT_MODEL_UPDATED,
|
10419 | api: this.gridApi,
|
10420 | columnApi: this.columnApi,
|
10421 | animate: false,
|
10422 | keepRenderedRows: false,
|
10423 | newData: false,
|
10424 | newPage: false
|
10425 | };
|
10426 | }
|
10427 | this.onModelUpdated(refreshEvent);
|
10428 | };
|
10429 | RowRenderer.prototype.getAllCellsForColumn = function (column) {
|
10430 | var eCells = [];
|
10431 | utils_1.Utils.iterateObject(this.rowCompsByIndex, callback);
|
10432 | utils_1.Utils.iterateObject(this.floatingBottomRowComps, callback);
|
10433 | utils_1.Utils.iterateObject(this.floatingTopRowComps, callback);
|
10434 | function callback(key, rowComp) {
|
10435 | var eCell = rowComp.getCellForCol(column);
|
10436 | if (eCell) {
|
10437 | eCells.push(eCell);
|
10438 | }
|
10439 | }
|
10440 | return eCells;
|
10441 | };
|
10442 | RowRenderer.prototype.refreshFloatingRowComps = function () {
|
10443 | this.refreshFloatingRows(this.floatingTopRowComps, this.pinnedRowModel.getPinnedTopRowData(), this.rowContainers.floatingTopPinnedLeft, this.rowContainers.floatingTopPinnedRight, this.rowContainers.floatingTop, this.rowContainers.floatingTopFullWidth);
|
10444 | this.refreshFloatingRows(this.floatingBottomRowComps, this.pinnedRowModel.getPinnedBottomRowData(), this.rowContainers.floatingBottomPinnedLeft, this.rowContainers.floatingBottomPinnedRight, this.rowContainers.floatingBottom, this.rowContainers.floatingBottomFullWith);
|
10445 | };
|
10446 | RowRenderer.prototype.refreshFloatingRows = function (rowComps, rowNodes, pinnedLeftContainerComp, pinnedRightContainerComp, bodyContainerComp, fullWidthContainerComp) {
|
10447 | var _this = this;
|
10448 | rowComps.forEach(function (row) {
|
10449 | row.destroy();
|
10450 | });
|
10451 | rowComps.length = 0;
|
10452 | if (rowNodes) {
|
10453 | rowNodes.forEach(function (node) {
|
10454 | var rowComp = new rowComp_1.RowComp(_this.$scope, bodyContainerComp, pinnedLeftContainerComp, pinnedRightContainerComp, fullWidthContainerComp, node, _this.beans, false, false);
|
10455 | rowComp.init();
|
10456 | rowComps.push(rowComp);
|
10457 | });
|
10458 | }
|
10459 | this.flushContainers(rowComps);
|
10460 | };
|
10461 | RowRenderer.prototype.onPinnedRowDataChanged = function () {
|
10462 |
|
10463 | var params = {
|
10464 | recycleRows: true
|
10465 | };
|
10466 | this.redrawAfterModelUpdate(params);
|
10467 | };
|
10468 | RowRenderer.prototype.onModelUpdated = function (refreshEvent) {
|
10469 | var params = {
|
10470 | recycleRows: refreshEvent.keepRenderedRows,
|
10471 | animate: refreshEvent.animate,
|
10472 | newData: refreshEvent.newData,
|
10473 | newPage: refreshEvent.newPage,
|
10474 |
|
10475 |
|
10476 |
|
10477 |
|
10478 | onlyBody: true
|
10479 | };
|
10480 | this.redrawAfterModelUpdate(params);
|
10481 | };
|
10482 |
|
10483 | RowRenderer.prototype.getRenderedIndexesForRowNodes = function (rowNodes) {
|
10484 | var result = [];
|
10485 | if (utils_1.Utils.missing(rowNodes)) {
|
10486 | return result;
|
10487 | }
|
10488 | utils_1.Utils.iterateObject(this.rowCompsByIndex, function (index, renderedRow) {
|
10489 | var rowNode = renderedRow.getRowNode();
|
10490 | if (rowNodes.indexOf(rowNode) >= 0) {
|
10491 | result.push(index);
|
10492 | }
|
10493 | });
|
10494 | return result;
|
10495 | };
|
10496 | RowRenderer.prototype.redrawRows = function (rowNodes) {
|
10497 | if (!rowNodes || rowNodes.length == 0) {
|
10498 | return;
|
10499 | }
|
10500 |
|
10501 |
|
10502 | var indexesToRemove = this.getRenderedIndexesForRowNodes(rowNodes);
|
10503 |
|
10504 | this.removeRowComps(indexesToRemove);
|
10505 |
|
10506 | this.redrawAfterModelUpdate({
|
10507 | recycleRows: true
|
10508 | });
|
10509 | };
|
10510 | RowRenderer.prototype.getCellToRestoreFocusToAfterRefresh = function (params) {
|
10511 | var focusedCell = params.suppressKeepFocus ? null : this.focusedCellController.getFocusCellToUseAfterRefresh();
|
10512 | if (utils_1.Utils.missing(focusedCell)) {
|
10513 | return null;
|
10514 | }
|
10515 |
|
10516 |
|
10517 |
|
10518 |
|
10519 |
|
10520 |
|
10521 | var activeElement = document.activeElement;
|
10522 | var domData = this.gridOptionsWrapper.getDomData(activeElement, cellComp_1.CellComp.DOM_DATA_KEY_CELL_COMP);
|
10523 | var elementIsNotACellDev = utils_1.Utils.missing(domData);
|
10524 | if (elementIsNotACellDev) {
|
10525 | return null;
|
10526 | }
|
10527 | return focusedCell;
|
10528 | };
|
10529 |
|
10530 | RowRenderer.prototype.redrawAfterModelUpdate = function (params) {
|
10531 | if (params === void 0) { params = {}; }
|
10532 | this.getLockOnRefresh();
|
10533 | var focusedCell = this.getCellToRestoreFocusToAfterRefresh(params);
|
10534 | this.sizeContainerToPageHeight();
|
10535 | this.scrollToTopIfNewData(params);
|
10536 | var recycleRows = params.recycleRows;
|
10537 | var animate = params.animate && this.gridOptionsWrapper.isAnimateRows();
|
10538 | var rowsToRecycle = this.binRowComps(recycleRows);
|
10539 | this.redraw(rowsToRecycle, animate);
|
10540 | if (!params.onlyBody) {
|
10541 | this.refreshFloatingRowComps();
|
10542 | }
|
10543 | this.restoreFocusedCell(focusedCell);
|
10544 | this.releaseLockOnRefresh();
|
10545 | };
|
10546 | RowRenderer.prototype.scrollToTopIfNewData = function (params) {
|
10547 | var scrollToTop = params.newData || params.newPage;
|
10548 | var suppressScrollToTop = this.gridOptionsWrapper.isSuppressScrollOnNewData();
|
10549 | if (scrollToTop && !suppressScrollToTop) {
|
10550 | this.gridPanel.scrollToTop();
|
10551 | }
|
10552 | };
|
10553 | RowRenderer.prototype.sizeContainerToPageHeight = function () {
|
10554 | var containerHeight = this.paginationProxy.getCurrentPageHeight();
|
10555 |
|
10556 |
|
10557 |
|
10558 |
|
10559 | if (containerHeight === 0) {
|
10560 | containerHeight = 1;
|
10561 | }
|
10562 | this.heightScaler.setModelHeight(containerHeight);
|
10563 | var realHeight = this.heightScaler.getUiContainerHeight();
|
10564 | this.rowContainers.body.setHeight(realHeight);
|
10565 | this.rowContainers.fullWidth.setHeight(realHeight);
|
10566 | this.rowContainers.pinnedLeft.setHeight(realHeight);
|
10567 | this.rowContainers.pinnedRight.setHeight(realHeight);
|
10568 | };
|
10569 | RowRenderer.prototype.getLockOnRefresh = function () {
|
10570 | if (this.refreshInProgress) {
|
10571 | throw new Error("ag-Grid: cannot get grid to draw rows when it is in the middle of drawing rows. " +
|
10572 | "Your code probably called a grid API method while the grid was in the render stage. To overcome " +
|
10573 | "this, put the API call into a timeout, eg instead of api.refreshView(), " +
|
10574 | "call setTimeout(function(){api.refreshView(),0}). To see what part of your code " +
|
10575 | "that caused the refresh check this stacktrace.");
|
10576 | }
|
10577 | this.refreshInProgress = true;
|
10578 | };
|
10579 | RowRenderer.prototype.releaseLockOnRefresh = function () {
|
10580 | this.refreshInProgress = false;
|
10581 | };
|
10582 |
|
10583 |
|
10584 |
|
10585 |
|
10586 | RowRenderer.prototype.restoreFocusedCell = function (gridCell) {
|
10587 | if (gridCell) {
|
10588 | this.focusedCellController.setFocusedCell(gridCell.rowIndex, gridCell.column, gridCell.floating, true);
|
10589 | }
|
10590 | };
|
10591 | RowRenderer.prototype.stopEditing = function (cancel) {
|
10592 | if (cancel === void 0) { cancel = false; }
|
10593 | this.forEachRowComp(function (key, rowComp) {
|
10594 | rowComp.stopEditing(cancel);
|
10595 | });
|
10596 | };
|
10597 | RowRenderer.prototype.forEachCellComp = function (callback) {
|
10598 | this.forEachRowComp(function (key, rowComp) { return rowComp.forEachCellComp(callback); });
|
10599 | };
|
10600 | RowRenderer.prototype.forEachRowComp = function (callback) {
|
10601 | utils_1.Utils.iterateObject(this.rowCompsByIndex, callback);
|
10602 | utils_1.Utils.iterateObject(this.floatingTopRowComps, callback);
|
10603 | utils_1.Utils.iterateObject(this.floatingBottomRowComps, callback);
|
10604 | };
|
10605 | RowRenderer.prototype.addRenderedRowListener = function (eventName, rowIndex, callback) {
|
10606 | var rowComp = this.rowCompsByIndex[rowIndex];
|
10607 | if (rowComp) {
|
10608 | rowComp.addEventListener(eventName, callback);
|
10609 | }
|
10610 | };
|
10611 | RowRenderer.prototype.flashCells = function (params) {
|
10612 | if (params === void 0) { params = {}; }
|
10613 | this.forEachCellCompFiltered(params.rowNodes, params.columns, function (cellComp) { return cellComp.flashCell(); });
|
10614 | };
|
10615 | RowRenderer.prototype.refreshCells = function (params) {
|
10616 | if (params === void 0) { params = {}; }
|
10617 | var refreshCellParams = {
|
10618 | forceRefresh: params.force,
|
10619 | newData: false
|
10620 | };
|
10621 | this.forEachCellCompFiltered(params.rowNodes, params.columns, function (cellComp) { return cellComp.refreshCell(refreshCellParams); });
|
10622 | };
|
10623 | RowRenderer.prototype.getCellRendererInstances = function (params) {
|
10624 | var res = [];
|
10625 | this.forEachCellCompFiltered(params.rowNodes, params.columns, function (cellComp) {
|
10626 | var cellRenderer = cellComp.getCellRenderer();
|
10627 | if (cellRenderer) {
|
10628 | res.push(cellRenderer);
|
10629 | }
|
10630 | });
|
10631 | return res;
|
10632 | };
|
10633 | RowRenderer.prototype.getCellEditorInstances = function (params) {
|
10634 | var res = [];
|
10635 | this.forEachCellCompFiltered(params.rowNodes, params.columns, function (cellComp) {
|
10636 | var cellEditor = cellComp.getCellEditor();
|
10637 | if (cellEditor) {
|
10638 | res.push(cellEditor);
|
10639 | }
|
10640 | });
|
10641 | return res;
|
10642 | };
|
10643 | RowRenderer.prototype.getEditingCells = function () {
|
10644 | var res = [];
|
10645 | this.forEachCellComp(function (cellComp) {
|
10646 | if (cellComp.isEditing()) {
|
10647 | var gridCellDef = cellComp.getGridCell().getGridCellDef();
|
10648 | res.push(gridCellDef);
|
10649 | }
|
10650 | });
|
10651 | return res;
|
10652 | };
|
10653 |
|
10654 |
|
10655 | RowRenderer.prototype.forEachCellCompFiltered = function (rowNodes, columns, callback) {
|
10656 | var _this = this;
|
10657 | var rowIdsMap;
|
10658 | if (utils_1.Utils.exists(rowNodes)) {
|
10659 | rowIdsMap = {
|
10660 | top: {},
|
10661 | bottom: {},
|
10662 | normal: {}
|
10663 | };
|
10664 | rowNodes.forEach(function (rowNode) {
|
10665 | if (rowNode.rowPinned === constants_1.Constants.PINNED_TOP) {
|
10666 | rowIdsMap.top[rowNode.id] = true;
|
10667 | }
|
10668 | else if (rowNode.rowPinned === constants_1.Constants.PINNED_BOTTOM) {
|
10669 | rowIdsMap.bottom[rowNode.id] = true;
|
10670 | }
|
10671 | else {
|
10672 | rowIdsMap.normal[rowNode.id] = true;
|
10673 | }
|
10674 | });
|
10675 | }
|
10676 | var colIdsMap;
|
10677 | if (utils_1.Utils.exists(columns)) {
|
10678 | colIdsMap = {};
|
10679 | columns.forEach(function (colKey) {
|
10680 | var column = _this.columnController.getGridColumn(colKey);
|
10681 | if (utils_1.Utils.exists(column)) {
|
10682 | colIdsMap[column.getId()] = true;
|
10683 | }
|
10684 | });
|
10685 | }
|
10686 | var processRow = function (rowComp) {
|
10687 | var rowNode = rowComp.getRowNode();
|
10688 | var id = rowNode.id;
|
10689 | var floating = rowNode.rowPinned;
|
10690 |
|
10691 | if (utils_1.Utils.exists(rowIdsMap)) {
|
10692 | if (floating === constants_1.Constants.PINNED_BOTTOM) {
|
10693 | if (!rowIdsMap.bottom[id]) {
|
10694 | return;
|
10695 | }
|
10696 | }
|
10697 | else if (floating === constants_1.Constants.PINNED_TOP) {
|
10698 | if (!rowIdsMap.top[id]) {
|
10699 | return;
|
10700 | }
|
10701 | }
|
10702 | else {
|
10703 | if (!rowIdsMap.normal[id]) {
|
10704 | return;
|
10705 | }
|
10706 | }
|
10707 | }
|
10708 | rowComp.forEachCellComp(function (cellComp) {
|
10709 | var colId = cellComp.getColumn().getId();
|
10710 | var excludeColFromRefresh = colIdsMap && !colIdsMap[colId];
|
10711 | if (excludeColFromRefresh) {
|
10712 | return;
|
10713 | }
|
10714 | callback(cellComp);
|
10715 | });
|
10716 | };
|
10717 | utils_1.Utils.iterateObject(this.rowCompsByIndex, function (index, rowComp) {
|
10718 | processRow(rowComp);
|
10719 | });
|
10720 | if (this.floatingTopRowComps) {
|
10721 | this.floatingTopRowComps.forEach(processRow);
|
10722 | }
|
10723 | if (this.floatingBottomRowComps) {
|
10724 | this.floatingBottomRowComps.forEach(processRow);
|
10725 | }
|
10726 | };
|
10727 | RowRenderer.prototype.destroy = function () {
|
10728 | _super.prototype.destroy.call(this);
|
10729 | var rowIndexesToRemove = Object.keys(this.rowCompsByIndex);
|
10730 | this.removeRowComps(rowIndexesToRemove);
|
10731 | };
|
10732 | RowRenderer.prototype.binRowComps = function (recycleRows) {
|
10733 | var _this = this;
|
10734 | var indexesToRemove;
|
10735 | var rowsToRecycle = {};
|
10736 | if (recycleRows) {
|
10737 | indexesToRemove = [];
|
10738 | utils_1.Utils.iterateObject(this.rowCompsByIndex, function (index, rowComp) {
|
10739 | var rowNode = rowComp.getRowNode();
|
10740 | if (utils_1.Utils.exists(rowNode.id)) {
|
10741 | rowsToRecycle[rowNode.id] = rowComp;
|
10742 | delete _this.rowCompsByIndex[index];
|
10743 | }
|
10744 | else {
|
10745 | indexesToRemove.push(index);
|
10746 | }
|
10747 | });
|
10748 | }
|
10749 | else {
|
10750 | indexesToRemove = Object.keys(this.rowCompsByIndex);
|
10751 | }
|
10752 | this.removeRowComps(indexesToRemove);
|
10753 | return rowsToRecycle;
|
10754 | };
|
10755 |
|
10756 | RowRenderer.prototype.removeRowComps = function (rowsToRemove) {
|
10757 | var _this = this;
|
10758 |
|
10759 |
|
10760 | rowsToRemove.forEach(function (indexToRemove) {
|
10761 | var renderedRow = _this.rowCompsByIndex[indexToRemove];
|
10762 | renderedRow.destroy();
|
10763 | delete _this.rowCompsByIndex[indexToRemove];
|
10764 | });
|
10765 | };
|
10766 |
|
10767 |
|
10768 |
|
10769 |
|
10770 | RowRenderer.prototype.redrawAfterScroll = function () {
|
10771 | this.getLockOnRefresh();
|
10772 | this.redraw(null, false, true);
|
10773 | this.releaseLockOnRefresh();
|
10774 | };
|
10775 | RowRenderer.prototype.removeRowCompsNotToDraw = function (indexesToDraw) {
|
10776 |
|
10777 | var indexesToDrawMap = {};
|
10778 | indexesToDraw.forEach(function (index) { return (indexesToDrawMap[index] = true); });
|
10779 | var existingIndexes = Object.keys(this.rowCompsByIndex);
|
10780 | var indexesNotToDraw = utils_1.Utils.filter(existingIndexes, function (index) { return !indexesToDrawMap[index]; });
|
10781 | this.removeRowComps(indexesNotToDraw);
|
10782 | };
|
10783 | RowRenderer.prototype.calculateIndexesToDraw = function () {
|
10784 | var _this = this;
|
10785 |
|
10786 | var indexesToDraw = utils_1.Utils.createArrayOfNumbers(this.firstRenderedRow, this.lastRenderedRow);
|
10787 |
|
10788 | utils_1.Utils.iterateObject(this.rowCompsByIndex, function (indexStr, rowComp) {
|
10789 | var index = Number(indexStr);
|
10790 | if (index < _this.firstRenderedRow || index > _this.lastRenderedRow) {
|
10791 | if (_this.keepRowBecauseEditing(rowComp)) {
|
10792 | indexesToDraw.push(index);
|
10793 | }
|
10794 | }
|
10795 | });
|
10796 | indexesToDraw.sort(function (a, b) { return a - b; });
|
10797 | return indexesToDraw;
|
10798 | };
|
10799 | RowRenderer.prototype.redraw = function (rowsToRecycle, animate, afterScroll) {
|
10800 | var _this = this;
|
10801 | if (animate === void 0) { animate = false; }
|
10802 | if (afterScroll === void 0) { afterScroll = false; }
|
10803 | this.heightScaler.update();
|
10804 | this.workOutFirstAndLastRowsToRender();
|
10805 |
|
10806 |
|
10807 |
|
10808 |
|
10809 |
|
10810 |
|
10811 | var indexesToDraw = this.calculateIndexesToDraw();
|
10812 | this.removeRowCompsNotToDraw(indexesToDraw);
|
10813 |
|
10814 | var nextVmTurnFunctions = [];
|
10815 | var rowComps = [];
|
10816 | indexesToDraw.forEach(function (rowIndex) {
|
10817 | var rowComp = _this.createOrUpdateRowComp(rowIndex, rowsToRecycle, animate, afterScroll);
|
10818 | if (utils_1.Utils.exists(rowComp)) {
|
10819 | rowComps.push(rowComp);
|
10820 | utils_1.Utils.pushAll(nextVmTurnFunctions, rowComp.getAndClearNextVMTurnFunctions());
|
10821 | }
|
10822 | });
|
10823 | this.flushContainers(rowComps);
|
10824 | utils_1.Utils.executeNextVMTurn(nextVmTurnFunctions);
|
10825 | if (afterScroll && !this.gridOptionsWrapper.isSuppressAnimationFrame()) {
|
10826 | this.beans.taskQueue.addP2Task(this.destroyRowComps.bind(this, rowsToRecycle, animate));
|
10827 | }
|
10828 | else {
|
10829 | this.destroyRowComps(rowsToRecycle, animate);
|
10830 | }
|
10831 | this.checkAngularCompile();
|
10832 | };
|
10833 | RowRenderer.prototype.flushContainers = function (rowComps) {
|
10834 | utils_1.Utils.iterateObject(this.rowContainers, function (key, rowContainerComp) {
|
10835 | if (rowContainerComp) {
|
10836 | rowContainerComp.flushRowTemplates();
|
10837 | }
|
10838 | });
|
10839 | rowComps.forEach(function (rowComp) { return rowComp.afterFlush(); });
|
10840 | };
|
10841 | RowRenderer.prototype.onDisplayedColumnsChanged = function () {
|
10842 | var pinningLeft = this.columnController.isPinningLeft();
|
10843 | var pinningRight = this.columnController.isPinningRight();
|
10844 | var atLeastOneChanged = this.pinningLeft !== pinningLeft || pinningRight !== this.pinningRight;
|
10845 | if (atLeastOneChanged) {
|
10846 | this.pinningLeft = pinningLeft;
|
10847 | this.pinningRight = pinningRight;
|
10848 | if (this.gridOptionsWrapper.isEmbedFullWidthRows()) {
|
10849 | this.redrawFullWidthEmbeddedRows();
|
10850 | }
|
10851 | }
|
10852 | };
|
10853 |
|
10854 |
|
10855 | RowRenderer.prototype.redrawFullWidthEmbeddedRows = function () {
|
10856 |
|
10857 |
|
10858 | var rowsToRemove = [];
|
10859 | utils_1.Utils.iterateObject(this.rowCompsByIndex, function (id, rowComp) {
|
10860 | if (rowComp.isFullWidth()) {
|
10861 | var rowIndex = rowComp.getRowNode().rowIndex;
|
10862 | rowsToRemove.push(rowIndex.toString());
|
10863 | }
|
10864 | });
|
10865 | this.refreshFloatingRowComps();
|
10866 | this.removeRowComps(rowsToRemove);
|
10867 | this.redrawAfterScroll();
|
10868 | };
|
10869 | RowRenderer.prototype.createOrUpdateRowComp = function (rowIndex, rowsToRecycle, animate, afterScroll) {
|
10870 | var rowNode;
|
10871 | var rowComp = this.rowCompsByIndex[rowIndex];
|
10872 |
|
10873 | if (!rowComp) {
|
10874 | rowNode = this.paginationProxy.getRow(rowIndex);
|
10875 | if (utils_1.Utils.exists(rowNode) && utils_1.Utils.exists(rowsToRecycle) && rowsToRecycle[rowNode.id]) {
|
10876 | rowComp = rowsToRecycle[rowNode.id];
|
10877 | rowsToRecycle[rowNode.id] = null;
|
10878 | }
|
10879 | }
|
10880 | var creatingNewRowComp = !rowComp;
|
10881 | if (creatingNewRowComp) {
|
10882 |
|
10883 | if (!rowNode) {
|
10884 | rowNode = this.paginationProxy.getRow(rowIndex);
|
10885 | }
|
10886 | if (utils_1.Utils.exists(rowNode)) {
|
10887 | rowComp = this.createRowComp(rowNode, animate, afterScroll);
|
10888 | }
|
10889 | else {
|
10890 |
|
10891 |
|
10892 | return;
|
10893 | }
|
10894 | }
|
10895 | else {
|
10896 |
|
10897 | rowComp.ensureDomOrder();
|
10898 | }
|
10899 | this.rowCompsByIndex[rowIndex] = rowComp;
|
10900 | return rowComp;
|
10901 | };
|
10902 | RowRenderer.prototype.destroyRowComps = function (rowCompsMap, animate) {
|
10903 | var delayedFuncs = [];
|
10904 | utils_1.Utils.iterateObject(rowCompsMap, function (nodeId, rowComp) {
|
10905 |
|
10906 | if (!rowComp) {
|
10907 | return;
|
10908 | }
|
10909 | rowComp.destroy(animate);
|
10910 | utils_1.Utils.pushAll(delayedFuncs, rowComp.getAndClearDelayedDestroyFunctions());
|
10911 | });
|
10912 | utils_1.Utils.executeInAWhile(delayedFuncs);
|
10913 | };
|
10914 | RowRenderer.prototype.checkAngularCompile = function () {
|
10915 | var _this = this;
|
10916 |
|
10917 | if (this.gridOptionsWrapper.isAngularCompileRows()) {
|
10918 |
|
10919 | setTimeout(function () {
|
10920 | _this.$scope.$apply();
|
10921 | }, 0);
|
10922 | }
|
10923 | };
|
10924 | RowRenderer.prototype.workOutFirstAndLastRowsToRender = function () {
|
10925 | var newFirst;
|
10926 | var newLast;
|
10927 | if (!this.paginationProxy.isRowsToRender()) {
|
10928 | newFirst = 0;
|
10929 | newLast = -1;
|
10930 | }
|
10931 | else {
|
10932 | var pageFirstRow = this.paginationProxy.getPageFirstRow();
|
10933 | var pageLastRow = this.paginationProxy.getPageLastRow();
|
10934 | var pixelOffset = this.paginationProxy ? this.paginationProxy.getPixelOffset() : 0;
|
10935 | var heightOffset = this.heightScaler.getOffset();
|
10936 | var bodyVRange = this.gridPanel.getVScrollPosition();
|
10937 | var topPixel = bodyVRange.top;
|
10938 | var bottomPixel = bodyVRange.bottom;
|
10939 | var realPixelTop = topPixel + pixelOffset + heightOffset;
|
10940 | var realPixelBottom = bottomPixel + pixelOffset + heightOffset;
|
10941 | var first = this.paginationProxy.getRowIndexAtPixel(realPixelTop);
|
10942 | var last = this.paginationProxy.getRowIndexAtPixel(realPixelBottom);
|
10943 |
|
10944 | var buffer = this.gridOptionsWrapper.getRowBuffer();
|
10945 | first = first - buffer;
|
10946 | last = last + buffer;
|
10947 |
|
10948 | if (first < pageFirstRow) {
|
10949 | first = pageFirstRow;
|
10950 | }
|
10951 | if (last > pageLastRow) {
|
10952 | last = pageLastRow;
|
10953 | }
|
10954 | newFirst = first;
|
10955 | newLast = last;
|
10956 | }
|
10957 | var firstDiffers = newFirst !== this.firstRenderedRow;
|
10958 | var lastDiffers = newLast !== this.lastRenderedRow;
|
10959 | if (firstDiffers || lastDiffers) {
|
10960 | this.firstRenderedRow = newFirst;
|
10961 | this.lastRenderedRow = newLast;
|
10962 | var event_1 = {
|
10963 | type: events_1.Events.EVENT_VIEWPORT_CHANGED,
|
10964 | firstRow: newFirst,
|
10965 | lastRow: newLast,
|
10966 | api: this.gridApi,
|
10967 | columnApi: this.columnApi
|
10968 | };
|
10969 | this.eventService.dispatchEvent(event_1);
|
10970 | }
|
10971 | };
|
10972 | RowRenderer.prototype.getFirstVirtualRenderedRow = function () {
|
10973 | return this.firstRenderedRow;
|
10974 | };
|
10975 | RowRenderer.prototype.getLastVirtualRenderedRow = function () {
|
10976 | return this.lastRenderedRow;
|
10977 | };
|
10978 |
|
10979 |
|
10980 |
|
10981 |
|
10982 |
|
10983 |
|
10984 |
|
10985 | RowRenderer.prototype.keepRowBecauseEditing = function (rowComp) {
|
10986 | var REMOVE_ROW = false;
|
10987 | var KEEP_ROW = true;
|
10988 | var rowNode = rowComp.getRowNode();
|
10989 | var rowHasFocus = this.focusedCellController.isRowNodeFocused(rowNode);
|
10990 | var rowIsEditing = rowComp.isEditing();
|
10991 | var mightWantToKeepRow = rowHasFocus || rowIsEditing;
|
10992 |
|
10993 | if (!mightWantToKeepRow) {
|
10994 | return REMOVE_ROW;
|
10995 | }
|
10996 |
|
10997 |
|
10998 |
|
10999 | var rowNodePresent = this.paginationProxy.isRowPresent(rowNode);
|
11000 | return rowNodePresent ? KEEP_ROW : REMOVE_ROW;
|
11001 | };
|
11002 | RowRenderer.prototype.createRowComp = function (rowNode, animate, afterScroll) {
|
11003 | var useAnimationFrameForCreate = afterScroll && !this.gridOptionsWrapper.isSuppressAnimationFrame();
|
11004 | var rowComp = new rowComp_1.RowComp(this.$scope, this.rowContainers.body, this.rowContainers.pinnedLeft, this.rowContainers.pinnedRight, this.rowContainers.fullWidth, rowNode, this.beans, animate, useAnimationFrameForCreate);
|
11005 | rowComp.init();
|
11006 | return rowComp;
|
11007 | };
|
11008 | RowRenderer.prototype.getRenderedNodes = function () {
|
11009 | var renderedRows = this.rowCompsByIndex;
|
11010 | return Object.keys(renderedRows).map(function (key) {
|
11011 | return renderedRows[key].getRowNode();
|
11012 | });
|
11013 | };
|
11014 |
|
11015 |
|
11016 | RowRenderer.prototype.navigateToNextCell = function (event, key, previousCell, allowUserOverride) {
|
11017 | var nextCell = previousCell;
|
11018 |
|
11019 | while (true) {
|
11020 | nextCell = this.cellNavigationService.getNextCellToFocus(key, nextCell);
|
11021 | if (utils_1.Utils.missing(nextCell)) {
|
11022 | break;
|
11023 | }
|
11024 | var skipGroupRows = this.gridOptionsWrapper.isGroupUseEntireRow();
|
11025 | if (skipGroupRows) {
|
11026 | var rowNode = this.paginationProxy.getRow(nextCell.rowIndex);
|
11027 | if (!rowNode.group) {
|
11028 | break;
|
11029 | }
|
11030 | }
|
11031 | else {
|
11032 | break;
|
11033 | }
|
11034 | }
|
11035 |
|
11036 |
|
11037 | if (allowUserOverride) {
|
11038 | var userFunc = this.gridOptionsWrapper.getNavigateToNextCellFunc();
|
11039 | if (utils_1.Utils.exists(userFunc)) {
|
11040 | var params = {
|
11041 | key: key,
|
11042 | previousCellDef: previousCell,
|
11043 | nextCellDef: nextCell ? nextCell.getGridCellDef() : null,
|
11044 | event: event
|
11045 | };
|
11046 | var nextCellDef = userFunc(params);
|
11047 | if (utils_1.Utils.exists(nextCellDef)) {
|
11048 | nextCell = new gridCell_1.GridCell(nextCellDef);
|
11049 | }
|
11050 | else {
|
11051 | nextCell = null;
|
11052 | }
|
11053 | }
|
11054 | }
|
11055 |
|
11056 | if (!nextCell) {
|
11057 | return;
|
11058 | }
|
11059 | this.ensureCellVisible(nextCell);
|
11060 | this.focusedCellController.setFocusedCell(nextCell.rowIndex, nextCell.column, nextCell.floating, true);
|
11061 | if (this.rangeController) {
|
11062 | var gridCell = new gridCell_1.GridCell({ rowIndex: nextCell.rowIndex, floating: nextCell.floating, column: nextCell.column });
|
11063 | this.rangeController.setRangeToCell(gridCell);
|
11064 | }
|
11065 | };
|
11066 | RowRenderer.prototype.ensureCellVisible = function (gridCell) {
|
11067 |
|
11068 | if (utils_1.Utils.missing(gridCell.floating)) {
|
11069 | this.gridPanel.ensureIndexVisible(gridCell.rowIndex);
|
11070 | }
|
11071 | if (!gridCell.column.isPinned()) {
|
11072 | this.gridPanel.ensureColumnVisible(gridCell.column);
|
11073 | }
|
11074 |
|
11075 |
|
11076 | this.gridPanel.horizontallyScrollHeaderCenterAndFloatingCenter();
|
11077 |
|
11078 | this.animationFrameService.flushAllFrames();
|
11079 | };
|
11080 | RowRenderer.prototype.startEditingCell = function (gridCell, keyPress, charPress) {
|
11081 | var cell = this.getComponentForCell(gridCell);
|
11082 | if (cell) {
|
11083 | cell.startRowOrCellEdit(keyPress, charPress);
|
11084 | }
|
11085 | };
|
11086 | RowRenderer.prototype.getComponentForCell = function (gridCell) {
|
11087 | var rowComponent;
|
11088 | switch (gridCell.floating) {
|
11089 | case constants_1.Constants.PINNED_TOP:
|
11090 | rowComponent = this.floatingTopRowComps[gridCell.rowIndex];
|
11091 | break;
|
11092 | case constants_1.Constants.PINNED_BOTTOM:
|
11093 | rowComponent = this.floatingBottomRowComps[gridCell.rowIndex];
|
11094 | break;
|
11095 | default:
|
11096 | rowComponent = this.rowCompsByIndex[gridCell.rowIndex];
|
11097 | break;
|
11098 | }
|
11099 | if (!rowComponent) {
|
11100 | return null;
|
11101 | }
|
11102 | var cellComponent = rowComponent.getRenderedCellForColumn(gridCell.column);
|
11103 | return cellComponent;
|
11104 | };
|
11105 | RowRenderer.prototype.onTabKeyDown = function (previousRenderedCell, keyboardEvent) {
|
11106 | var backwards = keyboardEvent.shiftKey;
|
11107 | var success = this.moveToCellAfter(previousRenderedCell, backwards);
|
11108 | if (success) {
|
11109 | keyboardEvent.preventDefault();
|
11110 | }
|
11111 | };
|
11112 | RowRenderer.prototype.tabToNextCell = function (backwards) {
|
11113 | var focusedCell = this.focusedCellController.getFocusedCell();
|
11114 |
|
11115 | if (utils_1.Utils.missing(focusedCell)) {
|
11116 | return false;
|
11117 | }
|
11118 | var renderedCell = this.getComponentForCell(focusedCell);
|
11119 |
|
11120 | if (utils_1.Utils.missing(renderedCell)) {
|
11121 | return false;
|
11122 | }
|
11123 | var result = this.moveToCellAfter(renderedCell, backwards);
|
11124 | return result;
|
11125 | };
|
11126 | RowRenderer.prototype.moveToCellAfter = function (previousRenderedCell, backwards) {
|
11127 | var editing = previousRenderedCell.isEditing();
|
11128 | var res;
|
11129 | if (editing) {
|
11130 | if (this.gridOptionsWrapper.isFullRowEdit()) {
|
11131 | res = this.moveToNextEditingRow(previousRenderedCell, backwards);
|
11132 | }
|
11133 | else {
|
11134 | res = this.moveToNextEditingCell(previousRenderedCell, backwards);
|
11135 | }
|
11136 | }
|
11137 | else {
|
11138 | res = this.moveToNextCellNotEditing(previousRenderedCell, backwards);
|
11139 | }
|
11140 | return res;
|
11141 | };
|
11142 | RowRenderer.prototype.moveToNextEditingCell = function (previousRenderedCell, backwards) {
|
11143 | var gridCell = previousRenderedCell.getGridCell();
|
11144 |
|
11145 |
|
11146 |
|
11147 |
|
11148 | previousRenderedCell.stopEditing();
|
11149 |
|
11150 | var nextRenderedCell = this.findNextCellToFocusOn(gridCell, backwards, true);
|
11151 | var foundCell = utils_1.Utils.exists(nextRenderedCell);
|
11152 |
|
11153 |
|
11154 | if (foundCell) {
|
11155 | nextRenderedCell.startEditingIfEnabled(null, null, true);
|
11156 | nextRenderedCell.focusCell(false);
|
11157 | }
|
11158 | return foundCell;
|
11159 | };
|
11160 | RowRenderer.prototype.moveToNextEditingRow = function (previousRenderedCell, backwards) {
|
11161 | var gridCell = previousRenderedCell.getGridCell();
|
11162 |
|
11163 | var nextRenderedCell = this.findNextCellToFocusOn(gridCell, backwards, true);
|
11164 | var foundCell = utils_1.Utils.exists(nextRenderedCell);
|
11165 |
|
11166 |
|
11167 | if (foundCell) {
|
11168 | this.moveEditToNextCellOrRow(previousRenderedCell, nextRenderedCell);
|
11169 | }
|
11170 | return foundCell;
|
11171 | };
|
11172 | RowRenderer.prototype.moveToNextCellNotEditing = function (previousRenderedCell, backwards) {
|
11173 | var gridCell = previousRenderedCell.getGridCell();
|
11174 |
|
11175 | var nextRenderedCell = this.findNextCellToFocusOn(gridCell, backwards, false);
|
11176 | var foundCell = utils_1.Utils.exists(nextRenderedCell);
|
11177 |
|
11178 |
|
11179 | if (foundCell) {
|
11180 | nextRenderedCell.focusCell(true);
|
11181 | }
|
11182 | return foundCell;
|
11183 | };
|
11184 | RowRenderer.prototype.moveEditToNextCellOrRow = function (previousRenderedCell, nextRenderedCell) {
|
11185 | var pGridCell = previousRenderedCell.getGridCell();
|
11186 | var nGridCell = nextRenderedCell.getGridCell();
|
11187 | var rowsMatch = pGridCell.rowIndex === nGridCell.rowIndex && pGridCell.floating === nGridCell.floating;
|
11188 | if (rowsMatch) {
|
11189 |
|
11190 | previousRenderedCell.setFocusOutOnEditor();
|
11191 | nextRenderedCell.setFocusInOnEditor();
|
11192 | }
|
11193 | else {
|
11194 | var pRow = previousRenderedCell.getRenderedRow();
|
11195 | var nRow = nextRenderedCell.getRenderedRow();
|
11196 | previousRenderedCell.setFocusOutOnEditor();
|
11197 | pRow.stopEditing();
|
11198 | nRow.startRowEditing();
|
11199 | nextRenderedCell.setFocusInOnEditor();
|
11200 | }
|
11201 | nextRenderedCell.focusCell();
|
11202 | };
|
11203 |
|
11204 |
|
11205 | RowRenderer.prototype.findNextCellToFocusOn = function (gridCell, backwards, startEditing) {
|
11206 | var nextCell = gridCell;
|
11207 | while (true) {
|
11208 | nextCell = this.cellNavigationService.getNextTabbedCell(nextCell, backwards);
|
11209 |
|
11210 | var userFunc = this.gridOptionsWrapper.getTabToNextCellFunc();
|
11211 | if (utils_1.Utils.exists(userFunc)) {
|
11212 | var params = {
|
11213 | backwards: backwards,
|
11214 | editing: startEditing,
|
11215 | previousCellDef: gridCell.getGridCellDef(),
|
11216 | nextCellDef: nextCell ? nextCell.getGridCellDef() : null
|
11217 | };
|
11218 | var nextCellDef = userFunc(params);
|
11219 | if (utils_1.Utils.exists(nextCellDef)) {
|
11220 | nextCell = new gridCell_1.GridCell(nextCellDef);
|
11221 | }
|
11222 | else {
|
11223 | nextCell = null;
|
11224 | }
|
11225 | }
|
11226 |
|
11227 |
|
11228 | if (!nextCell) {
|
11229 | return null;
|
11230 | }
|
11231 |
|
11232 |
|
11233 |
|
11234 |
|
11235 | if (startEditing) {
|
11236 | var rowNode = this.paginationProxy.getRow(nextCell.rowIndex);
|
11237 | var cellIsEditable = nextCell.column.isCellEditable(rowNode);
|
11238 | if (!cellIsEditable) {
|
11239 | continue;
|
11240 | }
|
11241 | }
|
11242 |
|
11243 | var cellIsNotFloating = utils_1.Utils.missing(nextCell.floating);
|
11244 | if (cellIsNotFloating) {
|
11245 | this.gridPanel.ensureIndexVisible(nextCell.rowIndex);
|
11246 | }
|
11247 |
|
11248 | if (!nextCell.column.isPinned()) {
|
11249 | this.gridPanel.ensureColumnVisible(nextCell.column);
|
11250 | }
|
11251 |
|
11252 |
|
11253 | this.gridPanel.horizontallyScrollHeaderCenterAndFloatingCenter();
|
11254 |
|
11255 |
|
11256 | this.animationFrameService.flushAllFrames();
|
11257 |
|
11258 |
|
11259 | var nextCellComp = this.getComponentForCell(nextCell);
|
11260 |
|
11261 |
|
11262 | if (utils_1.Utils.missing(nextCellComp)) {
|
11263 | continue;
|
11264 | }
|
11265 | if (nextCellComp.isSuppressNavigable()) {
|
11266 | continue;
|
11267 | }
|
11268 |
|
11269 |
|
11270 | if (this.rangeController) {
|
11271 | var gridCell_2 = new gridCell_1.GridCell({ rowIndex: nextCell.rowIndex, floating: nextCell.floating, column: nextCell.column });
|
11272 | this.rangeController.setRangeToCell(gridCell_2);
|
11273 | }
|
11274 |
|
11275 | return nextCellComp;
|
11276 | }
|
11277 | };
|
11278 | __decorate([
|
11279 | context_1.Autowired("paginationProxy"),
|
11280 | __metadata("design:type", paginationProxy_1.PaginationProxy)
|
11281 | ], RowRenderer.prototype, "paginationProxy", void 0);
|
11282 | __decorate([
|
11283 | context_1.Autowired("columnController"),
|
11284 | __metadata("design:type", columnController_1.ColumnController)
|
11285 | ], RowRenderer.prototype, "columnController", void 0);
|
11286 | __decorate([
|
11287 | context_1.Autowired("gridOptionsWrapper"),
|
11288 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
11289 | ], RowRenderer.prototype, "gridOptionsWrapper", void 0);
|
11290 | __decorate([
|
11291 | context_1.Autowired("gridCore"),
|
11292 | __metadata("design:type", gridCore_1.GridCore)
|
11293 | ], RowRenderer.prototype, "gridCore", void 0);
|
11294 | __decorate([
|
11295 | context_1.Autowired("$scope"),
|
11296 | __metadata("design:type", Object)
|
11297 | ], RowRenderer.prototype, "$scope", void 0);
|
11298 | __decorate([
|
11299 | context_1.Autowired("expressionService"),
|
11300 | __metadata("design:type", expressionService_1.ExpressionService)
|
11301 | ], RowRenderer.prototype, "expressionService", void 0);
|
11302 | __decorate([
|
11303 | context_1.Autowired("templateService"),
|
11304 | __metadata("design:type", templateService_1.TemplateService)
|
11305 | ], RowRenderer.prototype, "templateService", void 0);
|
11306 | __decorate([
|
11307 | context_1.Autowired("valueService"),
|
11308 | __metadata("design:type", valueService_1.ValueService)
|
11309 | ], RowRenderer.prototype, "valueService", void 0);
|
11310 | __decorate([
|
11311 | context_1.Autowired("eventService"),
|
11312 | __metadata("design:type", eventService_1.EventService)
|
11313 | ], RowRenderer.prototype, "eventService", void 0);
|
11314 | __decorate([
|
11315 | context_1.Autowired("pinnedRowModel"),
|
11316 | __metadata("design:type", pinnedRowModel_1.PinnedRowModel)
|
11317 | ], RowRenderer.prototype, "pinnedRowModel", void 0);
|
11318 | __decorate([
|
11319 | context_1.Autowired("context"),
|
11320 | __metadata("design:type", context_1.Context)
|
11321 | ], RowRenderer.prototype, "context", void 0);
|
11322 | __decorate([
|
11323 | context_1.Autowired("loggerFactory"),
|
11324 | __metadata("design:type", logger_1.LoggerFactory)
|
11325 | ], RowRenderer.prototype, "loggerFactory", void 0);
|
11326 | __decorate([
|
11327 | context_1.Autowired("focusedCellController"),
|
11328 | __metadata("design:type", focusedCellController_1.FocusedCellController)
|
11329 | ], RowRenderer.prototype, "focusedCellController", void 0);
|
11330 | __decorate([
|
11331 | context_1.Autowired("cellNavigationService"),
|
11332 | __metadata("design:type", cellNavigationService_1.CellNavigationService)
|
11333 | ], RowRenderer.prototype, "cellNavigationService", void 0);
|
11334 | __decorate([
|
11335 | context_1.Autowired("columnApi"),
|
11336 | __metadata("design:type", columnApi_1.ColumnApi)
|
11337 | ], RowRenderer.prototype, "columnApi", void 0);
|
11338 | __decorate([
|
11339 | context_1.Autowired("gridApi"),
|
11340 | __metadata("design:type", gridApi_1.GridApi)
|
11341 | ], RowRenderer.prototype, "gridApi", void 0);
|
11342 | __decorate([
|
11343 | context_1.Autowired("beans"),
|
11344 | __metadata("design:type", beans_1.Beans)
|
11345 | ], RowRenderer.prototype, "beans", void 0);
|
11346 | __decorate([
|
11347 | context_1.Autowired("heightScaler"),
|
11348 | __metadata("design:type", heightScaler_1.HeightScaler)
|
11349 | ], RowRenderer.prototype, "heightScaler", void 0);
|
11350 | __decorate([
|
11351 | context_1.Autowired("animationFrameService"),
|
11352 | __metadata("design:type", animationFrameService_1.AnimationFrameService)
|
11353 | ], RowRenderer.prototype, "animationFrameService", void 0);
|
11354 | __decorate([
|
11355 | context_1.Optional("rangeController"),
|
11356 | __metadata("design:type", Object)
|
11357 | ], RowRenderer.prototype, "rangeController", void 0);
|
11358 | __decorate([
|
11359 | __param(0, context_1.Qualifier("loggerFactory")),
|
11360 | __metadata("design:type", Function),
|
11361 | __metadata("design:paramtypes", [logger_1.LoggerFactory]),
|
11362 | __metadata("design:returntype", void 0)
|
11363 | ], RowRenderer.prototype, "agWire", null);
|
11364 | __decorate([
|
11365 | context_1.PreDestroy,
|
11366 | __metadata("design:type", Function),
|
11367 | __metadata("design:paramtypes", []),
|
11368 | __metadata("design:returntype", void 0)
|
11369 | ], RowRenderer.prototype, "destroy", null);
|
11370 | RowRenderer = __decorate([
|
11371 | context_1.Bean("rowRenderer")
|
11372 | ], RowRenderer);
|
11373 | return RowRenderer;
|
11374 | }(beanStub_1.BeanStub));
|
11375 | exports.RowRenderer = RowRenderer;
|
11376 |
|
11377 |
|
11378 | }),
|
11379 |
|
11380 | (function(module, exports, __webpack_require__) {
|
11381 |
|
11382 | "use strict";
|
11383 |
|
11384 |
|
11385 |
|
11386 |
|
11387 |
|
11388 |
|
11389 |
|
11390 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
11391 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
11392 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
11393 | 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;
|
11394 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
11395 | };
|
11396 | var __metadata = (this && this.__metadata) || function (k, v) {
|
11397 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
11398 | };
|
11399 | Object.defineProperty(exports, "__esModule", { value: true });
|
11400 | var context_1 = __webpack_require__(0);
|
11401 | var floatingFilter_1 = __webpack_require__(90);
|
11402 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
11403 | var floatingFilterWrapper_1 = __webpack_require__(123);
|
11404 | var filterManager_1 = __webpack_require__(18);
|
11405 | var componentResolver_1 = __webpack_require__(27);
|
11406 | var utils_1 = __webpack_require__(1);
|
11407 | var overlayWrapperComponent_1 = __webpack_require__(125);
|
11408 | var gridApi_1 = __webpack_require__(6);
|
11409 | var columnApi_1 = __webpack_require__(7);
|
11410 | var ComponentType;
|
11411 | (function (ComponentType) {
|
11412 | ComponentType[ComponentType["AG_GRID"] = 0] = "AG_GRID";
|
11413 | ComponentType[ComponentType["FRAMEWORK"] = 1] = "FRAMEWORK";
|
11414 | })(ComponentType || (ComponentType = {}));
|
11415 | var ComponentRecipes = (function () {
|
11416 | function ComponentRecipes() {
|
11417 | }
|
11418 | ComponentRecipes_1 = ComponentRecipes;
|
11419 | ComponentRecipes.prototype.newDateComponent = function (params) {
|
11420 | return this.componentResolver.createAgGridComponent(this.gridOptions, params, "dateComponent", {
|
11421 | api: this.gridApi,
|
11422 | columnApi: this.columnApi
|
11423 | }, "agDateInput");
|
11424 | };
|
11425 | ComponentRecipes.prototype.newHeaderComponent = function (params) {
|
11426 | return this.componentResolver.createAgGridComponent(params.column.getColDef(), params, "headerComponent", {
|
11427 | api: this.gridApi,
|
11428 | columnApi: this.columnApi,
|
11429 | column: params.column,
|
11430 | colDef: params.column.getColDef()
|
11431 | }, "agColumnHeader");
|
11432 | };
|
11433 | ComponentRecipes.prototype.newHeaderGroupComponent = function (params) {
|
11434 | return this.componentResolver.createAgGridComponent(params.columnGroup.getColGroupDef(), params, "headerGroupComponent", {
|
11435 | api: this.gridApi,
|
11436 | columnApi: this.columnApi
|
11437 | }, "agColumnGroupHeader");
|
11438 | };
|
11439 | ComponentRecipes.prototype.newFloatingFilterWrapperComponent = function (column, params) {
|
11440 | var _this = this;
|
11441 | var colDef = column.getColDef();
|
11442 | if (colDef.suppressFilter) {
|
11443 | return this.newEmptyFloatingFilterWrapperComponent(column);
|
11444 | }
|
11445 | var defaultFloatingFilterType;
|
11446 | if (!colDef.filter) {
|
11447 | defaultFloatingFilterType = this.gridOptionsWrapper.isEnterprise() ? 'agSetColumnFloatingFilter' : 'agTextColumnFloatingFilter';
|
11448 | }
|
11449 | else if (typeof colDef.filter === 'string' && Object.keys(ComponentRecipes_1.filterToFloatingFilterNames).indexOf(colDef.filter) > -1) {
|
11450 | defaultFloatingFilterType = ComponentRecipes_1.filterToFloatingFilterNames[colDef.filter];
|
11451 | }
|
11452 | var dynamicComponentParams = {
|
11453 | column: column,
|
11454 | colDef: colDef,
|
11455 | api: this.gridApi,
|
11456 | columnApi: this.columnApi
|
11457 | };
|
11458 | var floatingFilter = this.componentResolver.createAgGridComponent(colDef, params, "floatingFilterComponent", dynamicComponentParams, defaultFloatingFilterType, false);
|
11459 | var floatingFilterWrapperComponentParams = {
|
11460 | column: column,
|
11461 | floatingFilterComp: floatingFilter,
|
11462 | suppressFilterButton: this.componentResolver.mergeParams(colDef, 'floatingFilterComponent', dynamicComponentParams, params).suppressFilterButton
|
11463 | };
|
11464 | if (!floatingFilter) {
|
11465 | var filterComponent = this.getFilterComponentPrototype(colDef);
|
11466 | if (filterComponent && !filterComponent.component.prototype.getModelAsString) {
|
11467 | return this.newEmptyFloatingFilterWrapperComponent(column);
|
11468 | }
|
11469 | var rawModelFn_1 = params.currentParentModel;
|
11470 | params.currentParentModel = function () {
|
11471 | var parentPromise = _this.filterManager.getFilterComponent(column);
|
11472 | return parentPromise.resolveNow(null, function (parent) { return parent.getModelAsString ? parent.getModelAsString(rawModelFn_1()) : null; });
|
11473 | };
|
11474 | floatingFilterWrapperComponentParams.floatingFilterComp = utils_1.Promise.resolve(this.componentResolver.createInternalAgGridComponent(floatingFilter_1.ReadModelAsStringFloatingFilterComp, params));
|
11475 | }
|
11476 | return this.componentResolver.createInternalAgGridComponent(floatingFilterWrapper_1.FloatingFilterWrapperComp, floatingFilterWrapperComponentParams);
|
11477 | };
|
11478 | ComponentRecipes.prototype.newFullWidthGroupRowInnerCellRenderer = function (params) {
|
11479 | return this.componentResolver.createAgGridComponent(this.gridOptions, params, "groupRowInnerRenderer", params, null, false);
|
11480 | };
|
11481 | ComponentRecipes.prototype.newCellRenderer = function (target, params) {
|
11482 | return this.componentResolver.createAgGridComponent(target, params, "cellRenderer", params, null, false);
|
11483 | };
|
11484 | ComponentRecipes.prototype.newInnerCellRenderer = function (target, params) {
|
11485 | return this.componentResolver.createAgGridComponent(target, params, "innerRenderer", params, null);
|
11486 | };
|
11487 | ComponentRecipes.prototype.newFullRowGroupRenderer = function (params) {
|
11488 | return this.componentResolver.createAgGridComponent(this.gridOptionsWrapper, params, "fullWidthCellRenderer", params, null);
|
11489 | };
|
11490 | ComponentRecipes.prototype.newOverlayWrapperComponent = function () {
|
11491 | return this.componentResolver.createInternalAgGridComponent(overlayWrapperComponent_1.OverlayWrapperComponent, null);
|
11492 | };
|
11493 | ComponentRecipes.prototype.newLoadingOverlayComponent = function () {
|
11494 | return this.componentResolver.createAgGridComponent(this.gridOptions, null, "loadingOverlayComponent", {
|
11495 | api: this.gridApi,
|
11496 | columnApi: this.columnApi
|
11497 | }, "agLoadingOverlay");
|
11498 | };
|
11499 | ComponentRecipes.prototype.newNoRowsOverlayComponent = function () {
|
11500 | return this.componentResolver.createAgGridComponent(this.gridOptions, null, "noRowsOverlayComponent", {
|
11501 | api: this.gridApi,
|
11502 | columnApi: this.columnApi
|
11503 | }, "agNoRowsOverlay");
|
11504 | };
|
11505 | ComponentRecipes.prototype.getFilterComponentPrototype = function (colDef) {
|
11506 | return this.componentResolver.getComponentToUse(colDef, "filter", {
|
11507 | api: this.gridApi,
|
11508 | columnApi: this.columnApi,
|
11509 | colDef: colDef
|
11510 | });
|
11511 | };
|
11512 | ComponentRecipes.prototype.newEmptyFloatingFilterWrapperComponent = function (column) {
|
11513 | var floatingFilterWrapperComponentParams = {
|
11514 | column: column,
|
11515 | floatingFilterComp: null
|
11516 | };
|
11517 | return this.componentResolver.createInternalAgGridComponent(floatingFilterWrapper_1.EmptyFloatingFilterWrapperComp, floatingFilterWrapperComponentParams);
|
11518 | };
|
11519 | ComponentRecipes.filterToFloatingFilterNames = {
|
11520 | set: 'agSetColumnFloatingFilter',
|
11521 | agSetColumnFilter: 'agSetColumnFloatingFilter',
|
11522 | number: 'agNumberColumnFloatingFilter',
|
11523 | agNumberColumnFilter: 'agNumberColumnFloatingFilter',
|
11524 | date: 'agDateColumnFloatingFilter',
|
11525 | agDateColumnFilter: 'agDateColumnFloatingFilter',
|
11526 | text: 'agTextColumnFloatingFilter',
|
11527 | agTextColumnFilter: 'agTextColumnFloatingFilter'
|
11528 | };
|
11529 | __decorate([
|
11530 | context_1.Autowired("componentResolver"),
|
11531 | __metadata("design:type", componentResolver_1.ComponentResolver)
|
11532 | ], ComponentRecipes.prototype, "componentResolver", void 0);
|
11533 | __decorate([
|
11534 | context_1.Autowired("gridOptions"),
|
11535 | __metadata("design:type", Object)
|
11536 | ], ComponentRecipes.prototype, "gridOptions", void 0);
|
11537 | __decorate([
|
11538 | context_1.Autowired("gridApi"),
|
11539 | __metadata("design:type", gridApi_1.GridApi)
|
11540 | ], ComponentRecipes.prototype, "gridApi", void 0);
|
11541 | __decorate([
|
11542 | context_1.Autowired("columnApi"),
|
11543 | __metadata("design:type", columnApi_1.ColumnApi)
|
11544 | ], ComponentRecipes.prototype, "columnApi", void 0);
|
11545 | __decorate([
|
11546 | context_1.Autowired("gridOptionsWrapper"),
|
11547 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
11548 | ], ComponentRecipes.prototype, "gridOptionsWrapper", void 0);
|
11549 | __decorate([
|
11550 | context_1.Autowired('filterManager'),
|
11551 | __metadata("design:type", filterManager_1.FilterManager)
|
11552 | ], ComponentRecipes.prototype, "filterManager", void 0);
|
11553 | ComponentRecipes = ComponentRecipes_1 = __decorate([
|
11554 | context_1.Bean('componentRecipes')
|
11555 | ], ComponentRecipes);
|
11556 | return ComponentRecipes;
|
11557 | var ComponentRecipes_1;
|
11558 | }());
|
11559 | exports.ComponentRecipes = ComponentRecipes;
|
11560 |
|
11561 |
|
11562 | /***/ }),
|
11563 | /* 22 */
|
11564 | /***/ (function(module, exports, __webpack_require__) {
|
11565 |
|
11566 | "use strict";
|
11567 |
|
11568 |
|
11569 |
|
11570 |
|
11571 |
|
11572 |
|
11573 |
|
11574 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
11575 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
11576 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
11577 | 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;
|
11578 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
11579 | };
|
11580 | var __metadata = (this && this.__metadata) || function (k, v) {
|
11581 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
11582 | };
|
11583 | Object.defineProperty(exports, "__esModule", { value: true });
|
11584 | var context_1 = __webpack_require__(0);
|
11585 | var eventService_1 = __webpack_require__(3);
|
11586 | var events_1 = __webpack_require__(5);
|
11587 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
11588 | var columnApi_1 = __webpack_require__(7);
|
11589 | var columnController_1 = __webpack_require__(4);
|
11590 | var utils_1 = __webpack_require__(1);
|
11591 | var gridCell_1 = __webpack_require__(23);
|
11592 | var gridApi_1 = __webpack_require__(6);
|
11593 | var cellComp_1 = __webpack_require__(34);
|
11594 | var FocusedCellController = (function () {
|
11595 | function FocusedCellController() {
|
11596 | }
|
11597 | FocusedCellController.prototype.init = function () {
|
11598 | this.eventService.addEventListener(events_1.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED, this.clearFocusedCell.bind(this));
|
11599 | this.eventService.addEventListener(events_1.Events.EVENT_COLUMN_EVERYTHING_CHANGED, this.clearFocusedCell.bind(this));
|
11600 | this.eventService.addEventListener(events_1.Events.EVENT_COLUMN_GROUP_OPENED, this.clearFocusedCell.bind(this));
|
11601 | this.eventService.addEventListener(events_1.Events.EVENT_COLUMN_MOVED, this.clearFocusedCell.bind(this));
|
11602 | this.eventService.addEventListener(events_1.Events.EVENT_COLUMN_PINNED, this.clearFocusedCell.bind(this));
|
11603 | this.eventService.addEventListener(events_1.Events.EVENT_COLUMN_ROW_GROUP_CHANGED, this.clearFocusedCell.bind(this));
|
11604 | this.eventService.addEventListener(events_1.Events.EVENT_COLUMN_VISIBLE, this.clearFocusedCell.bind(this));
|
11605 | };
|
11606 | FocusedCellController.prototype.clearFocusedCell = function () {
|
11607 | this.focusedCell = null;
|
11608 | this.onCellFocused(false);
|
11609 | };
|
11610 | FocusedCellController.prototype.getFocusedCell = function () {
|
11611 | return this.focusedCell;
|
11612 | };
|
11613 |
|
11614 |
|
11615 |
|
11616 |
|
11617 |
|
11618 |
|
11619 |
|
11620 | FocusedCellController.prototype.getFocusCellToUseAfterRefresh = function () {
|
11621 | if (this.gridOptionsWrapper.isSuppressFocusAfterRefresh()) {
|
11622 | return null;
|
11623 | }
|
11624 | if (!this.focusedCell) {
|
11625 | return null;
|
11626 | }
|
11627 |
|
11628 |
|
11629 | var browserFocusedCell = this.getGridCellForDomElement(document.activeElement);
|
11630 | if (!browserFocusedCell) {
|
11631 | return null;
|
11632 | }
|
11633 | return this.focusedCell;
|
11634 | };
|
11635 | FocusedCellController.prototype.getGridCellForDomElement = function (eBrowserCell) {
|
11636 | var ePointer = eBrowserCell;
|
11637 | while (ePointer) {
|
11638 | var cellComp = this.gridOptionsWrapper.getDomData(ePointer, cellComp_1.CellComp.DOM_DATA_KEY_CELL_COMP);
|
11639 | if (cellComp) {
|
11640 | return cellComp.getGridCell();
|
11641 | }
|
11642 | ePointer = ePointer.parentNode;
|
11643 | }
|
11644 | return null;
|
11645 | };
|
11646 | FocusedCellController.prototype.setFocusedCell = function (rowIndex, colKey, floating, forceBrowserFocus) {
|
11647 | if (forceBrowserFocus === void 0) { forceBrowserFocus = false; }
|
11648 | var column = utils_1.Utils.makeNull(this.columnController.getGridColumn(colKey));
|
11649 | this.focusedCell = new gridCell_1.GridCell({ rowIndex: rowIndex,
|
11650 | floating: utils_1.Utils.makeNull(floating),
|
11651 | column: column });
|
11652 | this.onCellFocused(forceBrowserFocus);
|
11653 | };
|
11654 | FocusedCellController.prototype.isCellFocused = function (gridCell) {
|
11655 | if (utils_1.Utils.missing(this.focusedCell)) {
|
11656 | return false;
|
11657 | }
|
11658 | return this.focusedCell.column === gridCell.column && this.isRowFocused(gridCell.rowIndex, gridCell.floating);
|
11659 | };
|
11660 | FocusedCellController.prototype.isRowNodeFocused = function (rowNode) {
|
11661 | return this.isRowFocused(rowNode.rowIndex, rowNode.rowPinned);
|
11662 | };
|
11663 | FocusedCellController.prototype.isAnyCellFocused = function () {
|
11664 | return !!this.focusedCell;
|
11665 | };
|
11666 | FocusedCellController.prototype.isRowFocused = function (rowIndex, floating) {
|
11667 | if (utils_1.Utils.missing(this.focusedCell)) {
|
11668 | return false;
|
11669 | }
|
11670 | var floatingOrNull = utils_1.Utils.makeNull(floating);
|
11671 | return this.focusedCell.rowIndex === rowIndex && this.focusedCell.floating === floatingOrNull;
|
11672 | };
|
11673 | FocusedCellController.prototype.onCellFocused = function (forceBrowserFocus) {
|
11674 | var event = {
|
11675 | type: events_1.Events.EVENT_CELL_FOCUSED,
|
11676 | forceBrowserFocus: forceBrowserFocus,
|
11677 | rowIndex: null,
|
11678 | column: null,
|
11679 | floating: null,
|
11680 | api: this.gridApi,
|
11681 | columnApi: this.columnApi,
|
11682 | rowPinned: null
|
11683 | };
|
11684 | if (this.focusedCell) {
|
11685 | event.rowIndex = this.focusedCell.rowIndex;
|
11686 | event.column = this.focusedCell.column;
|
11687 | event.rowPinned = this.focusedCell.floating;
|
11688 | }
|
11689 | this.eventService.dispatchEvent(event);
|
11690 | };
|
11691 | __decorate([
|
11692 | context_1.Autowired('eventService'),
|
11693 | __metadata("design:type", eventService_1.EventService)
|
11694 | ], FocusedCellController.prototype, "eventService", void 0);
|
11695 | __decorate([
|
11696 | context_1.Autowired('gridOptionsWrapper'),
|
11697 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
11698 | ], FocusedCellController.prototype, "gridOptionsWrapper", void 0);
|
11699 | __decorate([
|
11700 | context_1.Autowired('columnController'),
|
11701 | __metadata("design:type", columnController_1.ColumnController)
|
11702 | ], FocusedCellController.prototype, "columnController", void 0);
|
11703 | __decorate([
|
11704 | context_1.Autowired('columnApi'),
|
11705 | __metadata("design:type", columnApi_1.ColumnApi)
|
11706 | ], FocusedCellController.prototype, "columnApi", void 0);
|
11707 | __decorate([
|
11708 | context_1.Autowired('gridApi'),
|
11709 | __metadata("design:type", gridApi_1.GridApi)
|
11710 | ], FocusedCellController.prototype, "gridApi", void 0);
|
11711 | __decorate([
|
11712 | context_1.PostConstruct,
|
11713 | __metadata("design:type", Function),
|
11714 | __metadata("design:paramtypes", []),
|
11715 | __metadata("design:returntype", void 0)
|
11716 | ], FocusedCellController.prototype, "init", null);
|
11717 | FocusedCellController = __decorate([
|
11718 | context_1.Bean('focusedCellController')
|
11719 | ], FocusedCellController);
|
11720 | return FocusedCellController;
|
11721 | }());
|
11722 | exports.FocusedCellController = FocusedCellController;
|
11723 |
|
11724 |
|
11725 | }),
|
11726 |
|
11727 | (function(module, exports, __webpack_require__) {
|
11728 |
|
11729 | "use strict";
|
11730 |
|
11731 |
|
11732 |
|
11733 |
|
11734 |
|
11735 |
|
11736 |
|
11737 | Object.defineProperty(exports, "__esModule", { value: true });
|
11738 | var utils_1 = __webpack_require__(1);
|
11739 | var gridRow_1 = __webpack_require__(64);
|
11740 | var GridCell = (function () {
|
11741 | function GridCell(gridCellDef) {
|
11742 | this.rowIndex = gridCellDef.rowIndex;
|
11743 | this.column = gridCellDef.column;
|
11744 | this.floating = utils_1.Utils.makeNull(gridCellDef.floating);
|
11745 | }
|
11746 | GridCell.prototype.getGridCellDef = function () {
|
11747 | return {
|
11748 | rowIndex: this.rowIndex,
|
11749 | column: this.column,
|
11750 | floating: this.floating
|
11751 | };
|
11752 | };
|
11753 | GridCell.prototype.getGridRow = function () {
|
11754 | return new gridRow_1.GridRow(this.rowIndex, this.floating);
|
11755 | };
|
11756 | GridCell.prototype.toString = function () {
|
11757 | return "rowIndex = " + this.rowIndex + ", floating = " + this.floating + ", column = " + (this.column ? this.column.getId() : null);
|
11758 | };
|
11759 | GridCell.prototype.createId = function () {
|
11760 | return this.rowIndex + "." + this.floating + "." + this.column.getId();
|
11761 | };
|
11762 | GridCell.prototype.equals = function (other) {
|
11763 | var colsMatch = this.column === other.column;
|
11764 | var floatingMatch = this.floating === other.floating;
|
11765 | var indexMatch = this.rowIndex === other.rowIndex;
|
11766 | return colsMatch && floatingMatch && indexMatch;
|
11767 | };
|
11768 | return GridCell;
|
11769 | }());
|
11770 | exports.GridCell = GridCell;
|
11771 |
|
11772 |
|
11773 | }),
|
11774 |
|
11775 | (function(module, exports, __webpack_require__) {
|
11776 |
|
11777 | "use strict";
|
11778 |
|
11779 |
|
11780 |
|
11781 |
|
11782 |
|
11783 |
|
11784 |
|
11785 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
11786 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
11787 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
11788 | 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;
|
11789 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
11790 | };
|
11791 | var __metadata = (this && this.__metadata) || function (k, v) {
|
11792 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
11793 | };
|
11794 | Object.defineProperty(exports, "__esModule", { value: true });
|
11795 | var column_1 = __webpack_require__(10);
|
11796 | var context_1 = __webpack_require__(0);
|
11797 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
11798 | var columnApi_1 = __webpack_require__(7);
|
11799 | var columnController_1 = __webpack_require__(4);
|
11800 | var eventService_1 = __webpack_require__(3);
|
11801 | var events_1 = __webpack_require__(5);
|
11802 | var context_2 = __webpack_require__(0);
|
11803 | var utils_1 = __webpack_require__(1);
|
11804 | var gridApi_1 = __webpack_require__(6);
|
11805 | var SortController = (function () {
|
11806 | function SortController() {
|
11807 | }
|
11808 | SortController_1 = SortController;
|
11809 | SortController.prototype.progressSort = function (column, multiSort, source) {
|
11810 | if (source === void 0) { source = "api"; }
|
11811 | var nextDirection = this.getNextSortDirection(column);
|
11812 | this.setSortForColumn(column, nextDirection, multiSort, source);
|
11813 | };
|
11814 | SortController.prototype.setSortForColumn = function (column, sort, multiSort, source) {
|
11815 | if (source === void 0) { source = "api"; }
|
11816 |
|
11817 | if (sort !== column_1.Column.SORT_ASC && sort !== column_1.Column.SORT_DESC) {
|
11818 | sort = null;
|
11819 | }
|
11820 |
|
11821 | column.setSort(sort, source);
|
11822 |
|
11823 | if (column.getSort()) {
|
11824 | var sortedAt = Number(new Date().valueOf());
|
11825 | column.setSortedAt(sortedAt);
|
11826 | }
|
11827 | else {
|
11828 | column.setSortedAt(null);
|
11829 | }
|
11830 | var doingMultiSort = multiSort && !this.gridOptionsWrapper.isSuppressMultiSort();
|
11831 |
|
11832 | if (!doingMultiSort) {
|
11833 | this.clearSortBarThisColumn(column, source);
|
11834 | }
|
11835 | this.dispatchSortChangedEvents();
|
11836 | };
|
11837 |
|
11838 |
|
11839 | SortController.prototype.onSortChanged = function () {
|
11840 | this.dispatchSortChangedEvents();
|
11841 | };
|
11842 | SortController.prototype.dispatchSortChangedEvents = function () {
|
11843 | var event = {
|
11844 | type: events_1.Events.EVENT_SORT_CHANGED,
|
11845 | api: this.gridApi,
|
11846 | columnApi: this.columnApi
|
11847 | };
|
11848 | this.eventService.dispatchEvent(event);
|
11849 | };
|
11850 | SortController.prototype.clearSortBarThisColumn = function (columnToSkip, source) {
|
11851 | this.columnController.getPrimaryAndSecondaryAndAutoColumns().forEach(function (columnToClear) {
|
11852 |
|
11853 | if (!(columnToClear === columnToSkip)) {
|
11854 |
|
11855 |
|
11856 | columnToClear.setSort(undefined, source);
|
11857 | }
|
11858 | });
|
11859 | };
|
11860 | SortController.prototype.getNextSortDirection = function (column) {
|
11861 | var sortingOrder;
|
11862 | if (column.getColDef().sortingOrder) {
|
11863 | sortingOrder = column.getColDef().sortingOrder;
|
11864 | }
|
11865 | else if (this.gridOptionsWrapper.getSortingOrder()) {
|
11866 | sortingOrder = this.gridOptionsWrapper.getSortingOrder();
|
11867 | }
|
11868 | else {
|
11869 | sortingOrder = SortController_1.DEFAULT_SORTING_ORDER;
|
11870 | }
|
11871 | if (!Array.isArray(sortingOrder) || sortingOrder.length <= 0) {
|
11872 | console.warn('ag-grid: sortingOrder must be an array with at least one element, currently it\'s ' + sortingOrder);
|
11873 | return;
|
11874 | }
|
11875 | var currentIndex = sortingOrder.indexOf(column.getSort());
|
11876 | var notInArray = currentIndex < 0;
|
11877 | var lastItemInArray = currentIndex == sortingOrder.length - 1;
|
11878 | var result;
|
11879 | if (notInArray || lastItemInArray) {
|
11880 | result = sortingOrder[0];
|
11881 | }
|
11882 | else {
|
11883 | result = sortingOrder[currentIndex + 1];
|
11884 | }
|
11885 |
|
11886 | if (SortController_1.DEFAULT_SORTING_ORDER.indexOf(result) < 0) {
|
11887 | console.warn('ag-grid: invalid sort type ' + result);
|
11888 | return null;
|
11889 | }
|
11890 | return result;
|
11891 | };
|
11892 |
|
11893 | SortController.prototype.getSortModel = function () {
|
11894 | var columnsWithSorting = this.getColumnsWithSortingOrdered();
|
11895 | return utils_1.Utils.map(columnsWithSorting, function (column) {
|
11896 | return {
|
11897 | colId: column.getColId(),
|
11898 | sort: column.getSort()
|
11899 | };
|
11900 | });
|
11901 | };
|
11902 | SortController.prototype.setSortModel = function (sortModel, source) {
|
11903 | var _this = this;
|
11904 | if (source === void 0) { source = "api"; }
|
11905 | if (!this.gridOptionsWrapper.isEnableSorting()) {
|
11906 | console.warn('ag-grid: You are setting the sort model on a grid that does not have sorting enabled');
|
11907 | return;
|
11908 | }
|
11909 |
|
11910 | var sortModelProvided = sortModel && sortModel.length > 0;
|
11911 | var allColumnsIncludingAuto = this.columnController.getPrimaryAndSecondaryAndAutoColumns();
|
11912 | allColumnsIncludingAuto.forEach(function (column) {
|
11913 | var sortForCol = null;
|
11914 | var sortedAt = -1;
|
11915 | if (sortModelProvided && !column.getColDef().suppressSorting) {
|
11916 | for (var j = 0; j < sortModel.length; j++) {
|
11917 | var sortModelEntry = sortModel[j];
|
11918 | if (typeof sortModelEntry.colId === 'string'
|
11919 | && typeof column.getColId() === 'string'
|
11920 | && _this.compareColIds(sortModelEntry, column)) {
|
11921 | sortForCol = sortModelEntry.sort;
|
11922 | sortedAt = j;
|
11923 | }
|
11924 | }
|
11925 | }
|
11926 | if (sortForCol) {
|
11927 | column.setSort(sortForCol, source);
|
11928 | column.setSortedAt(sortedAt);
|
11929 | }
|
11930 | else {
|
11931 | column.setSort(null, source);
|
11932 | column.setSortedAt(null);
|
11933 | }
|
11934 | });
|
11935 | this.dispatchSortChangedEvents();
|
11936 | };
|
11937 | SortController.prototype.compareColIds = function (sortModelEntry, column) {
|
11938 | return sortModelEntry.colId === column.getColId();
|
11939 | };
|
11940 | SortController.prototype.getColumnsWithSortingOrdered = function () {
|
11941 |
|
11942 | var allColumnsIncludingAuto = this.columnController.getPrimaryAndSecondaryAndAutoColumns();
|
11943 | var columnsWithSorting = utils_1.Utils.filter(allColumnsIncludingAuto, function (column) { return !!column.getSort(); });
|
11944 |
|
11945 | columnsWithSorting.sort(function (a, b) { return a.sortedAt - b.sortedAt; });
|
11946 | return columnsWithSorting;
|
11947 | };
|
11948 |
|
11949 | SortController.prototype.getSortForRowController = function () {
|
11950 | var columnsWithSorting = this.getColumnsWithSortingOrdered();
|
11951 | return utils_1.Utils.map(columnsWithSorting, function (column) {
|
11952 | var ascending = column.getSort() === column_1.Column.SORT_ASC;
|
11953 | return {
|
11954 | inverter: ascending ? 1 : -1,
|
11955 | column: column
|
11956 | };
|
11957 | });
|
11958 | };
|
11959 | SortController.DEFAULT_SORTING_ORDER = [column_1.Column.SORT_ASC, column_1.Column.SORT_DESC, null];
|
11960 | __decorate([
|
11961 | context_1.Autowired('gridOptionsWrapper'),
|
11962 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
11963 | ], SortController.prototype, "gridOptionsWrapper", void 0);
|
11964 | __decorate([
|
11965 | context_1.Autowired('columnController'),
|
11966 | __metadata("design:type", columnController_1.ColumnController)
|
11967 | ], SortController.prototype, "columnController", void 0);
|
11968 | __decorate([
|
11969 | context_1.Autowired('eventService'),
|
11970 | __metadata("design:type", eventService_1.EventService)
|
11971 | ], SortController.prototype, "eventService", void 0);
|
11972 | __decorate([
|
11973 | context_1.Autowired('columnApi'),
|
11974 | __metadata("design:type", columnApi_1.ColumnApi)
|
11975 | ], SortController.prototype, "columnApi", void 0);
|
11976 | __decorate([
|
11977 | context_1.Autowired('gridApi'),
|
11978 | __metadata("design:type", gridApi_1.GridApi)
|
11979 | ], SortController.prototype, "gridApi", void 0);
|
11980 | SortController = SortController_1 = __decorate([
|
11981 | context_2.Bean('sortController')
|
11982 | ], SortController);
|
11983 | return SortController;
|
11984 | var SortController_1;
|
11985 | }());
|
11986 | exports.SortController = SortController;
|
11987 |
|
11988 |
|
11989 | }),
|
11990 |
|
11991 | (function(module, exports, __webpack_require__) {
|
11992 |
|
11993 | "use strict";
|
11994 |
|
11995 |
|
11996 |
|
11997 |
|
11998 |
|
11999 |
|
12000 |
|
12001 | Object.defineProperty(exports, "__esModule", { value: true });
|
12002 | var Events = (function () {
|
12003 | function Events() {
|
12004 | }
|
12005 |
|
12006 | Events.EVENT_COLUMN_EVERYTHING_CHANGED = 'columnEverythingChanged';
|
12007 |
|
12008 | Events.EVENT_NEW_COLUMNS_LOADED = 'newColumnsLoaded';
|
12009 |
|
12010 | Events.EVENT_COLUMN_PIVOT_MODE_CHANGED = 'columnPivotModeChanged';
|
12011 |
|
12012 | Events.EVENT_COLUMN_ROW_GROUP_CHANGED = 'columnRowGroupChanged';
|
12013 |
|
12014 | Events.EVENT_COLUMN_PIVOT_CHANGED = 'columnPivotChanged';
|
12015 |
|
12016 | Events.EVENT_GRID_COLUMNS_CHANGED = 'gridColumnsChanged';
|
12017 |
|
12018 | Events.EVENT_COLUMN_VALUE_CHANGED = 'columnValueChanged';
|
12019 |
|
12020 | Events.EVENT_COLUMN_MOVED = 'columnMoved';
|
12021 |
|
12022 | Events.EVENT_COLUMN_VISIBLE = 'columnVisible';
|
12023 |
|
12024 | Events.EVENT_COLUMN_PINNED = 'columnPinned';
|
12025 |
|
12026 | Events.EVENT_COLUMN_GROUP_OPENED = 'columnGroupOpened';
|
12027 |
|
12028 | Events.EVENT_COLUMN_RESIZED = 'columnResized';
|
12029 |
|
12030 | Events.EVENT_DISPLAYED_COLUMNS_CHANGED = 'displayedColumnsChanged';
|
12031 |
|
12032 | Events.EVENT_VIRTUAL_COLUMNS_CHANGED = 'virtualColumnsChanged';
|
12033 |
|
12034 | Events.EVENT_ROW_GROUP_OPENED = 'rowGroupOpened';
|
12035 |
|
12036 | Events.EVENT_ROW_DATA_CHANGED = 'rowDataChanged';
|
12037 |
|
12038 | Events.EVENT_ROW_DATA_UPDATED = 'rowDataUpdated';
|
12039 |
|
12040 | Events.EVENT_PINNED_ROW_DATA_CHANGED = 'pinnedRowDataChanged';
|
12041 |
|
12042 | Events.EVENT_RANGE_SELECTION_CHANGED = 'rangeSelectionChanged';
|
12043 |
|
12044 | Events.EVENT_TOOL_PANEL_VISIBLE_CHANGED = 'toolPanelVisibleChanged';
|
12045 |
|
12046 | Events.EVENT_MODEL_UPDATED = 'modelUpdated';
|
12047 | Events.EVENT_PASTE_START = 'pasteStart';
|
12048 | Events.EVENT_PASTE_END = 'pasteEnd';
|
12049 | Events.EVENT_CELL_CLICKED = 'cellClicked';
|
12050 | Events.EVENT_CELL_DOUBLE_CLICKED = 'cellDoubleClicked';
|
12051 | Events.EVENT_CELL_MOUSE_DOWN = 'cellMouseDown';
|
12052 | Events.EVENT_CELL_CONTEXT_MENU = 'cellContextMenu';
|
12053 | Events.EVENT_CELL_VALUE_CHANGED = 'cellValueChanged';
|
12054 | Events.EVENT_ROW_VALUE_CHANGED = 'rowValueChanged';
|
12055 | Events.EVENT_CELL_FOCUSED = 'cellFocused';
|
12056 | Events.EVENT_ROW_SELECTED = 'rowSelected';
|
12057 | Events.EVENT_SELECTION_CHANGED = 'selectionChanged';
|
12058 | Events.EVENT_CELL_MOUSE_OVER = 'cellMouseOver';
|
12059 | Events.EVENT_CELL_MOUSE_OUT = 'cellMouseOut';
|
12060 |
|
12061 | Events.EVENT_FILTER_CHANGED = 'filterChanged';
|
12062 |
|
12063 | Events.EVENT_FILTER_MODIFIED = 'filterModified';
|
12064 | Events.EVENT_SORT_CHANGED = 'sortChanged';
|
12065 |
|
12066 | Events.EVENT_VIRTUAL_ROW_REMOVED = 'virtualRowRemoved';
|
12067 | Events.EVENT_ROW_CLICKED = 'rowClicked';
|
12068 | Events.EVENT_ROW_DOUBLE_CLICKED = 'rowDoubleClicked';
|
12069 |
|
12070 | Events.EVENT_GRID_READY = 'gridReady';
|
12071 | |
12072 |
|
12073 | Events.EVENT_GRID_SIZE_CHANGED = 'gridSizeChanged';
|
12074 |
|
12075 | Events.EVENT_VIEWPORT_CHANGED = 'viewportChanged';
|
12076 |
|
12077 | Events.EVENT_DRAG_STARTED = 'dragStarted';
|
12078 |
|
12079 | Events.EVENT_DRAG_STOPPED = 'dragStopped';
|
12080 | Events.EVENT_ROW_EDITING_STARTED = 'rowEditingStarted';
|
12081 | Events.EVENT_ROW_EDITING_STOPPED = 'rowEditingStopped';
|
12082 | Events.EVENT_CELL_EDITING_STARTED = 'cellEditingStarted';
|
12083 | Events.EVENT_CELL_EDITING_STOPPED = 'cellEditingStopped';
|
12084 |
|
12085 | Events.EVENT_BODY_SCROLL = 'bodyScroll';
|
12086 | Events.EVENT_ANIMATION_QUEUE_EMPTY = 'animationQueueEmpty';
|
12087 | Events.EVENT_HEIGHT_SCALE_CHANGED = 'heightScaleChanged';
|
12088 | |
12089 |
|
12090 | Events.EVENT_PAGINATION_CHANGED = 'paginationChanged';
|
12091 | |
12092 |
|
12093 |
|
12094 | Events.EVENT_COMPONENT_STATE_CHANGED = 'componentStateChanged';
|
12095 |
|
12096 |
|
12097 | Events.EVENT_BODY_HEIGHT_CHANGED = 'bodyHeightChanged';
|
12098 | Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED = 'displayedColumnsWidthChanged';
|
12099 | Events.EVENT_SCROLL_VISIBILITY_CHANGED = 'scrollVisibilityChanged';
|
12100 | Events.EVENT_COLUMN_HOVER_CHANGED = 'columnHoverChanged';
|
12101 | Events.EVENT_FLASH_CELLS = 'flashCells';
|
12102 | Events.EVENT_ROW_DRAG_ENTER = 'rowDragEnter';
|
12103 | Events.EVENT_ROW_DRAG_MOVE = 'rowDragMove';
|
12104 | Events.EVENT_ROW_DRAG_LEAVE = 'rowDragLeave';
|
12105 | Events.EVENT_ROW_DRAG_END = 'rowDragEnd';
|
12106 |
|
12107 |
|
12108 |
|
12109 | Events.EVENT_COLUMN_ROW_GROUP_CHANGE_REQUEST = 'columnRowGroupChangeRequest';
|
12110 | Events.EVENT_COLUMN_PIVOT_CHANGE_REQUEST = 'columnPivotChangeRequest';
|
12111 | Events.EVENT_COLUMN_VALUE_CHANGE_REQUEST = 'columnValueChangeRequest';
|
12112 | Events.EVENT_COLUMN_AGG_FUNC_CHANGE_REQUEST = 'columnAggFuncChangeRequest';
|
12113 | return Events;
|
12114 | }());
|
12115 | exports.Events = Events;
|
12116 |
|
12117 |
|
12118 | }),
|
12119 |
|
12120 | (function(module, exports, __webpack_require__) {
|
12121 |
|
12122 | "use strict";
|
12123 |
|
12124 |
|
12125 |
|
12126 |
|
12127 |
|
12128 |
|
12129 |
|
12130 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
12131 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
12132 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
12133 | 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;
|
12134 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
12135 | };
|
12136 | var __metadata = (this && this.__metadata) || function (k, v) {
|
12137 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
12138 | };
|
12139 | Object.defineProperty(exports, "__esModule", { value: true });
|
12140 | var column_1 = __webpack_require__(10);
|
12141 | var eventService_1 = __webpack_require__(3);
|
12142 | var context_1 = __webpack_require__(0);
|
12143 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
12144 | var columnApi_1 = __webpack_require__(7);
|
12145 | var gridApi_1 = __webpack_require__(6);
|
12146 | var ColumnGroup = (function () {
|
12147 | function ColumnGroup(originalColumnGroup, groupId, instanceId) {
|
12148 |
|
12149 | this.displayedChildren = [];
|
12150 | this.localEventService = new eventService_1.EventService();
|
12151 | this.groupId = groupId;
|
12152 | this.instanceId = instanceId;
|
12153 | this.originalColumnGroup = originalColumnGroup;
|
12154 | }
|
12155 |
|
12156 | ColumnGroup.createUniqueId = function (groupId, instanceId) {
|
12157 | return groupId + '_' + instanceId;
|
12158 | };
|
12159 |
|
12160 |
|
12161 | ColumnGroup.prototype.reset = function () {
|
12162 | this.parent = null;
|
12163 | this.children = null;
|
12164 | this.displayedChildren = null;
|
12165 | };
|
12166 | ColumnGroup.prototype.getParent = function () {
|
12167 | return this.parent;
|
12168 | };
|
12169 | ColumnGroup.prototype.setParent = function (parent) {
|
12170 | this.parent = parent;
|
12171 | };
|
12172 | ColumnGroup.prototype.getUniqueId = function () {
|
12173 | return ColumnGroup.createUniqueId(this.groupId, this.instanceId);
|
12174 | };
|
12175 | ColumnGroup.prototype.isEmptyGroup = function () {
|
12176 | return this.displayedChildren.length === 0;
|
12177 | };
|
12178 | ColumnGroup.prototype.isMoving = function () {
|
12179 | var allLeafColumns = this.getOriginalColumnGroup().getLeafColumns();
|
12180 | if (!allLeafColumns || allLeafColumns.length === 0) {
|
12181 | return false;
|
12182 | }
|
12183 | var allMoving = true;
|
12184 | allLeafColumns.forEach(function (col) {
|
12185 | if (!col.isMoving()) {
|
12186 | allMoving = false;
|
12187 | }
|
12188 | });
|
12189 | return allMoving;
|
12190 | };
|
12191 | ColumnGroup.prototype.checkLeft = function () {
|
12192 |
|
12193 | this.displayedChildren.forEach(function (child) {
|
12194 | if (child instanceof ColumnGroup) {
|
12195 | child.checkLeft();
|
12196 | }
|
12197 | });
|
12198 |
|
12199 | if (this.displayedChildren.length > 0) {
|
12200 | if (this.gridOptionsWrapper.isEnableRtl()) {
|
12201 | var lastChild = this.displayedChildren[this.displayedChildren.length - 1];
|
12202 | var lastChildLeft = lastChild.getLeft();
|
12203 | this.setLeft(lastChildLeft);
|
12204 | }
|
12205 | else {
|
12206 | var firstChildLeft = this.displayedChildren[0].getLeft();
|
12207 | this.setLeft(firstChildLeft);
|
12208 | }
|
12209 | }
|
12210 | else {
|
12211 |
|
12212 |
|
12213 | this.setLeft(null);
|
12214 | }
|
12215 | };
|
12216 | ColumnGroup.prototype.getLeft = function () {
|
12217 | return this.left;
|
12218 | };
|
12219 | ColumnGroup.prototype.getOldLeft = function () {
|
12220 | return this.oldLeft;
|
12221 | };
|
12222 | ColumnGroup.prototype.setLeft = function (left) {
|
12223 | this.oldLeft = left;
|
12224 | if (this.left !== left) {
|
12225 | this.left = left;
|
12226 | this.localEventService.dispatchEvent(this.createAgEvent(ColumnGroup.EVENT_LEFT_CHANGED));
|
12227 | }
|
12228 | };
|
12229 | ColumnGroup.prototype.createAgEvent = function (type) {
|
12230 | return {
|
12231 | type: type,
|
12232 | };
|
12233 | };
|
12234 | ColumnGroup.prototype.addEventListener = function (eventType, listener) {
|
12235 | this.localEventService.addEventListener(eventType, listener);
|
12236 | };
|
12237 | ColumnGroup.prototype.removeEventListener = function (eventType, listener) {
|
12238 | this.localEventService.removeEventListener(eventType, listener);
|
12239 | };
|
12240 | ColumnGroup.prototype.getGroupId = function () {
|
12241 | return this.groupId;
|
12242 | };
|
12243 | ColumnGroup.prototype.getInstanceId = function () {
|
12244 | return this.instanceId;
|
12245 | };
|
12246 | ColumnGroup.prototype.isChildInThisGroupDeepSearch = function (wantedChild) {
|
12247 | var result = false;
|
12248 | this.children.forEach(function (foundChild) {
|
12249 | if (wantedChild === foundChild) {
|
12250 | result = true;
|
12251 | }
|
12252 | if (foundChild instanceof ColumnGroup) {
|
12253 | if (foundChild.isChildInThisGroupDeepSearch(wantedChild)) {
|
12254 | result = true;
|
12255 | }
|
12256 | }
|
12257 | });
|
12258 | return result;
|
12259 | };
|
12260 | ColumnGroup.prototype.getActualWidth = function () {
|
12261 | var groupActualWidth = 0;
|
12262 | if (this.displayedChildren) {
|
12263 | this.displayedChildren.forEach(function (child) {
|
12264 | groupActualWidth += child.getActualWidth();
|
12265 | });
|
12266 | }
|
12267 | return groupActualWidth;
|
12268 | };
|
12269 | ColumnGroup.prototype.isResizable = function () {
|
12270 | if (!this.displayedChildren) {
|
12271 | return false;
|
12272 | }
|
12273 |
|
12274 | var result = false;
|
12275 | this.displayedChildren.forEach(function (child) {
|
12276 | if (child.isResizable()) {
|
12277 | result = true;
|
12278 | }
|
12279 | });
|
12280 | return result;
|
12281 | };
|
12282 | ColumnGroup.prototype.getMinWidth = function () {
|
12283 | var result = 0;
|
12284 | this.displayedChildren.forEach(function (groupChild) {
|
12285 | result += groupChild.getMinWidth();
|
12286 | });
|
12287 | return result;
|
12288 | };
|
12289 | ColumnGroup.prototype.addChild = function (child) {
|
12290 | if (!this.children) {
|
12291 | this.children = [];
|
12292 | }
|
12293 | this.children.push(child);
|
12294 | };
|
12295 | ColumnGroup.prototype.getDisplayedChildren = function () {
|
12296 | return this.displayedChildren;
|
12297 | };
|
12298 | ColumnGroup.prototype.getLeafColumns = function () {
|
12299 | var result = [];
|
12300 | this.addLeafColumns(result);
|
12301 | return result;
|
12302 | };
|
12303 | ColumnGroup.prototype.getDisplayedLeafColumns = function () {
|
12304 | var result = [];
|
12305 | this.addDisplayedLeafColumns(result);
|
12306 | return result;
|
12307 | };
|
12308 |
|
12309 | ColumnGroup.prototype.getDefinition = function () {
|
12310 | return this.originalColumnGroup.getColGroupDef();
|
12311 | };
|
12312 | ColumnGroup.prototype.getColGroupDef = function () {
|
12313 | return this.originalColumnGroup.getColGroupDef();
|
12314 | };
|
12315 | ColumnGroup.prototype.isPadding = function () {
|
12316 | return this.originalColumnGroup.isPadding();
|
12317 | };
|
12318 | ColumnGroup.prototype.isExpandable = function () {
|
12319 | return this.originalColumnGroup.isExpandable();
|
12320 | };
|
12321 | ColumnGroup.prototype.isExpanded = function () {
|
12322 | return this.originalColumnGroup.isExpanded();
|
12323 | };
|
12324 | ColumnGroup.prototype.setExpanded = function (expanded) {
|
12325 | this.originalColumnGroup.setExpanded(expanded);
|
12326 | };
|
12327 | ColumnGroup.prototype.addDisplayedLeafColumns = function (leafColumns) {
|
12328 | this.displayedChildren.forEach(function (child) {
|
12329 | if (child instanceof column_1.Column) {
|
12330 | leafColumns.push(child);
|
12331 | }
|
12332 | else if (child instanceof ColumnGroup) {
|
12333 | child.addDisplayedLeafColumns(leafColumns);
|
12334 | }
|
12335 | });
|
12336 | };
|
12337 | ColumnGroup.prototype.addLeafColumns = function (leafColumns) {
|
12338 | this.children.forEach(function (child) {
|
12339 | if (child instanceof column_1.Column) {
|
12340 | leafColumns.push(child);
|
12341 | }
|
12342 | else if (child instanceof ColumnGroup) {
|
12343 | child.addLeafColumns(leafColumns);
|
12344 | }
|
12345 | });
|
12346 | };
|
12347 | ColumnGroup.prototype.getChildren = function () {
|
12348 | return this.children;
|
12349 | };
|
12350 | ColumnGroup.prototype.getColumnGroupShow = function () {
|
12351 | return this.originalColumnGroup.getColumnGroupShow();
|
12352 | };
|
12353 | ColumnGroup.prototype.getOriginalColumnGroup = function () {
|
12354 | return this.originalColumnGroup;
|
12355 | };
|
12356 | ColumnGroup.prototype.calculateDisplayedColumns = function () {
|
12357 | var _this = this;
|
12358 |
|
12359 | this.displayedChildren = [];
|
12360 |
|
12361 | if (!this.originalColumnGroup.isExpandable()) {
|
12362 | this.displayedChildren = this.children;
|
12363 | }
|
12364 | else {
|
12365 |
|
12366 | this.children.forEach(function (abstractColumn) {
|
12367 | var headerGroupShow = abstractColumn.getColumnGroupShow();
|
12368 | switch (headerGroupShow) {
|
12369 | case ColumnGroup.HEADER_GROUP_SHOW_OPEN:
|
12370 |
|
12371 | if (_this.originalColumnGroup.isExpanded()) {
|
12372 | _this.displayedChildren.push(abstractColumn);
|
12373 | }
|
12374 | break;
|
12375 | case ColumnGroup.HEADER_GROUP_SHOW_CLOSED:
|
12376 |
|
12377 | if (!_this.originalColumnGroup.isExpanded()) {
|
12378 | _this.displayedChildren.push(abstractColumn);
|
12379 | }
|
12380 | break;
|
12381 | default:
|
12382 |
|
12383 | _this.displayedChildren.push(abstractColumn);
|
12384 | break;
|
12385 | }
|
12386 | });
|
12387 | }
|
12388 | this.localEventService.dispatchEvent(this.createAgEvent(ColumnGroup.EVENT_DISPLAYED_CHILDREN_CHANGED));
|
12389 | };
|
12390 | ColumnGroup.HEADER_GROUP_SHOW_OPEN = 'open';
|
12391 | ColumnGroup.HEADER_GROUP_SHOW_CLOSED = 'closed';
|
12392 | ColumnGroup.EVENT_LEFT_CHANGED = 'leftChanged';
|
12393 | ColumnGroup.EVENT_DISPLAYED_CHILDREN_CHANGED = 'displayedChildrenChanged';
|
12394 | __decorate([
|
12395 | context_1.Autowired('gridOptionsWrapper'),
|
12396 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
12397 | ], ColumnGroup.prototype, "gridOptionsWrapper", void 0);
|
12398 | __decorate([
|
12399 | context_1.Autowired('columnApi'),
|
12400 | __metadata("design:type", columnApi_1.ColumnApi)
|
12401 | ], ColumnGroup.prototype, "columnApi", void 0);
|
12402 | __decorate([
|
12403 | context_1.Autowired('gridApi'),
|
12404 | __metadata("design:type", gridApi_1.GridApi)
|
12405 | ], ColumnGroup.prototype, "gridApi", void 0);
|
12406 | return ColumnGroup;
|
12407 | }());
|
12408 | exports.ColumnGroup = ColumnGroup;
|
12409 |
|
12410 |
|
12411 | }),
|
12412 |
|
12413 | (function(module, exports, __webpack_require__) {
|
12414 |
|
12415 | "use strict";
|
12416 |
|
12417 |
|
12418 |
|
12419 |
|
12420 |
|
12421 |
|
12422 |
|
12423 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
12424 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
12425 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
12426 | 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;
|
12427 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
12428 | };
|
12429 | var __metadata = (this && this.__metadata) || function (k, v) {
|
12430 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
12431 | };
|
12432 | Object.defineProperty(exports, "__esModule", { value: true });
|
12433 | var context_1 = __webpack_require__(0);
|
12434 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
12435 | var utils_1 = __webpack_require__(1);
|
12436 | var componentProvider_1 = __webpack_require__(66);
|
12437 | var agComponentUtils_1 = __webpack_require__(76);
|
12438 | var componentMetadataProvider_1 = __webpack_require__(77);
|
12439 | var ComponentType;
|
12440 | (function (ComponentType) {
|
12441 | ComponentType[ComponentType["AG_GRID"] = 0] = "AG_GRID";
|
12442 | ComponentType[ComponentType["FRAMEWORK"] = 1] = "FRAMEWORK";
|
12443 | })(ComponentType = exports.ComponentType || (exports.ComponentType = {}));
|
12444 | var ComponentSource;
|
12445 | (function (ComponentSource) {
|
12446 | ComponentSource[ComponentSource["DEFAULT"] = 0] = "DEFAULT";
|
12447 | ComponentSource[ComponentSource["REGISTERED_BY_NAME"] = 1] = "REGISTERED_BY_NAME";
|
12448 | ComponentSource[ComponentSource["HARDCODED"] = 2] = "HARDCODED";
|
12449 | })(ComponentSource = exports.ComponentSource || (exports.ComponentSource = {}));
|
12450 | var ComponentResolver = (function () {
|
12451 | function ComponentResolver() {
|
12452 | }
|
12453 | |
12454 |
|
12455 |
|
12456 |
|
12457 |
|
12458 |
|
12459 |
|
12460 |
|
12461 |
|
12462 |
|
12463 |
|
12464 |
|
12465 |
|
12466 |
|
12467 |
|
12468 |
|
12469 |
|
12470 | ComponentResolver.prototype.getComponentToUse = function (holder, propertyName, dynamicComponentParams, defaultComponentName) {
|
12471 | |
12472 |
|
12473 |
|
12474 |
|
12475 |
|
12476 |
|
12477 |
|
12478 |
|
12479 | var hardcodedNameComponent = null;
|
12480 | var HardcodedJsComponent = null;
|
12481 | var hardcodedJsFunction = null;
|
12482 | var HardcodedFwComponent = null;
|
12483 | var dynamicComponentFn;
|
12484 | if (holder != null) {
|
12485 | var componentPropertyValue = holder[propertyName];
|
12486 | if (componentPropertyValue != null) {
|
12487 | if (typeof componentPropertyValue === 'string') {
|
12488 | hardcodedNameComponent = componentPropertyValue;
|
12489 | }
|
12490 | else if (this.agComponentUtils.doesImplementIComponent(componentPropertyValue)) {
|
12491 | HardcodedJsComponent = componentPropertyValue;
|
12492 | }
|
12493 | else {
|
12494 | hardcodedJsFunction = componentPropertyValue;
|
12495 | }
|
12496 | }
|
12497 | HardcodedFwComponent = holder[propertyName + "Framework"];
|
12498 | dynamicComponentFn = holder[propertyName + "Selector"];
|
12499 | }
|
12500 | |
12501 |
|
12502 |
|
12503 |
|
12504 | if ((HardcodedJsComponent && HardcodedFwComponent) ||
|
12505 | (hardcodedNameComponent && HardcodedFwComponent) ||
|
12506 | (hardcodedJsFunction && HardcodedFwComponent)) {
|
12507 | throw Error("ag-grid: you are trying to specify: " + propertyName + " twice as a component.");
|
12508 | }
|
12509 | if (HardcodedFwComponent && !this.frameworkComponentWrapper) {
|
12510 | throw Error("ag-grid: you are specifying a framework component but you are not using a framework version of ag-grid for : " + propertyName);
|
12511 | }
|
12512 | if (dynamicComponentFn && (hardcodedNameComponent || HardcodedJsComponent || hardcodedJsFunction || HardcodedFwComponent)) {
|
12513 | throw Error("ag-grid: you can't specify both, the selector and the component of ag-grid for : " + propertyName);
|
12514 | }
|
12515 | |
12516 |
|
12517 |
|
12518 |
|
12519 |
|
12520 |
|
12521 |
|
12522 |
|
12523 |
|
12524 |
|
12525 | if (HardcodedFwComponent) {
|
12526 |
|
12527 |
|
12528 | return {
|
12529 | type: ComponentType.FRAMEWORK,
|
12530 | component: HardcodedFwComponent,
|
12531 | source: ComponentSource.HARDCODED,
|
12532 | dynamicParams: null
|
12533 | };
|
12534 | }
|
12535 | if (HardcodedJsComponent) {
|
12536 |
|
12537 |
|
12538 | return {
|
12539 | type: ComponentType.AG_GRID,
|
12540 | component: HardcodedJsComponent,
|
12541 | source: ComponentSource.HARDCODED,
|
12542 | dynamicParams: null
|
12543 | };
|
12544 | }
|
12545 | if (hardcodedJsFunction) {
|
12546 |
|
12547 |
|
12548 | return this.agComponentUtils.adaptFunction(propertyName, hardcodedJsFunction, ComponentType.AG_GRID, ComponentSource.HARDCODED);
|
12549 | }
|
12550 | if (dynamicComponentFn) {
|
12551 | var dynamicComponentDef = dynamicComponentFn(dynamicComponentParams);
|
12552 | if (dynamicComponentDef != null) {
|
12553 | if (dynamicComponentDef.component == null) {
|
12554 | dynamicComponentDef.component = defaultComponentName;
|
12555 | }
|
12556 | var dynamicComponent = this.resolveByName(propertyName, dynamicComponentDef.component);
|
12557 | return utils_1._.assign(dynamicComponent, {
|
12558 | dynamicParams: dynamicComponentDef.params
|
12559 | });
|
12560 | }
|
12561 | }
|
12562 |
|
12563 | var componentNameToUse;
|
12564 | if (hardcodedNameComponent) {
|
12565 | componentNameToUse = hardcodedNameComponent;
|
12566 | }
|
12567 | else {
|
12568 | componentNameToUse = defaultComponentName;
|
12569 | }
|
12570 | return componentNameToUse == null ? null : this.resolveByName(propertyName, componentNameToUse);
|
12571 | };
|
12572 | ComponentResolver.prototype.resolveByName = function (propertyName, componentNameOpt) {
|
12573 | var componentName = componentNameOpt != null ? componentNameOpt : propertyName;
|
12574 | var registeredComponent = this.componentProvider.retrieve(componentName);
|
12575 | if (registeredComponent == null)
|
12576 | return null;
|
12577 |
|
12578 | if (registeredComponent.type == ComponentType.FRAMEWORK) {
|
12579 | return {
|
12580 | component: registeredComponent.component,
|
12581 | type: ComponentType.FRAMEWORK,
|
12582 | source: ComponentSource.REGISTERED_BY_NAME,
|
12583 | dynamicParams: null
|
12584 | };
|
12585 | }
|
12586 |
|
12587 | if (this.agComponentUtils.doesImplementIComponent(registeredComponent.component)) {
|
12588 | return {
|
12589 | component: registeredComponent.component,
|
12590 | type: ComponentType.AG_GRID,
|
12591 | source: (registeredComponent.source == componentProvider_1.RegisteredComponentSource.REGISTERED) ? ComponentSource.REGISTERED_BY_NAME : ComponentSource.DEFAULT,
|
12592 | dynamicParams: null
|
12593 | };
|
12594 | }
|
12595 |
|
12596 | return this.agComponentUtils.adaptFunction(propertyName, registeredComponent.component, registeredComponent.type, (registeredComponent.source == componentProvider_1.RegisteredComponentSource.REGISTERED) ? ComponentSource.REGISTERED_BY_NAME : ComponentSource.DEFAULT);
|
12597 | };
|
12598 | |
12599 |
|
12600 |
|
12601 |
|
12602 |
|
12603 |
|
12604 |
|
12605 |
|
12606 |
|
12607 |
|
12608 | ComponentResolver.prototype.mergeParams = function (holder, propertyName, agGridParams, dynamicCustomParams, dynamicParams) {
|
12609 | if (dynamicParams === void 0) { dynamicParams = null; }
|
12610 | var customParamsRaw = holder ? holder[propertyName + "Params"] : null;
|
12611 | var finalParams = {};
|
12612 | utils_1._.mergeDeep(finalParams, agGridParams);
|
12613 | if (customParamsRaw != null) {
|
12614 | var customParams = null;
|
12615 | if (typeof customParamsRaw === 'function') {
|
12616 | customParams = customParamsRaw(dynamicCustomParams);
|
12617 | }
|
12618 | else {
|
12619 | customParams = customParamsRaw;
|
12620 | }
|
12621 | utils_1._.mergeDeep(finalParams, customParams);
|
12622 | }
|
12623 | utils_1._.mergeDeep(finalParams, dynamicParams);
|
12624 | if (!finalParams.api) {
|
12625 | finalParams.api = this.gridOptions.api;
|
12626 | }
|
12627 | return finalParams;
|
12628 | };
|
12629 | |
12630 |
|
12631 |
|
12632 |
|
12633 |
|
12634 |
|
12635 |
|
12636 |
|
12637 |
|
12638 |
|
12639 |
|
12640 |
|
12641 |
|
12642 |
|
12643 |
|
12644 |
|
12645 |
|
12646 |
|
12647 | ComponentResolver.prototype.createAgGridComponent = function (holderOpt, agGridParams, propertyName, dynamicComponentParams, defaultComponentName, mandatory, customInitParamsCb) {
|
12648 | if (mandatory === void 0) { mandatory = true; }
|
12649 | var holder = holderOpt == null ? this.gridOptions : holderOpt;
|
12650 |
|
12651 | var componentAndParams = this.newAgGridComponent(holder, propertyName, dynamicComponentParams, defaultComponentName, mandatory);
|
12652 | if (!componentAndParams)
|
12653 | return null;
|
12654 |
|
12655 | var finalParams = this.mergeParams(holder, propertyName, agGridParams, dynamicComponentParams, componentAndParams[1]);
|
12656 |
|
12657 |
|
12658 | finalParams.agGridReact = this.context.getBean('agGridReact') ? utils_1._.cloneObject(this.context.getBean('agGridReact')) : {};
|
12659 |
|
12660 | finalParams.frameworkComponentWrapper = this.context.getBean('frameworkComponentWrapper') ? this.context.getBean('frameworkComponentWrapper') : {};
|
12661 | var deferredInit = this.initialiseComponent(componentAndParams[0], finalParams, customInitParamsCb);
|
12662 | if (deferredInit == null) {
|
12663 | return utils_1.Promise.resolve(componentAndParams[0]);
|
12664 | }
|
12665 | else {
|
12666 | var asPromise = deferredInit;
|
12667 | return asPromise.map(function (notRelevant) { return componentAndParams[0]; });
|
12668 | }
|
12669 | };
|
12670 | |
12671 |
|
12672 |
|
12673 |
|
12674 |
|
12675 |
|
12676 |
|
12677 |
|
12678 |
|
12679 | ComponentResolver.prototype.createInternalAgGridComponent = function (clazz, agGridParams, customInitParamsCb) {
|
12680 | var internalComponent = new clazz();
|
12681 | this.initialiseComponent(internalComponent, agGridParams, customInitParamsCb);
|
12682 | return internalComponent;
|
12683 | };
|
12684 | ComponentResolver.prototype.newAgGridComponent = function (holder, propertyName, dynamicComponentParams, defaultComponentName, mandatory) {
|
12685 | if (mandatory === void 0) { mandatory = true; }
|
12686 | var componentToUse = this.getComponentToUse(holder, propertyName, dynamicComponentParams, defaultComponentName);
|
12687 | if (!componentToUse || !componentToUse.component) {
|
12688 | if (mandatory) {
|
12689 | console.error("Error creating component " + propertyName + "=>" + defaultComponentName);
|
12690 | }
|
12691 | return null;
|
12692 | }
|
12693 | if (componentToUse.type === ComponentType.AG_GRID) {
|
12694 | return [
|
12695 | new componentToUse.component(),
|
12696 | componentToUse.dynamicParams
|
12697 | ];
|
12698 | }
|
12699 |
|
12700 | var FrameworkComponentRaw = componentToUse.component;
|
12701 | var thisComponentConfig = this.componentMetadataProvider.retrieve(propertyName);
|
12702 | return [
|
12703 | this.frameworkComponentWrapper.wrap(FrameworkComponentRaw, thisComponentConfig.mandatoryMethodList, thisComponentConfig.optionalMethodList, defaultComponentName),
|
12704 | componentToUse.dynamicParams
|
12705 | ];
|
12706 | };
|
12707 | ComponentResolver.prototype.initialiseComponent = function (component, agGridParams, customInitParamsCb) {
|
12708 | this.context.wireBean(component);
|
12709 | if (customInitParamsCb == null) {
|
12710 | return component.init(agGridParams);
|
12711 | }
|
12712 | else {
|
12713 | return component.init(customInitParamsCb(agGridParams, component));
|
12714 | }
|
12715 | };
|
12716 | __decorate([
|
12717 | context_1.Autowired("gridOptions"),
|
12718 | __metadata("design:type", Object)
|
12719 | ], ComponentResolver.prototype, "gridOptions", void 0);
|
12720 | __decorate([
|
12721 | context_1.Autowired("gridOptionsWrapper"),
|
12722 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
12723 | ], ComponentResolver.prototype, "gridOptionsWrapper", void 0);
|
12724 | __decorate([
|
12725 | context_1.Autowired("context"),
|
12726 | __metadata("design:type", context_1.Context)
|
12727 | ], ComponentResolver.prototype, "context", void 0);
|
12728 | __decorate([
|
12729 | context_1.Autowired("agComponentUtils"),
|
12730 | __metadata("design:type", agComponentUtils_1.AgComponentUtils)
|
12731 | ], ComponentResolver.prototype, "agComponentUtils", void 0);
|
12732 | __decorate([
|
12733 | context_1.Autowired("componentMetadataProvider"),
|
12734 | __metadata("design:type", componentMetadataProvider_1.ComponentMetadataProvider)
|
12735 | ], ComponentResolver.prototype, "componentMetadataProvider", void 0);
|
12736 | __decorate([
|
12737 | context_1.Autowired("componentProvider"),
|
12738 | __metadata("design:type", componentProvider_1.ComponentProvider)
|
12739 | ], ComponentResolver.prototype, "componentProvider", void 0);
|
12740 | __decorate([
|
12741 | context_1.Optional("frameworkComponentWrapper"),
|
12742 | __metadata("design:type", Object)
|
12743 | ], ComponentResolver.prototype, "frameworkComponentWrapper", void 0);
|
12744 | ComponentResolver = __decorate([
|
12745 | context_1.Bean('componentResolver')
|
12746 | ], ComponentResolver);
|
12747 | return ComponentResolver;
|
12748 | }());
|
12749 | exports.ComponentResolver = ComponentResolver;
|
12750 |
|
12751 |
|
12752 | }),
|
12753 |
|
12754 | (function(module, exports, __webpack_require__) {
|
12755 |
|
12756 | "use strict";
|
12757 |
|
12758 |
|
12759 |
|
12760 |
|
12761 |
|
12762 |
|
12763 |
|
12764 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
12765 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
12766 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
12767 | 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;
|
12768 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
12769 | };
|
12770 | var __metadata = (this && this.__metadata) || function (k, v) {
|
12771 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
12772 | };
|
12773 | Object.defineProperty(exports, "__esModule", { value: true });
|
12774 | var context_1 = __webpack_require__(0);
|
12775 | var columnApi_1 = __webpack_require__(7);
|
12776 | var columnController_1 = __webpack_require__(4);
|
12777 | var gridApi_1 = __webpack_require__(6);
|
12778 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
12779 | var expressionService_1 = __webpack_require__(19);
|
12780 | var rowRenderer_1 = __webpack_require__(20);
|
12781 | var templateService_1 = __webpack_require__(49);
|
12782 | var valueService_1 = __webpack_require__(15);
|
12783 | var eventService_1 = __webpack_require__(3);
|
12784 | var columnAnimationService_1 = __webpack_require__(53);
|
12785 | var focusedCellController_1 = __webpack_require__(22);
|
12786 | var cellEditorFactory_1 = __webpack_require__(54);
|
12787 | var cellRendererFactory_1 = __webpack_require__(55);
|
12788 | var popupService_1 = __webpack_require__(35);
|
12789 | var cellRendererService_1 = __webpack_require__(56);
|
12790 | var valueFormatterService_1 = __webpack_require__(43);
|
12791 | var stylingService_1 = __webpack_require__(73);
|
12792 | var columnHoverService_1 = __webpack_require__(45);
|
12793 | var paginationProxy_1 = __webpack_require__(29);
|
12794 | var animationFrameService_1 = __webpack_require__(37);
|
12795 | var componentResolver_1 = __webpack_require__(27);
|
12796 | var dragAndDropService_1 = __webpack_require__(14);
|
12797 | var sortController_1 = __webpack_require__(24);
|
12798 | var filterManager_1 = __webpack_require__(18);
|
12799 | var heightScaler_1 = __webpack_require__(57);
|
12800 |
|
12801 |
|
12802 |
|
12803 |
|
12804 |
|
12805 | var Beans = (function () {
|
12806 | function Beans() {
|
12807 | }
|
12808 | Beans.prototype.registerGridComp = function (gridPanel) {
|
12809 | this.gridPanel = gridPanel;
|
12810 | };
|
12811 | Beans.prototype.postConstruct = function () {
|
12812 | this.doingMasterDetail = this.gridOptionsWrapper.isMasterDetail();
|
12813 | };
|
12814 | __decorate([
|
12815 | context_1.Autowired('paginationProxy'),
|
12816 | __metadata("design:type", paginationProxy_1.PaginationProxy)
|
12817 | ], Beans.prototype, "paginationProxy", void 0);
|
12818 | __decorate([
|
12819 | context_1.Autowired('context'),
|
12820 | __metadata("design:type", context_1.Context)
|
12821 | ], Beans.prototype, "context", void 0);
|
12822 | __decorate([
|
12823 | context_1.Autowired('columnApi'),
|
12824 | __metadata("design:type", columnApi_1.ColumnApi)
|
12825 | ], Beans.prototype, "columnApi", void 0);
|
12826 | __decorate([
|
12827 | context_1.Autowired('gridApi'),
|
12828 | __metadata("design:type", gridApi_1.GridApi)
|
12829 | ], Beans.prototype, "gridApi", void 0);
|
12830 | __decorate([
|
12831 | context_1.Autowired('gridOptionsWrapper'),
|
12832 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
12833 | ], Beans.prototype, "gridOptionsWrapper", void 0);
|
12834 | __decorate([
|
12835 | context_1.Autowired('expressionService'),
|
12836 | __metadata("design:type", expressionService_1.ExpressionService)
|
12837 | ], Beans.prototype, "expressionService", void 0);
|
12838 | __decorate([
|
12839 | context_1.Autowired('rowRenderer'),
|
12840 | __metadata("design:type", rowRenderer_1.RowRenderer)
|
12841 | ], Beans.prototype, "rowRenderer", void 0);
|
12842 | __decorate([
|
12843 | context_1.Autowired('$compile'),
|
12844 | __metadata("design:type", Object)
|
12845 | ], Beans.prototype, "$compile", void 0);
|
12846 | __decorate([
|
12847 | context_1.Autowired('templateService'),
|
12848 | __metadata("design:type", templateService_1.TemplateService)
|
12849 | ], Beans.prototype, "templateService", void 0);
|
12850 | __decorate([
|
12851 | context_1.Autowired('valueService'),
|
12852 | __metadata("design:type", valueService_1.ValueService)
|
12853 | ], Beans.prototype, "valueService", void 0);
|
12854 | __decorate([
|
12855 | context_1.Autowired('eventService'),
|
12856 | __metadata("design:type", eventService_1.EventService)
|
12857 | ], Beans.prototype, "eventService", void 0);
|
12858 | __decorate([
|
12859 | context_1.Autowired('columnController'),
|
12860 | __metadata("design:type", columnController_1.ColumnController)
|
12861 | ], Beans.prototype, "columnController", void 0);
|
12862 | __decorate([
|
12863 | context_1.Autowired('columnAnimationService'),
|
12864 | __metadata("design:type", columnAnimationService_1.ColumnAnimationService)
|
12865 | ], Beans.prototype, "columnAnimationService", void 0);
|
12866 | __decorate([
|
12867 | context_1.Optional('rangeController'),
|
12868 | __metadata("design:type", Object)
|
12869 | ], Beans.prototype, "rangeController", void 0);
|
12870 | __decorate([
|
12871 | context_1.Autowired('focusedCellController'),
|
12872 | __metadata("design:type", focusedCellController_1.FocusedCellController)
|
12873 | ], Beans.prototype, "focusedCellController", void 0);
|
12874 | __decorate([
|
12875 | context_1.Optional('contextMenuFactory'),
|
12876 | __metadata("design:type", Object)
|
12877 | ], Beans.prototype, "contextMenuFactory", void 0);
|
12878 | __decorate([
|
12879 | context_1.Autowired('cellEditorFactory'),
|
12880 | __metadata("design:type", cellEditorFactory_1.CellEditorFactory)
|
12881 | ], Beans.prototype, "cellEditorFactory", void 0);
|
12882 | __decorate([
|
12883 | context_1.Autowired('cellRendererFactory'),
|
12884 | __metadata("design:type", cellRendererFactory_1.CellRendererFactory)
|
12885 | ], Beans.prototype, "cellRendererFactory", void 0);
|
12886 | __decorate([
|
12887 | context_1.Autowired('popupService'),
|
12888 | __metadata("design:type", popupService_1.PopupService)
|
12889 | ], Beans.prototype, "popupService", void 0);
|
12890 | __decorate([
|
12891 | context_1.Autowired('cellRendererService'),
|
12892 | __metadata("design:type", cellRendererService_1.CellRendererService)
|
12893 | ], Beans.prototype, "cellRendererService", void 0);
|
12894 | __decorate([
|
12895 | context_1.Autowired('valueFormatterService'),
|
12896 | __metadata("design:type", valueFormatterService_1.ValueFormatterService)
|
12897 | ], Beans.prototype, "valueFormatterService", void 0);
|
12898 | __decorate([
|
12899 | context_1.Autowired('stylingService'),
|
12900 | __metadata("design:type", stylingService_1.StylingService)
|
12901 | ], Beans.prototype, "stylingService", void 0);
|
12902 | __decorate([
|
12903 | context_1.Autowired('columnHoverService'),
|
12904 | __metadata("design:type", columnHoverService_1.ColumnHoverService)
|
12905 | ], Beans.prototype, "columnHoverService", void 0);
|
12906 | __decorate([
|
12907 | context_1.Autowired('enterprise'),
|
12908 | __metadata("design:type", Boolean)
|
12909 | ], Beans.prototype, "enterprise", void 0);
|
12910 | __decorate([
|
12911 | context_1.Autowired('componentResolver'),
|
12912 | __metadata("design:type", componentResolver_1.ComponentResolver)
|
12913 | ], Beans.prototype, "componentResolver", void 0);
|
12914 | __decorate([
|
12915 | context_1.Autowired('animationFrameService'),
|
12916 | __metadata("design:type", animationFrameService_1.AnimationFrameService)
|
12917 | ], Beans.prototype, "taskQueue", void 0);
|
12918 | __decorate([
|
12919 | context_1.Autowired('dragAndDropService'),
|
12920 | __metadata("design:type", dragAndDropService_1.DragAndDropService)
|
12921 | ], Beans.prototype, "dragAndDropService", void 0);
|
12922 | __decorate([
|
12923 | context_1.Autowired('sortController'),
|
12924 | __metadata("design:type", sortController_1.SortController)
|
12925 | ], Beans.prototype, "sortController", void 0);
|
12926 | __decorate([
|
12927 | context_1.Autowired('filterManager'),
|
12928 | __metadata("design:type", filterManager_1.FilterManager)
|
12929 | ], Beans.prototype, "filterManager", void 0);
|
12930 | __decorate([
|
12931 | context_1.Autowired('heightScaler'),
|
12932 | __metadata("design:type", heightScaler_1.HeightScaler)
|
12933 | ], Beans.prototype, "heightScaler", void 0);
|
12934 | __decorate([
|
12935 | context_1.PostConstruct,
|
12936 | __metadata("design:type", Function),
|
12937 | __metadata("design:paramtypes", []),
|
12938 | __metadata("design:returntype", void 0)
|
12939 | ], Beans.prototype, "postConstruct", null);
|
12940 | Beans = __decorate([
|
12941 | context_1.Bean('beans')
|
12942 | ], Beans);
|
12943 | return Beans;
|
12944 | }());
|
12945 | exports.Beans = Beans;
|
12946 |
|
12947 |
|
12948 | }),
|
12949 |
|
12950 | (function(module, exports, __webpack_require__) {
|
12951 |
|
12952 | "use strict";
|
12953 |
|
12954 |
|
12955 |
|
12956 |
|
12957 |
|
12958 |
|
12959 |
|
12960 | var __extends = (this && this.__extends) || (function () {
|
12961 | var extendStatics = Object.setPrototypeOf ||
|
12962 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
12963 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
12964 | return function (d, b) {
|
12965 | extendStatics(d, b);
|
12966 | function __() { this.constructor = d; }
|
12967 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
12968 | };
|
12969 | })();
|
12970 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
12971 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
12972 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
12973 | 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;
|
12974 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
12975 | };
|
12976 | var __metadata = (this && this.__metadata) || function (k, v) {
|
12977 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
12978 | };
|
12979 | Object.defineProperty(exports, "__esModule", { value: true });
|
12980 | var beanStub_1 = __webpack_require__(13);
|
12981 | var eventService_1 = __webpack_require__(3);
|
12982 | var events_1 = __webpack_require__(5);
|
12983 | var utils_1 = __webpack_require__(1);
|
12984 | var context_1 = __webpack_require__(0);
|
12985 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
12986 | var scrollVisibleService_1 = __webpack_require__(36);
|
12987 | var selectionController_1 = __webpack_require__(17);
|
12988 | var columnApi_1 = __webpack_require__(7);
|
12989 | var gridApi_1 = __webpack_require__(6);
|
12990 | var PaginationAutoPageSizeService = (function (_super) {
|
12991 | __extends(PaginationAutoPageSizeService, _super);
|
12992 | function PaginationAutoPageSizeService() {
|
12993 | return _super !== null && _super.apply(this, arguments) || this;
|
12994 | }
|
12995 | PaginationAutoPageSizeService.prototype.registerGridComp = function (gridPanel) {
|
12996 | this.gridPanel = gridPanel;
|
12997 | this.addDestroyableEventListener(this.eventService, events_1.Events.EVENT_BODY_HEIGHT_CHANGED, this.onBodyHeightChanged.bind(this));
|
12998 | this.addDestroyableEventListener(this.eventService, events_1.Events.EVENT_SCROLL_VISIBILITY_CHANGED, this.onScrollVisibilityChanged.bind(this));
|
12999 | this.checkPageSize();
|
13000 | };
|
13001 | PaginationAutoPageSizeService.prototype.notActive = function () {
|
13002 | return !this.gridOptionsWrapper.isPaginationAutoPageSize();
|
13003 | };
|
13004 | PaginationAutoPageSizeService.prototype.onScrollVisibilityChanged = function () {
|
13005 | this.checkPageSize();
|
13006 | };
|
13007 | PaginationAutoPageSizeService.prototype.onBodyHeightChanged = function () {
|
13008 | this.checkPageSize();
|
13009 | };
|
13010 | PaginationAutoPageSizeService.prototype.checkPageSize = function () {
|
13011 | if (this.notActive()) {
|
13012 | return;
|
13013 | }
|
13014 | var rowHeight = this.gridOptionsWrapper.getRowHeightAsNumber();
|
13015 | var bodyHeight = this.gridPanel.getBodyHeight();
|
13016 | if (this.scrollVisibleService.isBodyHorizontalScrollShowing()) {
|
13017 | bodyHeight = bodyHeight - this.gridOptionsWrapper.getScrollbarWidth();
|
13018 | }
|
13019 | if (bodyHeight > 0) {
|
13020 | var newPageSize = Math.floor(bodyHeight / rowHeight);
|
13021 | this.gridOptionsWrapper.setProperty('paginationPageSize', newPageSize);
|
13022 | }
|
13023 | };
|
13024 | __decorate([
|
13025 | context_1.Autowired('eventService'),
|
13026 | __metadata("design:type", eventService_1.EventService)
|
13027 | ], PaginationAutoPageSizeService.prototype, "eventService", void 0);
|
13028 | __decorate([
|
13029 | context_1.Autowired('gridOptionsWrapper'),
|
13030 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
13031 | ], PaginationAutoPageSizeService.prototype, "gridOptionsWrapper", void 0);
|
13032 | __decorate([
|
13033 | context_1.Autowired('scrollVisibleService'),
|
13034 | __metadata("design:type", scrollVisibleService_1.ScrollVisibleService)
|
13035 | ], PaginationAutoPageSizeService.prototype, "scrollVisibleService", void 0);
|
13036 | PaginationAutoPageSizeService = __decorate([
|
13037 | context_1.Bean('paginationAutoPageSizeService')
|
13038 | ], PaginationAutoPageSizeService);
|
13039 | return PaginationAutoPageSizeService;
|
13040 | }(beanStub_1.BeanStub));
|
13041 | exports.PaginationAutoPageSizeService = PaginationAutoPageSizeService;
|
13042 | var PaginationProxy = (function (_super) {
|
13043 | __extends(PaginationProxy, _super);
|
13044 | function PaginationProxy() {
|
13045 | var _this = _super !== null && _super.apply(this, arguments) || this;
|
13046 | _this.currentPage = 0;
|
13047 | _this.topRowIndex = 0;
|
13048 | _this.bottomRowIndex = 0;
|
13049 | _this.pixelOffset = 0;
|
13050 | return _this;
|
13051 | }
|
13052 | PaginationProxy.prototype.postConstruct = function () {
|
13053 | this.active = this.gridOptionsWrapper.isPagination();
|
13054 | this.addDestroyableEventListener(this.eventService, events_1.Events.EVENT_MODEL_UPDATED, this.onModelUpdated.bind(this));
|
13055 | this.addDestroyableEventListener(this.gridOptionsWrapper, 'paginationPageSize', this.onModelUpdated.bind(this));
|
13056 | this.onModelUpdated();
|
13057 | };
|
13058 | PaginationProxy.prototype.isLastRowFound = function () {
|
13059 | return this.rowModel.isLastRowFound();
|
13060 | };
|
13061 | PaginationProxy.prototype.onModelUpdated = function (modelUpdatedEvent) {
|
13062 | this.setIndexesAndBounds();
|
13063 | var paginationChangedEvent = {
|
13064 | type: events_1.Events.EVENT_PAGINATION_CHANGED,
|
13065 | animate: modelUpdatedEvent ? modelUpdatedEvent.animate : false,
|
13066 | newData: modelUpdatedEvent ? modelUpdatedEvent.newData : false,
|
13067 | newPage: modelUpdatedEvent ? modelUpdatedEvent.newPage : false,
|
13068 | keepRenderedRows: modelUpdatedEvent ? modelUpdatedEvent.keepRenderedRows : false,
|
13069 | api: this.gridApi,
|
13070 | columnApi: this.columnApi
|
13071 | };
|
13072 | this.eventService.dispatchEvent(paginationChangedEvent);
|
13073 | };
|
13074 | PaginationProxy.prototype.goToPage = function (page) {
|
13075 | if (!this.active) {
|
13076 | return;
|
13077 | }
|
13078 | if (this.currentPage === page) {
|
13079 | return;
|
13080 | }
|
13081 | this.currentPage = page;
|
13082 | var event = {
|
13083 | type: events_1.Events.EVENT_MODEL_UPDATED,
|
13084 | animate: false,
|
13085 | keepRenderedRows: false,
|
13086 | newData: false,
|
13087 | newPage: true,
|
13088 | api: this.gridApi,
|
13089 | columnApi: this.columnApi
|
13090 | };
|
13091 | this.onModelUpdated(event);
|
13092 | };
|
13093 | PaginationProxy.prototype.getPixelOffset = function () {
|
13094 | return this.pixelOffset;
|
13095 | };
|
13096 | PaginationProxy.prototype.getRow = function (index) {
|
13097 | return this.rowModel.getRow(index);
|
13098 | };
|
13099 | PaginationProxy.prototype.getRowNode = function (id) {
|
13100 | return this.rowModel.getRowNode(id);
|
13101 | };
|
13102 | PaginationProxy.prototype.getRowIndexAtPixel = function (pixel) {
|
13103 | return this.rowModel.getRowIndexAtPixel(pixel);
|
13104 | };
|
13105 | PaginationProxy.prototype.getCurrentPageHeight = function () {
|
13106 | if (utils_1._.missing(this.topRowBounds) || utils_1._.missing(this.bottomRowBounds)) {
|
13107 | return 0;
|
13108 | }
|
13109 | return this.bottomRowBounds.rowTop + this.bottomRowBounds.rowHeight - this.topRowBounds.rowTop;
|
13110 | };
|
13111 | PaginationProxy.prototype.isRowPresent = function (rowNode) {
|
13112 | if (!this.rowModel.isRowPresent(rowNode)) {
|
13113 | return false;
|
13114 | }
|
13115 | var nodeIsInPage = rowNode.rowIndex >= this.topRowIndex && rowNode.rowIndex <= this.bottomRowIndex;
|
13116 | return nodeIsInPage;
|
13117 | };
|
13118 | PaginationProxy.prototype.isEmpty = function () {
|
13119 | return this.rowModel.isEmpty();
|
13120 | };
|
13121 | PaginationProxy.prototype.isRowsToRender = function () {
|
13122 | return this.rowModel.isRowsToRender();
|
13123 | };
|
13124 | PaginationProxy.prototype.getNodesInRangeForSelection = function (firstInRange, lastInRange) {
|
13125 | return this.rowModel.getNodesInRangeForSelection(firstInRange, lastInRange);
|
13126 | };
|
13127 | PaginationProxy.prototype.forEachNode = function (callback) {
|
13128 | return this.rowModel.forEachNode(callback);
|
13129 | };
|
13130 | PaginationProxy.prototype.getType = function () {
|
13131 | return this.rowModel.getType();
|
13132 | };
|
13133 | PaginationProxy.prototype.getRowBounds = function (index) {
|
13134 | return this.rowModel.getRowBounds(index);
|
13135 | };
|
13136 | PaginationProxy.prototype.getPageFirstRow = function () {
|
13137 | return this.pageSize * this.currentPage;
|
13138 | };
|
13139 | PaginationProxy.prototype.getPageLastRow = function () {
|
13140 | var totalLastRow = (this.pageSize * (this.currentPage + 1)) - 1;
|
13141 | var pageLastRow = this.rowModel.getPageLastRow();
|
13142 | if (pageLastRow > totalLastRow) {
|
13143 | return totalLastRow;
|
13144 | }
|
13145 | else {
|
13146 | return pageLastRow;
|
13147 | }
|
13148 | };
|
13149 | PaginationProxy.prototype.getRowCount = function () {
|
13150 | return this.rowModel.getRowCount();
|
13151 | };
|
13152 | PaginationProxy.prototype.goToPageWithIndex = function (index) {
|
13153 | if (!this.active) {
|
13154 | return;
|
13155 | }
|
13156 | var pageNumber = Math.floor(index / this.pageSize);
|
13157 | this.goToPage(pageNumber);
|
13158 | };
|
13159 | PaginationProxy.prototype.getTotalRowCount = function () {
|
13160 | return this.rowModel.getPageLastRow() + 1;
|
13161 | };
|
13162 | PaginationProxy.prototype.isLastPageFound = function () {
|
13163 | return this.rowModel.isLastRowFound();
|
13164 | };
|
13165 | PaginationProxy.prototype.getCurrentPage = function () {
|
13166 | return this.currentPage;
|
13167 | };
|
13168 | PaginationProxy.prototype.goToNextPage = function () {
|
13169 | this.goToPage(this.currentPage + 1);
|
13170 | };
|
13171 | PaginationProxy.prototype.goToPreviousPage = function () {
|
13172 | this.goToPage(this.currentPage - 1);
|
13173 | };
|
13174 | PaginationProxy.prototype.goToFirstPage = function () {
|
13175 | this.goToPage(0);
|
13176 | };
|
13177 | PaginationProxy.prototype.goToLastPage = function () {
|
13178 | var rowCount = this.rowModel.getPageLastRow() + 1;
|
13179 | var lastPage = Math.floor(rowCount / this.pageSize);
|
13180 | this.goToPage(lastPage);
|
13181 | };
|
13182 | PaginationProxy.prototype.getPageSize = function () {
|
13183 | return this.pageSize;
|
13184 | };
|
13185 | PaginationProxy.prototype.getTotalPages = function () {
|
13186 | return this.totalPages;
|
13187 | };
|
13188 | PaginationProxy.prototype.setPageSize = function () {
|
13189 |
|
13190 | this.pageSize = this.gridOptionsWrapper.getPaginationPageSize();
|
13191 | if (!(this.pageSize >= 1)) {
|
13192 | this.pageSize = 100;
|
13193 | }
|
13194 | };
|
13195 | PaginationProxy.prototype.setIndexesAndBounds = function () {
|
13196 | if (this.active) {
|
13197 | this.setPageSize();
|
13198 | var totalRowCount = this.getTotalRowCount();
|
13199 | this.totalPages = Math.floor((totalRowCount - 1) / this.pageSize) + 1;
|
13200 | if (this.currentPage >= this.totalPages) {
|
13201 | this.currentPage = this.totalPages - 1;
|
13202 | }
|
13203 | if (!utils_1._.isNumeric(this.currentPage) || this.currentPage < 0) {
|
13204 | this.currentPage = 0;
|
13205 | }
|
13206 | this.topRowIndex = this.pageSize * this.currentPage;
|
13207 | this.bottomRowIndex = (this.pageSize * (this.currentPage + 1)) - 1;
|
13208 | var maxRowAllowed = this.rowModel.getPageLastRow();
|
13209 | if (this.bottomRowIndex > maxRowAllowed) {
|
13210 | this.bottomRowIndex = maxRowAllowed;
|
13211 | }
|
13212 | }
|
13213 | else {
|
13214 | this.pageSize = this.rowModel.getPageLastRow() + 1;
|
13215 | this.totalPages = 1;
|
13216 | this.currentPage = 0;
|
13217 | this.topRowIndex = 0;
|
13218 | this.bottomRowIndex = this.rowModel.getPageLastRow();
|
13219 | }
|
13220 | this.topRowBounds = this.rowModel.getRowBounds(this.topRowIndex);
|
13221 | this.bottomRowBounds = this.rowModel.getRowBounds(this.bottomRowIndex);
|
13222 | this.pixelOffset = utils_1._.exists(this.topRowBounds) ? this.topRowBounds.rowTop : 0;
|
13223 | };
|
13224 | __decorate([
|
13225 | context_1.Autowired('rowModel'),
|
13226 | __metadata("design:type", Object)
|
13227 | ], PaginationProxy.prototype, "rowModel", void 0);
|
13228 | __decorate([
|
13229 | context_1.Autowired('eventService'),
|
13230 | __metadata("design:type", eventService_1.EventService)
|
13231 | ], PaginationProxy.prototype, "eventService", void 0);
|
13232 | __decorate([
|
13233 | context_1.Autowired('gridOptionsWrapper'),
|
13234 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
13235 | ], PaginationProxy.prototype, "gridOptionsWrapper", void 0);
|
13236 | __decorate([
|
13237 | context_1.Autowired('selectionController'),
|
13238 | __metadata("design:type", selectionController_1.SelectionController)
|
13239 | ], PaginationProxy.prototype, "selectionController", void 0);
|
13240 | __decorate([
|
13241 | context_1.Autowired('columnApi'),
|
13242 | __metadata("design:type", columnApi_1.ColumnApi)
|
13243 | ], PaginationProxy.prototype, "columnApi", void 0);
|
13244 | __decorate([
|
13245 | context_1.Autowired('gridApi'),
|
13246 | __metadata("design:type", gridApi_1.GridApi)
|
13247 | ], PaginationProxy.prototype, "gridApi", void 0);
|
13248 | __decorate([
|
13249 | context_1.PostConstruct,
|
13250 | __metadata("design:type", Function),
|
13251 | __metadata("design:paramtypes", []),
|
13252 | __metadata("design:returntype", void 0)
|
13253 | ], PaginationProxy.prototype, "postConstruct", null);
|
13254 | PaginationProxy = __decorate([
|
13255 | context_1.Bean('paginationProxy')
|
13256 | ], PaginationProxy);
|
13257 | return PaginationProxy;
|
13258 | }(beanStub_1.BeanStub));
|
13259 | exports.PaginationProxy = PaginationProxy;
|
13260 |
|
13261 |
|
13262 | }),
|
13263 |
|
13264 | (function(module, exports, __webpack_require__) {
|
13265 |
|
13266 | "use strict";
|
13267 |
|
13268 |
|
13269 |
|
13270 |
|
13271 |
|
13272 |
|
13273 |
|
13274 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
13275 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
13276 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
13277 | 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;
|
13278 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
13279 | };
|
13280 | var __metadata = (this && this.__metadata) || function (k, v) {
|
13281 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
13282 | };
|
13283 | Object.defineProperty(exports, "__esModule", { value: true });
|
13284 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
13285 | var rowNode_1 = __webpack_require__(16);
|
13286 | var context_1 = __webpack_require__(0);
|
13287 | var eventService_1 = __webpack_require__(3);
|
13288 | var context_2 = __webpack_require__(0);
|
13289 | var events_1 = __webpack_require__(5);
|
13290 | var context_3 = __webpack_require__(0);
|
13291 | var constants_1 = __webpack_require__(9);
|
13292 | var utils_1 = __webpack_require__(1);
|
13293 | var columnApi_1 = __webpack_require__(7);
|
13294 | var gridApi_1 = __webpack_require__(6);
|
13295 | var PinnedRowModel = (function () {
|
13296 | function PinnedRowModel() {
|
13297 | }
|
13298 | PinnedRowModel.prototype.init = function () {
|
13299 | this.setPinnedTopRowData(this.gridOptionsWrapper.getPinnedTopRowData());
|
13300 | this.setPinnedBottomRowData(this.gridOptionsWrapper.getPinnedBottomRowData());
|
13301 | };
|
13302 | PinnedRowModel.prototype.isEmpty = function (floating) {
|
13303 | var rows = floating === constants_1.Constants.PINNED_TOP ? this.pinnedTopRows : this.pinnedBottomRows;
|
13304 | return utils_1.Utils.missingOrEmpty(rows);
|
13305 | };
|
13306 | PinnedRowModel.prototype.isRowsToRender = function (floating) {
|
13307 | return !this.isEmpty(floating);
|
13308 | };
|
13309 | PinnedRowModel.prototype.getRowAtPixel = function (pixel, floating) {
|
13310 | var rows = floating === constants_1.Constants.PINNED_TOP ? this.pinnedTopRows : this.pinnedBottomRows;
|
13311 | if (utils_1.Utils.missingOrEmpty(rows)) {
|
13312 | return 0;
|
13313 | }
|
13314 | for (var i = 0; i < rows.length; i++) {
|
13315 | var rowNode = rows[i];
|
13316 | var rowTopPixel = rowNode.rowTop + rowNode.rowHeight - 1;
|
13317 |
|
13318 |
|
13319 | if (rowTopPixel >= pixel) {
|
13320 | return i;
|
13321 | }
|
13322 | }
|
13323 | return rows.length - 1;
|
13324 | };
|
13325 | PinnedRowModel.prototype.setPinnedTopRowData = function (rowData) {
|
13326 | this.pinnedTopRows = this.createNodesFromData(rowData, true);
|
13327 | var event = {
|
13328 | type: events_1.Events.EVENT_PINNED_ROW_DATA_CHANGED,
|
13329 | api: this.gridApi,
|
13330 | columnApi: this.columnApi
|
13331 | };
|
13332 | this.eventService.dispatchEvent(event);
|
13333 | };
|
13334 | PinnedRowModel.prototype.setPinnedBottomRowData = function (rowData) {
|
13335 | this.pinnedBottomRows = this.createNodesFromData(rowData, false);
|
13336 | var event = {
|
13337 | type: events_1.Events.EVENT_PINNED_ROW_DATA_CHANGED,
|
13338 | api: this.gridApi,
|
13339 | columnApi: this.columnApi
|
13340 | };
|
13341 | this.eventService.dispatchEvent(event);
|
13342 | };
|
13343 | PinnedRowModel.prototype.createNodesFromData = function (allData, isTop) {
|
13344 | var _this = this;
|
13345 | var rowNodes = [];
|
13346 | if (allData) {
|
13347 | var nextRowTop_1 = 0;
|
13348 | allData.forEach(function (dataItem, index) {
|
13349 | var rowNode = new rowNode_1.RowNode();
|
13350 | _this.context.wireBean(rowNode);
|
13351 | rowNode.data = dataItem;
|
13352 | rowNode.rowPinned = isTop ? constants_1.Constants.PINNED_TOP : constants_1.Constants.PINNED_BOTTOM;
|
13353 | rowNode.setRowTop(nextRowTop_1);
|
13354 | rowNode.setRowHeight(_this.gridOptionsWrapper.getRowHeightForNode(rowNode));
|
13355 | rowNode.setRowIndex(index);
|
13356 | nextRowTop_1 += rowNode.rowHeight;
|
13357 | rowNodes.push(rowNode);
|
13358 | });
|
13359 | }
|
13360 | return rowNodes;
|
13361 | };
|
13362 | PinnedRowModel.prototype.getPinnedTopRowData = function () {
|
13363 | return this.pinnedTopRows;
|
13364 | };
|
13365 | PinnedRowModel.prototype.getPinnedBottomRowData = function () {
|
13366 | return this.pinnedBottomRows;
|
13367 | };
|
13368 | PinnedRowModel.prototype.getPinnedTopTotalHeight = function () {
|
13369 | return this.getTotalHeight(this.pinnedTopRows);
|
13370 | };
|
13371 | PinnedRowModel.prototype.getPinnedTopRowCount = function () {
|
13372 | return this.pinnedTopRows ? this.pinnedTopRows.length : 0;
|
13373 | };
|
13374 | PinnedRowModel.prototype.getPinnedBottomRowCount = function () {
|
13375 | return this.pinnedBottomRows ? this.pinnedBottomRows.length : 0;
|
13376 | };
|
13377 | PinnedRowModel.prototype.getPinnedTopRow = function (index) {
|
13378 | return this.pinnedTopRows[index];
|
13379 | };
|
13380 | PinnedRowModel.prototype.getPinnedBottomRow = function (index) {
|
13381 | return this.pinnedBottomRows[index];
|
13382 | };
|
13383 | PinnedRowModel.prototype.forEachPinnedTopRow = function (callback) {
|
13384 | if (utils_1.Utils.missingOrEmpty(this.pinnedTopRows)) {
|
13385 | return;
|
13386 | }
|
13387 | this.pinnedTopRows.forEach(callback);
|
13388 | };
|
13389 | PinnedRowModel.prototype.forEachPinnedBottomRow = function (callback) {
|
13390 | if (utils_1.Utils.missingOrEmpty(this.pinnedBottomRows)) {
|
13391 | return;
|
13392 | }
|
13393 | this.pinnedBottomRows.forEach(callback);
|
13394 | };
|
13395 | PinnedRowModel.prototype.getPinnedBottomTotalHeight = function () {
|
13396 | return this.getTotalHeight(this.pinnedBottomRows);
|
13397 | };
|
13398 | PinnedRowModel.prototype.getTotalHeight = function (rowNodes) {
|
13399 | if (!rowNodes || rowNodes.length === 0) {
|
13400 | return 0;
|
13401 | }
|
13402 | else {
|
13403 | var lastNode = rowNodes[rowNodes.length - 1];
|
13404 | return lastNode.rowTop + lastNode.rowHeight;
|
13405 | }
|
13406 | };
|
13407 | __decorate([
|
13408 | context_2.Autowired('gridOptionsWrapper'),
|
13409 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
13410 | ], PinnedRowModel.prototype, "gridOptionsWrapper", void 0);
|
13411 | __decorate([
|
13412 | context_2.Autowired('eventService'),
|
13413 | __metadata("design:type", eventService_1.EventService)
|
13414 | ], PinnedRowModel.prototype, "eventService", void 0);
|
13415 | __decorate([
|
13416 | context_2.Autowired('context'),
|
13417 | __metadata("design:type", context_1.Context)
|
13418 | ], PinnedRowModel.prototype, "context", void 0);
|
13419 | __decorate([
|
13420 | context_2.Autowired('columnApi'),
|
13421 | __metadata("design:type", columnApi_1.ColumnApi)
|
13422 | ], PinnedRowModel.prototype, "columnApi", void 0);
|
13423 | __decorate([
|
13424 | context_2.Autowired('gridApi'),
|
13425 | __metadata("design:type", gridApi_1.GridApi)
|
13426 | ], PinnedRowModel.prototype, "gridApi", void 0);
|
13427 | __decorate([
|
13428 | context_3.PostConstruct,
|
13429 | __metadata("design:type", Function),
|
13430 | __metadata("design:paramtypes", []),
|
13431 | __metadata("design:returntype", void 0)
|
13432 | ], PinnedRowModel.prototype, "init", null);
|
13433 | PinnedRowModel = __decorate([
|
13434 | context_1.Bean('pinnedRowModel')
|
13435 | ], PinnedRowModel);
|
13436 | return PinnedRowModel;
|
13437 | }());
|
13438 | exports.PinnedRowModel = PinnedRowModel;
|
13439 |
|
13440 |
|
13441 | }),
|
13442 |
|
13443 | (function(module, exports, __webpack_require__) {
|
13444 |
|
13445 | "use strict";
|
13446 |
|
13447 |
|
13448 |
|
13449 |
|
13450 |
|
13451 |
|
13452 |
|
13453 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
13454 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
13455 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
13456 | 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;
|
13457 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
13458 | };
|
13459 | var __metadata = (this && this.__metadata) || function (k, v) {
|
13460 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
13461 | };
|
13462 | Object.defineProperty(exports, "__esModule", { value: true });
|
13463 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
13464 | var columnGroup_1 = __webpack_require__(26);
|
13465 | var originalColumnGroup_1 = __webpack_require__(32);
|
13466 | var context_1 = __webpack_require__(0);
|
13467 | var context_2 = __webpack_require__(0);
|
13468 |
|
13469 | var ColumnUtils = (function () {
|
13470 | function ColumnUtils() {
|
13471 | }
|
13472 | ColumnUtils.prototype.calculateColInitialWidth = function (colDef) {
|
13473 | if (!colDef.width) {
|
13474 |
|
13475 | return this.gridOptionsWrapper.getColWidth();
|
13476 | }
|
13477 | else if (colDef.width < this.gridOptionsWrapper.getMinColWidth()) {
|
13478 |
|
13479 | return this.gridOptionsWrapper.getMinColWidth();
|
13480 | }
|
13481 | else {
|
13482 |
|
13483 | return colDef.width;
|
13484 | }
|
13485 | };
|
13486 | ColumnUtils.prototype.getOriginalPathForColumn = function (column, originalBalancedTree) {
|
13487 | var result = [];
|
13488 | var found = false;
|
13489 | recursePath(originalBalancedTree, 0);
|
13490 |
|
13491 |
|
13492 | if (found) {
|
13493 | return result;
|
13494 | }
|
13495 | else {
|
13496 | return null;
|
13497 | }
|
13498 | function recursePath(balancedColumnTree, dept) {
|
13499 | for (var i = 0; i < balancedColumnTree.length; i++) {
|
13500 | if (found) {
|
13501 |
|
13502 | return;
|
13503 | }
|
13504 | var node = balancedColumnTree[i];
|
13505 | if (node instanceof originalColumnGroup_1.OriginalColumnGroup) {
|
13506 | var nextNode = node;
|
13507 | recursePath(nextNode.getChildren(), dept + 1);
|
13508 | result[dept] = node;
|
13509 | }
|
13510 | else {
|
13511 | if (node === column) {
|
13512 | found = true;
|
13513 | }
|
13514 | }
|
13515 | }
|
13516 | }
|
13517 | };
|
13518 | |
13519 |
|
13520 |
|
13521 |
|
13522 |
|
13523 |
|
13524 |
|
13525 |
|
13526 |
|
13527 |
|
13528 |
|
13529 |
|
13530 |
|
13531 |
|
13532 |
|
13533 |
|
13534 |
|
13535 |
|
13536 |
|
13537 |
|
13538 |
|
13539 |
|
13540 |
|
13541 |
|
13542 |
|
13543 |
|
13544 |
|
13545 |
|
13546 |
|
13547 |
|
13548 |
|
13549 |
|
13550 |
|
13551 |
|
13552 | ColumnUtils.prototype.depthFirstOriginalTreeSearch = function (tree, callback) {
|
13553 | var _this = this;
|
13554 | if (!tree) {
|
13555 | return;
|
13556 | }
|
13557 | tree.forEach(function (child) {
|
13558 | if (child instanceof originalColumnGroup_1.OriginalColumnGroup) {
|
13559 | _this.depthFirstOriginalTreeSearch(child.getChildren(), callback);
|
13560 | }
|
13561 | callback(child);
|
13562 | });
|
13563 | };
|
13564 | ColumnUtils.prototype.depthFirstAllColumnTreeSearch = function (tree, callback) {
|
13565 | var _this = this;
|
13566 | if (!tree) {
|
13567 | return;
|
13568 | }
|
13569 | tree.forEach(function (child) {
|
13570 | if (child instanceof columnGroup_1.ColumnGroup) {
|
13571 | _this.depthFirstAllColumnTreeSearch(child.getChildren(), callback);
|
13572 | }
|
13573 | callback(child);
|
13574 | });
|
13575 | };
|
13576 | ColumnUtils.prototype.depthFirstDisplayedColumnTreeSearch = function (tree, callback) {
|
13577 | var _this = this;
|
13578 | if (!tree) {
|
13579 | return;
|
13580 | }
|
13581 | tree.forEach(function (child) {
|
13582 | if (child instanceof columnGroup_1.ColumnGroup) {
|
13583 | _this.depthFirstDisplayedColumnTreeSearch(child.getDisplayedChildren(), callback);
|
13584 | }
|
13585 | callback(child);
|
13586 | });
|
13587 | };
|
13588 | __decorate([
|
13589 | context_2.Autowired('gridOptionsWrapper'),
|
13590 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
13591 | ], ColumnUtils.prototype, "gridOptionsWrapper", void 0);
|
13592 | ColumnUtils = __decorate([
|
13593 | context_1.Bean('columnUtils')
|
13594 | ], ColumnUtils);
|
13595 | return ColumnUtils;
|
13596 | }());
|
13597 | exports.ColumnUtils = ColumnUtils;
|
13598 |
|
13599 |
|
13600 | }),
|
13601 |
|
13602 | (function(module, exports, __webpack_require__) {
|
13603 |
|
13604 | "use strict";
|
13605 |
|
13606 |
|
13607 |
|
13608 |
|
13609 |
|
13610 |
|
13611 |
|
13612 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
13613 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
13614 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
13615 | 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;
|
13616 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
13617 | };
|
13618 | var __metadata = (this && this.__metadata) || function (k, v) {
|
13619 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
13620 | };
|
13621 | Object.defineProperty(exports, "__esModule", { value: true });
|
13622 | var columnGroup_1 = __webpack_require__(26);
|
13623 | var column_1 = __webpack_require__(10);
|
13624 | var eventService_1 = __webpack_require__(3);
|
13625 | var context_1 = __webpack_require__(0);
|
13626 | var columnApi_1 = __webpack_require__(7);
|
13627 | var gridApi_1 = __webpack_require__(6);
|
13628 | var OriginalColumnGroup = (function () {
|
13629 | function OriginalColumnGroup(colGroupDef, groupId, padding, level) {
|
13630 | this.localEventService = new eventService_1.EventService();
|
13631 | this.expandable = false;
|
13632 | this.colGroupDef = colGroupDef;
|
13633 | this.groupId = groupId;
|
13634 | this.expanded = colGroupDef && !!colGroupDef.openByDefault;
|
13635 | this.padding = padding;
|
13636 | this.level = level;
|
13637 | }
|
13638 | OriginalColumnGroup.prototype.getLevel = function () {
|
13639 | return this.level;
|
13640 | };
|
13641 | OriginalColumnGroup.prototype.isVisible = function () {
|
13642 |
|
13643 | if (this.children) {
|
13644 | return this.children.some(function (child) { return child.isVisible(); });
|
13645 | }
|
13646 | else {
|
13647 | return false;
|
13648 | }
|
13649 | };
|
13650 | OriginalColumnGroup.prototype.isPadding = function () {
|
13651 | return this.padding;
|
13652 | };
|
13653 | OriginalColumnGroup.prototype.setExpanded = function (expanded) {
|
13654 | this.expanded = expanded;
|
13655 | var event = {
|
13656 | type: OriginalColumnGroup.EVENT_EXPANDED_CHANGED
|
13657 | };
|
13658 | this.localEventService.dispatchEvent(event);
|
13659 | };
|
13660 | OriginalColumnGroup.prototype.isExpandable = function () {
|
13661 | return this.expandable;
|
13662 | };
|
13663 | OriginalColumnGroup.prototype.isExpanded = function () {
|
13664 | return this.expanded;
|
13665 | };
|
13666 | OriginalColumnGroup.prototype.getGroupId = function () {
|
13667 | return this.groupId;
|
13668 | };
|
13669 | OriginalColumnGroup.prototype.getId = function () {
|
13670 | return this.getGroupId();
|
13671 | };
|
13672 | OriginalColumnGroup.prototype.setChildren = function (children) {
|
13673 | this.children = children;
|
13674 | };
|
13675 | OriginalColumnGroup.prototype.getChildren = function () {
|
13676 | return this.children;
|
13677 | };
|
13678 | OriginalColumnGroup.prototype.getColGroupDef = function () {
|
13679 | return this.colGroupDef;
|
13680 | };
|
13681 | OriginalColumnGroup.prototype.getLeafColumns = function () {
|
13682 | var result = [];
|
13683 | this.addLeafColumns(result);
|
13684 | return result;
|
13685 | };
|
13686 | OriginalColumnGroup.prototype.addLeafColumns = function (leafColumns) {
|
13687 | if (!this.children) {
|
13688 | return;
|
13689 | }
|
13690 | this.children.forEach(function (child) {
|
13691 | if (child instanceof column_1.Column) {
|
13692 | leafColumns.push(child);
|
13693 | }
|
13694 | else if (child instanceof OriginalColumnGroup) {
|
13695 | child.addLeafColumns(leafColumns);
|
13696 | }
|
13697 | });
|
13698 | };
|
13699 | OriginalColumnGroup.prototype.getColumnGroupShow = function () {
|
13700 | if (!this.padding) {
|
13701 | return this.colGroupDef.columnGroupShow;
|
13702 | }
|
13703 | else {
|
13704 |
|
13705 |
|
13706 |
|
13707 | return this.children[0].getColumnGroupShow();
|
13708 | }
|
13709 | };
|
13710 |
|
13711 |
|
13712 | OriginalColumnGroup.prototype.setupExpandable = function () {
|
13713 | var _this = this;
|
13714 | this.setExpandable();
|
13715 |
|
13716 | this.getLeafColumns().forEach(function (col) { return col.addEventListener(column_1.Column.EVENT_VISIBLE_CHANGED, _this.onColumnVisibilityChanged.bind(_this)); });
|
13717 | };
|
13718 | OriginalColumnGroup.prototype.setExpandable = function () {
|
13719 |
|
13720 | var atLeastOneShowingWhenOpen = false;
|
13721 |
|
13722 | var atLeastOneShowingWhenClosed = false;
|
13723 |
|
13724 | var atLeastOneChangeable = false;
|
13725 | for (var i = 0, j = this.children.length; i < j; i++) {
|
13726 | var abstractColumn = this.children[i];
|
13727 | if (!abstractColumn.isVisible()) {
|
13728 | continue;
|
13729 | }
|
13730 |
|
13731 | var headerGroupShow = abstractColumn.getColumnGroupShow();
|
13732 | if (headerGroupShow === columnGroup_1.ColumnGroup.HEADER_GROUP_SHOW_OPEN) {
|
13733 | atLeastOneShowingWhenOpen = true;
|
13734 | atLeastOneChangeable = true;
|
13735 | }
|
13736 | else if (headerGroupShow === columnGroup_1.ColumnGroup.HEADER_GROUP_SHOW_CLOSED) {
|
13737 | atLeastOneShowingWhenClosed = true;
|
13738 | atLeastOneChangeable = true;
|
13739 | }
|
13740 | else {
|
13741 | atLeastOneShowingWhenOpen = true;
|
13742 | atLeastOneShowingWhenClosed = true;
|
13743 | }
|
13744 | }
|
13745 | var expandable = atLeastOneShowingWhenOpen && atLeastOneShowingWhenClosed && atLeastOneChangeable;
|
13746 | if (this.expandable !== expandable) {
|
13747 | this.expandable = expandable;
|
13748 | var event_1 = {
|
13749 | type: OriginalColumnGroup.EVENT_EXPANDABLE_CHANGED
|
13750 | };
|
13751 | this.localEventService.dispatchEvent(event_1);
|
13752 | }
|
13753 | };
|
13754 | OriginalColumnGroup.prototype.onColumnVisibilityChanged = function () {
|
13755 | this.setExpandable();
|
13756 | };
|
13757 | OriginalColumnGroup.prototype.addEventListener = function (eventType, listener) {
|
13758 | this.localEventService.addEventListener(eventType, listener);
|
13759 | };
|
13760 | OriginalColumnGroup.prototype.removeEventListener = function (eventType, listener) {
|
13761 | this.localEventService.removeEventListener(eventType, listener);
|
13762 | };
|
13763 | OriginalColumnGroup.EVENT_EXPANDED_CHANGED = 'expandedChanged';
|
13764 | OriginalColumnGroup.EVENT_EXPANDABLE_CHANGED = 'expandableChanged';
|
13765 | __decorate([
|
13766 | context_1.Autowired('columnApi'),
|
13767 | __metadata("design:type", columnApi_1.ColumnApi)
|
13768 | ], OriginalColumnGroup.prototype, "columnApi", void 0);
|
13769 | __decorate([
|
13770 | context_1.Autowired('gridApi'),
|
13771 | __metadata("design:type", gridApi_1.GridApi)
|
13772 | ], OriginalColumnGroup.prototype, "gridApi", void 0);
|
13773 | return OriginalColumnGroup;
|
13774 | }());
|
13775 | exports.OriginalColumnGroup = OriginalColumnGroup;
|
13776 |
|
13777 |
|
13778 | }),
|
13779 |
|
13780 | (function(module, exports, __webpack_require__) {
|
13781 |
|
13782 | "use strict";
|
13783 |
|
13784 |
|
13785 |
|
13786 |
|
13787 |
|
13788 |
|
13789 |
|
13790 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
13791 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
13792 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
13793 | 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;
|
13794 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
13795 | };
|
13796 | var __metadata = (this && this.__metadata) || function (k, v) {
|
13797 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
13798 | };
|
13799 | Object.defineProperty(exports, "__esModule", { value: true });
|
13800 | var context_1 = __webpack_require__(0);
|
13801 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
13802 | var ValueCache = (function () {
|
13803 | function ValueCache() {
|
13804 | this.cacheVersion = 0;
|
13805 | }
|
13806 | ValueCache.prototype.init = function () {
|
13807 | this.active = this.gridOptionsWrapper.isValueCache();
|
13808 | this.neverExpires = this.gridOptionsWrapper.isValueCacheNeverExpires();
|
13809 | };
|
13810 | ValueCache.prototype.onDataChanged = function () {
|
13811 | if (this.neverExpires) {
|
13812 | return;
|
13813 | }
|
13814 | this.expire();
|
13815 | };
|
13816 | ValueCache.prototype.expire = function () {
|
13817 | this.cacheVersion++;
|
13818 | };
|
13819 | ValueCache.prototype.setValue = function (rowNode, colId, value) {
|
13820 | if (this.active) {
|
13821 | if (rowNode.__cacheVersion !== this.cacheVersion) {
|
13822 | rowNode.__cacheVersion = this.cacheVersion;
|
13823 | rowNode.__cacheData = {};
|
13824 | }
|
13825 | rowNode.__cacheData[colId] = value;
|
13826 | }
|
13827 | };
|
13828 | ValueCache.prototype.getValue = function (rowNode, colId) {
|
13829 | var valueInCache = this.active
|
13830 | && rowNode.__cacheVersion === this.cacheVersion
|
13831 | && rowNode.__cacheData[colId] !== undefined;
|
13832 | if (valueInCache) {
|
13833 | return rowNode.__cacheData[colId];
|
13834 | }
|
13835 | else {
|
13836 | return undefined;
|
13837 | }
|
13838 | };
|
13839 | __decorate([
|
13840 | context_1.Autowired('gridOptionsWrapper'),
|
13841 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
13842 | ], ValueCache.prototype, "gridOptionsWrapper", void 0);
|
13843 | __decorate([
|
13844 | context_1.PostConstruct,
|
13845 | __metadata("design:type", Function),
|
13846 | __metadata("design:paramtypes", []),
|
13847 | __metadata("design:returntype", void 0)
|
13848 | ], ValueCache.prototype, "init", null);
|
13849 | ValueCache = __decorate([
|
13850 | context_1.Bean('valueCache')
|
13851 | ], ValueCache);
|
13852 | return ValueCache;
|
13853 | }());
|
13854 | exports.ValueCache = ValueCache;
|
13855 |
|
13856 |
|
13857 | }),
|
13858 |
|
13859 | (function(module, exports, __webpack_require__) {
|
13860 |
|
13861 | "use strict";
|
13862 |
|
13863 |
|
13864 |
|
13865 |
|
13866 |
|
13867 |
|
13868 |
|
13869 | var __extends = (this && this.__extends) || (function () {
|
13870 | var extendStatics = Object.setPrototypeOf ||
|
13871 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
13872 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
13873 | return function (d, b) {
|
13874 | extendStatics(d, b);
|
13875 | function __() { this.constructor = d; }
|
13876 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
13877 | };
|
13878 | })();
|
13879 | Object.defineProperty(exports, "__esModule", { value: true });
|
13880 | var utils_1 = __webpack_require__(1);
|
13881 | var column_1 = __webpack_require__(10);
|
13882 | var rowNode_1 = __webpack_require__(16);
|
13883 | var constants_1 = __webpack_require__(9);
|
13884 | var events_1 = __webpack_require__(5);
|
13885 | var gridCell_1 = __webpack_require__(23);
|
13886 | var component_1 = __webpack_require__(8);
|
13887 | var checkboxSelectionComponent_1 = __webpack_require__(65);
|
13888 | var rowDragComp_1 = __webpack_require__(122);
|
13889 | var CellComp = (function (_super) {
|
13890 | __extends(CellComp, _super);
|
13891 | function CellComp(scope, beans, column, rowNode, rowComp, autoHeightCell) {
|
13892 | var _this = _super.call(this) || this;
|
13893 | _this.editingCell = false;
|
13894 |
|
13895 |
|
13896 |
|
13897 |
|
13898 |
|
13899 |
|
13900 | _this.cellEditorVersion = 0;
|
13901 | _this.cellRendererVersion = 0;
|
13902 | _this.scope = scope;
|
13903 | _this.beans = beans;
|
13904 | _this.column = column;
|
13905 | _this.rowNode = rowNode;
|
13906 | _this.rowComp = rowComp;
|
13907 | _this.autoHeightCell = autoHeightCell;
|
13908 | _this.createGridCellVo();
|
13909 | _this.rangeSelectionEnabled = beans.enterprise && beans.gridOptionsWrapper.isEnableRangeSelection();
|
13910 | _this.cellFocused = _this.beans.focusedCellController.isCellFocused(_this.gridCell);
|
13911 | _this.firstRightPinned = _this.column.isFirstRightPinned();
|
13912 | _this.lastLeftPinned = _this.column.isLastLeftPinned();
|
13913 | if (_this.rangeSelectionEnabled) {
|
13914 | _this.rangeCount = _this.beans.rangeController.getCellRangeCount(_this.gridCell);
|
13915 | }
|
13916 | _this.getValueAndFormat();
|
13917 | _this.setUsingWrapper();
|
13918 | _this.chooseCellRenderer();
|
13919 | _this.setupColSpan();
|
13920 | _this.rowSpan = _this.column.getRowSpan(_this.rowNode);
|
13921 | return _this;
|
13922 | }
|
13923 | CellComp.prototype.getCreateTemplate = function () {
|
13924 | var templateParts = [];
|
13925 | var col = this.column;
|
13926 | var width = this.getCellWidth();
|
13927 | var left = col.getLeft();
|
13928 | var valueToRender = this.getInitialValueToRender();
|
13929 | var valueSanitised = utils_1._.get(this.column, 'colDef.template', null) ? valueToRender : utils_1._.escape(valueToRender);
|
13930 | this.tooltip = this.getToolTip();
|
13931 | var tooltipSanitised = utils_1._.escape(this.tooltip);
|
13932 | var colIdSanitised = utils_1._.escape(col.getId());
|
13933 | var wrapperStartTemplate;
|
13934 | var wrapperEndTemplate;
|
13935 | var stylesFromColDef = this.preProcessStylesFromColDef();
|
13936 | var cssClasses = this.getInitialCssClasses();
|
13937 | var stylesForRowSpanning = this.getStylesForRowSpanning();
|
13938 | if (this.usingWrapper) {
|
13939 | wrapperStartTemplate = '<span ref="eCellWrapper" class="ag-cell-wrapper"><span ref="eCellValue" class="ag-cell-value">';
|
13940 | wrapperEndTemplate = '</span></span>';
|
13941 | }
|
13942 |
|
13943 | templateParts.push("<div");
|
13944 | templateParts.push(" tabindex=\"-1\"");
|
13945 | templateParts.push(" role=\"gridcell\"");
|
13946 | templateParts.push(" comp-id=\"" + this.getCompId() + "\" ");
|
13947 | templateParts.push(" col-id=\"" + colIdSanitised + "\"");
|
13948 | templateParts.push(" class=\"" + cssClasses.join(' ') + "\"");
|
13949 | templateParts.push(tooltipSanitised ? " title=\"" + tooltipSanitised + "\"" : "");
|
13950 | templateParts.push(" style=\"width: " + width + "px; left: " + left + "px; " + stylesFromColDef + " " + stylesForRowSpanning + "\" >");
|
13951 | templateParts.push(wrapperStartTemplate);
|
13952 | templateParts.push(valueSanitised);
|
13953 | templateParts.push(wrapperEndTemplate);
|
13954 | templateParts.push("</div>");
|
13955 | return templateParts.join('');
|
13956 | };
|
13957 | CellComp.prototype.getStylesForRowSpanning = function () {
|
13958 | if (this.rowSpan === 1) {
|
13959 | return '';
|
13960 | }
|
13961 | var singleRowHeight = this.beans.gridOptionsWrapper.getRowHeightAsNumber();
|
13962 | var totalRowHeight = singleRowHeight * this.rowSpan;
|
13963 | return "height: " + totalRowHeight + "px; z-index: 1;";
|
13964 | };
|
13965 | CellComp.prototype.afterAttached = function () {
|
13966 | var querySelector = "[comp-id=\"" + this.getCompId() + "\"]";
|
13967 | var eGui = this.eParentRow.querySelector(querySelector);
|
13968 | this.setGui(eGui);
|
13969 |
|
13970 | this.addDomData();
|
13971 | this.populateTemplate();
|
13972 | this.attachCellRenderer();
|
13973 | this.angular1Compile();
|
13974 | this.addDestroyableEventListener(this.beans.eventService, events_1.Events.EVENT_CELL_FOCUSED, this.onCellFocused.bind(this));
|
13975 | this.addDestroyableEventListener(this.beans.eventService, events_1.Events.EVENT_FLASH_CELLS, this.onFlashCells.bind(this));
|
13976 | this.addDestroyableEventListener(this.beans.eventService, events_1.Events.EVENT_COLUMN_HOVER_CHANGED, this.onColumnHover.bind(this));
|
13977 | this.addDestroyableEventListener(this.rowNode, rowNode_1.RowNode.EVENT_ROW_INDEX_CHANGED, this.onRowIndexChanged.bind(this));
|
13978 | this.addDestroyableEventListener(this.rowNode, rowNode_1.RowNode.EVENT_CELL_CHANGED, this.onCellChanged.bind(this));
|
13979 | this.addDestroyableEventListener(this.column, column_1.Column.EVENT_LEFT_CHANGED, this.onLeftChanged.bind(this));
|
13980 | this.addDestroyableEventListener(this.column, column_1.Column.EVENT_WIDTH_CHANGED, this.onWidthChanged.bind(this));
|
13981 | this.addDestroyableEventListener(this.column, column_1.Column.EVENT_FIRST_RIGHT_PINNED_CHANGED, this.onFirstRightPinnedChanged.bind(this));
|
13982 | this.addDestroyableEventListener(this.column, column_1.Column.EVENT_LAST_LEFT_PINNED_CHANGED, this.onLastLeftPinnedChanged.bind(this));
|
13983 |
|
13984 |
|
13985 | if (this.rangeSelectionEnabled) {
|
13986 | this.addDestroyableEventListener(this.beans.eventService, events_1.Events.EVENT_RANGE_SELECTION_CHANGED, this.onRangeSelectionChanged.bind(this));
|
13987 | }
|
13988 | };
|
13989 | CellComp.prototype.onColumnHover = function () {
|
13990 | var isHovered = this.beans.columnHoverService.isHovered(this.column);
|
13991 | utils_1._.addOrRemoveCssClass(this.getGui(), 'ag-column-hover', isHovered);
|
13992 | };
|
13993 | CellComp.prototype.onCellChanged = function (event) {
|
13994 | var eventImpactsThisCell = event.column === this.column;
|
13995 | if (eventImpactsThisCell) {
|
13996 | this.refreshCell({});
|
13997 | }
|
13998 | };
|
13999 | CellComp.prototype.getCellLeft = function () {
|
14000 | var mostLeftCol;
|
14001 | if (this.beans.gridOptionsWrapper.isEnableRtl() && this.colsSpanning) {
|
14002 | mostLeftCol = this.colsSpanning[this.colsSpanning.length - 1];
|
14003 | }
|
14004 | else {
|
14005 | mostLeftCol = this.column;
|
14006 | }
|
14007 | return mostLeftCol.getLeft();
|
14008 | };
|
14009 | CellComp.prototype.getCellWidth = function () {
|
14010 | if (this.colsSpanning) {
|
14011 | var result_1 = 0;
|
14012 | this.colsSpanning.forEach(function (col) { return result_1 += col.getActualWidth(); });
|
14013 | return result_1;
|
14014 | }
|
14015 | else {
|
14016 | return this.column.getActualWidth();
|
14017 | }
|
14018 | };
|
14019 | CellComp.prototype.onFlashCells = function (event) {
|
14020 | var cellId = this.gridCell.createId();
|
14021 | var shouldFlash = event.cells[cellId];
|
14022 | if (shouldFlash) {
|
14023 | this.animateCell('highlight');
|
14024 | }
|
14025 | };
|
14026 | CellComp.prototype.setupColSpan = function () {
|
14027 |
|
14028 | if (utils_1._.missing(this.column.getColDef().colSpan)) {
|
14029 | return;
|
14030 | }
|
14031 |
|
14032 | this.addDestroyableEventListener(this.beans.eventService, events_1.Events.EVENT_DISPLAYED_COLUMNS_CHANGED, this.onDisplayColumnsChanged.bind(this));
|
14033 |
|
14034 |
|
14035 |
|
14036 |
|
14037 | this.addDestroyableEventListener(this.beans.eventService, events_1.Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED, this.onWidthChanged.bind(this));
|
14038 | this.colsSpanning = this.getColSpanningList();
|
14039 | };
|
14040 | CellComp.prototype.getColSpanningList = function () {
|
14041 | var colSpan = this.column.getColSpan(this.rowNode);
|
14042 | var colsSpanning = [];
|
14043 |
|
14044 | if (colSpan === 1) {
|
14045 | colsSpanning.push(this.column);
|
14046 | }
|
14047 | else {
|
14048 | var pointer = this.column;
|
14049 | var pinned = this.column.getPinned();
|
14050 | for (var i = 0; i < colSpan; i++) {
|
14051 | colsSpanning.push(pointer);
|
14052 | pointer = this.beans.columnController.getDisplayedColAfter(pointer);
|
14053 | if (utils_1._.missing(pointer)) {
|
14054 | break;
|
14055 | }
|
14056 |
|
14057 | if (pinned !== pointer.getPinned()) {
|
14058 | break;
|
14059 | }
|
14060 | }
|
14061 | }
|
14062 | return colsSpanning;
|
14063 | };
|
14064 | CellComp.prototype.onDisplayColumnsChanged = function () {
|
14065 | var colsSpanning = this.getColSpanningList();
|
14066 | if (!utils_1._.compareArrays(this.colsSpanning, colsSpanning)) {
|
14067 | this.colsSpanning = colsSpanning;
|
14068 | this.onWidthChanged();
|
14069 | this.onLeftChanged();
|
14070 | }
|
14071 | };
|
14072 | CellComp.prototype.getInitialCssClasses = function () {
|
14073 | var cssClasses = ["ag-cell", "ag-cell-not-inline-editing"];
|
14074 |
|
14075 |
|
14076 | if (!this.autoHeightCell) {
|
14077 | cssClasses.push('ag-cell-with-height');
|
14078 | }
|
14079 | var doingFocusCss = !this.beans.gridOptionsWrapper.isSuppressCellSelection();
|
14080 | if (doingFocusCss) {
|
14081 |
|
14082 | cssClasses.push(this.cellFocused ? 'ag-cell-focus' : 'ag-cell-no-focus');
|
14083 | }
|
14084 | else {
|
14085 |
|
14086 | cssClasses.push('ag-cell-no-focus');
|
14087 | }
|
14088 | if (this.firstRightPinned) {
|
14089 | cssClasses.push('ag-cell-first-right-pinned');
|
14090 | }
|
14091 | if (this.lastLeftPinned) {
|
14092 | cssClasses.push('ag-cell-last-left-pinned');
|
14093 | }
|
14094 | if (this.beans.columnHoverService.isHovered(this.column)) {
|
14095 | cssClasses.push('ag-column-hover');
|
14096 | }
|
14097 | utils_1._.pushAll(cssClasses, this.preProcessClassesFromColDef());
|
14098 | utils_1._.pushAll(cssClasses, this.preProcessCellClassRules());
|
14099 | utils_1._.pushAll(cssClasses, this.getRangeClasses());
|
14100 |
|
14101 | if (!this.usingWrapper) {
|
14102 | cssClasses.push('ag-cell-value');
|
14103 | }
|
14104 | return cssClasses;
|
14105 | };
|
14106 | CellComp.prototype.getInitialValueToRender = function () {
|
14107 |
|
14108 | if (this.usingCellRenderer) {
|
14109 | if (typeof this.cellRendererGui === 'string') {
|
14110 | return this.cellRendererGui;
|
14111 | }
|
14112 | else {
|
14113 | return '';
|
14114 | }
|
14115 | }
|
14116 | var colDef = this.column.getColDef();
|
14117 | if (colDef.template) {
|
14118 |
|
14119 |
|
14120 | return colDef.template;
|
14121 | }
|
14122 | else if (colDef.templateUrl) {
|
14123 |
|
14124 |
|
14125 |
|
14126 | var template = this.beans.templateService.getTemplate(colDef.templateUrl, this.refreshCell.bind(this, true));
|
14127 | if (template) {
|
14128 | return template;
|
14129 | }
|
14130 | else {
|
14131 | return '';
|
14132 | }
|
14133 | }
|
14134 | else {
|
14135 | return this.getValueToUse();
|
14136 | }
|
14137 | };
|
14138 | CellComp.prototype.getRenderedRow = function () {
|
14139 | return this.rowComp;
|
14140 | };
|
14141 | CellComp.prototype.isSuppressNavigable = function () {
|
14142 | return this.column.isSuppressNavigable(this.rowNode);
|
14143 | };
|
14144 | CellComp.prototype.getCellRenderer = function () {
|
14145 | return this.cellRenderer;
|
14146 | };
|
14147 | CellComp.prototype.getCellEditor = function () {
|
14148 | return this.cellEditor;
|
14149 | };
|
14150 |
|
14151 |
|
14152 |
|
14153 |
|
14154 |
|
14155 |
|
14156 | CellComp.prototype.refreshCell = function (params) {
|
14157 | if (this.editingCell) {
|
14158 | return;
|
14159 | }
|
14160 | var newData = params && params.newData;
|
14161 | var suppressFlash = (params && params.suppressFlash) || this.column.getColDef().suppressCellFlash;
|
14162 | var forceRefresh = params && params.forceRefresh;
|
14163 | var oldValue = this.value;
|
14164 | this.getValueAndFormat();
|
14165 |
|
14166 |
|
14167 |
|
14168 | var valuesDifferent = !this.valuesAreEqual(oldValue, this.value);
|
14169 | var dataNeedsUpdating = forceRefresh || valuesDifferent;
|
14170 | if (dataNeedsUpdating) {
|
14171 | var cellRendererRefreshed = void 0;
|
14172 |
|
14173 |
|
14174 |
|
14175 | if (newData || suppressFlash) {
|
14176 | cellRendererRefreshed = false;
|
14177 | }
|
14178 | else {
|
14179 | cellRendererRefreshed = this.attemptCellRendererRefresh();
|
14180 | }
|
14181 |
|
14182 |
|
14183 |
|
14184 | if (!cellRendererRefreshed) {
|
14185 | this.replaceContentsAfterRefresh();
|
14186 | }
|
14187 | if (!suppressFlash) {
|
14188 | var flashCell = this.beans.gridOptionsWrapper.isEnableCellChangeFlash()
|
14189 | || this.column.getColDef().enableCellChangeFlash;
|
14190 | if (flashCell) {
|
14191 | this.flashCell();
|
14192 | }
|
14193 | }
|
14194 |
|
14195 | this.postProcessStylesFromColDef();
|
14196 | this.postProcessClassesFromColDef();
|
14197 | }
|
14198 | this.refreshToolTip();
|
14199 |
|
14200 |
|
14201 | this.postProcessCellClassRules();
|
14202 | };
|
14203 |
|
14204 | CellComp.prototype.flashCell = function () {
|
14205 | this.animateCell('data-changed');
|
14206 | };
|
14207 | CellComp.prototype.animateCell = function (cssName) {
|
14208 | var fullName = 'ag-cell-' + cssName;
|
14209 | var animationFullName = 'ag-cell-' + cssName + '-animation';
|
14210 | var element = this.getGui();
|
14211 |
|
14212 | utils_1._.addCssClass(element, fullName);
|
14213 | utils_1._.removeCssClass(element, animationFullName);
|
14214 |
|
14215 | setTimeout(function () {
|
14216 | utils_1._.removeCssClass(element, fullName);
|
14217 | utils_1._.addCssClass(element, animationFullName);
|
14218 | setTimeout(function () {
|
14219 |
|
14220 | utils_1._.removeCssClass(element, animationFullName);
|
14221 | }, 1000);
|
14222 | }, 500);
|
14223 | };
|
14224 | CellComp.prototype.replaceContentsAfterRefresh = function () {
|
14225 |
|
14226 | utils_1._.removeAllChildren(this.eParentOfValue);
|
14227 |
|
14228 | if (this.cellRenderer && this.cellRenderer.destroy) {
|
14229 | this.cellRenderer.destroy();
|
14230 | }
|
14231 | this.cellRenderer = null;
|
14232 | this.cellRendererGui = null;
|
14233 |
|
14234 | this.putDataIntoCellAfterRefresh();
|
14235 | this.angular1Compile();
|
14236 | };
|
14237 | CellComp.prototype.angular1Compile = function () {
|
14238 |
|
14239 | if (this.beans.gridOptionsWrapper.isAngularCompileRows()) {
|
14240 | var eGui = this.getGui();
|
14241 | var compiledElement_1 = this.beans.$compile(eGui)(this.scope);
|
14242 | this.addDestroyFunc(function () {
|
14243 | compiledElement_1.remove();
|
14244 | });
|
14245 | }
|
14246 | };
|
14247 | CellComp.prototype.postProcessStylesFromColDef = function () {
|
14248 | var stylesToUse = this.processStylesFromColDef();
|
14249 | if (stylesToUse) {
|
14250 | utils_1._.addStylesToElement(this.getGui(), stylesToUse);
|
14251 | }
|
14252 | };
|
14253 | CellComp.prototype.preProcessStylesFromColDef = function () {
|
14254 | var stylesToUse = this.processStylesFromColDef();
|
14255 | return utils_1._.cssStyleObjectToMarkup(stylesToUse);
|
14256 | };
|
14257 | CellComp.prototype.processStylesFromColDef = function () {
|
14258 | var colDef = this.column.getColDef();
|
14259 | if (colDef.cellStyle) {
|
14260 | var cssToUse = void 0;
|
14261 | if (typeof colDef.cellStyle === 'function') {
|
14262 | var cellStyleParams = {
|
14263 | value: this.value,
|
14264 | data: this.rowNode.data,
|
14265 | node: this.rowNode,
|
14266 | colDef: colDef,
|
14267 | column: this.column,
|
14268 | $scope: this.scope,
|
14269 | context: this.beans.gridOptionsWrapper.getContext(),
|
14270 | api: this.beans.gridOptionsWrapper.getApi()
|
14271 | };
|
14272 | var cellStyleFunc = colDef.cellStyle;
|
14273 | cssToUse = cellStyleFunc(cellStyleParams);
|
14274 | }
|
14275 | else {
|
14276 | cssToUse = colDef.cellStyle;
|
14277 | }
|
14278 | return cssToUse;
|
14279 | }
|
14280 | };
|
14281 | CellComp.prototype.postProcessClassesFromColDef = function () {
|
14282 | var _this = this;
|
14283 | this.processClassesFromColDef(function (className) { return utils_1._.addCssClass(_this.getGui(), className); });
|
14284 | };
|
14285 | CellComp.prototype.preProcessClassesFromColDef = function () {
|
14286 | var res = [];
|
14287 | this.processClassesFromColDef(function (className) { return res.push(className); });
|
14288 | return res;
|
14289 | };
|
14290 | CellComp.prototype.processClassesFromColDef = function (onApplicableClass) {
|
14291 | this.beans.stylingService.processStaticCellClasses(this.column.getColDef(), {
|
14292 | value: this.value,
|
14293 | data: this.rowNode.data,
|
14294 | node: this.rowNode,
|
14295 | colDef: this.column.getColDef(),
|
14296 | rowIndex: this.rowNode.rowIndex,
|
14297 | $scope: this.scope,
|
14298 | api: this.beans.gridOptionsWrapper.getApi(),
|
14299 | context: this.beans.gridOptionsWrapper.getContext()
|
14300 | }, onApplicableClass);
|
14301 | };
|
14302 | CellComp.prototype.putDataIntoCellAfterRefresh = function () {
|
14303 |
|
14304 | var colDef = this.column.getColDef();
|
14305 | if (colDef.template) {
|
14306 |
|
14307 |
|
14308 | this.eParentOfValue.innerHTML = colDef.template;
|
14309 | }
|
14310 | else if (colDef.templateUrl) {
|
14311 |
|
14312 |
|
14313 |
|
14314 | var template = this.beans.templateService.getTemplate(colDef.templateUrl, this.refreshCell.bind(this, true));
|
14315 | if (template) {
|
14316 | this.eParentOfValue.innerHTML = template;
|
14317 | }
|
14318 |
|
14319 | }
|
14320 | else if (this.usingCellRenderer) {
|
14321 | this.attachCellRenderer();
|
14322 | }
|
14323 | else {
|
14324 | var valueToUse = this.getValueToUse();
|
14325 | if (valueToUse !== null && valueToUse !== undefined) {
|
14326 | this.eParentOfValue.innerText = valueToUse;
|
14327 | }
|
14328 | }
|
14329 | };
|
14330 | CellComp.prototype.attemptCellRendererRefresh = function () {
|
14331 | if (utils_1._.missing(this.cellRenderer) || utils_1._.missing(this.cellRenderer.refresh)) {
|
14332 | return false;
|
14333 | }
|
14334 |
|
14335 |
|
14336 | var params = this.createCellRendererParams();
|
14337 | var result = this.cellRenderer.refresh(params);
|
14338 |
|
14339 |
|
14340 |
|
14341 |
|
14342 | return result === true || result === undefined;
|
14343 | };
|
14344 | CellComp.prototype.refreshToolTip = function () {
|
14345 | var newTooltip = this.getToolTip();
|
14346 | if (this.tooltip !== newTooltip) {
|
14347 | this.tooltip = newTooltip;
|
14348 | if (utils_1._.exists(newTooltip)) {
|
14349 | var tooltipSanitised = utils_1._.escape(this.tooltip);
|
14350 | this.eParentOfValue.setAttribute('title', tooltipSanitised);
|
14351 | }
|
14352 | else {
|
14353 | this.eParentOfValue.removeAttribute('title');
|
14354 | }
|
14355 | }
|
14356 | };
|
14357 | CellComp.prototype.valuesAreEqual = function (val1, val2) {
|
14358 |
|
14359 | var colDef = this.column.getColDef();
|
14360 | var equalsMethod = colDef ? colDef.equals : null;
|
14361 | if (equalsMethod) {
|
14362 | return equalsMethod(val1, val2);
|
14363 | }
|
14364 | else {
|
14365 | return val1 === val2;
|
14366 | }
|
14367 | };
|
14368 | CellComp.prototype.getToolTip = function () {
|
14369 | var colDef = this.column.getColDef();
|
14370 | var data = this.rowNode.data;
|
14371 | if (colDef.tooltipField && utils_1._.exists(data)) {
|
14372 | return utils_1._.getValueUsingField(data, colDef.tooltipField, this.column.isTooltipFieldContainsDots());
|
14373 | }
|
14374 | else if (colDef.tooltip) {
|
14375 | return colDef.tooltip({
|
14376 | value: this.value,
|
14377 | valueFormatted: this.valueFormatted,
|
14378 | data: this.rowNode.data,
|
14379 | node: this.rowNode,
|
14380 | colDef: this.column.getColDef(),
|
14381 | api: this.beans.gridOptionsWrapper.getApi(),
|
14382 | $scope: this.scope,
|
14383 | context: this.beans.gridOptionsWrapper.getContext(),
|
14384 | rowIndex: this.gridCell.rowIndex
|
14385 | });
|
14386 | }
|
14387 | else {
|
14388 | return null;
|
14389 | }
|
14390 | };
|
14391 | CellComp.prototype.processCellClassRules = function (onApplicableClass, onNotApplicableClass) {
|
14392 | this.beans.stylingService.processClassRules(this.column.getColDef().cellClassRules, {
|
14393 | value: this.value,
|
14394 | data: this.rowNode.data,
|
14395 | node: this.rowNode,
|
14396 | colDef: this.column.getColDef(),
|
14397 | rowIndex: this.gridCell.rowIndex,
|
14398 | api: this.beans.gridOptionsWrapper.getApi(),
|
14399 | $scope: this.scope,
|
14400 | context: this.beans.gridOptionsWrapper.getContext()
|
14401 | }, onApplicableClass, onNotApplicableClass);
|
14402 | };
|
14403 | CellComp.prototype.postProcessCellClassRules = function () {
|
14404 | var _this = this;
|
14405 | this.processCellClassRules(function (className) {
|
14406 | utils_1._.addCssClass(_this.getGui(), className);
|
14407 | }, function (className) {
|
14408 | utils_1._.removeCssClass(_this.getGui(), className);
|
14409 | });
|
14410 | };
|
14411 | CellComp.prototype.preProcessCellClassRules = function () {
|
14412 | var res = [];
|
14413 | this.processCellClassRules(function (className) {
|
14414 | res.push(className);
|
14415 | }, function (className) {
|
14416 |
|
14417 |
|
14418 | });
|
14419 | return res;
|
14420 | };
|
14421 |
|
14422 | CellComp.prototype.setUsingWrapper = function () {
|
14423 | var colDef = this.column.getColDef();
|
14424 |
|
14425 | if (this.rowNode.rowPinned) {
|
14426 | this.usingWrapper = false;
|
14427 | this.includeSelectionComponent = false;
|
14428 | this.includeRowDraggingComponent = false;
|
14429 | return;
|
14430 | }
|
14431 | var cbSelectionIsFunc = typeof colDef.checkboxSelection === 'function';
|
14432 | var rowDraggableIsFunc = typeof colDef.rowDrag === 'function';
|
14433 | this.includeSelectionComponent = cbSelectionIsFunc || colDef.checkboxSelection === true;
|
14434 | this.includeRowDraggingComponent = rowDraggableIsFunc || colDef.rowDrag === true;
|
14435 | this.usingWrapper = this.includeRowDraggingComponent || this.includeSelectionComponent;
|
14436 | };
|
14437 | CellComp.prototype.chooseCellRenderer = function () {
|
14438 |
|
14439 | var colDef = this.column.getColDef();
|
14440 |
|
14441 |
|
14442 | if (colDef.template || colDef.templateUrl) {
|
14443 | this.usingCellRenderer = false;
|
14444 | return;
|
14445 | }
|
14446 | var params = this.createCellRendererParams();
|
14447 | var cellRenderer = this.beans.componentResolver.getComponentToUse(colDef, 'cellRenderer', params, null);
|
14448 | var pinnedRowCellRenderer = this.beans.componentResolver.getComponentToUse(colDef, 'pinnedRowCellRenderer', params, null);
|
14449 | if (pinnedRowCellRenderer && this.rowNode.rowPinned) {
|
14450 | this.cellRendererType = 'pinnedRowCellRenderer';
|
14451 | this.usingCellRenderer = true;
|
14452 | }
|
14453 | else if (cellRenderer) {
|
14454 | this.cellRendererType = 'cellRenderer';
|
14455 | this.usingCellRenderer = true;
|
14456 | }
|
14457 | else {
|
14458 | this.usingCellRenderer = false;
|
14459 | }
|
14460 | };
|
14461 | CellComp.prototype.createCellRendererInstance = function () {
|
14462 | var params = this.createCellRendererParams();
|
14463 | this.cellRendererVersion++;
|
14464 | var callback = this.afterCellRendererCreated.bind(this, this.cellRendererVersion);
|
14465 | this.beans.componentResolver.createAgGridComponent(this.column.getColDef(), params, this.cellRendererType, params, null).then(callback);
|
14466 | };
|
14467 | CellComp.prototype.afterCellRendererCreated = function (cellRendererVersion, cellRenderer) {
|
14468 |
|
14469 | if (!this.isAlive() || (cellRendererVersion !== this.cellRendererVersion)) {
|
14470 | if (cellRenderer.destroy) {
|
14471 | cellRenderer.destroy();
|
14472 | }
|
14473 | return;
|
14474 | }
|
14475 | this.cellRenderer = cellRenderer;
|
14476 | this.cellRendererGui = this.cellRenderer.getGui();
|
14477 | if (utils_1._.missing(this.cellRendererGui)) {
|
14478 | return;
|
14479 | }
|
14480 |
|
14481 |
|
14482 | if (!this.editingCell) {
|
14483 | this.eParentOfValue.appendChild(this.cellRendererGui);
|
14484 | }
|
14485 | };
|
14486 | CellComp.prototype.attachCellRenderer = function () {
|
14487 | if (!this.usingCellRenderer) {
|
14488 | return;
|
14489 | }
|
14490 | this.createCellRendererInstance();
|
14491 | };
|
14492 | CellComp.prototype.createCellRendererParams = function () {
|
14493 | var _this = this;
|
14494 | var params = {
|
14495 | value: this.value,
|
14496 | valueFormatted: this.valueFormatted,
|
14497 | getValue: this.getValue.bind(this),
|
14498 | setValue: function (value) {
|
14499 | _this.beans.valueService.setValue(_this.rowNode, _this.column, value);
|
14500 | },
|
14501 | formatValue: this.formatValue.bind(this),
|
14502 | data: this.rowNode.data,
|
14503 | node: this.rowNode,
|
14504 | colDef: this.column.getColDef(),
|
14505 | column: this.column,
|
14506 | $scope: this.scope,
|
14507 | rowIndex: this.gridCell.rowIndex,
|
14508 | api: this.beans.gridOptionsWrapper.getApi(),
|
14509 | columnApi: this.beans.gridOptionsWrapper.getColumnApi(),
|
14510 | context: this.beans.gridOptionsWrapper.getContext(),
|
14511 | refreshCell: this.refreshCell.bind(this),
|
14512 | eGridCell: this.getGui(),
|
14513 | eParentOfValue: this.eParentOfValue,
|
14514 |
|
14515 |
|
14516 |
|
14517 |
|
14518 |
|
14519 | addRowCompListener: this.rowComp ? this.rowComp.addEventListener.bind(this.rowComp) : null,
|
14520 | addRenderedRowListener: function (eventType, listener) {
|
14521 | console.warn('ag-Grid: since ag-Grid .v11, params.addRenderedRowListener() is now params.addRowCompListener()');
|
14522 | if (_this.rowComp) {
|
14523 | _this.rowComp.addEventListener(eventType, listener);
|
14524 | }
|
14525 | }
|
14526 | };
|
14527 | return params;
|
14528 | };
|
14529 | CellComp.prototype.formatValue = function (value) {
|
14530 | var valueFormatted = this.beans.valueFormatterService.formatValue(this.column, this.rowNode, this.scope, value);
|
14531 | var valueFormattedExists = valueFormatted !== null && valueFormatted !== undefined;
|
14532 | return valueFormattedExists ? valueFormatted : value;
|
14533 | };
|
14534 | CellComp.prototype.getValueToUse = function () {
|
14535 | var valueFormattedExists = this.valueFormatted !== null && this.valueFormatted !== undefined;
|
14536 | return valueFormattedExists ? this.valueFormatted : this.value;
|
14537 | };
|
14538 | CellComp.prototype.getValueAndFormat = function () {
|
14539 | this.value = this.getValue();
|
14540 | this.valueFormatted = this.beans.valueFormatterService.formatValue(this.column, this.rowNode, this.scope, this.value);
|
14541 | };
|
14542 | CellComp.prototype.getValue = function () {
|
14543 |
|
14544 |
|
14545 |
|
14546 |
|
14547 | var lockedClosedGroup = this.rowNode.leafGroup && this.beans.columnController.isPivotMode();
|
14548 | var isOpenGroup = this.rowNode.group && this.rowNode.expanded && !this.rowNode.footer && !lockedClosedGroup;
|
14549 | if (isOpenGroup && this.beans.gridOptionsWrapper.isGroupIncludeFooter()) {
|
14550 |
|
14551 |
|
14552 | return this.beans.valueService.getValue(this.column, this.rowNode, false, true);
|
14553 | }
|
14554 | else {
|
14555 | return this.beans.valueService.getValue(this.column, this.rowNode);
|
14556 | }
|
14557 | };
|
14558 | CellComp.prototype.onMouseEvent = function (eventName, mouseEvent) {
|
14559 | if (utils_1._.isStopPropagationForAgGrid(mouseEvent)) {
|
14560 | return;
|
14561 | }
|
14562 | switch (eventName) {
|
14563 | case 'click':
|
14564 | this.onCellClicked(mouseEvent);
|
14565 | break;
|
14566 | case 'mousedown':
|
14567 | this.onMouseDown(mouseEvent);
|
14568 | break;
|
14569 | case 'dblclick':
|
14570 | this.onCellDoubleClicked(mouseEvent);
|
14571 | break;
|
14572 | case 'mouseout':
|
14573 | this.onMouseOut(mouseEvent);
|
14574 | break;
|
14575 | case 'mouseover':
|
14576 | this.onMouseOver(mouseEvent);
|
14577 | break;
|
14578 | }
|
14579 | };
|
14580 | CellComp.prototype.dispatchCellContextMenuEvent = function (event) {
|
14581 | var colDef = this.column.getColDef();
|
14582 | var cellContextMenuEvent = this.createEvent(event, events_1.Events.EVENT_CELL_CONTEXT_MENU);
|
14583 | this.beans.eventService.dispatchEvent(cellContextMenuEvent);
|
14584 | if (colDef.onCellContextMenu) {
|
14585 |
|
14586 | setTimeout(function () { return colDef.onCellContextMenu(cellContextMenuEvent); }, 0);
|
14587 | }
|
14588 | };
|
14589 | CellComp.prototype.createEvent = function (domEvent, eventType) {
|
14590 | var event = {
|
14591 | node: this.rowNode,
|
14592 | data: this.rowNode.data,
|
14593 | value: this.value,
|
14594 | column: this.column,
|
14595 | colDef: this.column.getColDef(),
|
14596 | context: this.beans.gridOptionsWrapper.getContext(),
|
14597 | api: this.beans.gridApi,
|
14598 | columnApi: this.beans.columnApi,
|
14599 | rowPinned: this.rowNode.rowPinned,
|
14600 | event: domEvent,
|
14601 | type: eventType,
|
14602 | rowIndex: this.rowNode.rowIndex
|
14603 | };
|
14604 |
|
14605 | if (this.scope) {
|
14606 | event.$scope = this.scope;
|
14607 | }
|
14608 | return event;
|
14609 | };
|
14610 | CellComp.prototype.onMouseOut = function (mouseEvent) {
|
14611 | var cellMouseOutEvent = this.createEvent(mouseEvent, events_1.Events.EVENT_CELL_MOUSE_OUT);
|
14612 | this.beans.eventService.dispatchEvent(cellMouseOutEvent);
|
14613 | this.beans.columnHoverService.clearMouseOver();
|
14614 | };
|
14615 | CellComp.prototype.onMouseOver = function (mouseEvent) {
|
14616 | var cellMouseOverEvent = this.createEvent(mouseEvent, events_1.Events.EVENT_CELL_MOUSE_OVER);
|
14617 | this.beans.eventService.dispatchEvent(cellMouseOverEvent);
|
14618 | this.beans.columnHoverService.setMouseOver([this.column]);
|
14619 | };
|
14620 | CellComp.prototype.onCellDoubleClicked = function (mouseEvent) {
|
14621 | var colDef = this.column.getColDef();
|
14622 |
|
14623 | var cellDoubleClickedEvent = this.createEvent(mouseEvent, events_1.Events.EVENT_CELL_DOUBLE_CLICKED);
|
14624 | this.beans.eventService.dispatchEvent(cellDoubleClickedEvent);
|
14625 |
|
14626 | if (typeof colDef.onCellDoubleClicked === 'function') {
|
14627 |
|
14628 | setTimeout(function () { return colDef.onCellDoubleClicked(cellDoubleClickedEvent); }, 0);
|
14629 | }
|
14630 | var editOnDoubleClick = !this.beans.gridOptionsWrapper.isSingleClickEdit()
|
14631 | && !this.beans.gridOptionsWrapper.isSuppressClickEdit();
|
14632 | if (editOnDoubleClick) {
|
14633 | this.startRowOrCellEdit();
|
14634 | }
|
14635 | };
|
14636 |
|
14637 | CellComp.prototype.startRowOrCellEdit = function (keyPress, charPress) {
|
14638 | if (this.beans.gridOptionsWrapper.isFullRowEdit()) {
|
14639 | this.rowComp.startRowEditing(keyPress, charPress, this);
|
14640 | }
|
14641 | else {
|
14642 | this.startEditingIfEnabled(keyPress, charPress, true);
|
14643 | }
|
14644 | };
|
14645 | CellComp.prototype.isCellEditable = function () {
|
14646 | return this.column.isCellEditable(this.rowNode);
|
14647 | };
|
14648 |
|
14649 | CellComp.prototype.startEditingIfEnabled = function (keyPress, charPress, cellStartedEdit) {
|
14650 | if (keyPress === void 0) { keyPress = null; }
|
14651 | if (charPress === void 0) { charPress = null; }
|
14652 | if (cellStartedEdit === void 0) { cellStartedEdit = false; }
|
14653 |
|
14654 | if (!this.isCellEditable()) {
|
14655 | return;
|
14656 | }
|
14657 |
|
14658 | if (this.editingCell) {
|
14659 | return;
|
14660 | }
|
14661 | this.editingCell = true;
|
14662 | this.cellEditorVersion++;
|
14663 | var callback = this.afterCellEditorCreated.bind(this, this.cellEditorVersion);
|
14664 | var params = this.createCellEditorParams(keyPress, charPress, cellStartedEdit);
|
14665 | this.beans.cellEditorFactory.createCellEditor(this.column.getColDef(), params).then(callback);
|
14666 |
|
14667 |
|
14668 |
|
14669 | var cellEditorAsync = utils_1._.missing(this.cellEditor);
|
14670 | if (cellEditorAsync && cellStartedEdit) {
|
14671 | this.focusCell(true);
|
14672 | }
|
14673 | };
|
14674 | CellComp.prototype.afterCellEditorCreated = function (cellEditorVersion, cellEditor) {
|
14675 |
|
14676 |
|
14677 |
|
14678 | var versionMismatch = cellEditorVersion !== this.cellEditorVersion;
|
14679 | if (versionMismatch || !this.editingCell) {
|
14680 | if (cellEditor.destroy) {
|
14681 | cellEditor.destroy();
|
14682 | }
|
14683 | return;
|
14684 | }
|
14685 | if (cellEditor.isCancelBeforeStart && cellEditor.isCancelBeforeStart()) {
|
14686 | if (cellEditor.destroy) {
|
14687 | cellEditor.destroy();
|
14688 | }
|
14689 | this.editingCell = false;
|
14690 | return;
|
14691 | }
|
14692 | if (!cellEditor.getGui) {
|
14693 | console.warn("ag-Grid: cellEditor for column " + this.column.getId() + " is missing getGui() method");
|
14694 |
|
14695 | if (cellEditor.render) {
|
14696 | console.warn("ag-Grid: we found 'render' on the component, are you trying to set a React renderer but added it as colDef.cellEditor instead of colDef.cellEditorFmk?");
|
14697 | }
|
14698 | if (cellEditor.destroy) {
|
14699 | cellEditor.destroy();
|
14700 | }
|
14701 | this.editingCell = false;
|
14702 | return;
|
14703 | }
|
14704 | this.cellEditor = cellEditor;
|
14705 | this.cellEditorInPopup = cellEditor.isPopup && cellEditor.isPopup();
|
14706 | this.setInlineEditingClass();
|
14707 | if (this.cellEditorInPopup) {
|
14708 | this.addPopupCellEditor();
|
14709 | }
|
14710 | else {
|
14711 | this.addInCellEditor();
|
14712 | }
|
14713 | if (cellEditor.afterGuiAttached) {
|
14714 | cellEditor.afterGuiAttached();
|
14715 | }
|
14716 | var event = this.createEvent(null, events_1.Events.EVENT_CELL_EDITING_STARTED);
|
14717 | this.beans.eventService.dispatchEvent(event);
|
14718 | };
|
14719 | CellComp.prototype.addInCellEditor = function () {
|
14720 | utils_1._.removeAllChildren(this.getGui());
|
14721 | this.getGui().appendChild(this.cellEditor.getGui());
|
14722 | this.angular1Compile();
|
14723 | };
|
14724 | CellComp.prototype.addPopupCellEditor = function () {
|
14725 | var _this = this;
|
14726 | var ePopupGui = this.cellEditor.getGui();
|
14727 | this.hideEditorPopup = this.beans.popupService.addAsModalPopup(ePopupGui, true,
|
14728 |
|
14729 | function () {
|
14730 | _this.onPopupEditorClosed();
|
14731 | });
|
14732 | this.beans.popupService.positionPopupOverComponent({
|
14733 | column: this.column,
|
14734 | rowNode: this.rowNode,
|
14735 | type: 'popupCellEditor',
|
14736 | eventSource: this.getGui(),
|
14737 | ePopup: ePopupGui,
|
14738 | keepWithinBounds: true
|
14739 | });
|
14740 | this.angular1Compile();
|
14741 | };
|
14742 | CellComp.prototype.onPopupEditorClosed = function () {
|
14743 |
|
14744 |
|
14745 |
|
14746 |
|
14747 | if (this.editingCell) {
|
14748 |
|
14749 |
|
14750 | this.stopRowOrCellEdit();
|
14751 |
|
14752 |
|
14753 |
|
14754 | if (this.beans.focusedCellController.isCellFocused(this.gridCell)) {
|
14755 | this.focusCell(true);
|
14756 | }
|
14757 | }
|
14758 | };
|
14759 |
|
14760 |
|
14761 | CellComp.prototype.setInlineEditingClass = function () {
|
14762 |
|
14763 |
|
14764 |
|
14765 |
|
14766 |
|
14767 |
|
14768 | var editingInline = this.editingCell && !this.cellEditorInPopup;
|
14769 | var popupEditorShowing = this.editingCell && this.cellEditorInPopup;
|
14770 | utils_1._.addOrRemoveCssClass(this.getGui(), "ag-cell-inline-editing", editingInline);
|
14771 | utils_1._.addOrRemoveCssClass(this.getGui(), "ag-cell-not-inline-editing", !editingInline);
|
14772 | utils_1._.addOrRemoveCssClass(this.getGui(), "ag-cell-popup-editing", popupEditorShowing);
|
14773 | utils_1._.addOrRemoveCssClass(this.getGui().parentNode, "ag-row-inline-editing", editingInline);
|
14774 | utils_1._.addOrRemoveCssClass(this.getGui().parentNode, "ag-row-not-inline-editing", !editingInline);
|
14775 | };
|
14776 | CellComp.prototype.createCellEditorParams = function (keyPress, charPress, cellStartedEdit) {
|
14777 | var params = {
|
14778 | value: this.getValue(),
|
14779 | keyPress: keyPress,
|
14780 | charPress: charPress,
|
14781 | column: this.column,
|
14782 | rowIndex: this.gridCell.rowIndex,
|
14783 | node: this.rowNode,
|
14784 | api: this.beans.gridOptionsWrapper.getApi(),
|
14785 | cellStartedEdit: cellStartedEdit,
|
14786 | columnApi: this.beans.gridOptionsWrapper.getColumnApi(),
|
14787 | context: this.beans.gridOptionsWrapper.getContext(),
|
14788 | $scope: this.scope,
|
14789 | onKeyDown: this.onKeyDown.bind(this),
|
14790 | stopEditing: this.stopEditingAndFocus.bind(this),
|
14791 | eGridCell: this.getGui(),
|
14792 | parseValue: this.parseValue.bind(this),
|
14793 | formatValue: this.formatValue.bind(this)
|
14794 | };
|
14795 | return params;
|
14796 | };
|
14797 |
|
14798 |
|
14799 | CellComp.prototype.stopEditingAndFocus = function (suppressNavigateAfterEdit) {
|
14800 | if (suppressNavigateAfterEdit === void 0) { suppressNavigateAfterEdit = false; }
|
14801 | this.stopRowOrCellEdit();
|
14802 | this.focusCell(true);
|
14803 | if (!suppressNavigateAfterEdit) {
|
14804 | this.navigateAfterEdit();
|
14805 | }
|
14806 | };
|
14807 | CellComp.prototype.parseValue = function (newValue) {
|
14808 | var params = {
|
14809 | node: this.rowNode,
|
14810 | data: this.rowNode.data,
|
14811 | oldValue: this.value,
|
14812 | newValue: newValue,
|
14813 | colDef: this.column.getColDef(),
|
14814 | column: this.column,
|
14815 | api: this.beans.gridOptionsWrapper.getApi(),
|
14816 | columnApi: this.beans.gridOptionsWrapper.getColumnApi(),
|
14817 | context: this.beans.gridOptionsWrapper.getContext()
|
14818 | };
|
14819 | var valueParser = this.column.getColDef().valueParser;
|
14820 | return utils_1._.exists(valueParser) ? this.beans.expressionService.evaluate(valueParser, params) : newValue;
|
14821 | };
|
14822 | CellComp.prototype.focusCell = function (forceBrowserFocus) {
|
14823 | if (forceBrowserFocus === void 0) { forceBrowserFocus = false; }
|
14824 | this.beans.focusedCellController.setFocusedCell(this.gridCell.rowIndex, this.column, this.rowNode.rowPinned, forceBrowserFocus);
|
14825 | };
|
14826 | CellComp.prototype.setFocusInOnEditor = function () {
|
14827 | if (this.editingCell) {
|
14828 | if (this.cellEditor && this.cellEditor.focusIn) {
|
14829 |
|
14830 | this.cellEditor.focusIn();
|
14831 | }
|
14832 | else {
|
14833 |
|
14834 |
|
14835 |
|
14836 | this.focusCell(true);
|
14837 | }
|
14838 | }
|
14839 | };
|
14840 | CellComp.prototype.isEditing = function () {
|
14841 | return this.editingCell;
|
14842 | };
|
14843 | CellComp.prototype.onKeyDown = function (event) {
|
14844 | var key = event.which || event.keyCode;
|
14845 |
|
14846 | if (this.doesUserWantToCancelKeyboardEvent(event)) {
|
14847 | return;
|
14848 | }
|
14849 | switch (key) {
|
14850 | case constants_1.Constants.KEY_ENTER:
|
14851 | this.onEnterKeyDown();
|
14852 | break;
|
14853 | case constants_1.Constants.KEY_F2:
|
14854 | this.onF2KeyDown();
|
14855 | break;
|
14856 | case constants_1.Constants.KEY_ESCAPE:
|
14857 | this.onEscapeKeyDown();
|
14858 | break;
|
14859 | case constants_1.Constants.KEY_TAB:
|
14860 | this.onTabKeyDown(event);
|
14861 | break;
|
14862 | case constants_1.Constants.KEY_BACKSPACE:
|
14863 | case constants_1.Constants.KEY_DELETE:
|
14864 | this.onBackspaceOrDeleteKeyPressed(key);
|
14865 | break;
|
14866 | case constants_1.Constants.KEY_DOWN:
|
14867 | case constants_1.Constants.KEY_UP:
|
14868 | case constants_1.Constants.KEY_RIGHT:
|
14869 | case constants_1.Constants.KEY_LEFT:
|
14870 | this.onNavigationKeyPressed(event, key);
|
14871 | break;
|
14872 | }
|
14873 | };
|
14874 | CellComp.prototype.doesUserWantToCancelKeyboardEvent = function (event) {
|
14875 | var callback = this.column.getColDef().suppressKeyboardEvent;
|
14876 | if (utils_1._.missing(callback)) {
|
14877 | return false;
|
14878 | }
|
14879 | else {
|
14880 |
|
14881 | var params = {
|
14882 | event: event,
|
14883 | editing: this.editingCell,
|
14884 | column: this.column,
|
14885 | api: this.beans.gridOptionsWrapper.getApi(),
|
14886 | node: this.rowNode,
|
14887 | data: this.rowNode.data,
|
14888 | colDef: this.column.getColDef(),
|
14889 | context: this.beans.gridOptionsWrapper.getContext(),
|
14890 | columnApi: this.beans.gridOptionsWrapper.getColumnApi()
|
14891 | };
|
14892 | return callback(params);
|
14893 | }
|
14894 | };
|
14895 | CellComp.prototype.setFocusOutOnEditor = function () {
|
14896 | if (this.editingCell && this.cellEditor && this.cellEditor.focusOut) {
|
14897 | this.cellEditor.focusOut();
|
14898 | }
|
14899 | };
|
14900 | CellComp.prototype.onNavigationKeyPressed = function (event, key) {
|
14901 | if (this.editingCell) {
|
14902 | this.stopRowOrCellEdit();
|
14903 | }
|
14904 | if (event.shiftKey && this.rangeSelectionEnabled) {
|
14905 | this.onShiftRangeSelect(key);
|
14906 | }
|
14907 | else {
|
14908 | this.beans.rowRenderer.navigateToNextCell(event, key, this.gridCell, true);
|
14909 | }
|
14910 |
|
14911 | event.preventDefault();
|
14912 | };
|
14913 | CellComp.prototype.onShiftRangeSelect = function (key) {
|
14914 | var success = this.beans.rangeController.extendRangeInDirection(this.gridCell, key);
|
14915 | if (!success) {
|
14916 | return;
|
14917 | }
|
14918 | var ranges = this.beans.rangeController.getCellRanges();
|
14919 |
|
14920 | if (utils_1._.missing(ranges) || ranges.length !== 1) {
|
14921 | return;
|
14922 | }
|
14923 | var endCell = ranges[0].end;
|
14924 | this.beans.rowRenderer.ensureCellVisible(endCell);
|
14925 | };
|
14926 | CellComp.prototype.onTabKeyDown = function (event) {
|
14927 | if (this.beans.gridOptionsWrapper.isSuppressTabbing()) {
|
14928 | return;
|
14929 | }
|
14930 | this.beans.rowRenderer.onTabKeyDown(this, event);
|
14931 | };
|
14932 | CellComp.prototype.onBackspaceOrDeleteKeyPressed = function (key) {
|
14933 | if (!this.editingCell) {
|
14934 | this.startRowOrCellEdit(key);
|
14935 | }
|
14936 | };
|
14937 | CellComp.prototype.onEnterKeyDown = function () {
|
14938 | if (this.editingCell || this.rowComp.isEditing()) {
|
14939 | this.stopEditingAndFocus();
|
14940 | }
|
14941 | else {
|
14942 | if (this.beans.gridOptionsWrapper.isEnterMovesDown()) {
|
14943 | this.beans.rowRenderer.navigateToNextCell(null, constants_1.Constants.KEY_DOWN, this.gridCell, false);
|
14944 | }
|
14945 | else {
|
14946 | this.startRowOrCellEdit(constants_1.Constants.KEY_ENTER);
|
14947 | }
|
14948 | }
|
14949 | };
|
14950 | CellComp.prototype.navigateAfterEdit = function () {
|
14951 | var fullRowEdit = this.beans.gridOptionsWrapper.isFullRowEdit();
|
14952 | if (fullRowEdit) {
|
14953 | return;
|
14954 | }
|
14955 | var enterMovesDownAfterEdit = this.beans.gridOptionsWrapper.isEnterMovesDownAfterEdit();
|
14956 | if (enterMovesDownAfterEdit) {
|
14957 | this.beans.rowRenderer.navigateToNextCell(null, constants_1.Constants.KEY_DOWN, this.gridCell, false);
|
14958 | }
|
14959 | };
|
14960 | CellComp.prototype.onF2KeyDown = function () {
|
14961 | if (!this.editingCell) {
|
14962 | this.startRowOrCellEdit(constants_1.Constants.KEY_F2);
|
14963 | }
|
14964 | };
|
14965 | CellComp.prototype.onEscapeKeyDown = function () {
|
14966 | if (this.editingCell) {
|
14967 | this.stopRowOrCellEdit(true);
|
14968 | this.focusCell(true);
|
14969 | }
|
14970 | };
|
14971 | CellComp.prototype.onKeyPress = function (event) {
|
14972 |
|
14973 |
|
14974 | var eventTarget = utils_1._.getTarget(event);
|
14975 | var eventOnChildComponent = eventTarget !== this.getGui();
|
14976 | if (eventOnChildComponent) {
|
14977 | return;
|
14978 | }
|
14979 | if (!this.editingCell) {
|
14980 | var pressedChar = String.fromCharCode(event.charCode);
|
14981 | if (pressedChar === ' ') {
|
14982 | this.onSpaceKeyPressed(event);
|
14983 | }
|
14984 | else {
|
14985 | if (utils_1._.isEventFromPrintableCharacter(event)) {
|
14986 | this.startRowOrCellEdit(null, pressedChar);
|
14987 |
|
14988 |
|
14989 |
|
14990 |
|
14991 |
|
14992 | event.preventDefault();
|
14993 | }
|
14994 | }
|
14995 | }
|
14996 | };
|
14997 | CellComp.prototype.onSpaceKeyPressed = function (event) {
|
14998 | if (!this.editingCell && this.beans.gridOptionsWrapper.isRowSelection()) {
|
14999 | var selected = this.rowNode.isSelected();
|
15000 | this.rowNode.setSelected(!selected);
|
15001 | }
|
15002 |
|
15003 | event.preventDefault();
|
15004 | };
|
15005 | CellComp.prototype.onMouseDown = function (mouseEvent) {
|
15006 |
|
15007 |
|
15008 |
|
15009 |
|
15010 |
|
15011 |
|
15012 | this.focusCell(false);
|
15013 |
|
15014 |
|
15015 |
|
15016 | if (this.beans.rangeController) {
|
15017 | var thisCell = this.gridCell;
|
15018 | if (mouseEvent.shiftKey) {
|
15019 | this.beans.rangeController.extendRangeToCell(thisCell);
|
15020 | }
|
15021 | else {
|
15022 | var cellAlreadyInRange = this.beans.rangeController.isCellInAnyRange(thisCell);
|
15023 | if (!cellAlreadyInRange) {
|
15024 | var ctrlKeyPressed = mouseEvent.ctrlKey || mouseEvent.metaKey;
|
15025 | this.beans.rangeController.setRangeToCell(thisCell, ctrlKeyPressed);
|
15026 | }
|
15027 | }
|
15028 | }
|
15029 | var cellMouseDownEvent = this.createEvent(mouseEvent, events_1.Events.EVENT_CELL_MOUSE_DOWN);
|
15030 | this.beans.eventService.dispatchEvent(cellMouseDownEvent);
|
15031 | };
|
15032 |
|
15033 | CellComp.prototype.isDoubleClickOnIPad = function () {
|
15034 | if (!utils_1._.isUserAgentIPad()) {
|
15035 | return false;
|
15036 | }
|
15037 | var nowMillis = new Date().getTime();
|
15038 | var res = nowMillis - this.lastIPadMouseClickEvent < 200;
|
15039 | this.lastIPadMouseClickEvent = nowMillis;
|
15040 | return res;
|
15041 | };
|
15042 | CellComp.prototype.onCellClicked = function (mouseEvent) {
|
15043 |
|
15044 |
|
15045 | if (this.isDoubleClickOnIPad()) {
|
15046 | this.onCellDoubleClicked(mouseEvent);
|
15047 | mouseEvent.preventDefault();
|
15048 | return;
|
15049 | }
|
15050 | var cellClickedEvent = this.createEvent(mouseEvent, events_1.Events.EVENT_CELL_CLICKED);
|
15051 | this.beans.eventService.dispatchEvent(cellClickedEvent);
|
15052 | var colDef = this.column.getColDef();
|
15053 | if (colDef.onCellClicked) {
|
15054 |
|
15055 | setTimeout(function () { return colDef.onCellClicked(cellClickedEvent); }, 0);
|
15056 | }
|
15057 | var editOnSingleClick = (this.beans.gridOptionsWrapper.isSingleClickEdit() || colDef.singleClickEdit)
|
15058 | && !this.beans.gridOptionsWrapper.isSuppressClickEdit();
|
15059 | if (editOnSingleClick) {
|
15060 | this.startRowOrCellEdit();
|
15061 | }
|
15062 | this.doIeFocusHack();
|
15063 | };
|
15064 |
|
15065 |
|
15066 |
|
15067 |
|
15068 | CellComp.prototype.doIeFocusHack = function () {
|
15069 | if (utils_1._.isBrowserIE() || utils_1._.isBrowserEdge()) {
|
15070 | if (utils_1._.missing(document.activeElement) || document.activeElement === document.body) {
|
15071 |
|
15072 | this.getGui().focus();
|
15073 | }
|
15074 | }
|
15075 | };
|
15076 | CellComp.prototype.createGridCellVo = function () {
|
15077 | var gridCellDef = {
|
15078 | rowIndex: this.rowNode.rowIndex,
|
15079 | floating: this.rowNode.rowPinned,
|
15080 | column: this.column
|
15081 | };
|
15082 | this.gridCell = new gridCell_1.GridCell(gridCellDef);
|
15083 | };
|
15084 | CellComp.prototype.getGridCell = function () {
|
15085 | return this.gridCell;
|
15086 | };
|
15087 | CellComp.prototype.getParentRow = function () {
|
15088 | return this.eParentRow;
|
15089 | };
|
15090 | CellComp.prototype.setParentRow = function (eParentRow) {
|
15091 | this.eParentRow = eParentRow;
|
15092 | };
|
15093 | CellComp.prototype.getColumn = function () {
|
15094 | return this.column;
|
15095 | };
|
15096 | CellComp.prototype.detach = function () {
|
15097 | this.eParentRow.removeChild(this.getGui());
|
15098 | };
|
15099 |
|
15100 |
|
15101 |
|
15102 |
|
15103 | CellComp.prototype.destroy = function () {
|
15104 | _super.prototype.destroy.call(this);
|
15105 | if (this.cellEditor && this.cellEditor.destroy) {
|
15106 | this.cellEditor.destroy();
|
15107 | this.cellEditor = null;
|
15108 | }
|
15109 | if (this.cellRenderer && this.cellRenderer.destroy) {
|
15110 | this.cellRenderer.destroy();
|
15111 | this.cellRenderer = null;
|
15112 | }
|
15113 | };
|
15114 | CellComp.prototype.onLeftChanged = function () {
|
15115 | var left = this.getCellLeft();
|
15116 | this.getGui().style.left = left + 'px';
|
15117 | };
|
15118 | CellComp.prototype.onWidthChanged = function () {
|
15119 | var width = this.getCellWidth();
|
15120 | this.getGui().style.width = width + 'px';
|
15121 | };
|
15122 | CellComp.prototype.getRangeClasses = function () {
|
15123 | var res = [];
|
15124 | if (!this.rangeSelectionEnabled) {
|
15125 | return res;
|
15126 | }
|
15127 | if (this.rangeCount !== 0) {
|
15128 | res.push('ag-cell-range-selected');
|
15129 | }
|
15130 | if (this.rangeCount === 1) {
|
15131 | res.push('ag-cell-range-selected-1');
|
15132 | }
|
15133 | if (this.rangeCount === 2) {
|
15134 | res.push('ag-cell-range-selected-2');
|
15135 | }
|
15136 | if (this.rangeCount === 3) {
|
15137 | res.push('ag-cell-range-selected-3');
|
15138 | }
|
15139 | if (this.rangeCount >= 4) {
|
15140 | res.push('ag-cell-range-selected-4');
|
15141 | }
|
15142 | return res;
|
15143 | };
|
15144 | CellComp.prototype.onRowIndexChanged = function () {
|
15145 |
|
15146 |
|
15147 | this.createGridCellVo();
|
15148 |
|
15149 | this.onCellFocused();
|
15150 |
|
15151 | this.onRangeSelectionChanged();
|
15152 | };
|
15153 | CellComp.prototype.onRangeSelectionChanged = function () {
|
15154 | if (!this.beans.enterprise) {
|
15155 | return;
|
15156 | }
|
15157 | var newRangeCount = this.beans.rangeController.getCellRangeCount(this.gridCell);
|
15158 | var element = this.getGui();
|
15159 | if (this.rangeCount !== newRangeCount) {
|
15160 | utils_1._.addOrRemoveCssClass(element, 'ag-cell-range-selected', newRangeCount !== 0);
|
15161 | utils_1._.addOrRemoveCssClass(element, 'ag-cell-range-selected-1', newRangeCount === 1);
|
15162 | utils_1._.addOrRemoveCssClass(element, 'ag-cell-range-selected-2', newRangeCount === 2);
|
15163 | utils_1._.addOrRemoveCssClass(element, 'ag-cell-range-selected-3', newRangeCount === 3);
|
15164 | utils_1._.addOrRemoveCssClass(element, 'ag-cell-range-selected-4', newRangeCount >= 4);
|
15165 | this.rangeCount = newRangeCount;
|
15166 | }
|
15167 | };
|
15168 | CellComp.prototype.onFirstRightPinnedChanged = function () {
|
15169 | var firstRightPinned = this.column.isFirstRightPinned();
|
15170 | if (this.firstRightPinned !== firstRightPinned) {
|
15171 | this.firstRightPinned = firstRightPinned;
|
15172 | utils_1._.addOrRemoveCssClass(this.getGui(), 'ag-cell-first-right-pinned', firstRightPinned);
|
15173 | }
|
15174 | };
|
15175 | CellComp.prototype.onLastLeftPinnedChanged = function () {
|
15176 | var lastLeftPinned = this.column.isLastLeftPinned();
|
15177 | if (this.lastLeftPinned !== lastLeftPinned) {
|
15178 | this.lastLeftPinned = lastLeftPinned;
|
15179 | utils_1._.addOrRemoveCssClass(this.getGui(), 'ag-cell-last-left-pinned', lastLeftPinned);
|
15180 | }
|
15181 | };
|
15182 | CellComp.prototype.populateTemplate = function () {
|
15183 | if (this.usingWrapper) {
|
15184 | this.eParentOfValue = this.getRefElement('eCellValue');
|
15185 | this.eCellWrapper = this.getRefElement('eCellWrapper');
|
15186 | if (this.includeRowDraggingComponent) {
|
15187 | this.addRowDragging();
|
15188 | }
|
15189 | if (this.includeSelectionComponent) {
|
15190 | this.addSelectionCheckbox();
|
15191 | }
|
15192 | }
|
15193 | else {
|
15194 | this.eParentOfValue = this.getGui();
|
15195 | }
|
15196 | };
|
15197 | CellComp.prototype.addRowDragging = function () {
|
15198 |
|
15199 | if (!this.beans.gridOptionsWrapper.isRowModelDefault()) {
|
15200 | utils_1._.doOnce(function () { return console.warn('ag-Grid: row dragging is only allowed in the In Memory Row Model'); }, 'CellComp.addRowDragging');
|
15201 | return;
|
15202 | }
|
15203 | if (this.beans.gridOptionsWrapper.isPagination()) {
|
15204 | utils_1._.doOnce(function () { return console.warn('ag-Grid: row dragging is not possible when doing pagination'); }, 'CellComp.addRowDragging');
|
15205 | return;
|
15206 | }
|
15207 | var rowDraggingComp = new rowDragComp_1.RowDragComp(this.rowNode, this.column, this.getValueToUse(), this.beans);
|
15208 | this.addFeature(this.beans.context, rowDraggingComp);
|
15209 |
|
15210 |
|
15211 |
|
15212 |
|
15213 | this.eCellWrapper.insertBefore(rowDraggingComp.getGui(), this.eParentOfValue);
|
15214 | };
|
15215 | CellComp.prototype.addSelectionCheckbox = function () {
|
15216 | var cbSelectionComponent = new checkboxSelectionComponent_1.CheckboxSelectionComponent();
|
15217 | this.beans.context.wireBean(cbSelectionComponent);
|
15218 | var visibleFunc = this.column.getColDef().checkboxSelection;
|
15219 | visibleFunc = typeof visibleFunc === 'function' ? visibleFunc : null;
|
15220 | cbSelectionComponent.init({ rowNode: this.rowNode, column: this.column, visibleFunc: visibleFunc });
|
15221 | this.addDestroyFunc(function () { return cbSelectionComponent.destroy(); });
|
15222 |
|
15223 | this.eCellWrapper.insertBefore(cbSelectionComponent.getGui(), this.eParentOfValue);
|
15224 | };
|
15225 | CellComp.prototype.addDomData = function () {
|
15226 | var _this = this;
|
15227 | var element = this.getGui();
|
15228 | this.beans.gridOptionsWrapper.setDomData(element, CellComp.DOM_DATA_KEY_CELL_COMP, this);
|
15229 | this.addDestroyFunc(function () {
|
15230 | return _this.beans.gridOptionsWrapper.setDomData(element, CellComp.DOM_DATA_KEY_CELL_COMP, null);
|
15231 | });
|
15232 | };
|
15233 | CellComp.prototype.onCellFocused = function (event) {
|
15234 | var cellFocused = this.beans.focusedCellController.isCellFocused(this.gridCell);
|
15235 |
|
15236 | if (cellFocused !== this.cellFocused) {
|
15237 |
|
15238 |
|
15239 | var doingFocusCss = !this.beans.gridOptionsWrapper.isSuppressCellSelection();
|
15240 | if (doingFocusCss) {
|
15241 | utils_1._.addOrRemoveCssClass(this.getGui(), 'ag-cell-focus', cellFocused);
|
15242 | utils_1._.addOrRemoveCssClass(this.getGui(), 'ag-cell-no-focus', !cellFocused);
|
15243 | }
|
15244 | this.cellFocused = cellFocused;
|
15245 | }
|
15246 |
|
15247 |
|
15248 | if (cellFocused && event && event.forceBrowserFocus) {
|
15249 | this.getGui().focus();
|
15250 | }
|
15251 |
|
15252 | var fullRowEdit = this.beans.gridOptionsWrapper.isFullRowEdit();
|
15253 | if (!cellFocused && !fullRowEdit && this.editingCell) {
|
15254 | this.stopRowOrCellEdit();
|
15255 | }
|
15256 | };
|
15257 |
|
15258 | CellComp.prototype.stopRowOrCellEdit = function (cancel) {
|
15259 | if (cancel === void 0) { cancel = false; }
|
15260 | if (this.beans.gridOptionsWrapper.isFullRowEdit()) {
|
15261 | this.rowComp.stopRowEditing(cancel);
|
15262 | }
|
15263 | else {
|
15264 | this.stopEditing(cancel);
|
15265 | }
|
15266 | };
|
15267 | CellComp.prototype.stopEditing = function (cancel) {
|
15268 | if (cancel === void 0) { cancel = false; }
|
15269 | if (!this.editingCell) {
|
15270 | return;
|
15271 | }
|
15272 |
|
15273 |
|
15274 | if (!this.cellEditor) {
|
15275 | this.editingCell = false;
|
15276 | return;
|
15277 | }
|
15278 | var newValueExists = false;
|
15279 | var newValue;
|
15280 | if (!cancel) {
|
15281 |
|
15282 |
|
15283 |
|
15284 | var userWantsToCancel = this.cellEditor.isCancelAfterEnd && this.cellEditor.isCancelAfterEnd();
|
15285 | if (!userWantsToCancel) {
|
15286 | newValue = this.cellEditor.getValue();
|
15287 | newValueExists = true;
|
15288 | }
|
15289 | }
|
15290 |
|
15291 |
|
15292 |
|
15293 |
|
15294 | this.editingCell = false;
|
15295 | if (this.cellEditor.destroy) {
|
15296 | this.cellEditor.destroy();
|
15297 | }
|
15298 |
|
15299 |
|
15300 | this.cellEditor = null;
|
15301 | if (this.cellEditorInPopup) {
|
15302 | this.hideEditorPopup();
|
15303 | this.hideEditorPopup = null;
|
15304 | }
|
15305 | else {
|
15306 | utils_1._.removeAllChildren(this.getGui());
|
15307 |
|
15308 | if (this.usingWrapper) {
|
15309 |
|
15310 | this.getGui().appendChild(this.eCellWrapper);
|
15311 | }
|
15312 | else {
|
15313 |
|
15314 |
|
15315 |
|
15316 | if (this.cellRenderer) {
|
15317 |
|
15318 |
|
15319 | var eCell = this.cellRendererGui;
|
15320 |
|
15321 |
|
15322 | if (eCell) {
|
15323 | this.getGui().appendChild(eCell);
|
15324 | }
|
15325 | }
|
15326 | }
|
15327 | }
|
15328 | this.setInlineEditingClass();
|
15329 | if (newValueExists) {
|
15330 | this.rowNode.setDataValue(this.column, newValue);
|
15331 | this.getValueAndFormat();
|
15332 | }
|
15333 |
|
15334 |
|
15335 |
|
15336 | this.refreshCell({ forceRefresh: true, suppressFlash: true });
|
15337 | var event = this.createEvent(null, events_1.Events.EVENT_CELL_EDITING_STOPPED);
|
15338 | this.beans.eventService.dispatchEvent(event);
|
15339 | };
|
15340 | CellComp.DOM_DATA_KEY_CELL_COMP = 'cellComp';
|
15341 | return CellComp;
|
15342 | }(component_1.Component));
|
15343 | exports.CellComp = CellComp;
|
15344 |
|
15345 |
|
15346 | }),
|
15347 |
|
15348 | (function(module, exports, __webpack_require__) {
|
15349 |
|
15350 | "use strict";
|
15351 |
|
15352 |
|
15353 |
|
15354 |
|
15355 |
|
15356 |
|
15357 |
|
15358 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
15359 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
15360 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
15361 | 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;
|
15362 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
15363 | };
|
15364 | var __metadata = (this && this.__metadata) || function (k, v) {
|
15365 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
15366 | };
|
15367 | Object.defineProperty(exports, "__esModule", { value: true });
|
15368 | var utils_1 = __webpack_require__(1);
|
15369 | var constants_1 = __webpack_require__(9);
|
15370 | var context_1 = __webpack_require__(0);
|
15371 | var gridCore_1 = __webpack_require__(42);
|
15372 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
15373 | var environment_1 = __webpack_require__(41);
|
15374 | var PopupService = (function () {
|
15375 | function PopupService() {
|
15376 | this.activePopupElements = [];
|
15377 | }
|
15378 | PopupService.prototype.getPopupParent = function () {
|
15379 | var ePopupParent = this.gridOptionsWrapper.getPopupParent();
|
15380 | if (ePopupParent) {
|
15381 |
|
15382 | return ePopupParent;
|
15383 | }
|
15384 | else {
|
15385 | return this.gridCore.getRootGui();
|
15386 | }
|
15387 | };
|
15388 | PopupService.prototype.positionPopupForMenu = function (params) {
|
15389 | var sourceRect = params.eventSource.getBoundingClientRect();
|
15390 | var parentRect = this.getPopupParent().getBoundingClientRect();
|
15391 | var y = sourceRect.top - parentRect.top;
|
15392 | y = this.keepYWithinBounds(params, y);
|
15393 | var minWidth = (params.ePopup.clientWidth > 0) ? params.ePopup.clientWidth : 200;
|
15394 | var widthOfParent = parentRect.right - parentRect.left;
|
15395 | var maxX = widthOfParent - minWidth;
|
15396 |
|
15397 |
|
15398 |
|
15399 | var x;
|
15400 | if (this.gridOptionsWrapper.isEnableRtl()) {
|
15401 |
|
15402 | x = xLeftPosition();
|
15403 | if (x < 0) {
|
15404 | x = xRightPosition();
|
15405 | }
|
15406 | if (x > maxX) {
|
15407 | x = 0;
|
15408 | }
|
15409 | }
|
15410 | else {
|
15411 |
|
15412 | x = xRightPosition();
|
15413 | if (x > maxX) {
|
15414 | x = xLeftPosition();
|
15415 | }
|
15416 | if (x < 0) {
|
15417 | x = 0;
|
15418 | }
|
15419 | }
|
15420 | params.ePopup.style.left = x + "px";
|
15421 | params.ePopup.style.top = y + "px";
|
15422 | function xRightPosition() {
|
15423 | return sourceRect.right - parentRect.left - 2;
|
15424 | }
|
15425 | function xLeftPosition() {
|
15426 | return sourceRect.left - parentRect.left - minWidth;
|
15427 | }
|
15428 | };
|
15429 | PopupService.prototype.positionPopupUnderMouseEvent = function (params) {
|
15430 | var parentRect = this.getPopupParent().getBoundingClientRect();
|
15431 | this.positionPopup({
|
15432 | ePopup: params.ePopup,
|
15433 | x: params.mouseEvent.clientX - parentRect.left,
|
15434 | y: params.mouseEvent.clientY - parentRect.top,
|
15435 | keepWithinBounds: true
|
15436 | });
|
15437 | this.callPostProcessPopup(params.ePopup, null, params.mouseEvent, params.type, params.column, params.rowNode);
|
15438 | };
|
15439 | PopupService.prototype.positionPopupUnderComponent = function (params) {
|
15440 | var sourceRect = params.eventSource.getBoundingClientRect();
|
15441 | var parentRect = this.getPopupParent().getBoundingClientRect();
|
15442 | this.positionPopup({
|
15443 | ePopup: params.ePopup,
|
15444 | minWidth: params.minWidth,
|
15445 | nudgeX: params.nudgeX,
|
15446 | nudgeY: params.nudgeY,
|
15447 | x: sourceRect.left - parentRect.left,
|
15448 | y: sourceRect.top - parentRect.top + sourceRect.height,
|
15449 | keepWithinBounds: params.keepWithinBounds
|
15450 | });
|
15451 | this.callPostProcessPopup(params.ePopup, params.eventSource, null, params.type, params.column, params.rowNode);
|
15452 | };
|
15453 | PopupService.prototype.callPostProcessPopup = function (ePopup, eventSource, mouseEvent, type, column, rowNode) {
|
15454 | var callback = this.gridOptionsWrapper.getPostProcessPopupFunc();
|
15455 | if (callback) {
|
15456 | var params = {
|
15457 | column: column,
|
15458 | rowNode: rowNode,
|
15459 | ePopup: ePopup,
|
15460 | type: type,
|
15461 | eventSource: eventSource,
|
15462 | mouseEvent: mouseEvent
|
15463 | };
|
15464 | callback(params);
|
15465 | }
|
15466 | };
|
15467 | PopupService.prototype.positionPopupOverComponent = function (params) {
|
15468 | var sourceRect = params.eventSource.getBoundingClientRect();
|
15469 | var parentRect = this.getPopupParent().getBoundingClientRect();
|
15470 | this.positionPopup({
|
15471 | ePopup: params.ePopup,
|
15472 | minWidth: params.minWidth,
|
15473 | nudgeX: params.nudgeX,
|
15474 | nudgeY: params.nudgeY,
|
15475 | x: sourceRect.left - parentRect.left,
|
15476 | y: sourceRect.top - parentRect.top,
|
15477 | keepWithinBounds: params.keepWithinBounds
|
15478 | });
|
15479 | this.callPostProcessPopup(params.ePopup, params.eventSource, null, params.type, params.column, params.rowNode);
|
15480 | };
|
15481 | PopupService.prototype.positionPopup = function (params) {
|
15482 | var x = params.x;
|
15483 | var y = params.y;
|
15484 | if (params.nudgeX) {
|
15485 | x += params.nudgeX;
|
15486 | }
|
15487 | if (params.nudgeY) {
|
15488 | y += params.nudgeY;
|
15489 | }
|
15490 |
|
15491 | if (params.keepWithinBounds) {
|
15492 | x = this.keepXWithinBounds(params, x);
|
15493 | y = this.keepYWithinBounds(params, y);
|
15494 | }
|
15495 | params.ePopup.style.left = x + "px";
|
15496 | params.ePopup.style.top = y + "px";
|
15497 | };
|
15498 | PopupService.prototype.keepYWithinBounds = function (params, y) {
|
15499 | var parentRect = this.getPopupParent().getBoundingClientRect();
|
15500 | var minHeight;
|
15501 | if (params.ePopup.clientHeight > 0) {
|
15502 | minHeight = params.ePopup.clientHeight;
|
15503 | }
|
15504 | else {
|
15505 | minHeight = 200;
|
15506 | }
|
15507 | var heightOfParent = parentRect.bottom - parentRect.top;
|
15508 | var maxY = heightOfParent - minHeight - 5;
|
15509 | if (y > maxY) {
|
15510 | return maxY;
|
15511 | }
|
15512 | else if (y < 0) {
|
15513 | return 0;
|
15514 | }
|
15515 | else {
|
15516 | return y;
|
15517 | }
|
15518 | };
|
15519 | PopupService.prototype.keepXWithinBounds = function (params, x) {
|
15520 | var parentRect = this.getPopupParent().getBoundingClientRect();
|
15521 | var minWidth;
|
15522 | if (params.minWidth > 0) {
|
15523 | minWidth = params.minWidth;
|
15524 | }
|
15525 | else if (params.ePopup.clientWidth > 0) {
|
15526 | minWidth = params.ePopup.clientWidth;
|
15527 | }
|
15528 | else {
|
15529 | minWidth = 200;
|
15530 | }
|
15531 | var widthOfParent = parentRect.right - parentRect.left;
|
15532 | var maxX = widthOfParent - minWidth - 5;
|
15533 | if (x > maxX) {
|
15534 | return maxX;
|
15535 | }
|
15536 | else if (x < 0) {
|
15537 | return 0;
|
15538 | }
|
15539 | else {
|
15540 | return x;
|
15541 | }
|
15542 | };
|
15543 |
|
15544 |
|
15545 |
|
15546 | PopupService.prototype.addAsModalPopup = function (eChild, closeOnEsc, closedCallback, click) {
|
15547 | var _this = this;
|
15548 | var eBody = this.gridOptionsWrapper.getDocument();
|
15549 | if (!eBody) {
|
15550 | console.warn('ag-grid: could not find the body of the document, document.body is empty');
|
15551 | return;
|
15552 | }
|
15553 | eChild.style.top = '0px';
|
15554 | eChild.style.left = '0px';
|
15555 | var popupAlreadyShown = utils_1.Utils.isVisible(eChild);
|
15556 | if (popupAlreadyShown) {
|
15557 | return;
|
15558 | }
|
15559 | var ePopupParent = this.getPopupParent();
|
15560 |
|
15561 |
|
15562 | var eWrapper = document.createElement('div');
|
15563 | utils_1.Utils.addCssClass(eWrapper, this.environment.getTheme());
|
15564 | eWrapper.appendChild(eChild);
|
15565 | ePopupParent.appendChild(eWrapper);
|
15566 | this.activePopupElements.push(eChild);
|
15567 | var popupHidden = false;
|
15568 | var hidePopupOnKeyboardEvent = function (event) {
|
15569 | var key = event.which || event.keyCode;
|
15570 | if (key === constants_1.Constants.KEY_ESCAPE) {
|
15571 | hidePopup(null);
|
15572 | }
|
15573 | };
|
15574 | var hidePopupOnMouseEvent = function (event) {
|
15575 | hidePopup(event);
|
15576 | };
|
15577 | var hidePopupOnTouchEvent = function (event) {
|
15578 | hidePopup(null, event);
|
15579 | };
|
15580 | var hidePopup = function (mouseEvent, touchEvent) {
|
15581 |
|
15582 |
|
15583 | if (_this.isEventFromCurrentPopup(mouseEvent, touchEvent, eChild)) {
|
15584 | return;
|
15585 | }
|
15586 |
|
15587 | if (_this.isEventSameChainAsOriginalEvent(click, mouseEvent, touchEvent)) {
|
15588 | return;
|
15589 | }
|
15590 |
|
15591 |
|
15592 | if (popupHidden) {
|
15593 | return;
|
15594 | }
|
15595 | popupHidden = true;
|
15596 | ePopupParent.removeChild(eWrapper);
|
15597 | utils_1.Utils.removeFromArray(_this.activePopupElements, eChild);
|
15598 | eBody.removeEventListener('keydown', hidePopupOnKeyboardEvent);
|
15599 | eBody.removeEventListener('click', hidePopupOnMouseEvent);
|
15600 | eBody.removeEventListener('touchstart', hidePopupOnTouchEvent);
|
15601 | eBody.removeEventListener('contextmenu', hidePopupOnMouseEvent);
|
15602 | if (closedCallback) {
|
15603 | closedCallback();
|
15604 | }
|
15605 | };
|
15606 |
|
15607 |
|
15608 | setTimeout(function () {
|
15609 | if (closeOnEsc) {
|
15610 | eBody.addEventListener('keydown', hidePopupOnKeyboardEvent);
|
15611 | }
|
15612 | eBody.addEventListener('click', hidePopupOnMouseEvent);
|
15613 | eBody.addEventListener('touchstart', hidePopupOnTouchEvent);
|
15614 | eBody.addEventListener('contextmenu', hidePopupOnMouseEvent);
|
15615 | }, 0);
|
15616 | return hidePopup;
|
15617 | };
|
15618 | PopupService.prototype.isEventFromCurrentPopup = function (mouseEvent, touchEvent, eChild) {
|
15619 | var event = mouseEvent ? mouseEvent : touchEvent;
|
15620 | if (event) {
|
15621 | var indexOfThisChild = this.activePopupElements.indexOf(eChild);
|
15622 | for (var i = indexOfThisChild; i < this.activePopupElements.length; i++) {
|
15623 | var element = this.activePopupElements[i];
|
15624 | if (utils_1.Utils.isElementInEventPath(element, event)) {
|
15625 | return true;
|
15626 | }
|
15627 | }
|
15628 | }
|
15629 | return false;
|
15630 | };
|
15631 |
|
15632 |
|
15633 | PopupService.prototype.isEventSameChainAsOriginalEvent = function (originalClick, mouseEvent, touchEvent) {
|
15634 |
|
15635 |
|
15636 |
|
15637 |
|
15638 | var mouseEventOrTouch;
|
15639 | if (mouseEvent) {
|
15640 |
|
15641 | mouseEventOrTouch = mouseEvent;
|
15642 | }
|
15643 | else if (touchEvent) {
|
15644 |
|
15645 | mouseEventOrTouch = touchEvent.touches[0];
|
15646 | }
|
15647 | if (mouseEventOrTouch && originalClick) {
|
15648 |
|
15649 |
|
15650 | var xMatch = Math.abs(originalClick.screenX - mouseEvent.screenX) < 5;
|
15651 | var yMatch = Math.abs(originalClick.screenY - mouseEvent.screenY) < 5;
|
15652 | if (xMatch && yMatch) {
|
15653 | return true;
|
15654 | }
|
15655 | }
|
15656 | return false;
|
15657 | };
|
15658 | __decorate([
|
15659 | context_1.Autowired('gridCore'),
|
15660 | __metadata("design:type", gridCore_1.GridCore)
|
15661 | ], PopupService.prototype, "gridCore", void 0);
|
15662 | __decorate([
|
15663 | context_1.Autowired('gridOptionsWrapper'),
|
15664 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
15665 | ], PopupService.prototype, "gridOptionsWrapper", void 0);
|
15666 | __decorate([
|
15667 | context_1.Autowired('environment'),
|
15668 | __metadata("design:type", environment_1.Environment)
|
15669 | ], PopupService.prototype, "environment", void 0);
|
15670 | PopupService = __decorate([
|
15671 | context_1.Bean('popupService')
|
15672 | ], PopupService);
|
15673 | return PopupService;
|
15674 | }());
|
15675 | exports.PopupService = PopupService;
|
15676 |
|
15677 |
|
15678 | }),
|
15679 |
|
15680 | (function(module, exports, __webpack_require__) {
|
15681 |
|
15682 | "use strict";
|
15683 |
|
15684 |
|
15685 |
|
15686 |
|
15687 |
|
15688 |
|
15689 |
|
15690 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
15691 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
15692 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
15693 | 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;
|
15694 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
15695 | };
|
15696 | var __metadata = (this && this.__metadata) || function (k, v) {
|
15697 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
15698 | };
|
15699 | Object.defineProperty(exports, "__esModule", { value: true });
|
15700 | var context_1 = __webpack_require__(0);
|
15701 | var eventService_1 = __webpack_require__(3);
|
15702 | var events_1 = __webpack_require__(5);
|
15703 | var columnController_1 = __webpack_require__(4);
|
15704 | var columnApi_1 = __webpack_require__(7);
|
15705 | var gridApi_1 = __webpack_require__(6);
|
15706 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
15707 | var ScrollVisibleService = (function () {
|
15708 | function ScrollVisibleService() {
|
15709 | }
|
15710 | ScrollVisibleService.prototype.setScrollsVisible = function (params) {
|
15711 | var atLeastOneDifferent = this.bodyHorizontalScrollShowing !== params.bodyHorizontalScrollShowing ||
|
15712 | this.leftVerticalScrollShowing !== params.leftVerticalScrollShowing ||
|
15713 | this.rightVerticalScrollShowing !== params.rightVerticalScrollShowing;
|
15714 | if (atLeastOneDifferent) {
|
15715 | this.bodyHorizontalScrollShowing = params.bodyHorizontalScrollShowing;
|
15716 | this.leftVerticalScrollShowing = params.leftVerticalScrollShowing;
|
15717 | this.rightVerticalScrollShowing = params.rightVerticalScrollShowing;
|
15718 | var event_1 = {
|
15719 | type: events_1.Events.EVENT_SCROLL_VISIBILITY_CHANGED,
|
15720 | api: this.gridApi,
|
15721 | columnApi: this.columnApi
|
15722 | };
|
15723 | this.eventService.dispatchEvent(event_1);
|
15724 | }
|
15725 | };
|
15726 |
|
15727 | ScrollVisibleService.prototype.isBodyHorizontalScrollShowing = function () {
|
15728 | return this.bodyHorizontalScrollShowing;
|
15729 | };
|
15730 |
|
15731 | ScrollVisibleService.prototype.isLeftVerticalScrollShowing = function () {
|
15732 | return this.leftVerticalScrollShowing;
|
15733 | };
|
15734 |
|
15735 | ScrollVisibleService.prototype.isRightVerticalScrollShowing = function () {
|
15736 | return this.rightVerticalScrollShowing;
|
15737 | };
|
15738 | __decorate([
|
15739 | context_1.Autowired('eventService'),
|
15740 | __metadata("design:type", eventService_1.EventService)
|
15741 | ], ScrollVisibleService.prototype, "eventService", void 0);
|
15742 | __decorate([
|
15743 | context_1.Autowired('columnController'),
|
15744 | __metadata("design:type", columnController_1.ColumnController)
|
15745 | ], ScrollVisibleService.prototype, "columnController", void 0);
|
15746 | __decorate([
|
15747 | context_1.Autowired('columnApi'),
|
15748 | __metadata("design:type", columnApi_1.ColumnApi)
|
15749 | ], ScrollVisibleService.prototype, "columnApi", void 0);
|
15750 | __decorate([
|
15751 | context_1.Autowired('gridApi'),
|
15752 | __metadata("design:type", gridApi_1.GridApi)
|
15753 | ], ScrollVisibleService.prototype, "gridApi", void 0);
|
15754 | __decorate([
|
15755 | context_1.Autowired('gridOptionsWrapper'),
|
15756 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
15757 | ], ScrollVisibleService.prototype, "gridOptionsWrapper", void 0);
|
15758 | ScrollVisibleService = __decorate([
|
15759 | context_1.Bean('scrollVisibleService')
|
15760 | ], ScrollVisibleService);
|
15761 | return ScrollVisibleService;
|
15762 | }());
|
15763 | exports.ScrollVisibleService = ScrollVisibleService;
|
15764 |
|
15765 |
|
15766 | }),
|
15767 |
|
15768 | (function(module, exports, __webpack_require__) {
|
15769 |
|
15770 | "use strict";
|
15771 |
|
15772 |
|
15773 |
|
15774 |
|
15775 |
|
15776 |
|
15777 |
|
15778 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
15779 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
15780 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
15781 | 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;
|
15782 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
15783 | };
|
15784 | var __metadata = (this && this.__metadata) || function (k, v) {
|
15785 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
15786 | };
|
15787 | Object.defineProperty(exports, "__esModule", { value: true });
|
15788 | var context_1 = __webpack_require__(0);
|
15789 | var linkedList_1 = __webpack_require__(124);
|
15790 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
15791 | var eventKeys_1 = __webpack_require__(25);
|
15792 | var eventService_1 = __webpack_require__(3);
|
15793 | var AnimationFrameService = (function () {
|
15794 | function AnimationFrameService() {
|
15795 | this.p1Tasks = new linkedList_1.LinkedList();
|
15796 | this.p2Tasks = new linkedList_1.LinkedList();
|
15797 | this.ticking = false;
|
15798 | }
|
15799 | AnimationFrameService.prototype.registerGridComp = function (gridPanel) {
|
15800 | this.gridPanel = gridPanel;
|
15801 | };
|
15802 | AnimationFrameService.prototype.init = function () {
|
15803 | this.useAnimationFrame = !this.gridOptionsWrapper.isSuppressAnimationFrame();
|
15804 | };
|
15805 |
|
15806 |
|
15807 |
|
15808 |
|
15809 | AnimationFrameService.prototype.verifyAnimationFrameOn = function (methodName) {
|
15810 | if (this.useAnimationFrame === false) {
|
15811 | console.warn("ag-Grid: AnimationFrameService." + methodName + " called but animation frames are off");
|
15812 | }
|
15813 | };
|
15814 | AnimationFrameService.prototype.addP1Task = function (task) {
|
15815 | this.verifyAnimationFrameOn('addP1Task');
|
15816 | this.p1Tasks.add(task);
|
15817 | this.schedule();
|
15818 | };
|
15819 | AnimationFrameService.prototype.addP2Task = function (task) {
|
15820 | this.verifyAnimationFrameOn('addP2Task');
|
15821 | this.p2Tasks.add(task);
|
15822 | this.schedule();
|
15823 | };
|
15824 | AnimationFrameService.prototype.executeFrame = function (millis) {
|
15825 | this.verifyAnimationFrameOn('executeFrame');
|
15826 | var frameStart = new Date().getTime();
|
15827 | var duration = (new Date().getTime()) - frameStart;
|
15828 | var gridPanelNeedsAFrame = true;
|
15829 |
|
15830 | var noMaxMillis = millis <= 0;
|
15831 | while (noMaxMillis || duration < millis) {
|
15832 | if (gridPanelNeedsAFrame) {
|
15833 | gridPanelNeedsAFrame = this.gridPanel.executeFrame();
|
15834 | }
|
15835 | else if (!this.p1Tasks.isEmpty()) {
|
15836 | var task = this.p1Tasks.remove();
|
15837 | task();
|
15838 | }
|
15839 | else if (!this.p2Tasks.isEmpty()) {
|
15840 | var task = this.p2Tasks.remove();
|
15841 | task();
|
15842 | }
|
15843 | else {
|
15844 | break;
|
15845 | }
|
15846 | duration = (new Date().getTime()) - frameStart;
|
15847 | }
|
15848 | if (gridPanelNeedsAFrame || !this.p1Tasks.isEmpty() || !this.p2Tasks.isEmpty()) {
|
15849 | this.requestFrame();
|
15850 | }
|
15851 | else {
|
15852 | this.stopTicking();
|
15853 | }
|
15854 | };
|
15855 | AnimationFrameService.prototype.stopTicking = function () {
|
15856 | this.ticking = false;
|
15857 | var event = {
|
15858 | type: eventKeys_1.Events.EVENT_ANIMATION_QUEUE_EMPTY,
|
15859 | columnApi: this.gridOptionsWrapper.getColumnApi(),
|
15860 | api: this.gridOptionsWrapper.getApi()
|
15861 | };
|
15862 | this.eventService.dispatchEvent(event);
|
15863 | };
|
15864 | AnimationFrameService.prototype.flushAllFrames = function () {
|
15865 | if (!this.useAnimationFrame) {
|
15866 | return;
|
15867 | }
|
15868 | this.executeFrame(-1);
|
15869 | };
|
15870 | AnimationFrameService.prototype.schedule = function () {
|
15871 | if (!this.useAnimationFrame) {
|
15872 | return;
|
15873 | }
|
15874 | if (!this.ticking) {
|
15875 | this.ticking = true;
|
15876 | this.requestFrame();
|
15877 | }
|
15878 | };
|
15879 | AnimationFrameService.prototype.requestFrame = function () {
|
15880 |
|
15881 |
|
15882 | var callback = this.executeFrame.bind(this, 60);
|
15883 | if (window.requestAnimationFrame) {
|
15884 | window.requestAnimationFrame(callback);
|
15885 | }
|
15886 | else if (window.webkitRequestAnimationFrame) {
|
15887 | window.webkitRequestAnimationFrame(callback);
|
15888 | }
|
15889 | else {
|
15890 | setTimeout(callback, 0);
|
15891 | }
|
15892 | };
|
15893 | AnimationFrameService.prototype.isQueueEmpty = function () {
|
15894 | return this.ticking;
|
15895 | };
|
15896 | __decorate([
|
15897 | context_1.Autowired('gridOptionsWrapper'),
|
15898 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
15899 | ], AnimationFrameService.prototype, "gridOptionsWrapper", void 0);
|
15900 | __decorate([
|
15901 | context_1.Autowired('eventService'),
|
15902 | __metadata("design:type", eventService_1.EventService)
|
15903 | ], AnimationFrameService.prototype, "eventService", void 0);
|
15904 | __decorate([
|
15905 | context_1.PostConstruct,
|
15906 | __metadata("design:type", Function),
|
15907 | __metadata("design:paramtypes", []),
|
15908 | __metadata("design:returntype", void 0)
|
15909 | ], AnimationFrameService.prototype, "init", null);
|
15910 | AnimationFrameService = __decorate([
|
15911 | context_1.Bean('animationFrameService')
|
15912 | ], AnimationFrameService);
|
15913 | return AnimationFrameService;
|
15914 | }());
|
15915 | exports.AnimationFrameService = AnimationFrameService;
|
15916 |
|
15917 |
|
15918 | }),
|
15919 |
|
15920 | (function(module, exports, __webpack_require__) {
|
15921 |
|
15922 | "use strict";
|
15923 |
|
15924 |
|
15925 |
|
15926 |
|
15927 |
|
15928 |
|
15929 |
|
15930 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
15931 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
15932 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
15933 | 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;
|
15934 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
15935 | };
|
15936 | var __metadata = (this && this.__metadata) || function (k, v) {
|
15937 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
15938 | };
|
15939 | var __param = (this && this.__param) || function (paramIndex, decorator) {
|
15940 | return function (target, key) { decorator(target, key, paramIndex); }
|
15941 | };
|
15942 | Object.defineProperty(exports, "__esModule", { value: true });
|
15943 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
15944 | var logger_1 = __webpack_require__(12);
|
15945 | var columnUtils_1 = __webpack_require__(31);
|
15946 | var columnKeyCreator_1 = __webpack_require__(107);
|
15947 | var originalColumnGroup_1 = __webpack_require__(32);
|
15948 | var column_1 = __webpack_require__(10);
|
15949 | var context_1 = __webpack_require__(0);
|
15950 | var utils_1 = __webpack_require__(1);
|
15951 | var defaultColumnTypes_1 = __webpack_require__(134);
|
15952 |
|
15953 | var BalancedColumnTreeBuilder = (function () {
|
15954 | function BalancedColumnTreeBuilder() {
|
15955 | }
|
15956 | BalancedColumnTreeBuilder.prototype.setBeans = function (loggerFactory) {
|
15957 | this.logger = loggerFactory.create('BalancedColumnTreeBuilder');
|
15958 | };
|
15959 | BalancedColumnTreeBuilder.prototype.createForAutoGroups = function (autoGroupCols, gridBalancedTree) {
|
15960 | var _this = this;
|
15961 | var autoColBalancedTree = [];
|
15962 | autoGroupCols.forEach(function (col) {
|
15963 | var fakeTreeItem = _this.createAutoGroupTreeItem(gridBalancedTree, col);
|
15964 | autoColBalancedTree.push(fakeTreeItem);
|
15965 | });
|
15966 | return autoColBalancedTree;
|
15967 | };
|
15968 | BalancedColumnTreeBuilder.prototype.createAutoGroupTreeItem = function (balancedColumnTree, column) {
|
15969 | var dept = this.findDept(balancedColumnTree);
|
15970 |
|
15971 | var nextChild = column;
|
15972 | for (var i = dept - 1; i >= 0; i--) {
|
15973 | var autoGroup = new originalColumnGroup_1.OriginalColumnGroup(null, "FAKE_PATH_" + column.getId() + "}_" + i, true, i);
|
15974 | this.context.wireBean(autoGroup);
|
15975 | autoGroup.setChildren([nextChild]);
|
15976 | nextChild = autoGroup;
|
15977 | }
|
15978 |
|
15979 | return nextChild;
|
15980 | };
|
15981 | BalancedColumnTreeBuilder.prototype.findDept = function (balancedColumnTree) {
|
15982 | var dept = 0;
|
15983 | var pointer = balancedColumnTree;
|
15984 | while (pointer && pointer[0] && pointer[0] instanceof originalColumnGroup_1.OriginalColumnGroup) {
|
15985 | dept++;
|
15986 | pointer = pointer[0].getChildren();
|
15987 | }
|
15988 | return dept;
|
15989 | };
|
15990 | BalancedColumnTreeBuilder.prototype.createBalancedColumnGroups = function (abstractColDefs, primaryColumns) {
|
15991 |
|
15992 |
|
15993 |
|
15994 | var columnKeyCreator = new columnKeyCreator_1.ColumnKeyCreator();
|
15995 |
|
15996 | var unbalancedTree = this.recursivelyCreateColumns(abstractColDefs, 0, columnKeyCreator, primaryColumns);
|
15997 | var treeDept = this.findMaxDept(unbalancedTree, 0);
|
15998 | this.logger.log('Number of levels for grouped columns is ' + treeDept);
|
15999 | var balancedTree = this.balanceColumnTree(unbalancedTree, 0, treeDept, columnKeyCreator);
|
16000 | this.columnUtils.depthFirstOriginalTreeSearch(balancedTree, function (child) {
|
16001 | if (child instanceof originalColumnGroup_1.OriginalColumnGroup) {
|
16002 | child.setupExpandable();
|
16003 | }
|
16004 | });
|
16005 | return {
|
16006 | balancedTree: balancedTree,
|
16007 | treeDept: treeDept
|
16008 | };
|
16009 | };
|
16010 | BalancedColumnTreeBuilder.prototype.balanceColumnTree = function (unbalancedTree, currentDept, columnDept, columnKeyCreator) {
|
16011 | var _this = this;
|
16012 | var result = [];
|
16013 |
|
16014 |
|
16015 | unbalancedTree.forEach(function (child) {
|
16016 | if (child instanceof originalColumnGroup_1.OriginalColumnGroup) {
|
16017 | var originalGroup = child;
|
16018 | var newChildren = _this.balanceColumnTree(originalGroup.getChildren(), currentDept + 1, columnDept, columnKeyCreator);
|
16019 | originalGroup.setChildren(newChildren);
|
16020 | result.push(originalGroup);
|
16021 | }
|
16022 | else {
|
16023 | var newChild = child;
|
16024 | for (var i = columnDept - 1; i >= currentDept; i--) {
|
16025 | var newColId = columnKeyCreator.getUniqueKey(null, null);
|
16026 | var colGroupDefMerged = _this.createMergedColGroupDef(null);
|
16027 | var paddedGroup = new originalColumnGroup_1.OriginalColumnGroup(colGroupDefMerged, newColId, true, currentDept);
|
16028 | _this.context.wireBean(paddedGroup);
|
16029 | paddedGroup.setChildren([newChild]);
|
16030 | newChild = paddedGroup;
|
16031 | }
|
16032 | result.push(newChild);
|
16033 | }
|
16034 | });
|
16035 | return result;
|
16036 | };
|
16037 | BalancedColumnTreeBuilder.prototype.findMaxDept = function (treeChildren, dept) {
|
16038 | var maxDeptThisLevel = dept;
|
16039 | for (var i = 0; i < treeChildren.length; i++) {
|
16040 | var abstractColumn = treeChildren[i];
|
16041 | if (abstractColumn instanceof originalColumnGroup_1.OriginalColumnGroup) {
|
16042 | var originalGroup = abstractColumn;
|
16043 | var newDept = this.findMaxDept(originalGroup.getChildren(), dept + 1);
|
16044 | if (maxDeptThisLevel < newDept) {
|
16045 | maxDeptThisLevel = newDept;
|
16046 | }
|
16047 | }
|
16048 | }
|
16049 | return maxDeptThisLevel;
|
16050 | };
|
16051 | BalancedColumnTreeBuilder.prototype.recursivelyCreateColumns = function (abstractColDefs, level, columnKeyCreator, primaryColumns) {
|
16052 | var _this = this;
|
16053 | var result = [];
|
16054 | if (!abstractColDefs) {
|
16055 | return result;
|
16056 | }
|
16057 | abstractColDefs.forEach(function (abstractColDef) {
|
16058 | var newGroupOrColumn;
|
16059 | if (_this.isColumnGroup(abstractColDef)) {
|
16060 | newGroupOrColumn = _this.createColumnGroup(columnKeyCreator, primaryColumns, abstractColDef, level);
|
16061 | }
|
16062 | else {
|
16063 | newGroupOrColumn = _this.createColumn(columnKeyCreator, primaryColumns, abstractColDef);
|
16064 | }
|
16065 | result.push(newGroupOrColumn);
|
16066 | });
|
16067 | return result;
|
16068 | };
|
16069 | BalancedColumnTreeBuilder.prototype.createColumnGroup = function (columnKeyCreator, primaryColumns, colGroupDef, level) {
|
16070 | var colGroupDefMerged = this.createMergedColGroupDef(colGroupDef);
|
16071 | var groupId = columnKeyCreator.getUniqueKey(colGroupDefMerged.groupId, null);
|
16072 | var originalGroup = new originalColumnGroup_1.OriginalColumnGroup(colGroupDefMerged, groupId, false, level);
|
16073 | this.context.wireBean(originalGroup);
|
16074 | var children = this.recursivelyCreateColumns(colGroupDefMerged.children, level + 1, columnKeyCreator, primaryColumns);
|
16075 | originalGroup.setChildren(children);
|
16076 | return originalGroup;
|
16077 | };
|
16078 | BalancedColumnTreeBuilder.prototype.createMergedColGroupDef = function (colGroupDef) {
|
16079 | var colGroupDefMerged = {};
|
16080 | utils_1.Utils.assign(colGroupDefMerged, this.gridOptionsWrapper.getDefaultColGroupDef());
|
16081 | utils_1.Utils.assign(colGroupDefMerged, colGroupDef);
|
16082 | this.checkForDeprecatedItems(colGroupDefMerged);
|
16083 | return colGroupDefMerged;
|
16084 | };
|
16085 | BalancedColumnTreeBuilder.prototype.createColumn = function (columnKeyCreator, primaryColumns, colDef) {
|
16086 | var colDefMerged = this.mergeColDefs(colDef);
|
16087 | this.checkForDeprecatedItems(colDefMerged);
|
16088 | var colId = columnKeyCreator.getUniqueKey(colDefMerged.colId, colDefMerged.field);
|
16089 | var column = new column_1.Column(colDefMerged, colId, primaryColumns);
|
16090 | this.context.wireBean(column);
|
16091 | return column;
|
16092 | };
|
16093 | BalancedColumnTreeBuilder.prototype.mergeColDefs = function (colDef) {
|
16094 |
|
16095 | var colDefMerged = {};
|
16096 |
|
16097 | utils_1.Utils.assign(colDefMerged, this.gridOptionsWrapper.getDefaultColDef());
|
16098 |
|
16099 | if (colDef.type) {
|
16100 | this.assignColumnTypes(colDef, colDefMerged);
|
16101 | }
|
16102 |
|
16103 | utils_1.Utils.assign(colDefMerged, colDef);
|
16104 | return colDefMerged;
|
16105 | };
|
16106 | BalancedColumnTreeBuilder.prototype.assignColumnTypes = function (colDef, colDefMerged) {
|
16107 | var typeKeys;
|
16108 | if (colDef.type instanceof Array) {
|
16109 | var invalidArray = colDef.type.some(function (a) { return typeof a !== 'string'; });
|
16110 | if (invalidArray) {
|
16111 | console.warn("ag-grid: if colDef.type is supplied an array it should be of type 'string[]'");
|
16112 | }
|
16113 | else {
|
16114 | typeKeys = colDef.type;
|
16115 | }
|
16116 | }
|
16117 | else if (typeof colDef.type === 'string') {
|
16118 | typeKeys = colDef.type.split(',');
|
16119 | }
|
16120 | else {
|
16121 | console.warn("ag-grid: colDef.type should be of type 'string' | 'string[]'");
|
16122 | return;
|
16123 | }
|
16124 |
|
16125 | var allColumnTypes = utils_1.Utils.assign({}, this.gridOptionsWrapper.getColumnTypes(), defaultColumnTypes_1.DefaultColumnTypes);
|
16126 | typeKeys.forEach(function (t) {
|
16127 | var typeColDef = allColumnTypes[t.trim()];
|
16128 | if (typeColDef) {
|
16129 | utils_1.Utils.assign(colDefMerged, typeColDef);
|
16130 | }
|
16131 | else {
|
16132 | console.warn("ag-grid: colDef.type '" + t + "' does not correspond to defined gridOptions.columnTypes");
|
16133 | }
|
16134 | });
|
16135 | };
|
16136 | BalancedColumnTreeBuilder.prototype.checkForDeprecatedItems = function (colDef) {
|
16137 | if (colDef) {
|
16138 | var colDefNoType = colDef;
|
16139 | if (colDefNoType.group !== undefined) {
|
16140 | console.warn('ag-grid: colDef.group is invalid, please check documentation on how to do grouping as it changed in version 3');
|
16141 | }
|
16142 | if (colDefNoType.headerGroup !== undefined) {
|
16143 | console.warn('ag-grid: colDef.headerGroup is invalid, please check documentation on how to do grouping as it changed in version 3');
|
16144 | }
|
16145 | if (colDefNoType.headerGroupShow !== undefined) {
|
16146 | console.warn('ag-grid: colDef.headerGroupShow is invalid, should be columnGroupShow, please check documentation on how to do grouping as it changed in version 3');
|
16147 | }
|
16148 | if (colDefNoType.suppressRowGroup !== undefined) {
|
16149 | console.warn('ag-grid: colDef.suppressRowGroup is deprecated, please use colDef.type instead');
|
16150 | }
|
16151 | if (colDefNoType.suppressAggregation !== undefined) {
|
16152 | console.warn('ag-grid: colDef.suppressAggregation is deprecated, please use colDef.type instead');
|
16153 | }
|
16154 | if (colDefNoType.suppressRowGroup || colDefNoType.suppressAggregation) {
|
16155 | console.warn('ag-grid: colDef.suppressAggregation and colDef.suppressRowGroup are deprecated, use allowRowGroup, allowPivot and allowValue instead');
|
16156 | }
|
16157 | if (colDefNoType.displayName) {
|
16158 | console.warn("ag-grid: Found displayName " + colDefNoType.displayName + ", please use headerName instead, displayName is deprecated.");
|
16159 | colDefNoType.headerName = colDefNoType.displayName;
|
16160 | }
|
16161 | }
|
16162 | };
|
16163 |
|
16164 | BalancedColumnTreeBuilder.prototype.isColumnGroup = function (abstractColDef) {
|
16165 | return abstractColDef.children !== undefined;
|
16166 | };
|
16167 | __decorate([
|
16168 | context_1.Autowired('gridOptionsWrapper'),
|
16169 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
16170 | ], BalancedColumnTreeBuilder.prototype, "gridOptionsWrapper", void 0);
|
16171 | __decorate([
|
16172 | context_1.Autowired('columnUtils'),
|
16173 | __metadata("design:type", columnUtils_1.ColumnUtils)
|
16174 | ], BalancedColumnTreeBuilder.prototype, "columnUtils", void 0);
|
16175 | __decorate([
|
16176 | context_1.Autowired('context'),
|
16177 | __metadata("design:type", context_1.Context)
|
16178 | ], BalancedColumnTreeBuilder.prototype, "context", void 0);
|
16179 | __decorate([
|
16180 | __param(0, context_1.Qualifier('loggerFactory')),
|
16181 | __metadata("design:type", Function),
|
16182 | __metadata("design:paramtypes", [logger_1.LoggerFactory]),
|
16183 | __metadata("design:returntype", void 0)
|
16184 | ], BalancedColumnTreeBuilder.prototype, "setBeans", null);
|
16185 | BalancedColumnTreeBuilder = __decorate([
|
16186 | context_1.Bean('balancedColumnTreeBuilder')
|
16187 | ], BalancedColumnTreeBuilder);
|
16188 | return BalancedColumnTreeBuilder;
|
16189 | }());
|
16190 | exports.BalancedColumnTreeBuilder = BalancedColumnTreeBuilder;
|
16191 |
|
16192 |
|
16193 | }),
|
16194 |
|
16195 | (function(module, exports, __webpack_require__) {
|
16196 |
|
16197 | "use strict";
|
16198 |
|
16199 |
|
16200 |
|
16201 |
|
16202 |
|
16203 |
|
16204 |
|
16205 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
16206 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
16207 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
16208 | 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;
|
16209 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
16210 | };
|
16211 | var __metadata = (this && this.__metadata) || function (k, v) {
|
16212 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
16213 | };
|
16214 | Object.defineProperty(exports, "__esModule", { value: true });
|
16215 | var rowRenderer_1 = __webpack_require__(20);
|
16216 | var context_1 = __webpack_require__(0);
|
16217 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
16218 | var headerWrapperComp_1 = __webpack_require__(100);
|
16219 | var AutoWidthCalculator = (function () {
|
16220 | function AutoWidthCalculator() {
|
16221 | }
|
16222 | AutoWidthCalculator.prototype.registerGridComp = function (gridPanel) {
|
16223 | this.gridPanel = gridPanel;
|
16224 | };
|
16225 | AutoWidthCalculator.prototype.registerHeaderRootComp = function (headerRootComp) {
|
16226 | this.headerRootComp = headerRootComp;
|
16227 | };
|
16228 |
|
16229 |
|
16230 |
|
16231 |
|
16232 | AutoWidthCalculator.prototype.getPreferredWidthForColumn = function (column) {
|
16233 | var eHeaderCell = this.getHeaderCellForColumn(column);
|
16234 |
|
16235 | if (!eHeaderCell) {
|
16236 | return -1;
|
16237 | }
|
16238 | var eDummyContainer = document.createElement('span');
|
16239 |
|
16240 | eDummyContainer.style.position = 'fixed';
|
16241 |
|
16242 |
|
16243 | var eBodyContainer = this.gridPanel.getBodyContainer();
|
16244 | eBodyContainer.appendChild(eDummyContainer);
|
16245 |
|
16246 |
|
16247 | this.putRowCellsIntoDummyContainer(column, eDummyContainer);
|
16248 |
|
16249 |
|
16250 |
|
16251 |
|
16252 | this.cloneItemIntoDummy(eHeaderCell, eDummyContainer);
|
16253 |
|
16254 |
|
16255 | var dummyContainerWidth = eDummyContainer.offsetWidth;
|
16256 |
|
16257 | eBodyContainer.removeChild(eDummyContainer);
|
16258 |
|
16259 |
|
16260 | var autoSizePadding = this.gridOptionsWrapper.getAutoSizePadding();
|
16261 | return dummyContainerWidth + autoSizePadding;
|
16262 | };
|
16263 | AutoWidthCalculator.prototype.getHeaderCellForColumn = function (column) {
|
16264 | var comp = null;
|
16265 |
|
16266 | this.headerRootComp.forEachHeaderElement(function (headerElement) {
|
16267 | if (headerElement instanceof headerWrapperComp_1.HeaderWrapperComp) {
|
16268 | var headerWrapperComp = headerElement;
|
16269 | if (headerWrapperComp.getColumn() === column) {
|
16270 | comp = headerWrapperComp;
|
16271 | }
|
16272 | }
|
16273 | });
|
16274 | return comp ? comp.getGui() : null;
|
16275 | };
|
16276 | AutoWidthCalculator.prototype.putRowCellsIntoDummyContainer = function (column, eDummyContainer) {
|
16277 | var _this = this;
|
16278 | var eCells = this.rowRenderer.getAllCellsForColumn(column);
|
16279 | eCells.forEach(function (eCell) { return _this.cloneItemIntoDummy(eCell, eDummyContainer); });
|
16280 | };
|
16281 | AutoWidthCalculator.prototype.cloneItemIntoDummy = function (eCell, eDummyContainer) {
|
16282 |
|
16283 | var eCellClone = eCell.cloneNode(true);
|
16284 |
|
16285 | eCellClone.style.width = '';
|
16286 |
|
16287 | eCellClone.style.position = 'static';
|
16288 | eCellClone.style.left = '';
|
16289 |
|
16290 |
|
16291 |
|
16292 | var eCloneParent = document.createElement('div');
|
16293 |
|
16294 |
|
16295 | eCloneParent.style.display = 'table-row';
|
16296 |
|
16297 |
|
16298 |
|
16299 | eCloneParent.appendChild(eCellClone);
|
16300 | eDummyContainer.appendChild(eCloneParent);
|
16301 | };
|
16302 | __decorate([
|
16303 | context_1.Autowired('rowRenderer'),
|
16304 | __metadata("design:type", rowRenderer_1.RowRenderer)
|
16305 | ], AutoWidthCalculator.prototype, "rowRenderer", void 0);
|
16306 | __decorate([
|
16307 | context_1.Autowired('gridOptionsWrapper'),
|
16308 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
16309 | ], AutoWidthCalculator.prototype, "gridOptionsWrapper", void 0);
|
16310 | AutoWidthCalculator = __decorate([
|
16311 | context_1.Bean('autoWidthCalculator')
|
16312 | ], AutoWidthCalculator);
|
16313 | return AutoWidthCalculator;
|
16314 | }());
|
16315 | exports.AutoWidthCalculator = AutoWidthCalculator;
|
16316 |
|
16317 |
|
16318 | }),
|
16319 |
|
16320 | (function(module, exports, __webpack_require__) {
|
16321 |
|
16322 | "use strict";
|
16323 |
|
16324 |
|
16325 |
|
16326 |
|
16327 |
|
16328 |
|
16329 |
|
16330 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
16331 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
16332 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
16333 | 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;
|
16334 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
16335 | };
|
16336 | var __metadata = (this && this.__metadata) || function (k, v) {
|
16337 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
16338 | };
|
16339 | Object.defineProperty(exports, "__esModule", { value: true });
|
16340 | var context_1 = __webpack_require__(0);
|
16341 | var logger_1 = __webpack_require__(12);
|
16342 | var utils_1 = __webpack_require__(1);
|
16343 | var eventService_1 = __webpack_require__(3);
|
16344 | var events_1 = __webpack_require__(5);
|
16345 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
16346 | var columnApi_1 = __webpack_require__(7);
|
16347 | var gridApi_1 = __webpack_require__(6);
|
16348 |
|
16349 |
|
16350 | var DragService = (function () {
|
16351 | function DragService() {
|
16352 | this.onMouseUpListener = this.onMouseUp.bind(this);
|
16353 | this.onMouseMoveListener = this.onMouseMove.bind(this);
|
16354 | this.onTouchEndListener = this.onTouchUp.bind(this);
|
16355 | this.onTouchMoveListener = this.onTouchMove.bind(this);
|
16356 | this.dragEndFunctions = [];
|
16357 | this.dragSources = [];
|
16358 | }
|
16359 | DragService.prototype.init = function () {
|
16360 | this.logger = this.loggerFactory.create('DragService');
|
16361 | };
|
16362 | DragService.prototype.destroy = function () {
|
16363 | this.dragSources.forEach(this.removeListener.bind(this));
|
16364 | this.dragSources.length = 0;
|
16365 | };
|
16366 | DragService.prototype.removeListener = function (dragSourceAndListener) {
|
16367 | var element = dragSourceAndListener.dragSource.eElement;
|
16368 | var mouseDownListener = dragSourceAndListener.mouseDownListener;
|
16369 | element.removeEventListener('mousedown', mouseDownListener);
|
16370 |
|
16371 | if (dragSourceAndListener.touchEnabled) {
|
16372 | var touchStartListener = dragSourceAndListener.touchStartListener;
|
16373 | element.removeEventListener('touchstart', touchStartListener, { passive: true });
|
16374 | }
|
16375 | };
|
16376 | DragService.prototype.removeDragSource = function (params) {
|
16377 | var dragSourceAndListener = utils_1.Utils.find(this.dragSources, function (item) { return item.dragSource === params; });
|
16378 | if (!dragSourceAndListener) {
|
16379 | return;
|
16380 | }
|
16381 | this.removeListener(dragSourceAndListener);
|
16382 | utils_1.Utils.removeFromArray(this.dragSources, dragSourceAndListener);
|
16383 | };
|
16384 | DragService.prototype.setNoSelectToBody = function (noSelect) {
|
16385 | var usrDocument = this.gridOptionsWrapper.getDocument();
|
16386 | var eBody = usrDocument.querySelector('body');
|
16387 | if (utils_1.Utils.exists(eBody)) {
|
16388 | utils_1.Utils.addOrRemoveCssClass(eBody, 'ag-body-no-select', noSelect);
|
16389 | }
|
16390 | };
|
16391 | DragService.prototype.addDragSource = function (params, includeTouch) {
|
16392 | if (includeTouch === void 0) { includeTouch = false; }
|
16393 | var mouseListener = this.onMouseDown.bind(this, params);
|
16394 | params.eElement.addEventListener('mousedown', mouseListener);
|
16395 | var touchListener = null;
|
16396 | var suppressTouch = this.gridOptionsWrapper.isSuppressTouch();
|
16397 | var reallyIncludeTouch = includeTouch && !suppressTouch;
|
16398 | if (reallyIncludeTouch) {
|
16399 | touchListener = this.onTouchStart.bind(this, params);
|
16400 | params.eElement.addEventListener('touchstart', touchListener, { passive: false });
|
16401 | }
|
16402 | this.dragSources.push({
|
16403 | dragSource: params,
|
16404 | mouseDownListener: mouseListener,
|
16405 | touchStartListener: touchListener,
|
16406 | touchEnabled: includeTouch
|
16407 | });
|
16408 | };
|
16409 |
|
16410 | DragService.prototype.onTouchStart = function (params, touchEvent) {
|
16411 | var _this = this;
|
16412 | this.currentDragParams = params;
|
16413 | this.dragging = false;
|
16414 | var touch = touchEvent.touches[0];
|
16415 | this.touchLastTime = touch;
|
16416 | this.touchStart = touch;
|
16417 | touchEvent.preventDefault();
|
16418 |
|
16419 |
|
16420 | params.eElement.addEventListener('touchmove', this.onTouchMoveListener, { passive: true });
|
16421 | params.eElement.addEventListener('touchend', this.onTouchEndListener, { passive: true });
|
16422 | params.eElement.addEventListener('touchcancel', this.onTouchEndListener, { passive: true });
|
16423 | this.dragEndFunctions.push(function () {
|
16424 | params.eElement.removeEventListener('touchmove', _this.onTouchMoveListener, { passive: true });
|
16425 | params.eElement.removeEventListener('touchend', _this.onTouchEndListener, { passive: true });
|
16426 | params.eElement.removeEventListener('touchcancel', _this.onTouchEndListener, { passive: true });
|
16427 | });
|
16428 |
|
16429 | if (params.dragStartPixels === 0) {
|
16430 | this.onCommonMove(touch, this.touchStart);
|
16431 | }
|
16432 | };
|
16433 |
|
16434 | DragService.prototype.onMouseDown = function (params, mouseEvent) {
|
16435 | var _this = this;
|
16436 |
|
16437 |
|
16438 |
|
16439 | if (params.skipMouseEvent) {
|
16440 | if (params.skipMouseEvent(mouseEvent)) {
|
16441 | return;
|
16442 | }
|
16443 | }
|
16444 |
|
16445 |
|
16446 |
|
16447 | if (mouseEvent._alreadyProcessedByDragService) {
|
16448 | return;
|
16449 | }
|
16450 | mouseEvent._alreadyProcessedByDragService = true;
|
16451 |
|
16452 | if (mouseEvent.button !== 0) {
|
16453 | return;
|
16454 | }
|
16455 | this.currentDragParams = params;
|
16456 | this.dragging = false;
|
16457 | this.mouseEventLastTime = mouseEvent;
|
16458 | this.mouseStartEvent = mouseEvent;
|
16459 | var usrDocument = this.gridOptionsWrapper.getDocument();
|
16460 |
|
16461 |
|
16462 | usrDocument.addEventListener('mousemove', this.onMouseMoveListener);
|
16463 | usrDocument.addEventListener('mouseup', this.onMouseUpListener);
|
16464 | this.dragEndFunctions.push(function () {
|
16465 | usrDocument.removeEventListener('mousemove', _this.onMouseMoveListener);
|
16466 | usrDocument.removeEventListener('mouseup', _this.onMouseUpListener);
|
16467 | });
|
16468 |
|
16469 | if (params.dragStartPixels === 0) {
|
16470 | this.onMouseMove(mouseEvent);
|
16471 | }
|
16472 | };
|
16473 |
|
16474 |
|
16475 | DragService.prototype.isEventNearStartEvent = function (currentEvent, startEvent) {
|
16476 |
|
16477 | var requiredPixelDiff = utils_1.Utils.exists(this.currentDragParams.dragStartPixels) ? this.currentDragParams.dragStartPixels : 4;
|
16478 | return utils_1.Utils.areEventsNear(currentEvent, startEvent, requiredPixelDiff);
|
16479 | };
|
16480 | DragService.prototype.getFirstActiveTouch = function (touchList) {
|
16481 | for (var i = 0; i < touchList.length; i++) {
|
16482 | var matches = touchList[i].identifier === this.touchStart.identifier;
|
16483 | if (matches) {
|
16484 | return touchList[i];
|
16485 | }
|
16486 | }
|
16487 | return null;
|
16488 | };
|
16489 | DragService.prototype.onCommonMove = function (currentEvent, startEvent) {
|
16490 | if (!this.dragging) {
|
16491 |
|
16492 | var toEarlyToDrag = !this.dragging && this.isEventNearStartEvent(currentEvent, startEvent);
|
16493 | if (toEarlyToDrag) {
|
16494 | return;
|
16495 | }
|
16496 | else {
|
16497 |
|
16498 | this.dragging = true;
|
16499 | var event_1 = {
|
16500 | type: events_1.Events.EVENT_DRAG_STARTED,
|
16501 | api: this.gridApi,
|
16502 | columnApi: this.columnApi
|
16503 | };
|
16504 | this.eventService.dispatchEvent(event_1);
|
16505 | this.currentDragParams.onDragStart(startEvent);
|
16506 | this.setNoSelectToBody(true);
|
16507 | }
|
16508 | }
|
16509 | this.currentDragParams.onDragging(currentEvent);
|
16510 | };
|
16511 | DragService.prototype.onTouchMove = function (touchEvent) {
|
16512 | var touch = this.getFirstActiveTouch(touchEvent.touches);
|
16513 | if (!touch) {
|
16514 | return;
|
16515 | }
|
16516 |
|
16517 |
|
16518 |
|
16519 |
|
16520 |
|
16521 | this.onCommonMove(touch, this.touchStart);
|
16522 | };
|
16523 |
|
16524 |
|
16525 | DragService.prototype.onMouseMove = function (mouseEvent) {
|
16526 | this.onCommonMove(mouseEvent, this.mouseStartEvent);
|
16527 | };
|
16528 | DragService.prototype.onTouchUp = function (touchEvent) {
|
16529 | var touch = this.getFirstActiveTouch(touchEvent.changedTouches);
|
16530 |
|
16531 |
|
16532 |
|
16533 |
|
16534 |
|
16535 | if (!touch) {
|
16536 | touch = this.touchLastTime;
|
16537 | }
|
16538 |
|
16539 |
|
16540 |
|
16541 |
|
16542 | this.onUpCommon(touch);
|
16543 |
|
16544 |
|
16545 |
|
16546 |
|
16547 |
|
16548 | };
|
16549 | DragService.prototype.onMouseUp = function (mouseEvent) {
|
16550 | this.onUpCommon(mouseEvent);
|
16551 | };
|
16552 | DragService.prototype.onUpCommon = function (eventOrTouch) {
|
16553 | if (this.dragging) {
|
16554 | this.dragging = false;
|
16555 | this.currentDragParams.onDragStop(eventOrTouch);
|
16556 | var event_2 = {
|
16557 | type: events_1.Events.EVENT_DRAG_STOPPED,
|
16558 | api: this.gridApi,
|
16559 | columnApi: this.columnApi
|
16560 | };
|
16561 | this.eventService.dispatchEvent(event_2);
|
16562 | }
|
16563 | this.setNoSelectToBody(false);
|
16564 | this.mouseStartEvent = null;
|
16565 | this.mouseEventLastTime = null;
|
16566 | this.touchStart = null;
|
16567 | this.touchLastTime = null;
|
16568 | this.currentDragParams = null;
|
16569 | this.dragEndFunctions.forEach(function (func) { return func(); });
|
16570 | this.dragEndFunctions.length = 0;
|
16571 | };
|
16572 | __decorate([
|
16573 | context_1.Autowired('loggerFactory'),
|
16574 | __metadata("design:type", logger_1.LoggerFactory)
|
16575 | ], DragService.prototype, "loggerFactory", void 0);
|
16576 | __decorate([
|
16577 | context_1.Autowired('eventService'),
|
16578 | __metadata("design:type", eventService_1.EventService)
|
16579 | ], DragService.prototype, "eventService", void 0);
|
16580 | __decorate([
|
16581 | context_1.Autowired('gridOptionsWrapper'),
|
16582 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
16583 | ], DragService.prototype, "gridOptionsWrapper", void 0);
|
16584 | __decorate([
|
16585 | context_1.Autowired('columnApi'),
|
16586 | __metadata("design:type", columnApi_1.ColumnApi)
|
16587 | ], DragService.prototype, "columnApi", void 0);
|
16588 | __decorate([
|
16589 | context_1.Autowired('gridApi'),
|
16590 | __metadata("design:type", gridApi_1.GridApi)
|
16591 | ], DragService.prototype, "gridApi", void 0);
|
16592 | __decorate([
|
16593 | context_1.PostConstruct,
|
16594 | __metadata("design:type", Function),
|
16595 | __metadata("design:paramtypes", []),
|
16596 | __metadata("design:returntype", void 0)
|
16597 | ], DragService.prototype, "init", null);
|
16598 | __decorate([
|
16599 | context_1.PreDestroy,
|
16600 | __metadata("design:type", Function),
|
16601 | __metadata("design:paramtypes", []),
|
16602 | __metadata("design:returntype", void 0)
|
16603 | ], DragService.prototype, "destroy", null);
|
16604 | DragService = __decorate([
|
16605 | context_1.Bean('dragService')
|
16606 | ], DragService);
|
16607 | return DragService;
|
16608 | }());
|
16609 | exports.DragService = DragService;
|
16610 |
|
16611 |
|
16612 | }),
|
16613 |
|
16614 | (function(module, exports, __webpack_require__) {
|
16615 |
|
16616 | "use strict";
|
16617 |
|
16618 |
|
16619 |
|
16620 |
|
16621 |
|
16622 |
|
16623 |
|
16624 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
16625 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
16626 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
16627 | 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;
|
16628 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
16629 | };
|
16630 | var __metadata = (this && this.__metadata) || function (k, v) {
|
16631 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
16632 | };
|
16633 | Object.defineProperty(exports, "__esModule", { value: true });
|
16634 | var context_1 = __webpack_require__(0);
|
16635 | var themeNames = ['fresh', 'dark', 'blue', 'bootstrap', 'material', 'balham-dark', 'balham'];
|
16636 | var themes = themeNames.concat(themeNames.map(function (name) { return "theme-" + name; }));
|
16637 | var themeClass = new RegExp("ag-(" + themes.join('|') + ")");
|
16638 | var matGridSize = 8;
|
16639 | var freshGridSize = 4;
|
16640 | var balhamGridSize = 4;
|
16641 | var HARD_CODED_SIZES = {
|
16642 | 'ag-theme-material': {
|
16643 | headerHeight: matGridSize * 7,
|
16644 | virtualItemHeight: matGridSize * 5,
|
16645 | rowHeight: matGridSize * 6
|
16646 | },
|
16647 | 'ag-theme-classic': {
|
16648 | headerHeight: 25,
|
16649 | virtualItemHeight: freshGridSize * 5,
|
16650 | rowHeight: 25
|
16651 | },
|
16652 | 'ag-theme-balham': {
|
16653 | headerHeight: balhamGridSize * 8,
|
16654 | virtualItemHeight: balhamGridSize * 7,
|
16655 | rowHeight: balhamGridSize * 7
|
16656 | }
|
16657 | };
|
16658 | var Environment = (function () {
|
16659 | function Environment() {
|
16660 | this.sassVariables = {};
|
16661 | }
|
16662 |
|
16663 |
|
16664 | Environment.prototype.loadSassVariables = function () {
|
16665 | |
16666 |
|
16667 |
|
16668 |
|
16669 |
|
16670 |
|
16671 |
|
16672 |
|
16673 |
|
16674 |
|
16675 |
|
16676 |
|
16677 |
|
16678 |
|
16679 |
|
16680 | };
|
16681 | Environment.prototype.getSassVariable = function (theme, key) {
|
16682 | if (theme == 'ag-theme-material') {
|
16683 | return HARD_CODED_SIZES['ag-theme-material'][key];
|
16684 | }
|
16685 | else if (theme == 'ag-theme-balham' || theme == 'ag-theme-balham-dark') {
|
16686 | return HARD_CODED_SIZES['ag-theme-balham'][key];
|
16687 | }
|
16688 | return HARD_CODED_SIZES['ag-theme-classic'][key];
|
16689 | |
16690 |
|
16691 |
|
16692 |
|
16693 |
|
16694 |
|
16695 |
|
16696 | };
|
16697 | Environment.prototype.getTheme = function () {
|
16698 | var themeMatch;
|
16699 | var element = this.eGridDiv;
|
16700 | while (element != document.documentElement && themeMatch == null) {
|
16701 | themeMatch = element.className.match(themeClass);
|
16702 | element = element.parentElement;
|
16703 | if (element == null) {
|
16704 | break;
|
16705 | }
|
16706 | }
|
16707 | if (themeMatch) {
|
16708 | return themeMatch[0];
|
16709 | }
|
16710 | else {
|
16711 | return 'ag-fresh';
|
16712 | }
|
16713 | };
|
16714 | __decorate([
|
16715 | context_1.Autowired('eGridDiv'),
|
16716 | __metadata("design:type", HTMLElement)
|
16717 | ], Environment.prototype, "eGridDiv", void 0);
|
16718 | Environment = __decorate([
|
16719 | context_1.Bean('environment')
|
16720 | ], Environment);
|
16721 | return Environment;
|
16722 | }());
|
16723 | exports.Environment = Environment;
|
16724 |
|
16725 |
|
16726 | }),
|
16727 |
|
16728 | (function(module, exports, __webpack_require__) {
|
16729 |
|
16730 | "use strict";
|
16731 |
|
16732 |
|
16733 |
|
16734 |
|
16735 |
|
16736 |
|
16737 |
|
16738 | var __extends = (this && this.__extends) || (function () {
|
16739 | var extendStatics = Object.setPrototypeOf ||
|
16740 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
16741 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
16742 | return function (d, b) {
|
16743 | extendStatics(d, b);
|
16744 | function __() { this.constructor = d; }
|
16745 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
16746 | };
|
16747 | })();
|
16748 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
16749 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
16750 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
16751 | 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;
|
16752 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
16753 | };
|
16754 | var __metadata = (this && this.__metadata) || function (k, v) {
|
16755 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
16756 | };
|
16757 | Object.defineProperty(exports, "__esModule", { value: true });
|
16758 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
16759 | var columnApi_1 = __webpack_require__(7);
|
16760 | var columnController_1 = __webpack_require__(4);
|
16761 | var rowRenderer_1 = __webpack_require__(20);
|
16762 | var filterManager_1 = __webpack_require__(18);
|
16763 | var eventService_1 = __webpack_require__(3);
|
16764 | var gridPanel_1 = __webpack_require__(78);
|
16765 | var logger_1 = __webpack_require__(12);
|
16766 | var popupService_1 = __webpack_require__(35);
|
16767 | var utils_1 = __webpack_require__(1);
|
16768 | var context_1 = __webpack_require__(0);
|
16769 | var focusedCellController_1 = __webpack_require__(22);
|
16770 | var component_1 = __webpack_require__(8);
|
16771 | var gridApi_1 = __webpack_require__(6);
|
16772 | var componentAnnotations_1 = __webpack_require__(11);
|
16773 | var resizeObserver_1 = __webpack_require__(96);
|
16774 | var events_1 = __webpack_require__(5);
|
16775 | var GridCore = (function (_super) {
|
16776 | __extends(GridCore, _super);
|
16777 | function GridCore() {
|
16778 | return _super.call(this) || this;
|
16779 | }
|
16780 | GridCore_1 = GridCore;
|
16781 | GridCore.prototype.init = function () {
|
16782 | var _this = this;
|
16783 | this.logger = this.loggerFactory.create('GridCore');
|
16784 | var template = this.enterprise ? GridCore_1.TEMPLATE_ENTERPRISE : GridCore_1.TEMPLATE_NORMAL;
|
16785 | this.setTemplate(template);
|
16786 | this.instantiate(this.context);
|
16787 | if (this.enterprise) {
|
16788 | this.toolPanelComp.registerGridComp(this.gridPanel);
|
16789 | this.statusBar.registerGridPanel(this.gridPanel);
|
16790 | }
|
16791 | this.gridOptionsWrapper.addLayoutElement(this.getGui());
|
16792 |
|
16793 | this.showToolPanel(this.gridOptionsWrapper.isShowToolPanel());
|
16794 | this.eGridDiv.appendChild(this.getGui());
|
16795 | this.addDestroyFunc(function () {
|
16796 | _this.eGridDiv.removeChild(_this.getGui());
|
16797 | });
|
16798 |
|
16799 | if (this.$scope) {
|
16800 | var quickFilterUnregisterFn = this.$scope.$watch(this.quickFilterOnScope, function (newFilter) { return _this.filterManager.setQuickFilter(newFilter); });
|
16801 | this.addDestroyFunc(quickFilterUnregisterFn);
|
16802 | }
|
16803 |
|
16804 |
|
16805 | this.addRtlSupport();
|
16806 | this.finished = false;
|
16807 | this.addDestroyFunc(function () { return _this.finished = true; });
|
16808 | this.logger.log('ready');
|
16809 | this.gridOptionsWrapper.addLayoutElement(this.eRootWrapperBody);
|
16810 | var unsubscribeFromResize = resizeObserver_1.observeResize(this.eGridDiv, this.onGridSizeChanged.bind(this));
|
16811 | this.addDestroyFunc(function () { return unsubscribeFromResize(); });
|
16812 | };
|
16813 | GridCore.prototype.onGridSizeChanged = function () {
|
16814 | var event = {
|
16815 | type: events_1.Events.EVENT_GRID_SIZE_CHANGED,
|
16816 | api: this.gridApi,
|
16817 | columnApi: this.columnApi,
|
16818 | clientWidth: this.eGridDiv.clientWidth,
|
16819 | clientHeight: this.eGridDiv.clientHeight
|
16820 | };
|
16821 | this.eventService.dispatchEvent(event);
|
16822 | };
|
16823 | GridCore.prototype.getPreferredWidth = function () {
|
16824 | var widthForCols = this.columnController.getBodyContainerWidth()
|
16825 | + this.columnController.getPinnedLeftContainerWidth()
|
16826 | + this.columnController.getPinnedRightContainerWidth();
|
16827 | var widthForToolpanel = this.toolPanelComp ? this.toolPanelComp.getPreferredWidth() : 0;
|
16828 | return widthForCols + widthForToolpanel;
|
16829 | };
|
16830 | GridCore.prototype.addRtlSupport = function () {
|
16831 | var cssClass = this.gridOptionsWrapper.isEnableRtl() ? 'ag-rtl' : 'ag-ltr';
|
16832 | utils_1.Utils.addCssClass(this.getGui(), cssClass);
|
16833 | };
|
16834 | GridCore.prototype.getRootGui = function () {
|
16835 | return this.getGui();
|
16836 | };
|
16837 | GridCore.prototype.showToolPanel = function (show) {
|
16838 | if (!this.toolPanelComp) {
|
16839 | if (show) {
|
16840 | console.warn('ag-Grid: toolPanel is only available in ag-Grid Enterprise');
|
16841 | }
|
16842 | return;
|
16843 | }
|
16844 | this.toolPanelComp.showToolPanel(show);
|
16845 | };
|
16846 | GridCore.prototype.isToolPanelShowing = function () {
|
16847 | return this.toolPanelComp.isToolPanelShowing();
|
16848 | };
|
16849 |
|
16850 | GridCore.prototype.destroy = function () {
|
16851 | _super.prototype.destroy.call(this);
|
16852 | this.logger.log('Grid DOM removed');
|
16853 | };
|
16854 |
|
16855 | GridCore.prototype.ensureNodeVisible = function (comparator, position) {
|
16856 | if (position === void 0) { position = 'top'; }
|
16857 | if (this.doingVirtualPaging) {
|
16858 | throw 'Cannot use ensureNodeVisible when doing virtual paging, as we cannot check rows that are not in memory';
|
16859 | }
|
16860 |
|
16861 | var rowCount = this.rowModel.getPageLastRow() + 1;
|
16862 | var comparatorIsAFunction = typeof comparator === 'function';
|
16863 | var indexToSelect = -1;
|
16864 |
|
16865 | for (var i = 0; i < rowCount; i++) {
|
16866 | var node = this.rowModel.getRow(i);
|
16867 | if (comparatorIsAFunction) {
|
16868 | if (comparator(node)) {
|
16869 | indexToSelect = i;
|
16870 | break;
|
16871 | }
|
16872 | }
|
16873 | else {
|
16874 |
|
16875 | if (comparator === node || comparator === node.data) {
|
16876 | indexToSelect = i;
|
16877 | break;
|
16878 | }
|
16879 | }
|
16880 | }
|
16881 | if (indexToSelect >= 0) {
|
16882 | this.gridPanel.ensureIndexVisible(indexToSelect, position);
|
16883 | }
|
16884 | };
|
16885 | GridCore.TEMPLATE_NORMAL = "<div class=\"ag-root-wrapper\">\n <div class=\"ag-root-wrapper-body\" ref=\"rootWrapperBody\">\n <ag-grid-comp ref=\"gridPanel\"></ag-grid-comp>\n </div>\n <ag-pagination></ag-pagination>\n </div>";
|
16886 | GridCore.TEMPLATE_ENTERPRISE = "<div class=\"ag-root-wrapper\">\n <ag-header-column-drop></ag-header-column-drop>\n <div ref=\"rootWrapperBody\" class=\"ag-root-wrapper-body\">\n <ag-grid-comp ref=\"gridPanel\"></ag-grid-comp>\n <ag-tool-panel ref=\"toolPanel\"></ag-tool-panel>\n </div>\n <ag-status-bar ref=\"statusBar\"></ag-status-bar>\n <ag-pagination></ag-pagination>\n </div>";
|
16887 | __decorate([
|
16888 | context_1.Autowired('enterprise'),
|
16889 | __metadata("design:type", Boolean)
|
16890 | ], GridCore.prototype, "enterprise", void 0);
|
16891 | __decorate([
|
16892 | context_1.Autowired('gridOptions'),
|
16893 | __metadata("design:type", Object)
|
16894 | ], GridCore.prototype, "gridOptions", void 0);
|
16895 | __decorate([
|
16896 | context_1.Autowired('gridOptionsWrapper'),
|
16897 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
16898 | ], GridCore.prototype, "gridOptionsWrapper", void 0);
|
16899 | __decorate([
|
16900 | context_1.Autowired('rowModel'),
|
16901 | __metadata("design:type", Object)
|
16902 | ], GridCore.prototype, "rowModel", void 0);
|
16903 | __decorate([
|
16904 | context_1.Autowired('frameworkFactory'),
|
16905 | __metadata("design:type", Object)
|
16906 | ], GridCore.prototype, "frameworkFactory", void 0);
|
16907 | __decorate([
|
16908 | context_1.Autowired('columnController'),
|
16909 | __metadata("design:type", columnController_1.ColumnController)
|
16910 | ], GridCore.prototype, "columnController", void 0);
|
16911 | __decorate([
|
16912 | context_1.Autowired('rowRenderer'),
|
16913 | __metadata("design:type", rowRenderer_1.RowRenderer)
|
16914 | ], GridCore.prototype, "rowRenderer", void 0);
|
16915 | __decorate([
|
16916 | context_1.Autowired('filterManager'),
|
16917 | __metadata("design:type", filterManager_1.FilterManager)
|
16918 | ], GridCore.prototype, "filterManager", void 0);
|
16919 | __decorate([
|
16920 | context_1.Autowired('eventService'),
|
16921 | __metadata("design:type", eventService_1.EventService)
|
16922 | ], GridCore.prototype, "eventService", void 0);
|
16923 | __decorate([
|
16924 | context_1.Autowired('eGridDiv'),
|
16925 | __metadata("design:type", HTMLElement)
|
16926 | ], GridCore.prototype, "eGridDiv", void 0);
|
16927 | __decorate([
|
16928 | context_1.Autowired('$scope'),
|
16929 | __metadata("design:type", Object)
|
16930 | ], GridCore.prototype, "$scope", void 0);
|
16931 | __decorate([
|
16932 | context_1.Autowired('quickFilterOnScope'),
|
16933 | __metadata("design:type", String)
|
16934 | ], GridCore.prototype, "quickFilterOnScope", void 0);
|
16935 | __decorate([
|
16936 | context_1.Autowired('popupService'),
|
16937 | __metadata("design:type", popupService_1.PopupService)
|
16938 | ], GridCore.prototype, "popupService", void 0);
|
16939 | __decorate([
|
16940 | context_1.Autowired('focusedCellController'),
|
16941 | __metadata("design:type", focusedCellController_1.FocusedCellController)
|
16942 | ], GridCore.prototype, "focusedCellController", void 0);
|
16943 | __decorate([
|
16944 | context_1.Autowired('context'),
|
16945 | __metadata("design:type", context_1.Context)
|
16946 | ], GridCore.prototype, "context", void 0);
|
16947 | __decorate([
|
16948 | context_1.Autowired('loggerFactory'),
|
16949 | __metadata("design:type", logger_1.LoggerFactory)
|
16950 | ], GridCore.prototype, "loggerFactory", void 0);
|
16951 | __decorate([
|
16952 | context_1.Autowired('columnApi'),
|
16953 | __metadata("design:type", columnApi_1.ColumnApi)
|
16954 | ], GridCore.prototype, "columnApi", void 0);
|
16955 | __decorate([
|
16956 | context_1.Autowired('gridApi'),
|
16957 | __metadata("design:type", gridApi_1.GridApi)
|
16958 | ], GridCore.prototype, "gridApi", void 0);
|
16959 | __decorate([
|
16960 | context_1.Optional('rowGroupCompFactory'),
|
16961 | __metadata("design:type", Object)
|
16962 | ], GridCore.prototype, "rowGroupCompFactory", void 0);
|
16963 | __decorate([
|
16964 | context_1.Optional('pivotCompFactory'),
|
16965 | __metadata("design:type", Object)
|
16966 | ], GridCore.prototype, "pivotCompFactory", void 0);
|
16967 | __decorate([
|
16968 | componentAnnotations_1.RefSelector('statusBar'),
|
16969 | __metadata("design:type", Object)
|
16970 | ], GridCore.prototype, "statusBar", void 0);
|
16971 | __decorate([
|
16972 | componentAnnotations_1.RefSelector('gridPanel'),
|
16973 | __metadata("design:type", gridPanel_1.GridPanel)
|
16974 | ], GridCore.prototype, "gridPanel", void 0);
|
16975 | __decorate([
|
16976 | componentAnnotations_1.RefSelector('toolPanel'),
|
16977 | __metadata("design:type", Object)
|
16978 | ], GridCore.prototype, "toolPanelComp", void 0);
|
16979 | __decorate([
|
16980 | componentAnnotations_1.RefSelector('rootWrapperBody'),
|
16981 | __metadata("design:type", HTMLElement)
|
16982 | ], GridCore.prototype, "eRootWrapperBody", void 0);
|
16983 | __decorate([
|
16984 | context_1.PostConstruct,
|
16985 | __metadata("design:type", Function),
|
16986 | __metadata("design:paramtypes", []),
|
16987 | __metadata("design:returntype", void 0)
|
16988 | ], GridCore.prototype, "init", null);
|
16989 | __decorate([
|
16990 | context_1.PreDestroy,
|
16991 | __metadata("design:type", Function),
|
16992 | __metadata("design:paramtypes", []),
|
16993 | __metadata("design:returntype", void 0)
|
16994 | ], GridCore.prototype, "destroy", null);
|
16995 | GridCore = GridCore_1 = __decorate([
|
16996 | context_1.Bean('gridCore'),
|
16997 | __metadata("design:paramtypes", [])
|
16998 | ], GridCore);
|
16999 | return GridCore;
|
17000 | var GridCore_1;
|
17001 | }(component_1.Component));
|
17002 | exports.GridCore = GridCore;
|
17003 |
|
17004 |
|
17005 | }),
|
17006 |
|
17007 | (function(module, exports, __webpack_require__) {
|
17008 |
|
17009 | "use strict";
|
17010 |
|
17011 |
|
17012 |
|
17013 |
|
17014 |
|
17015 |
|
17016 |
|
17017 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
17018 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
17019 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
17020 | 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;
|
17021 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
17022 | };
|
17023 | var __metadata = (this && this.__metadata) || function (k, v) {
|
17024 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
17025 | };
|
17026 | Object.defineProperty(exports, "__esModule", { value: true });
|
17027 | var context_1 = __webpack_require__(0);
|
17028 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
17029 | var expressionService_1 = __webpack_require__(19);
|
17030 | var ValueFormatterService = (function () {
|
17031 | function ValueFormatterService() {
|
17032 | }
|
17033 | ValueFormatterService.prototype.formatValue = function (column, rowNode, $scope, value) {
|
17034 | var formatter;
|
17035 | var colDef = column.getColDef();
|
17036 |
|
17037 | if (rowNode && rowNode.rowPinned) {
|
17038 | formatter = colDef.pinnedRowValueFormatter ? colDef.pinnedRowValueFormatter : colDef.valueFormatter;
|
17039 | }
|
17040 | else {
|
17041 | formatter = colDef.valueFormatter;
|
17042 | }
|
17043 | var result = null;
|
17044 | if (formatter) {
|
17045 | var params = {
|
17046 | value: value,
|
17047 | node: rowNode,
|
17048 | data: rowNode ? rowNode.data : null,
|
17049 | colDef: column.getColDef(),
|
17050 | column: column,
|
17051 | api: this.gridOptionsWrapper.getApi(),
|
17052 | columnApi: this.gridOptionsWrapper.getColumnApi(),
|
17053 | context: this.gridOptionsWrapper.getContext()
|
17054 | };
|
17055 |
|
17056 |
|
17057 |
|
17058 |
|
17059 |
|
17060 | params.$scope = $scope;
|
17061 | result = this.expressionService.evaluate(formatter, params);
|
17062 | }
|
17063 | else if (colDef.refData) {
|
17064 | return colDef.refData[value];
|
17065 | }
|
17066 |
|
17067 | if ((result === null || result === undefined) && Array.isArray(value)) {
|
17068 | result = value.join(', ');
|
17069 | }
|
17070 | return result;
|
17071 | };
|
17072 | __decorate([
|
17073 | context_1.Autowired('gridOptionsWrapper'),
|
17074 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
17075 | ], ValueFormatterService.prototype, "gridOptionsWrapper", void 0);
|
17076 | __decorate([
|
17077 | context_1.Autowired('expressionService'),
|
17078 | __metadata("design:type", expressionService_1.ExpressionService)
|
17079 | ], ValueFormatterService.prototype, "expressionService", void 0);
|
17080 | ValueFormatterService = __decorate([
|
17081 | context_1.Bean('valueFormatterService')
|
17082 | ], ValueFormatterService);
|
17083 | return ValueFormatterService;
|
17084 | }());
|
17085 | exports.ValueFormatterService = ValueFormatterService;
|
17086 |
|
17087 |
|
17088 | }),
|
17089 |
|
17090 | (function(module, exports, __webpack_require__) {
|
17091 |
|
17092 | "use strict";
|
17093 |
|
17094 |
|
17095 |
|
17096 |
|
17097 |
|
17098 |
|
17099 |
|
17100 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
17101 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
17102 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
17103 | 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;
|
17104 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
17105 | };
|
17106 | var __metadata = (this && this.__metadata) || function (k, v) {
|
17107 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
17108 | };
|
17109 | Object.defineProperty(exports, "__esModule", { value: true });
|
17110 | var context_1 = __webpack_require__(0);
|
17111 | var context_2 = __webpack_require__(0);
|
17112 | var utils_1 = __webpack_require__(1);
|
17113 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
17114 | var cellComp_1 = __webpack_require__(34);
|
17115 | var MouseEventService = (function () {
|
17116 | function MouseEventService() {
|
17117 | this.gridInstanceId = MouseEventService_1.gridInstanceSequence.next();
|
17118 | }
|
17119 | MouseEventService_1 = MouseEventService;
|
17120 | MouseEventService.prototype.init = function () {
|
17121 | this.stampDomElementWithGridInstance();
|
17122 | };
|
17123 |
|
17124 |
|
17125 |
|
17126 | MouseEventService.prototype.stampDomElementWithGridInstance = function () {
|
17127 | this.eGridDiv[MouseEventService_1.GRID_DOM_KEY] = this.gridInstanceId;
|
17128 | };
|
17129 | MouseEventService.prototype.getRenderedCellForEvent = function (event) {
|
17130 | var sourceElement = utils_1.Utils.getTarget(event);
|
17131 | while (sourceElement) {
|
17132 | var renderedCell = this.gridOptionsWrapper.getDomData(sourceElement, cellComp_1.CellComp.DOM_DATA_KEY_CELL_COMP);
|
17133 | if (renderedCell) {
|
17134 | return renderedCell;
|
17135 | }
|
17136 | sourceElement = sourceElement.parentElement;
|
17137 | }
|
17138 | return null;
|
17139 | };
|
17140 |
|
17141 |
|
17142 |
|
17143 | MouseEventService.prototype.isEventFromThisGrid = function (event) {
|
17144 | var path = utils_1.Utils.getEventPath(event);
|
17145 | for (var i = 0; i < path.length; i++) {
|
17146 | var element = path[i];
|
17147 | var instanceId = element[MouseEventService_1.GRID_DOM_KEY];
|
17148 | if (utils_1.Utils.exists(instanceId)) {
|
17149 | var eventFromThisGrid = instanceId === this.gridInstanceId;
|
17150 | return eventFromThisGrid;
|
17151 | }
|
17152 | }
|
17153 | return false;
|
17154 | };
|
17155 | MouseEventService.prototype.getGridCellForEvent = function (event) {
|
17156 | var cellComp = this.getRenderedCellForEvent(event);
|
17157 | return cellComp ? cellComp.getGridCell() : null;
|
17158 | };
|
17159 | MouseEventService.gridInstanceSequence = new utils_1.NumberSequence();
|
17160 | MouseEventService.GRID_DOM_KEY = '__ag_grid_instance';
|
17161 | __decorate([
|
17162 | context_2.Autowired('gridOptionsWrapper'),
|
17163 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
17164 | ], MouseEventService.prototype, "gridOptionsWrapper", void 0);
|
17165 | __decorate([
|
17166 | context_2.Autowired('eGridDiv'),
|
17167 | __metadata("design:type", HTMLElement)
|
17168 | ], MouseEventService.prototype, "eGridDiv", void 0);
|
17169 | __decorate([
|
17170 | context_1.PostConstruct,
|
17171 | __metadata("design:type", Function),
|
17172 | __metadata("design:paramtypes", []),
|
17173 | __metadata("design:returntype", void 0)
|
17174 | ], MouseEventService.prototype, "init", null);
|
17175 | MouseEventService = MouseEventService_1 = __decorate([
|
17176 | context_1.Bean('mouseEventService')
|
17177 | ], MouseEventService);
|
17178 | return MouseEventService;
|
17179 | var MouseEventService_1;
|
17180 | }());
|
17181 | exports.MouseEventService = MouseEventService;
|
17182 |
|
17183 |
|
17184 | }),
|
17185 |
|
17186 | (function(module, exports, __webpack_require__) {
|
17187 |
|
17188 | "use strict";
|
17189 |
|
17190 |
|
17191 |
|
17192 |
|
17193 |
|
17194 |
|
17195 |
|
17196 | var __extends = (this && this.__extends) || (function () {
|
17197 | var extendStatics = Object.setPrototypeOf ||
|
17198 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
17199 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
17200 | return function (d, b) {
|
17201 | extendStatics(d, b);
|
17202 | function __() { this.constructor = d; }
|
17203 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
17204 | };
|
17205 | })();
|
17206 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
17207 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
17208 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
17209 | 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;
|
17210 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
17211 | };
|
17212 | var __metadata = (this && this.__metadata) || function (k, v) {
|
17213 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
17214 | };
|
17215 | Object.defineProperty(exports, "__esModule", { value: true });
|
17216 | var eventService_1 = __webpack_require__(3);
|
17217 | var context_1 = __webpack_require__(0);
|
17218 | var events_1 = __webpack_require__(5);
|
17219 | var beanStub_1 = __webpack_require__(13);
|
17220 | var columnApi_1 = __webpack_require__(7);
|
17221 | var gridApi_1 = __webpack_require__(6);
|
17222 | var ColumnHoverService = (function (_super) {
|
17223 | __extends(ColumnHoverService, _super);
|
17224 | function ColumnHoverService() {
|
17225 | return _super !== null && _super.apply(this, arguments) || this;
|
17226 | }
|
17227 | ColumnHoverService.prototype.setMouseOver = function (columns) {
|
17228 | this.selectedColumns = columns;
|
17229 | var event = {
|
17230 | type: events_1.Events.EVENT_COLUMN_HOVER_CHANGED,
|
17231 | api: this.gridApi,
|
17232 | columnApi: this.columnApi
|
17233 | };
|
17234 | this.eventService.dispatchEvent(event);
|
17235 | };
|
17236 | ColumnHoverService.prototype.clearMouseOver = function () {
|
17237 | this.selectedColumns = null;
|
17238 | var event = {
|
17239 | type: events_1.Events.EVENT_COLUMN_HOVER_CHANGED,
|
17240 | api: this.gridApi,
|
17241 | columnApi: this.columnApi
|
17242 | };
|
17243 | this.eventService.dispatchEvent(event);
|
17244 | };
|
17245 | ColumnHoverService.prototype.isHovered = function (column) {
|
17246 | return this.selectedColumns && this.selectedColumns.indexOf(column) >= 0;
|
17247 | };
|
17248 | __decorate([
|
17249 | context_1.Autowired('eventService'),
|
17250 | __metadata("design:type", eventService_1.EventService)
|
17251 | ], ColumnHoverService.prototype, "eventService", void 0);
|
17252 | __decorate([
|
17253 | context_1.Autowired('columnApi'),
|
17254 | __metadata("design:type", columnApi_1.ColumnApi)
|
17255 | ], ColumnHoverService.prototype, "columnApi", void 0);
|
17256 | __decorate([
|
17257 | context_1.Autowired('gridApi'),
|
17258 | __metadata("design:type", gridApi_1.GridApi)
|
17259 | ], ColumnHoverService.prototype, "gridApi", void 0);
|
17260 | ColumnHoverService = __decorate([
|
17261 | context_1.Bean('columnHoverService')
|
17262 | ], ColumnHoverService);
|
17263 | return ColumnHoverService;
|
17264 | }(beanStub_1.BeanStub));
|
17265 | exports.ColumnHoverService = ColumnHoverService;
|
17266 |
|
17267 |
|
17268 | }),
|
17269 |
|
17270 | (function(module, exports, __webpack_require__) {
|
17271 |
|
17272 | "use strict";
|
17273 |
|
17274 |
|
17275 |
|
17276 |
|
17277 |
|
17278 |
|
17279 |
|
17280 | Object.defineProperty(exports, "__esModule", { value: true });
|
17281 | var eventService_1 = __webpack_require__(3);
|
17282 | var utils_1 = __webpack_require__(1);
|
17283 | var TouchListener = (function () {
|
17284 | function TouchListener(eElement, preventMouseClick) {
|
17285 | if (preventMouseClick === void 0) { preventMouseClick = false; }
|
17286 | var _this = this;
|
17287 | this.destroyFuncs = [];
|
17288 | this.touching = false;
|
17289 | this.eventService = new eventService_1.EventService();
|
17290 | this.eElement = eElement;
|
17291 | this.preventMouseClick = preventMouseClick;
|
17292 | var startListener = this.onTouchStart.bind(this);
|
17293 | var moveListener = this.onTouchMove.bind(this);
|
17294 | var endListener = this.onTouchEnd.bind(this);
|
17295 | this.eElement.addEventListener("touchstart", startListener, { passive: true });
|
17296 | this.eElement.addEventListener("touchmove", moveListener, { passive: true });
|
17297 |
|
17298 | this.eElement.addEventListener("touchend", endListener, { passive: false });
|
17299 | this.destroyFuncs.push(function () {
|
17300 | _this.eElement.addEventListener("touchstart", startListener, { passive: true });
|
17301 | _this.eElement.addEventListener("touchmove", moveListener, { passive: true });
|
17302 | _this.eElement.addEventListener("touchend", endListener, { passive: false });
|
17303 | });
|
17304 | }
|
17305 | TouchListener.prototype.getActiveTouch = function (touchList) {
|
17306 | for (var i = 0; i < touchList.length; i++) {
|
17307 | var matches = touchList[i].identifier === this.touchStart.identifier;
|
17308 | if (matches) {
|
17309 | return touchList[i];
|
17310 | }
|
17311 | }
|
17312 | return null;
|
17313 | };
|
17314 | TouchListener.prototype.addEventListener = function (eventType, listener) {
|
17315 | this.eventService.addEventListener(eventType, listener);
|
17316 | };
|
17317 | TouchListener.prototype.removeEventListener = function (eventType, listener) {
|
17318 | this.eventService.removeEventListener(eventType, listener);
|
17319 | };
|
17320 | TouchListener.prototype.onTouchStart = function (touchEvent) {
|
17321 | var _this = this;
|
17322 |
|
17323 | if (this.touching) {
|
17324 | return;
|
17325 | }
|
17326 | this.touchStart = touchEvent.touches[0];
|
17327 | this.touching = true;
|
17328 | this.moved = false;
|
17329 | var touchStartCopy = this.touchStart;
|
17330 | setTimeout(function () {
|
17331 | var touchesMatch = _this.touchStart === touchStartCopy;
|
17332 | if (_this.touching && touchesMatch && !_this.moved) {
|
17333 | _this.moved = true;
|
17334 | var event_1 = {
|
17335 | type: TouchListener.EVENT_LONG_TAP,
|
17336 | touchStart: _this.touchStart,
|
17337 | touchEvent: touchEvent
|
17338 | };
|
17339 | _this.eventService.dispatchEvent(event_1);
|
17340 | }
|
17341 | }, 500);
|
17342 | };
|
17343 | TouchListener.prototype.onTouchMove = function (touchEvent) {
|
17344 | if (!this.touching) {
|
17345 | return;
|
17346 | }
|
17347 | var touch = this.getActiveTouch(touchEvent.touches);
|
17348 | if (!touch) {
|
17349 | return;
|
17350 | }
|
17351 | var eventIsFarAway = !utils_1.Utils.areEventsNear(touch, this.touchStart, 4);
|
17352 | if (eventIsFarAway) {
|
17353 | this.moved = true;
|
17354 | }
|
17355 | };
|
17356 | TouchListener.prototype.onTouchEnd = function (touchEvent) {
|
17357 | if (!this.touching) {
|
17358 | return;
|
17359 | }
|
17360 | if (!this.moved) {
|
17361 | var event_2 = {
|
17362 | type: TouchListener.EVENT_TAP,
|
17363 | touchStart: this.touchStart
|
17364 | };
|
17365 | this.eventService.dispatchEvent(event_2);
|
17366 | this.checkForDoubleTap();
|
17367 |
|
17368 | if (this.preventMouseClick) {
|
17369 | touchEvent.preventDefault();
|
17370 | }
|
17371 | }
|
17372 | this.touching = false;
|
17373 | };
|
17374 | TouchListener.prototype.checkForDoubleTap = function () {
|
17375 | var now = new Date().getTime();
|
17376 | if (this.lastTapTime > 0) {
|
17377 |
|
17378 | var interval = now - this.lastTapTime;
|
17379 | if (interval > TouchListener.DOUBLE_TAP_MILLIS) {
|
17380 |
|
17381 | var event_3 = {
|
17382 | type: TouchListener.EVENT_DOUBLE_TAP,
|
17383 | touchStart: this.touchStart
|
17384 | };
|
17385 | this.eventService.dispatchEvent(event_3);
|
17386 |
|
17387 | this.lastTapTime = null;
|
17388 | }
|
17389 | else {
|
17390 | this.lastTapTime = now;
|
17391 | }
|
17392 | }
|
17393 | else {
|
17394 | this.lastTapTime = now;
|
17395 | }
|
17396 | };
|
17397 | TouchListener.prototype.destroy = function () {
|
17398 | this.destroyFuncs.forEach(function (func) { return func(); });
|
17399 | };
|
17400 | TouchListener.EVENT_TAP = "tap";
|
17401 | TouchListener.EVENT_DOUBLE_TAP = "doubleTap";
|
17402 | TouchListener.EVENT_LONG_TAP = "longTap";
|
17403 | TouchListener.DOUBLE_TAP_MILLIS = 500;
|
17404 | return TouchListener;
|
17405 | }());
|
17406 | exports.TouchListener = TouchListener;
|
17407 |
|
17408 |
|
17409 | }),
|
17410 |
|
17411 | (function(module, exports, __webpack_require__) {
|
17412 |
|
17413 | "use strict";
|
17414 |
|
17415 |
|
17416 |
|
17417 |
|
17418 |
|
17419 |
|
17420 |
|
17421 | var __extends = (this && this.__extends) || (function () {
|
17422 | var extendStatics = Object.setPrototypeOf ||
|
17423 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
17424 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
17425 | return function (d, b) {
|
17426 | extendStatics(d, b);
|
17427 | function __() { this.constructor = d; }
|
17428 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
17429 | };
|
17430 | })();
|
17431 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
17432 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
17433 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
17434 | 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;
|
17435 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
17436 | };
|
17437 | var __metadata = (this && this.__metadata) || function (k, v) {
|
17438 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
17439 | };
|
17440 | Object.defineProperty(exports, "__esModule", { value: true });
|
17441 | var context_1 = __webpack_require__(0);
|
17442 | var gridSerializer_1 = __webpack_require__(63);
|
17443 | var downloader_1 = __webpack_require__(84);
|
17444 | var columnController_1 = __webpack_require__(4);
|
17445 | var valueService_1 = __webpack_require__(15);
|
17446 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
17447 | var constants_1 = __webpack_require__(9);
|
17448 | var utils_1 = __webpack_require__(1);
|
17449 | var LINE_SEPARATOR = '\r\n';
|
17450 | var CsvSerializingSession = (function (_super) {
|
17451 | __extends(CsvSerializingSession, _super);
|
17452 | function CsvSerializingSession(columnController, valueService, gridOptionsWrapper, processCellCallback, processHeaderCallback, suppressQuotes, columnSeparator) {
|
17453 | var _this = _super.call(this, columnController, valueService, gridOptionsWrapper, processCellCallback, processHeaderCallback) || this;
|
17454 | _this.suppressQuotes = suppressQuotes;
|
17455 | _this.columnSeparator = columnSeparator;
|
17456 | _this.result = '';
|
17457 | _this.lineOpened = false;
|
17458 | return _this;
|
17459 | }
|
17460 | CsvSerializingSession.prototype.prepare = function (columnsToExport) {
|
17461 | };
|
17462 | CsvSerializingSession.prototype.addCustomHeader = function (customHeader) {
|
17463 | if (!customHeader)
|
17464 | return;
|
17465 | this.result += customHeader + LINE_SEPARATOR;
|
17466 | };
|
17467 | CsvSerializingSession.prototype.addCustomFooter = function (customFooter) {
|
17468 | if (!customFooter)
|
17469 | return;
|
17470 | this.result += customFooter + LINE_SEPARATOR;
|
17471 | };
|
17472 | CsvSerializingSession.prototype.onNewHeaderGroupingRow = function () {
|
17473 | if (this.lineOpened)
|
17474 | this.result += LINE_SEPARATOR;
|
17475 | return {
|
17476 | onColumn: this.onNewHeaderGroupingRowColumn.bind(this)
|
17477 | };
|
17478 | };
|
17479 | CsvSerializingSession.prototype.onNewHeaderGroupingRowColumn = function (header, index, span) {
|
17480 | if (index != 0) {
|
17481 | this.result += this.columnSeparator;
|
17482 | }
|
17483 | this.result += header;
|
17484 | for (var i = 1; i <= span; i++) {
|
17485 | this.result += this.columnSeparator + this.putInQuotes("", this.suppressQuotes);
|
17486 | }
|
17487 | this.lineOpened = true;
|
17488 | };
|
17489 | CsvSerializingSession.prototype.onNewHeaderRow = function () {
|
17490 | if (this.lineOpened)
|
17491 | this.result += LINE_SEPARATOR;
|
17492 | return {
|
17493 | onColumn: this.onNewHeaderRowColumn.bind(this)
|
17494 | };
|
17495 | };
|
17496 | CsvSerializingSession.prototype.onNewHeaderRowColumn = function (column, index, node) {
|
17497 | if (index != 0) {
|
17498 | this.result += this.columnSeparator;
|
17499 | }
|
17500 | this.result += this.putInQuotes(this.extractHeaderValue(column), this.suppressQuotes);
|
17501 | this.lineOpened = true;
|
17502 | };
|
17503 | CsvSerializingSession.prototype.onNewBodyRow = function () {
|
17504 | if (this.lineOpened)
|
17505 | this.result += LINE_SEPARATOR;
|
17506 | return {
|
17507 | onColumn: this.onNewBodyRowColumn.bind(this)
|
17508 | };
|
17509 | };
|
17510 | CsvSerializingSession.prototype.onNewBodyRowColumn = function (column, index, node) {
|
17511 | if (index != 0) {
|
17512 | this.result += this.columnSeparator;
|
17513 | }
|
17514 | this.result += this.putInQuotes(this.extractRowCellValue(column, index, constants_1.Constants.EXPORT_TYPE_CSV, node), this.suppressQuotes);
|
17515 | this.lineOpened = true;
|
17516 | };
|
17517 | CsvSerializingSession.prototype.putInQuotes = function (value, suppressQuotes) {
|
17518 | if (suppressQuotes) {
|
17519 | return value;
|
17520 | }
|
17521 | if (value === null || value === undefined) {
|
17522 | return '""';
|
17523 | }
|
17524 | var stringValue;
|
17525 | if (typeof value === 'string') {
|
17526 | stringValue = value;
|
17527 | }
|
17528 | else if (typeof value.toString === 'function') {
|
17529 | stringValue = value.toString();
|
17530 | }
|
17531 | else {
|
17532 | console.warn('unknown value type during csv conversion');
|
17533 | stringValue = '';
|
17534 | }
|
17535 |
|
17536 | var valueEscaped = stringValue.replace(/"/g, "\"\"");
|
17537 | return '"' + valueEscaped + '"';
|
17538 | };
|
17539 | CsvSerializingSession.prototype.parse = function () {
|
17540 | return this.result;
|
17541 | };
|
17542 | return CsvSerializingSession;
|
17543 | }(gridSerializer_1.BaseGridSerializingSession));
|
17544 | exports.CsvSerializingSession = CsvSerializingSession;
|
17545 | var BaseCreator = (function () {
|
17546 | function BaseCreator() {
|
17547 | }
|
17548 | BaseCreator.prototype.setBeans = function (beans) {
|
17549 | this.beans = beans;
|
17550 | };
|
17551 | BaseCreator.prototype.export = function (userParams) {
|
17552 | if (this.isExportSuppressed()) {
|
17553 | console.warn("ag-grid: Export canceled. Export is not allowed as per your configuration.");
|
17554 | return "";
|
17555 | }
|
17556 | var _a = this.getMergedParamsAndData(userParams), mergedParams = _a.mergedParams, data = _a.data;
|
17557 | var fileNamePresent = mergedParams && mergedParams.fileName && mergedParams.fileName.length !== 0;
|
17558 | var fileName = fileNamePresent ? mergedParams.fileName : this.getDefaultFileName();
|
17559 | if (fileName.indexOf(".") === -1) {
|
17560 | fileName = fileName + "." + this.getDefaultFileExtension();
|
17561 | }
|
17562 | this.beans.downloader.download(fileName, data, this.getMimeType());
|
17563 | return data;
|
17564 | };
|
17565 | BaseCreator.prototype.getData = function (params) {
|
17566 | return this.getMergedParamsAndData(params).data;
|
17567 | };
|
17568 | BaseCreator.prototype.getMergedParamsAndData = function (userParams) {
|
17569 | var mergedParams = this.mergeDefaultParams(userParams);
|
17570 | var data = this.beans.gridSerializer.serialize(this.createSerializingSession(mergedParams), mergedParams);
|
17571 | return { mergedParams: mergedParams, data: data };
|
17572 | };
|
17573 | BaseCreator.prototype.mergeDefaultParams = function (userParams) {
|
17574 | var baseParams = this.beans.gridOptionsWrapper.getDefaultExportParams();
|
17575 | var params = {};
|
17576 | utils_1._.assign(params, baseParams);
|
17577 | utils_1._.assign(params, userParams);
|
17578 | return params;
|
17579 | };
|
17580 | return BaseCreator;
|
17581 | }());
|
17582 | exports.BaseCreator = BaseCreator;
|
17583 | var CsvCreator = (function (_super) {
|
17584 | __extends(CsvCreator, _super);
|
17585 | function CsvCreator() {
|
17586 | return _super !== null && _super.apply(this, arguments) || this;
|
17587 | }
|
17588 | CsvCreator.prototype.postConstruct = function () {
|
17589 | this.setBeans({
|
17590 | downloader: this.downloader,
|
17591 | gridSerializer: this.gridSerializer,
|
17592 | gridOptionsWrapper: this.gridOptionsWrapper
|
17593 | });
|
17594 | };
|
17595 | CsvCreator.prototype.exportDataAsCsv = function (params) {
|
17596 | return this.export(params);
|
17597 | };
|
17598 | CsvCreator.prototype.getDataAsCsv = function (params) {
|
17599 | return this.getData(params);
|
17600 | };
|
17601 | CsvCreator.prototype.getMimeType = function () {
|
17602 | return "text/csv;charset=utf-8;";
|
17603 | };
|
17604 | CsvCreator.prototype.getDefaultFileName = function () {
|
17605 | return 'export.csv';
|
17606 | };
|
17607 | CsvCreator.prototype.getDefaultFileExtension = function () {
|
17608 | return 'csv';
|
17609 | };
|
17610 | CsvCreator.prototype.createSerializingSession = function (params) {
|
17611 | return new CsvSerializingSession(this.columnController, this.valueService, this.gridOptionsWrapper, params ? params.processCellCallback : null, params ? params.processHeaderCallback : null, params && params.suppressQuotes, (params && params.columnSeparator) || ',');
|
17612 | };
|
17613 | CsvCreator.prototype.isExportSuppressed = function () {
|
17614 | return this.gridOptionsWrapper.isSuppressCsvExport();
|
17615 | };
|
17616 | __decorate([
|
17617 | context_1.Autowired('columnController'),
|
17618 | __metadata("design:type", columnController_1.ColumnController)
|
17619 | ], CsvCreator.prototype, "columnController", void 0);
|
17620 | __decorate([
|
17621 | context_1.Autowired('valueService'),
|
17622 | __metadata("design:type", valueService_1.ValueService)
|
17623 | ], CsvCreator.prototype, "valueService", void 0);
|
17624 | __decorate([
|
17625 | context_1.Autowired('downloader'),
|
17626 | __metadata("design:type", downloader_1.Downloader)
|
17627 | ], CsvCreator.prototype, "downloader", void 0);
|
17628 | __decorate([
|
17629 | context_1.Autowired('gridSerializer'),
|
17630 | __metadata("design:type", gridSerializer_1.GridSerializer)
|
17631 | ], CsvCreator.prototype, "gridSerializer", void 0);
|
17632 | __decorate([
|
17633 | context_1.Autowired('gridOptionsWrapper'),
|
17634 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
17635 | ], CsvCreator.prototype, "gridOptionsWrapper", void 0);
|
17636 | __decorate([
|
17637 | context_1.PostConstruct,
|
17638 | __metadata("design:type", Function),
|
17639 | __metadata("design:paramtypes", []),
|
17640 | __metadata("design:returntype", void 0)
|
17641 | ], CsvCreator.prototype, "postConstruct", null);
|
17642 | CsvCreator = __decorate([
|
17643 | context_1.Bean('csvCreator')
|
17644 | ], CsvCreator);
|
17645 | return CsvCreator;
|
17646 | }(BaseCreator));
|
17647 | exports.CsvCreator = CsvCreator;
|
17648 |
|
17649 |
|
17650 | }),
|
17651 |
|
17652 | (function(module, exports, __webpack_require__) {
|
17653 |
|
17654 | "use strict";
|
17655 |
|
17656 |
|
17657 |
|
17658 |
|
17659 |
|
17660 |
|
17661 |
|
17662 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
17663 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
17664 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
17665 | 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;
|
17666 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
17667 | };
|
17668 | var __metadata = (this && this.__metadata) || function (k, v) {
|
17669 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
17670 | };
|
17671 | Object.defineProperty(exports, "__esModule", { value: true });
|
17672 | var columnUtils_1 = __webpack_require__(31);
|
17673 | var columnGroup_1 = __webpack_require__(26);
|
17674 | var originalColumnGroup_1 = __webpack_require__(32);
|
17675 | var context_1 = __webpack_require__(0);
|
17676 | var utils_1 = __webpack_require__(1);
|
17677 | var context_2 = __webpack_require__(0);
|
17678 |
|
17679 | var DisplayedGroupCreator = (function () {
|
17680 | function DisplayedGroupCreator() {
|
17681 | }
|
17682 | DisplayedGroupCreator.prototype.createDisplayedGroups = function (
|
17683 | // all displayed columns sorted - this is the columns the grid should show
|
17684 | sortedVisibleColumns,
|
17685 | // the tree of columns, as provided by the users, used to know what groups columns roll up into
|
17686 | balancedColumnTree,
|
17687 | // create's unique id's for the group
|
17688 | groupInstanceIdCreator,
|
17689 | // we try to reuse old groups if we can, to allow gui to do animation
|
17690 | oldDisplayedGroups) {
|
17691 | var _this = this;
|
17692 | var result = [];
|
17693 | var previousRealPath;
|
17694 | var previousOriginalPath;
|
17695 | var oldColumnsMapped = this.mapOldGroupsById(oldDisplayedGroups);
|
17696 |
|
17697 |
|
17698 | sortedVisibleColumns.forEach(function (currentColumn) {
|
17699 | var currentOriginalPath = _this.getOriginalPathForColumn(balancedColumnTree, currentColumn);
|
17700 | var currentRealPath = [];
|
17701 | var firstColumn = !previousOriginalPath;
|
17702 | for (var i = 0; i < currentOriginalPath.length; i++) {
|
17703 | if (firstColumn || currentOriginalPath[i] !== previousOriginalPath[i]) {
|
17704 |
|
17705 | var newGroup = _this.createColumnGroup(currentOriginalPath[i], groupInstanceIdCreator, oldColumnsMapped);
|
17706 | currentRealPath[i] = newGroup;
|
17707 |
|
17708 | if (i == 0) {
|
17709 | result.push(newGroup);
|
17710 | }
|
17711 | else {
|
17712 | currentRealPath[i - 1].addChild(newGroup);
|
17713 | }
|
17714 | }
|
17715 | else {
|
17716 |
|
17717 | currentRealPath[i] = previousRealPath[i];
|
17718 | }
|
17719 | }
|
17720 | var noColumnGroups = currentRealPath.length === 0;
|
17721 | if (noColumnGroups) {
|
17722 |
|
17723 |
|
17724 | result.push(currentColumn);
|
17725 | }
|
17726 | else {
|
17727 | var leafGroup = currentRealPath[currentRealPath.length - 1];
|
17728 | leafGroup.addChild(currentColumn);
|
17729 | }
|
17730 | previousRealPath = currentRealPath;
|
17731 | previousOriginalPath = currentOriginalPath;
|
17732 | });
|
17733 | this.setupParentsIntoColumns(result, null);
|
17734 | return result;
|
17735 | };
|
17736 | DisplayedGroupCreator.prototype.createColumnGroup = function (originalGroup, groupInstanceIdCreator, oldColumnsMapped) {
|
17737 | var groupId = originalGroup.getGroupId();
|
17738 | var instanceId = groupInstanceIdCreator.getInstanceIdForKey(groupId);
|
17739 | var uniqueId = columnGroup_1.ColumnGroup.createUniqueId(groupId, instanceId);
|
17740 | var columnGroup = oldColumnsMapped[uniqueId];
|
17741 |
|
17742 |
|
17743 |
|
17744 | if (columnGroup && columnGroup.getOriginalColumnGroup() !== originalGroup) {
|
17745 | columnGroup = null;
|
17746 | }
|
17747 | if (utils_1.Utils.exists(columnGroup)) {
|
17748 |
|
17749 | columnGroup.reset();
|
17750 | }
|
17751 | else {
|
17752 | columnGroup = new columnGroup_1.ColumnGroup(originalGroup, groupId, instanceId);
|
17753 | this.context.wireBean(columnGroup);
|
17754 | }
|
17755 | return columnGroup;
|
17756 | };
|
17757 |
|
17758 | DisplayedGroupCreator.prototype.mapOldGroupsById = function (displayedGroups) {
|
17759 | var result = {};
|
17760 | var recursive = function (columnsOrGroups) {
|
17761 | columnsOrGroups.forEach(function (columnOrGroup) {
|
17762 | if (columnOrGroup instanceof columnGroup_1.ColumnGroup) {
|
17763 | var columnGroup = columnOrGroup;
|
17764 | result[columnOrGroup.getUniqueId()] = columnGroup;
|
17765 | recursive(columnGroup.getChildren());
|
17766 | }
|
17767 | });
|
17768 | };
|
17769 | if (displayedGroups) {
|
17770 | recursive(displayedGroups);
|
17771 | }
|
17772 | return result;
|
17773 | };
|
17774 | DisplayedGroupCreator.prototype.setupParentsIntoColumns = function (columnsOrGroups, parent) {
|
17775 | var _this = this;
|
17776 | columnsOrGroups.forEach(function (columnsOrGroup) {
|
17777 | columnsOrGroup.setParent(parent);
|
17778 | if (columnsOrGroup instanceof columnGroup_1.ColumnGroup) {
|
17779 | var columnGroup = columnsOrGroup;
|
17780 | _this.setupParentsIntoColumns(columnGroup.getChildren(), columnGroup);
|
17781 | }
|
17782 | });
|
17783 | };
|
17784 |
|
17785 |
|
17786 |
|
17787 |
|
17788 |
|
17789 |
|
17790 |
|
17791 |
|
17792 |
|
17793 |
|
17794 |
|
17795 |
|
17796 |
|
17797 |
|
17798 |
|
17799 |
|
17800 |
|
17801 |
|
17802 |
|
17803 |
|
17804 |
|
17805 |
|
17806 |
|
17807 |
|
17808 |
|
17809 | DisplayedGroupCreator.prototype.getOriginalPathForColumn = function (balancedColumnTree, column) {
|
17810 | var result = [];
|
17811 | var found = false;
|
17812 | recursePath(balancedColumnTree, 0);
|
17813 |
|
17814 |
|
17815 |
|
17816 | if (found) {
|
17817 | return result;
|
17818 | }
|
17819 | else {
|
17820 | console.log('could not get path');
|
17821 | return null;
|
17822 |
|
17823 | }
|
17824 | function recursePath(balancedColumnTree, dept) {
|
17825 | for (var i = 0; i < balancedColumnTree.length; i++) {
|
17826 | if (found) {
|
17827 |
|
17828 | return;
|
17829 | }
|
17830 | var node = balancedColumnTree[i];
|
17831 | if (node instanceof originalColumnGroup_1.OriginalColumnGroup) {
|
17832 | var nextNode = node;
|
17833 | recursePath(nextNode.getChildren(), dept + 1);
|
17834 | result[dept] = node;
|
17835 | }
|
17836 | else {
|
17837 | if (node === column) {
|
17838 | found = true;
|
17839 | }
|
17840 | }
|
17841 | }
|
17842 | }
|
17843 | };
|
17844 | __decorate([
|
17845 | context_2.Autowired('columnUtils'),
|
17846 | __metadata("design:type", columnUtils_1.ColumnUtils)
|
17847 | ], DisplayedGroupCreator.prototype, "columnUtils", void 0);
|
17848 | __decorate([
|
17849 | context_2.Autowired('context'),
|
17850 | __metadata("design:type", context_1.Context)
|
17851 | ], DisplayedGroupCreator.prototype, "context", void 0);
|
17852 | DisplayedGroupCreator = __decorate([
|
17853 | context_1.Bean('displayedGroupCreator')
|
17854 | ], DisplayedGroupCreator);
|
17855 | return DisplayedGroupCreator;
|
17856 | }());
|
17857 | exports.DisplayedGroupCreator = DisplayedGroupCreator;
|
17858 |
|
17859 |
|
17860 | }),
|
17861 |
|
17862 | (function(module, exports, __webpack_require__) {
|
17863 |
|
17864 | "use strict";
|
17865 |
|
17866 |
|
17867 |
|
17868 |
|
17869 |
|
17870 |
|
17871 |
|
17872 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
17873 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
17874 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
17875 | 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;
|
17876 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
17877 | };
|
17878 | var __metadata = (this && this.__metadata) || function (k, v) {
|
17879 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
17880 | };
|
17881 | Object.defineProperty(exports, "__esModule", { value: true });
|
17882 | var context_1 = __webpack_require__(0);
|
17883 | var context_2 = __webpack_require__(0);
|
17884 | var TemplateService = (function () {
|
17885 | function TemplateService() {
|
17886 | this.templateCache = {};
|
17887 | this.waitingCallbacks = {};
|
17888 | }
|
17889 |
|
17890 |
|
17891 | TemplateService.prototype.getTemplate = function (url, callback) {
|
17892 | var templateFromCache = this.templateCache[url];
|
17893 | if (templateFromCache) {
|
17894 | return templateFromCache;
|
17895 | }
|
17896 | var callbackList = this.waitingCallbacks[url];
|
17897 | var that = this;
|
17898 | if (!callbackList) {
|
17899 |
|
17900 | callbackList = [];
|
17901 | this.waitingCallbacks[url] = callbackList;
|
17902 |
|
17903 | var client = new XMLHttpRequest();
|
17904 | client.onload = function () {
|
17905 | that.handleHttpResult(this, url);
|
17906 | };
|
17907 | client.open("GET", url);
|
17908 | client.send();
|
17909 | }
|
17910 |
|
17911 | if (callback) {
|
17912 | callbackList.push(callback);
|
17913 | }
|
17914 |
|
17915 | return null;
|
17916 | };
|
17917 | TemplateService.prototype.handleHttpResult = function (httpResult, url) {
|
17918 | if (httpResult.status !== 200 || httpResult.response === null) {
|
17919 | console.warn('Unable to get template error ' + httpResult.status + ' - ' + url);
|
17920 | return;
|
17921 | }
|
17922 |
|
17923 |
|
17924 | this.templateCache[url] = httpResult.response || httpResult.responseText;
|
17925 |
|
17926 | var callbacks = this.waitingCallbacks[url];
|
17927 | for (var i = 0; i < callbacks.length; i++) {
|
17928 | var callback = callbacks[i];
|
17929 |
|
17930 |
|
17931 |
|
17932 | callback();
|
17933 | }
|
17934 | if (this.$scope) {
|
17935 | var that_1 = this;
|
17936 | setTimeout(function () {
|
17937 | that_1.$scope.$apply();
|
17938 | }, 0);
|
17939 | }
|
17940 | };
|
17941 | __decorate([
|
17942 | context_2.Autowired('$scope'),
|
17943 | __metadata("design:type", Object)
|
17944 | ], TemplateService.prototype, "$scope", void 0);
|
17945 | TemplateService = __decorate([
|
17946 | context_1.Bean('templateService')
|
17947 | ], TemplateService);
|
17948 | return TemplateService;
|
17949 | }());
|
17950 | exports.TemplateService = TemplateService;
|
17951 |
|
17952 |
|
17953 | }),
|
17954 |
|
17955 | (function(module, exports, __webpack_require__) {
|
17956 |
|
17957 | "use strict";
|
17958 |
|
17959 |
|
17960 |
|
17961 |
|
17962 |
|
17963 |
|
17964 |
|
17965 | var __extends = (this && this.__extends) || (function () {
|
17966 | var extendStatics = Object.setPrototypeOf ||
|
17967 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
17968 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
17969 | return function (d, b) {
|
17970 | extendStatics(d, b);
|
17971 | function __() { this.constructor = d; }
|
17972 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
17973 | };
|
17974 | })();
|
17975 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
17976 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
17977 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
17978 | 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;
|
17979 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
17980 | };
|
17981 | var __metadata = (this && this.__metadata) || function (k, v) {
|
17982 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
17983 | };
|
17984 | Object.defineProperty(exports, "__esModule", { value: true });
|
17985 | var utils_1 = __webpack_require__(1);
|
17986 | var cellComp_1 = __webpack_require__(34);
|
17987 | var rowNode_1 = __webpack_require__(16);
|
17988 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
17989 | var column_1 = __webpack_require__(10);
|
17990 | var events_1 = __webpack_require__(5);
|
17991 | var context_1 = __webpack_require__(0);
|
17992 | var component_1 = __webpack_require__(8);
|
17993 | var componentAnnotations_1 = __webpack_require__(11);
|
17994 | var LoadingCellRenderer = (function (_super) {
|
17995 | __extends(LoadingCellRenderer, _super);
|
17996 | function LoadingCellRenderer() {
|
17997 | return _super.call(this, LoadingCellRenderer.TEMPLATE) || this;
|
17998 | }
|
17999 | LoadingCellRenderer.prototype.init = function (params) {
|
18000 | var eLoadingIcon = utils_1._.createIconNoSpan('groupLoading', this.gridOptionsWrapper, null);
|
18001 | this.eLoadingIcon.appendChild(eLoadingIcon);
|
18002 | var localeTextFunc = this.gridOptionsWrapper.getLocaleTextFunc();
|
18003 | this.eLoadingText.innerText = localeTextFunc('loadingOoo', 'Loading');
|
18004 | };
|
18005 | LoadingCellRenderer.prototype.refresh = function (params) {
|
18006 | return false;
|
18007 | };
|
18008 | LoadingCellRenderer.TEMPLATE = "<div class=\"ag-stub-cell\">\n <span class=\"ag-loading-icon\" ref=\"eLoadingIcon\"></span>\n <span class=\"ag-loading-text\" ref=\"eLoadingText\"></span>\n </div>";
|
18009 | __decorate([
|
18010 | context_1.Autowired('gridOptionsWrapper'),
|
18011 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
18012 | ], LoadingCellRenderer.prototype, "gridOptionsWrapper", void 0);
|
18013 | __decorate([
|
18014 | componentAnnotations_1.RefSelector('eLoadingIcon'),
|
18015 | __metadata("design:type", HTMLElement)
|
18016 | ], LoadingCellRenderer.prototype, "eLoadingIcon", void 0);
|
18017 | __decorate([
|
18018 | componentAnnotations_1.RefSelector('eLoadingText'),
|
18019 | __metadata("design:type", HTMLElement)
|
18020 | ], LoadingCellRenderer.prototype, "eLoadingText", void 0);
|
18021 | return LoadingCellRenderer;
|
18022 | }(component_1.Component));
|
18023 | exports.LoadingCellRenderer = LoadingCellRenderer;
|
18024 | var RowComp = (function (_super) {
|
18025 | __extends(RowComp, _super);
|
18026 | function RowComp(parentScope, bodyContainerComp, pinnedLeftContainerComp, pinnedRightContainerComp, fullWidthContainerComp, rowNode, beans, animateIn, useAnimationFrameForCreate) {
|
18027 | var _this = _super.call(this) || this;
|
18028 | _this.eAllRowContainers = [];
|
18029 | _this.active = true;
|
18030 | _this.columnRefreshPending = false;
|
18031 | _this.cellComps = {};
|
18032 |
|
18033 |
|
18034 |
|
18035 | _this.createSecondPassFuncs = [];
|
18036 |
|
18037 |
|
18038 |
|
18039 | _this.removeFirstPassFuncs = [];
|
18040 |
|
18041 |
|
18042 | _this.removeSecondPassFuncs = [];
|
18043 | _this.initialised = false;
|
18044 | _this.parentScope = parentScope;
|
18045 | _this.beans = beans;
|
18046 | _this.bodyContainerComp = bodyContainerComp;
|
18047 | _this.pinnedLeftContainerComp = pinnedLeftContainerComp;
|
18048 | _this.pinnedRightContainerComp = pinnedRightContainerComp;
|
18049 | _this.fullWidthContainerComp = fullWidthContainerComp;
|
18050 | _this.rowNode = rowNode;
|
18051 | _this.rowIsEven = _this.rowNode.rowIndex % 2 === 0;
|
18052 | _this.paginationPage = _this.beans.paginationProxy.getCurrentPage();
|
18053 | _this.useAnimationFrameForCreate = useAnimationFrameForCreate;
|
18054 | _this.setAnimateFlags(animateIn);
|
18055 | return _this;
|
18056 | }
|
18057 | RowComp.prototype.init = function () {
|
18058 | var _this = this;
|
18059 | this.rowFocused = this.beans.focusedCellController.isRowFocused(this.rowNode.rowIndex, this.rowNode.rowPinned);
|
18060 | this.scope = this.createChildScopeOrNull(this.rowNode.data);
|
18061 | this.setupRowContainers();
|
18062 | this.addListeners();
|
18063 | if (this.slideRowIn) {
|
18064 | this.createSecondPassFuncs.push(function () {
|
18065 | _this.onTopChanged();
|
18066 | });
|
18067 | }
|
18068 | if (this.fadeRowIn) {
|
18069 | this.createSecondPassFuncs.push(function () {
|
18070 | _this.eAllRowContainers.forEach(function (eRow) { return utils_1._.removeCssClass(eRow, 'ag-opacity-zero'); });
|
18071 | });
|
18072 | }
|
18073 | };
|
18074 | RowComp.prototype.createTemplate = function (contents, extraCssClass) {
|
18075 | if (extraCssClass === void 0) { extraCssClass = null; }
|
18076 | var templateParts = [];
|
18077 | var rowHeight = this.rowNode.rowHeight;
|
18078 | var rowClasses = this.getInitialRowClasses(extraCssClass).join(' ');
|
18079 | var rowIdSanitised = utils_1._.escape(this.rowNode.id);
|
18080 | var userRowStyles = this.preProcessStylesFromGridOptions();
|
18081 | var businessKey = this.getRowBusinessKey();
|
18082 | var businessKeySanitised = utils_1._.escape(businessKey);
|
18083 | var rowTopStyle = this.getInitialRowTopStyle();
|
18084 | templateParts.push("<div");
|
18085 | templateParts.push(" role=\"row\"");
|
18086 | templateParts.push(" row-index=\"" + this.rowNode.getRowIndexString() + "\"");
|
18087 | templateParts.push(rowIdSanitised ? " row-id=\"" + rowIdSanitised + "\"" : "");
|
18088 | templateParts.push(businessKey ? " row-business-key=\"" + businessKeySanitised + "\"" : "");
|
18089 | templateParts.push(" comp-id=\"" + this.getCompId() + "\"");
|
18090 | templateParts.push(" class=\"" + rowClasses + "\"");
|
18091 | templateParts.push(" style=\"height: " + rowHeight + "px; " + rowTopStyle + " " + userRowStyles + "\">");
|
18092 |
|
18093 | templateParts.push(contents);
|
18094 | templateParts.push("</div>");
|
18095 | return templateParts.join('');
|
18096 | };
|
18097 | RowComp.prototype.getCellForCol = function (column) {
|
18098 | var cellComp = this.cellComps[column.getColId()];
|
18099 | if (cellComp) {
|
18100 | return cellComp.getGui();
|
18101 | }
|
18102 | else {
|
18103 | return null;
|
18104 | }
|
18105 | };
|
18106 | RowComp.prototype.afterFlush = function () {
|
18107 | if (!this.initialised) {
|
18108 | this.initialised = true;
|
18109 | this.executeProcessRowPostCreateFunc();
|
18110 | }
|
18111 | };
|
18112 | RowComp.prototype.executeProcessRowPostCreateFunc = function () {
|
18113 | var func = this.beans.gridOptionsWrapper.getProcessRowPostCreateFunc();
|
18114 | if (func) {
|
18115 | var params = {
|
18116 | eRow: this.eBodyRow,
|
18117 | ePinnedLeftRow: this.ePinnedLeftRow,
|
18118 | ePinnedRightRow: this.ePinnedRightRow,
|
18119 | node: this.rowNode,
|
18120 | api: this.beans.gridOptionsWrapper.getApi(),
|
18121 | rowIndex: this.rowNode.rowIndex,
|
18122 | addRenderedRowListener: this.addEventListener.bind(this),
|
18123 | columnApi: this.beans.gridOptionsWrapper.getColumnApi(),
|
18124 | context: this.beans.gridOptionsWrapper.getContext()
|
18125 | };
|
18126 | func(params);
|
18127 | }
|
18128 | };
|
18129 | RowComp.prototype.getInitialRowTopStyle = function () {
|
18130 |
|
18131 | var pixels = this.slideRowIn ? this.roundRowTopToBounds(this.rowNode.oldRowTop) : this.rowNode.rowTop;
|
18132 | var afterPaginationPixels = this.applyPaginationOffset(pixels);
|
18133 | var afterScalingPixels = this.beans.heightScaler.getRealPixelPosition(afterPaginationPixels);
|
18134 | if (this.beans.gridOptionsWrapper.isSuppressRowTransform()) {
|
18135 | return "top: " + afterScalingPixels + "px; ";
|
18136 | }
|
18137 | else {
|
18138 | return "transform: translateY(" + afterScalingPixels + "px); ";
|
18139 | }
|
18140 | };
|
18141 | RowComp.prototype.getRowBusinessKey = function () {
|
18142 | if (typeof this.beans.gridOptionsWrapper.getBusinessKeyForNodeFunc() === 'function') {
|
18143 | var businessKey = this.beans.gridOptionsWrapper.getBusinessKeyForNodeFunc()(this.rowNode);
|
18144 | return businessKey;
|
18145 | }
|
18146 | };
|
18147 | RowComp.prototype.lazyCreateCells = function (cols, eRow) {
|
18148 | if (this.active) {
|
18149 | var cellTemplatesAndComps = this.createCells(cols);
|
18150 | eRow.innerHTML = cellTemplatesAndComps.template;
|
18151 | this.callAfterRowAttachedOnCells(cellTemplatesAndComps.cellComps, eRow);
|
18152 | }
|
18153 | };
|
18154 | RowComp.prototype.createRowContainer = function (rowContainerComp, cols, callback) {
|
18155 | var _this = this;
|
18156 | var cellTemplatesAndComps;
|
18157 | if (this.useAnimationFrameForCreate) {
|
18158 | cellTemplatesAndComps = { cellComps: [], template: '' };
|
18159 | }
|
18160 | else {
|
18161 | cellTemplatesAndComps = this.createCells(cols);
|
18162 | }
|
18163 | var rowTemplate = this.createTemplate(cellTemplatesAndComps.template);
|
18164 | rowContainerComp.appendRowTemplate(rowTemplate, function () {
|
18165 | var eRow = rowContainerComp.getRowElement(_this.getCompId());
|
18166 | _this.afterRowAttached(rowContainerComp, eRow);
|
18167 | callback(eRow);
|
18168 | if (_this.useAnimationFrameForCreate) {
|
18169 | _this.beans.taskQueue.addP1Task(_this.lazyCreateCells.bind(_this, cols, eRow));
|
18170 | }
|
18171 | else {
|
18172 | _this.callAfterRowAttachedOnCells(cellTemplatesAndComps.cellComps, eRow);
|
18173 | }
|
18174 | });
|
18175 | };
|
18176 | RowComp.prototype.createChildScopeOrNull = function (data) {
|
18177 | if (this.beans.gridOptionsWrapper.isAngularCompileRows()) {
|
18178 | var newChildScope_1 = this.parentScope.$new();
|
18179 | newChildScope_1.data = data;
|
18180 | newChildScope_1.rowNode = this.rowNode;
|
18181 | newChildScope_1.context = this.beans.gridOptionsWrapper.getContext();
|
18182 | this.addDestroyFunc(function () {
|
18183 | newChildScope_1.$destroy();
|
18184 | newChildScope_1.data = null;
|
18185 | newChildScope_1.rowNode = null;
|
18186 | newChildScope_1.context = null;
|
18187 | });
|
18188 | return newChildScope_1;
|
18189 | }
|
18190 | else {
|
18191 | return null;
|
18192 | }
|
18193 | };
|
18194 | RowComp.prototype.setupRowContainers = function () {
|
18195 | var isFullWidthCellFunc = this.beans.gridOptionsWrapper.getIsFullWidthCellFunc();
|
18196 | var isFullWidthCell = isFullWidthCellFunc ? isFullWidthCellFunc(this.rowNode) : false;
|
18197 | var isDetailCell = this.beans.doingMasterDetail && this.rowNode.detail;
|
18198 | var isGroupSpanningRow = this.rowNode.group && this.beans.gridOptionsWrapper.isGroupUseEntireRow();
|
18199 | if (this.rowNode.stub) {
|
18200 | this.createFullWidthRows(RowComp.LOADING_CELL_RENDERER, RowComp.LOADING_CELL_RENDERER_COMP_NAME);
|
18201 | }
|
18202 | else if (isDetailCell) {
|
18203 | this.createFullWidthRows(RowComp.DETAIL_CELL_RENDERER, RowComp.DETAIL_CELL_RENDERER_COMP_NAME);
|
18204 | }
|
18205 | else if (isFullWidthCell) {
|
18206 | this.createFullWidthRows(RowComp.FULL_WIDTH_CELL_RENDERER, null);
|
18207 | }
|
18208 | else if (isGroupSpanningRow) {
|
18209 | this.createFullWidthRows(RowComp.GROUP_ROW_RENDERER, RowComp.GROUP_ROW_RENDERER_COMP_NAME);
|
18210 | }
|
18211 | else {
|
18212 | this.setupNormalRowContainers();
|
18213 | }
|
18214 | };
|
18215 | RowComp.prototype.setupNormalRowContainers = function () {
|
18216 | var _this = this;
|
18217 | var centerCols = this.beans.columnController.getAllDisplayedCenterVirtualColumnsForRow(this.rowNode);
|
18218 | this.createRowContainer(this.bodyContainerComp, centerCols, function (eRow) { return _this.eBodyRow = eRow; });
|
18219 | var leftCols = this.beans.columnController.getDisplayedLeftColumnsForRow(this.rowNode);
|
18220 | var rightCols = this.beans.columnController.getDisplayedRightColumnsForRow(this.rowNode);
|
18221 | this.createRowContainer(this.pinnedRightContainerComp, rightCols, function (eRow) { return _this.ePinnedRightRow = eRow; });
|
18222 | this.createRowContainer(this.pinnedLeftContainerComp, leftCols, function (eRow) { return _this.ePinnedLeftRow = eRow; });
|
18223 | };
|
18224 | RowComp.prototype.createFullWidthRows = function (type, name) {
|
18225 | var _this = this;
|
18226 | this.fullWidthRow = true;
|
18227 | this.fullWidthRowEmbedded = this.beans.gridOptionsWrapper.isEmbedFullWidthRows();
|
18228 | if (this.fullWidthRowEmbedded) {
|
18229 | this.createFullWidthRowContainer(this.bodyContainerComp, null, null, type, name, function (eRow) {
|
18230 | _this.eFullWidthRowBody = eRow;
|
18231 | }, function (cellRenderer) {
|
18232 | _this.fullWidthRowComponentBody = cellRenderer;
|
18233 | });
|
18234 | this.createFullWidthRowContainer(this.pinnedLeftContainerComp, column_1.Column.PINNED_LEFT, 'ag-cell-last-left-pinned', type, name, function (eRow) {
|
18235 | _this.eFullWidthRowLeft = eRow;
|
18236 | }, function (cellRenderer) {
|
18237 | _this.fullWidthRowComponentLeft = cellRenderer;
|
18238 | });
|
18239 | this.createFullWidthRowContainer(this.pinnedRightContainerComp, column_1.Column.PINNED_RIGHT, 'ag-cell-first-right-pinned', type, name, function (eRow) {
|
18240 | _this.eFullWidthRowRight = eRow;
|
18241 | }, function (cellRenderer) {
|
18242 | _this.fullWidthRowComponentRight = cellRenderer;
|
18243 | });
|
18244 | }
|
18245 | else {
|
18246 |
|
18247 |
|
18248 | this.createFullWidthRowContainer(this.fullWidthContainerComp, null, null, type, name, function (eRow) {
|
18249 | _this.eFullWidthRow = eRow;
|
18250 | }, function (cellRenderer) {
|
18251 | _this.fullWidthRowComponent = cellRenderer;
|
18252 | });
|
18253 | }
|
18254 | };
|
18255 | RowComp.prototype.setAnimateFlags = function (animateIn) {
|
18256 | if (animateIn) {
|
18257 | var oldRowTopExists = utils_1._.exists(this.rowNode.oldRowTop);
|
18258 |
|
18259 | this.slideRowIn = oldRowTopExists;
|
18260 |
|
18261 | this.fadeRowIn = !oldRowTopExists;
|
18262 | }
|
18263 | else {
|
18264 | this.slideRowIn = false;
|
18265 | this.fadeRowIn = false;
|
18266 | }
|
18267 | };
|
18268 | RowComp.prototype.isEditing = function () {
|
18269 | return this.editingRow;
|
18270 | };
|
18271 | RowComp.prototype.stopRowEditing = function (cancel) {
|
18272 | this.stopEditing(cancel);
|
18273 | };
|
18274 | RowComp.prototype.isFullWidth = function () {
|
18275 | return this.fullWidthRow;
|
18276 | };
|
18277 | RowComp.prototype.addListeners = function () {
|
18278 | this.addDestroyableEventListener(this.rowNode, rowNode_1.RowNode.EVENT_HEIGHT_CHANGED, this.onRowHeightChanged.bind(this));
|
18279 | this.addDestroyableEventListener(this.rowNode, rowNode_1.RowNode.EVENT_ROW_SELECTED, this.onRowSelected.bind(this));
|
18280 | this.addDestroyableEventListener(this.rowNode, rowNode_1.RowNode.EVENT_ROW_INDEX_CHANGED, this.onRowIndexChanged.bind(this));
|
18281 | this.addDestroyableEventListener(this.rowNode, rowNode_1.RowNode.EVENT_TOP_CHANGED, this.onTopChanged.bind(this));
|
18282 | this.addDestroyableEventListener(this.rowNode, rowNode_1.RowNode.EVENT_EXPANDED_CHANGED, this.onExpandedChanged.bind(this));
|
18283 | this.addDestroyableEventListener(this.rowNode, rowNode_1.RowNode.EVENT_DATA_CHANGED, this.onRowNodeDataChanged.bind(this));
|
18284 | this.addDestroyableEventListener(this.rowNode, rowNode_1.RowNode.EVENT_CELL_CHANGED, this.onRowNodeCellChanged.bind(this));
|
18285 | this.addDestroyableEventListener(this.rowNode, rowNode_1.RowNode.EVENT_DRAGGING_CHANGED, this.onRowNodeDraggingChanged.bind(this));
|
18286 | var eventService = this.beans.eventService;
|
18287 | this.addDestroyableEventListener(eventService, events_1.Events.EVENT_HEIGHT_SCALE_CHANGED, this.onTopChanged.bind(this));
|
18288 | this.addDestroyableEventListener(eventService, events_1.Events.EVENT_DISPLAYED_COLUMNS_CHANGED, this.onDisplayedColumnsChanged.bind(this));
|
18289 | this.addDestroyableEventListener(eventService, events_1.Events.EVENT_VIRTUAL_COLUMNS_CHANGED, this.onVirtualColumnsChanged.bind(this));
|
18290 | this.addDestroyableEventListener(eventService, events_1.Events.EVENT_COLUMN_RESIZED, this.onColumnResized.bind(this));
|
18291 | this.addDestroyableEventListener(eventService, events_1.Events.EVENT_CELL_FOCUSED, this.onCellFocusChanged.bind(this));
|
18292 | this.addDestroyableEventListener(eventService, events_1.Events.EVENT_PAGINATION_CHANGED, this.onPaginationChanged.bind(this));
|
18293 | this.addDestroyableEventListener(eventService, events_1.Events.EVENT_GRID_COLUMNS_CHANGED, this.onGridColumnsChanged.bind(this));
|
18294 | };
|
18295 |
|
18296 |
|
18297 | RowComp.prototype.onGridColumnsChanged = function () {
|
18298 | var allRenderedCellIds = Object.keys(this.cellComps);
|
18299 | this.removeRenderedCells(allRenderedCellIds);
|
18300 | };
|
18301 | RowComp.prototype.onRowNodeDataChanged = function (event) {
|
18302 |
|
18303 |
|
18304 |
|
18305 | this.forEachCellComp(function (cellComp) {
|
18306 | return cellComp.refreshCell({
|
18307 | suppressFlash: !event.update,
|
18308 | newData: !event.update
|
18309 | });
|
18310 | });
|
18311 |
|
18312 |
|
18313 |
|
18314 |
|
18315 |
|
18316 | this.onRowSelected();
|
18317 |
|
18318 | this.postProcessCss();
|
18319 | };
|
18320 | RowComp.prototype.onRowNodeCellChanged = function (event) {
|
18321 |
|
18322 | this.postProcessCss();
|
18323 | };
|
18324 | RowComp.prototype.postProcessCss = function () {
|
18325 | this.postProcessStylesFromGridOptions();
|
18326 | this.postProcessClassesFromGridOptions();
|
18327 | this.postProcessRowClassRules();
|
18328 | this.postProcessRowDragging();
|
18329 | };
|
18330 | RowComp.prototype.onRowNodeDraggingChanged = function () {
|
18331 | this.postProcessRowDragging();
|
18332 | };
|
18333 | RowComp.prototype.postProcessRowDragging = function () {
|
18334 | var dragging = this.rowNode.dragging;
|
18335 | this.eAllRowContainers.forEach(function (row) { return utils_1._.addOrRemoveCssClass(row, 'ag-row-dragging', dragging); });
|
18336 | };
|
18337 | RowComp.prototype.onExpandedChanged = function () {
|
18338 | if (this.rowNode.group && !this.rowNode.footer) {
|
18339 | var expanded_1 = this.rowNode.expanded;
|
18340 | this.eAllRowContainers.forEach(function (row) { return utils_1._.addOrRemoveCssClass(row, 'ag-row-group-expanded', expanded_1); });
|
18341 | this.eAllRowContainers.forEach(function (row) { return utils_1._.addOrRemoveCssClass(row, 'ag-row-group-contracted', !expanded_1); });
|
18342 | }
|
18343 | };
|
18344 | RowComp.prototype.onDisplayedColumnsChanged = function () {
|
18345 | if (!this.fullWidthRow) {
|
18346 | this.refreshCells();
|
18347 | }
|
18348 | };
|
18349 | RowComp.prototype.destroyFullWidthComponents = function () {
|
18350 | if (this.fullWidthRowComponent) {
|
18351 | if (this.fullWidthRowComponent.destroy) {
|
18352 | this.fullWidthRowComponent.destroy();
|
18353 | }
|
18354 | this.fullWidthRowComponent = null;
|
18355 | }
|
18356 | if (this.fullWidthRowComponentBody) {
|
18357 | if (this.fullWidthRowComponentBody.destroy) {
|
18358 | this.fullWidthRowComponentBody.destroy();
|
18359 | }
|
18360 | this.fullWidthRowComponent = null;
|
18361 | }
|
18362 | if (this.fullWidthRowComponentLeft) {
|
18363 | if (this.fullWidthRowComponentLeft.destroy) {
|
18364 | this.fullWidthRowComponentLeft.destroy();
|
18365 | }
|
18366 | this.fullWidthRowComponentLeft = null;
|
18367 | }
|
18368 | if (this.fullWidthRowComponentRight) {
|
18369 | if (this.fullWidthRowComponentRight.destroy) {
|
18370 | this.fullWidthRowComponentRight.destroy();
|
18371 | }
|
18372 | this.fullWidthRowComponent = null;
|
18373 | }
|
18374 | };
|
18375 | RowComp.prototype.getContainerForCell = function (pinnedType) {
|
18376 | switch (pinnedType) {
|
18377 | case column_1.Column.PINNED_LEFT: return this.ePinnedLeftRow;
|
18378 | case column_1.Column.PINNED_RIGHT: return this.ePinnedRightRow;
|
18379 | default: return this.eBodyRow;
|
18380 | }
|
18381 | };
|
18382 | RowComp.prototype.onVirtualColumnsChanged = function () {
|
18383 | if (!this.fullWidthRow) {
|
18384 | this.refreshCells();
|
18385 | }
|
18386 | };
|
18387 | RowComp.prototype.onColumnResized = function () {
|
18388 | if (!this.fullWidthRow) {
|
18389 | this.refreshCells();
|
18390 | }
|
18391 | };
|
18392 | RowComp.prototype.refreshCells = function () {
|
18393 | if (this.beans.gridOptionsWrapper.isSuppressAnimationFrame()) {
|
18394 | this.refreshCellsInAnimationFrame();
|
18395 | }
|
18396 | else {
|
18397 | if (this.columnRefreshPending) {
|
18398 | return;
|
18399 | }
|
18400 | this.beans.taskQueue.addP1Task(this.refreshCellsInAnimationFrame.bind(this));
|
18401 | }
|
18402 | };
|
18403 | RowComp.prototype.refreshCellsInAnimationFrame = function () {
|
18404 | if (!this.active) {
|
18405 | return;
|
18406 | }
|
18407 | this.columnRefreshPending = false;
|
18408 | var centerCols = this.beans.columnController.getAllDisplayedCenterVirtualColumnsForRow(this.rowNode);
|
18409 | var leftCols = this.beans.columnController.getDisplayedLeftColumnsForRow(this.rowNode);
|
18410 | var rightCols = this.beans.columnController.getDisplayedRightColumnsForRow(this.rowNode);
|
18411 | this.insertCellsIntoContainer(this.eBodyRow, centerCols);
|
18412 | this.insertCellsIntoContainer(this.ePinnedLeftRow, leftCols);
|
18413 | this.insertCellsIntoContainer(this.ePinnedRightRow, rightCols);
|
18414 | var colIdsToRemove = Object.keys(this.cellComps);
|
18415 | centerCols.forEach(function (col) { return utils_1._.removeFromArray(colIdsToRemove, col.getId()); });
|
18416 | leftCols.forEach(function (col) { return utils_1._.removeFromArray(colIdsToRemove, col.getId()); });
|
18417 | rightCols.forEach(function (col) { return utils_1._.removeFromArray(colIdsToRemove, col.getId()); });
|
18418 |
|
18419 |
|
18420 | colIdsToRemove = utils_1._.filter(colIdsToRemove, this.isCellEligibleToBeRemoved.bind(this));
|
18421 |
|
18422 | this.removeRenderedCells(colIdsToRemove);
|
18423 | };
|
18424 | RowComp.prototype.removeRenderedCells = function (colIds) {
|
18425 | var _this = this;
|
18426 | colIds.forEach(function (key) {
|
18427 | var cellComp = _this.cellComps[key];
|
18428 |
|
18429 | if (utils_1._.missing(cellComp)) {
|
18430 | return;
|
18431 | }
|
18432 | cellComp.detach();
|
18433 | cellComp.destroy();
|
18434 | _this.cellComps[key] = null;
|
18435 | });
|
18436 | };
|
18437 | RowComp.prototype.isCellEligibleToBeRemoved = function (indexStr) {
|
18438 | var displayedColumns = this.beans.columnController.getAllDisplayedColumns();
|
18439 | var REMOVE_CELL = true;
|
18440 | var KEEP_CELL = false;
|
18441 | var renderedCell = this.cellComps[indexStr];
|
18442 | if (!renderedCell) {
|
18443 | return REMOVE_CELL;
|
18444 | }
|
18445 |
|
18446 | if (this.isCellInWrongRow(renderedCell)) {
|
18447 | return REMOVE_CELL;
|
18448 | }
|
18449 |
|
18450 | var editing = renderedCell.isEditing();
|
18451 | var focused = this.beans.focusedCellController.isCellFocused(renderedCell.getGridCell());
|
18452 | var mightWantToKeepCell = editing || focused;
|
18453 | if (mightWantToKeepCell) {
|
18454 | var column = renderedCell.getColumn();
|
18455 | var cellStillDisplayed = displayedColumns.indexOf(column) >= 0;
|
18456 | return cellStillDisplayed ? KEEP_CELL : REMOVE_CELL;
|
18457 | }
|
18458 | else {
|
18459 | return REMOVE_CELL;
|
18460 | }
|
18461 | };
|
18462 | RowComp.prototype.ensureCellInCorrectContainer = function (cellComp) {
|
18463 | var element = cellComp.getGui();
|
18464 | var column = cellComp.getColumn();
|
18465 | var pinnedType = column.getPinned();
|
18466 | var eContainer = this.getContainerForCell(pinnedType);
|
18467 |
|
18468 | var eOldContainer = cellComp.getParentRow();
|
18469 | var inWrongRow = eOldContainer !== eContainer;
|
18470 | if (inWrongRow) {
|
18471 |
|
18472 | if (eOldContainer) {
|
18473 | eOldContainer.removeChild(element);
|
18474 | }
|
18475 | eContainer.appendChild(element);
|
18476 | cellComp.setParentRow(eContainer);
|
18477 | }
|
18478 | };
|
18479 | RowComp.prototype.isCellInWrongRow = function (cellComp) {
|
18480 | var column = cellComp.getColumn();
|
18481 | var rowWeWant = this.getContainerForCell(column.getPinned());
|
18482 |
|
18483 | var oldRow = cellComp.getParentRow();
|
18484 | return oldRow !== rowWeWant;
|
18485 | };
|
18486 | RowComp.prototype.insertCellsIntoContainer = function (eRow, cols) {
|
18487 | var _this = this;
|
18488 | if (!eRow) {
|
18489 | return;
|
18490 | }
|
18491 | var cellTemplates = [];
|
18492 | var newCellComps = [];
|
18493 | cols.forEach(function (col) {
|
18494 | var colId = col.getId();
|
18495 | var oldCell = _this.cellComps[colId];
|
18496 | if (oldCell) {
|
18497 | _this.ensureCellInCorrectContainer(oldCell);
|
18498 | }
|
18499 | else {
|
18500 | _this.createNewCell(col, eRow, cellTemplates, newCellComps);
|
18501 | }
|
18502 | });
|
18503 | if (cellTemplates.length > 0) {
|
18504 | utils_1._.appendHtml(eRow, cellTemplates.join(''));
|
18505 | this.callAfterRowAttachedOnCells(newCellComps, eRow);
|
18506 | }
|
18507 | };
|
18508 | RowComp.prototype.addDomData = function (eRowContainer) {
|
18509 | var gow = this.beans.gridOptionsWrapper;
|
18510 | gow.setDomData(eRowContainer, RowComp.DOM_DATA_KEY_RENDERED_ROW, this);
|
18511 | this.addDestroyFunc(function () {
|
18512 | gow.setDomData(eRowContainer, RowComp.DOM_DATA_KEY_RENDERED_ROW, null);
|
18513 | });
|
18514 | };
|
18515 | RowComp.prototype.createNewCell = function (col, eContainer, cellTemplates, newCellComps) {
|
18516 | var newCellComp = new cellComp_1.CellComp(this.scope, this.beans, col, this.rowNode, this, false);
|
18517 | var cellTemplate = newCellComp.getCreateTemplate();
|
18518 | cellTemplates.push(cellTemplate);
|
18519 | newCellComps.push(newCellComp);
|
18520 | this.cellComps[col.getId()] = newCellComp;
|
18521 | newCellComp.setParentRow(eContainer);
|
18522 | };
|
18523 | RowComp.prototype.onMouseEvent = function (eventName, mouseEvent) {
|
18524 | switch (eventName) {
|
18525 | case 'dblclick':
|
18526 | this.onRowDblClick(mouseEvent);
|
18527 | break;
|
18528 | case 'click':
|
18529 | this.onRowClick(mouseEvent);
|
18530 | break;
|
18531 | }
|
18532 | };
|
18533 | RowComp.prototype.createRowEvent = function (type, domEvent) {
|
18534 | return {
|
18535 | type: type,
|
18536 | node: this.rowNode,
|
18537 | data: this.rowNode.data,
|
18538 | rowIndex: this.rowNode.rowIndex,
|
18539 | rowPinned: this.rowNode.rowPinned,
|
18540 | context: this.beans.gridOptionsWrapper.getContext(),
|
18541 | api: this.beans.gridOptionsWrapper.getApi(),
|
18542 | columnApi: this.beans.gridOptionsWrapper.getColumnApi(),
|
18543 | event: domEvent
|
18544 | };
|
18545 | };
|
18546 | RowComp.prototype.createRowEventWithSource = function (type, domEvent) {
|
18547 | var event = this.createRowEvent(type, domEvent);
|
18548 |
|
18549 |
|
18550 |
|
18551 |
|
18552 |
|
18553 |
|
18554 | event.source = this;
|
18555 | return event;
|
18556 | };
|
18557 | RowComp.prototype.onRowDblClick = function (mouseEvent) {
|
18558 | if (utils_1._.isStopPropagationForAgGrid(mouseEvent)) {
|
18559 | return;
|
18560 | }
|
18561 | var agEvent = this.createRowEventWithSource(events_1.Events.EVENT_ROW_DOUBLE_CLICKED, mouseEvent);
|
18562 | this.beans.eventService.dispatchEvent(agEvent);
|
18563 | };
|
18564 | RowComp.prototype.onRowClick = function (mouseEvent) {
|
18565 | var stop = utils_1._.isStopPropagationForAgGrid(mouseEvent);
|
18566 | if (stop) {
|
18567 | return;
|
18568 | }
|
18569 | var agEvent = this.createRowEventWithSource(events_1.Events.EVENT_ROW_CLICKED, mouseEvent);
|
18570 | this.beans.eventService.dispatchEvent(agEvent);
|
18571 |
|
18572 | var multiSelectKeyPressed = mouseEvent.ctrlKey || mouseEvent.metaKey;
|
18573 | var shiftKeyPressed = mouseEvent.shiftKey;
|
18574 |
|
18575 |
|
18576 | if (this.rowNode.group) {
|
18577 | return;
|
18578 | }
|
18579 |
|
18580 | if (this.rowNode.rowPinned) {
|
18581 | return;
|
18582 | }
|
18583 |
|
18584 | if (!this.beans.gridOptionsWrapper.isRowSelection()) {
|
18585 | return;
|
18586 | }
|
18587 |
|
18588 | if (this.beans.gridOptionsWrapper.isSuppressRowClickSelection()) {
|
18589 | return;
|
18590 | }
|
18591 | var multiSelectOnClick = this.beans.gridOptionsWrapper.isRowMultiSelectWithClick();
|
18592 | var rowDeselectionWithCtrl = this.beans.gridOptionsWrapper.isRowDeselection();
|
18593 | if (this.rowNode.isSelected()) {
|
18594 | if (multiSelectOnClick) {
|
18595 | this.rowNode.setSelectedParams({ newValue: false });
|
18596 | }
|
18597 | else if (multiSelectKeyPressed) {
|
18598 | if (rowDeselectionWithCtrl) {
|
18599 | this.rowNode.setSelectedParams({ newValue: false });
|
18600 | }
|
18601 | }
|
18602 | else {
|
18603 |
|
18604 | this.rowNode.setSelectedParams({ newValue: true, clearSelection: true });
|
18605 | }
|
18606 | }
|
18607 | else {
|
18608 | var clearSelection = multiSelectOnClick ? false : !multiSelectKeyPressed;
|
18609 | this.rowNode.setSelectedParams({ newValue: true, clearSelection: clearSelection, rangeSelect: shiftKeyPressed });
|
18610 | }
|
18611 | };
|
18612 | RowComp.prototype.createFullWidthRowContainer = function (rowContainerComp, pinned, extraCssClass, cellRendererType, cellRendererName, eRowCallback, cellRendererCallback) {
|
18613 | var _this = this;
|
18614 | var rowTemplate = this.createTemplate('', extraCssClass);
|
18615 | rowContainerComp.appendRowTemplate(rowTemplate, function () {
|
18616 | var eRow = rowContainerComp.getRowElement(_this.getCompId());
|
18617 | var params = _this.createFullWidthParams(eRow, pinned);
|
18618 | var callback = function (cellRenderer) {
|
18619 | if (_this.isAlive()) {
|
18620 | var gui = cellRenderer.getGui();
|
18621 | eRow.appendChild(gui);
|
18622 | cellRendererCallback(cellRenderer);
|
18623 | }
|
18624 | else {
|
18625 | if (cellRenderer.destroy) {
|
18626 | cellRenderer.destroy();
|
18627 | }
|
18628 | }
|
18629 | };
|
18630 | _this.beans.componentResolver.createAgGridComponent(null, params, cellRendererType, params, cellRendererName).then(callback);
|
18631 | _this.afterRowAttached(rowContainerComp, eRow);
|
18632 | eRowCallback(eRow);
|
18633 | _this.angular1Compile(eRow);
|
18634 | });
|
18635 | };
|
18636 | RowComp.prototype.angular1Compile = function (element) {
|
18637 | if (this.scope) {
|
18638 | this.beans.$compile(element)(this.scope);
|
18639 | }
|
18640 | };
|
18641 | RowComp.prototype.createFullWidthParams = function (eRow, pinned) {
|
18642 | var params = {
|
18643 | fullWidth: true,
|
18644 | data: this.rowNode.data,
|
18645 | node: this.rowNode,
|
18646 | value: this.rowNode.key,
|
18647 | $scope: this.scope,
|
18648 | rowIndex: this.rowNode.rowIndex,
|
18649 | api: this.beans.gridOptionsWrapper.getApi(),
|
18650 | columnApi: this.beans.gridOptionsWrapper.getColumnApi(),
|
18651 | context: this.beans.gridOptionsWrapper.getContext(),
|
18652 |
|
18653 | eGridCell: eRow,
|
18654 | eParentOfValue: eRow,
|
18655 | pinned: pinned,
|
18656 | addRenderedRowListener: this.addEventListener.bind(this)
|
18657 | };
|
18658 | return params;
|
18659 | };
|
18660 | RowComp.prototype.getInitialRowClasses = function (extraCssClass) {
|
18661 | var classes = [];
|
18662 | if (utils_1._.exists(extraCssClass)) {
|
18663 | classes.push(extraCssClass);
|
18664 | }
|
18665 | classes.push('ag-row');
|
18666 | classes.push(this.rowFocused ? 'ag-row-focus' : 'ag-row-no-focus');
|
18667 | if (this.fadeRowIn) {
|
18668 | classes.push('ag-opacity-zero');
|
18669 | }
|
18670 | if (this.rowIsEven) {
|
18671 | classes.push('ag-row-even');
|
18672 | }
|
18673 | else {
|
18674 | classes.push('ag-row-odd');
|
18675 | }
|
18676 | if (this.rowNode.isSelected()) {
|
18677 | classes.push('ag-row-selected');
|
18678 | }
|
18679 | if (this.rowNode.group) {
|
18680 | classes.push('ag-row-group');
|
18681 |
|
18682 | classes.push('ag-row-level-' + this.rowNode.level);
|
18683 | if (this.rowNode.footer) {
|
18684 | classes.push('ag-row-footer');
|
18685 | }
|
18686 | }
|
18687 | else {
|
18688 |
|
18689 | if (this.rowNode.parent) {
|
18690 | classes.push('ag-row-level-' + (this.rowNode.parent.level + 1));
|
18691 | }
|
18692 | else {
|
18693 | classes.push('ag-row-level-0');
|
18694 | }
|
18695 | }
|
18696 | if (this.rowNode.stub) {
|
18697 | classes.push('ag-row-stub');
|
18698 | }
|
18699 | if (this.fullWidthRow) {
|
18700 | classes.push('ag-full-width-row');
|
18701 | }
|
18702 | if (this.rowNode.group && !this.rowNode.footer) {
|
18703 | classes.push(this.rowNode.expanded ? 'ag-row-group-expanded' : 'ag-row-group-contracted');
|
18704 | }
|
18705 | if (this.rowNode.dragging) {
|
18706 | classes.push('ag-row-dragging');
|
18707 | }
|
18708 | utils_1._.pushAll(classes, this.processClassesFromGridOptions());
|
18709 | utils_1._.pushAll(classes, this.preProcessRowClassRules());
|
18710 | return classes;
|
18711 | };
|
18712 | RowComp.prototype.preProcessRowClassRules = function () {
|
18713 | var res = [];
|
18714 | this.processRowClassRules(function (className) {
|
18715 | res.push(className);
|
18716 | }, function (className) {
|
18717 |
|
18718 |
|
18719 | });
|
18720 | return res;
|
18721 | };
|
18722 | RowComp.prototype.processRowClassRules = function (onApplicableClass, onNotApplicableClass) {
|
18723 | this.beans.stylingService.processClassRules(this.beans.gridOptionsWrapper.rowClassRules(), {
|
18724 | value: undefined,
|
18725 | colDef: undefined,
|
18726 | data: this.rowNode.data,
|
18727 | node: this.rowNode,
|
18728 | rowIndex: this.rowNode.rowIndex,
|
18729 | api: this.beans.gridOptionsWrapper.getApi(),
|
18730 | $scope: this.scope,
|
18731 | context: this.beans.gridOptionsWrapper.getContext()
|
18732 | }, onApplicableClass, onNotApplicableClass);
|
18733 | };
|
18734 | RowComp.prototype.stopEditing = function (cancel) {
|
18735 | if (cancel === void 0) { cancel = false; }
|
18736 | this.forEachCellComp(function (renderedCell) {
|
18737 | renderedCell.stopEditing(cancel);
|
18738 | });
|
18739 | if (this.editingRow) {
|
18740 | if (!cancel) {
|
18741 | var event_1 = this.createRowEvent(events_1.Events.EVENT_ROW_VALUE_CHANGED);
|
18742 | this.beans.eventService.dispatchEvent(event_1);
|
18743 | }
|
18744 | this.setEditingRow(false);
|
18745 | }
|
18746 | };
|
18747 | RowComp.prototype.setEditingRow = function (value) {
|
18748 | this.editingRow = value;
|
18749 | this.eAllRowContainers.forEach(function (row) { return utils_1._.addOrRemoveCssClass(row, 'ag-row-editing', value); });
|
18750 | var event = value ?
|
18751 | this.createRowEvent(events_1.Events.EVENT_ROW_EDITING_STARTED)
|
18752 | : this.createRowEvent(events_1.Events.EVENT_ROW_EDITING_STOPPED);
|
18753 | this.beans.eventService.dispatchEvent(event);
|
18754 | };
|
18755 | RowComp.prototype.startRowEditing = function (keyPress, charPress, sourceRenderedCell) {
|
18756 | if (keyPress === void 0) { keyPress = null; }
|
18757 | if (charPress === void 0) { charPress = null; }
|
18758 | if (sourceRenderedCell === void 0) { sourceRenderedCell = null; }
|
18759 |
|
18760 | if (this.editingRow) {
|
18761 | return;
|
18762 | }
|
18763 | this.forEachCellComp(function (renderedCell) {
|
18764 | var cellStartedEdit = renderedCell === sourceRenderedCell;
|
18765 | if (cellStartedEdit) {
|
18766 | renderedCell.startEditingIfEnabled(keyPress, charPress, cellStartedEdit);
|
18767 | }
|
18768 | else {
|
18769 | renderedCell.startEditingIfEnabled(null, null, cellStartedEdit);
|
18770 | }
|
18771 | });
|
18772 | this.setEditingRow(true);
|
18773 | };
|
18774 | RowComp.prototype.forEachCellComp = function (callback) {
|
18775 | utils_1._.iterateObject(this.cellComps, function (key, cellComp) {
|
18776 | if (cellComp) {
|
18777 | callback(cellComp);
|
18778 | }
|
18779 | });
|
18780 | };
|
18781 | RowComp.prototype.postProcessClassesFromGridOptions = function () {
|
18782 | var _this = this;
|
18783 | var cssClasses = this.processClassesFromGridOptions();
|
18784 | if (cssClasses) {
|
18785 | cssClasses.forEach(function (classStr) {
|
18786 | _this.eAllRowContainers.forEach(function (row) { return utils_1._.addCssClass(row, classStr); });
|
18787 | });
|
18788 | }
|
18789 | };
|
18790 | RowComp.prototype.postProcessRowClassRules = function () {
|
18791 | var _this = this;
|
18792 | this.processRowClassRules(function (className) {
|
18793 | _this.eAllRowContainers.forEach(function (row) { return utils_1._.addCssClass(row, className); });
|
18794 | }, function (className) {
|
18795 | _this.eAllRowContainers.forEach(function (row) { return utils_1._.removeCssClass(row, className); });
|
18796 | });
|
18797 | };
|
18798 | RowComp.prototype.processClassesFromGridOptions = function () {
|
18799 | var res = [];
|
18800 | var process = function (rowClass) {
|
18801 | if (typeof rowClass === 'string') {
|
18802 | res.push(rowClass);
|
18803 | }
|
18804 | else if (Array.isArray(rowClass)) {
|
18805 | rowClass.forEach(function (e) { return res.push(e); });
|
18806 | }
|
18807 | };
|
18808 |
|
18809 | var rowClass = this.beans.gridOptionsWrapper.getRowClass();
|
18810 | if (rowClass) {
|
18811 | if (typeof rowClass === 'function') {
|
18812 | console.warn('ag-Grid: rowClass should not be a function, please use getRowClass instead');
|
18813 | return;
|
18814 | }
|
18815 | process(rowClass);
|
18816 | }
|
18817 |
|
18818 | var rowClassFunc = this.beans.gridOptionsWrapper.getRowClassFunc();
|
18819 | if (rowClassFunc) {
|
18820 | var params = {
|
18821 | node: this.rowNode,
|
18822 | data: this.rowNode.data,
|
18823 | rowIndex: this.rowNode.rowIndex,
|
18824 | context: this.beans.gridOptionsWrapper.getContext(),
|
18825 | api: this.beans.gridOptionsWrapper.getApi()
|
18826 | };
|
18827 | var rowClassFuncResult = rowClassFunc(params);
|
18828 | process(rowClassFuncResult);
|
18829 | }
|
18830 | return res;
|
18831 | };
|
18832 | RowComp.prototype.preProcessStylesFromGridOptions = function () {
|
18833 | var rowStyles = this.processStylesFromGridOptions();
|
18834 | return utils_1._.cssStyleObjectToMarkup(rowStyles);
|
18835 | };
|
18836 | RowComp.prototype.postProcessStylesFromGridOptions = function () {
|
18837 | var rowStyles = this.processStylesFromGridOptions();
|
18838 | this.eAllRowContainers.forEach(function (row) { return utils_1._.addStylesToElement(row, rowStyles); });
|
18839 | };
|
18840 | RowComp.prototype.processStylesFromGridOptions = function () {
|
18841 |
|
18842 | var rowStyle = this.beans.gridOptionsWrapper.getRowStyle();
|
18843 | if (rowStyle && typeof rowStyle === 'function') {
|
18844 | console.log('ag-Grid: rowStyle should be an object of key/value styles, not be a function, use getRowStyle() instead');
|
18845 | return;
|
18846 | }
|
18847 |
|
18848 | var rowStyleFunc = this.beans.gridOptionsWrapper.getRowStyleFunc();
|
18849 | var rowStyleFuncResult;
|
18850 | if (rowStyleFunc) {
|
18851 | var params = {
|
18852 | data: this.rowNode.data,
|
18853 | node: this.rowNode,
|
18854 | api: this.beans.gridOptionsWrapper.getApi(),
|
18855 | context: this.beans.gridOptionsWrapper.getContext(),
|
18856 | $scope: this.scope
|
18857 | };
|
18858 | rowStyleFuncResult = rowStyleFunc(params);
|
18859 | }
|
18860 | return utils_1._.assign({}, rowStyle, rowStyleFuncResult);
|
18861 | };
|
18862 | RowComp.prototype.createCells = function (cols) {
|
18863 | var _this = this;
|
18864 | var templateParts = [];
|
18865 | var newCellComps = [];
|
18866 | cols.forEach(function (col) {
|
18867 | var newCellComp = new cellComp_1.CellComp(_this.scope, _this.beans, col, _this.rowNode, _this, false);
|
18868 | var cellTemplate = newCellComp.getCreateTemplate();
|
18869 | templateParts.push(cellTemplate);
|
18870 | newCellComps.push(newCellComp);
|
18871 | _this.cellComps[col.getId()] = newCellComp;
|
18872 | });
|
18873 | var templateAndComps = {
|
18874 | template: templateParts.join(''),
|
18875 | cellComps: newCellComps
|
18876 | };
|
18877 | return templateAndComps;
|
18878 | };
|
18879 | RowComp.prototype.onRowSelected = function () {
|
18880 | var selected = this.rowNode.isSelected();
|
18881 | this.eAllRowContainers.forEach(function (row) { return utils_1._.addOrRemoveCssClass(row, 'ag-row-selected', selected); });
|
18882 | };
|
18883 |
|
18884 |
|
18885 |
|
18886 | RowComp.prototype.callAfterRowAttachedOnCells = function (newCellComps, eRow) {
|
18887 | var _this = this;
|
18888 | newCellComps.forEach(function (cellComp) {
|
18889 | cellComp.setParentRow(eRow);
|
18890 | cellComp.afterAttached();
|
18891 |
|
18892 |
|
18893 | if (_this.editingRow) {
|
18894 | cellComp.startEditingIfEnabled();
|
18895 | }
|
18896 | });
|
18897 | };
|
18898 | RowComp.prototype.afterRowAttached = function (rowContainerComp, eRow) {
|
18899 | var _this = this;
|
18900 | this.addDomData(eRow);
|
18901 | this.removeSecondPassFuncs.push(function () {
|
18902 |
|
18903 | rowContainerComp.removeRowElement(eRow);
|
18904 | });
|
18905 | this.removeFirstPassFuncs.push(function () {
|
18906 | if (utils_1._.exists(_this.rowNode.rowTop)) {
|
18907 |
|
18908 |
|
18909 |
|
18910 |
|
18911 | var rowTop = _this.roundRowTopToBounds(_this.rowNode.rowTop);
|
18912 | _this.setRowTop(rowTop);
|
18913 | }
|
18914 | else {
|
18915 | utils_1._.addCssClass(eRow, 'ag-opacity-zero');
|
18916 | }
|
18917 | });
|
18918 | this.eAllRowContainers.push(eRow);
|
18919 |
|
18920 |
|
18921 | if (this.useAnimationFrameForCreate) {
|
18922 | this.beans.taskQueue.addP1Task(this.addHoverFunctionality.bind(this, eRow));
|
18923 | }
|
18924 | else {
|
18925 | this.addHoverFunctionality(eRow);
|
18926 | }
|
18927 | };
|
18928 | RowComp.prototype.addHoverFunctionality = function (eRow) {
|
18929 | var _this = this;
|
18930 |
|
18931 |
|
18932 | if (!this.active) {
|
18933 | return;
|
18934 | }
|
18935 |
|
18936 |
|
18937 |
|
18938 |
|
18939 |
|
18940 |
|
18941 |
|
18942 | this.addDestroyableEventListener(eRow, 'mouseenter', function () { return _this.rowNode.onMouseEnter(); });
|
18943 | this.addDestroyableEventListener(eRow, 'mouseleave', function () { return _this.rowNode.onMouseLeave(); });
|
18944 |
|
18945 | this.addDestroyableEventListener(this.rowNode, rowNode_1.RowNode.EVENT_MOUSE_ENTER, function () {
|
18946 |
|
18947 |
|
18948 |
|
18949 | if (!_this.beans.gridOptionsWrapper.isSuppressRowHoverHighlight()) {
|
18950 | utils_1._.addCssClass(eRow, 'ag-row-hover');
|
18951 | }
|
18952 | });
|
18953 | this.addDestroyableEventListener(this.rowNode, rowNode_1.RowNode.EVENT_MOUSE_LEAVE, function () {
|
18954 | utils_1._.removeCssClass(eRow, 'ag-row-hover');
|
18955 | });
|
18956 | };
|
18957 |
|
18958 |
|
18959 |
|
18960 |
|
18961 | RowComp.prototype.roundRowTopToBounds = function (rowTop) {
|
18962 | var range = this.beans.gridPanel.getVScrollPosition();
|
18963 | var minPixel = this.applyPaginationOffset(range.top, true) - 100;
|
18964 | var maxPixel = this.applyPaginationOffset(range.bottom, true) + 100;
|
18965 | if (rowTop < minPixel) {
|
18966 | return minPixel;
|
18967 | }
|
18968 | else if (rowTop > maxPixel) {
|
18969 | return maxPixel;
|
18970 | }
|
18971 | else {
|
18972 | return rowTop;
|
18973 | }
|
18974 | };
|
18975 | RowComp.prototype.onRowHeightChanged = function () {
|
18976 |
|
18977 |
|
18978 |
|
18979 | if (utils_1._.exists(this.rowNode.rowHeight)) {
|
18980 | var heightPx_1 = this.rowNode.rowHeight + 'px';
|
18981 | this.eAllRowContainers.forEach(function (row) { return row.style.height = heightPx_1; });
|
18982 | }
|
18983 | };
|
18984 | RowComp.prototype.addEventListener = function (eventType, listener) {
|
18985 | if (eventType === 'renderedRowRemoved' || eventType === 'rowRemoved') {
|
18986 | eventType = events_1.Events.EVENT_VIRTUAL_ROW_REMOVED;
|
18987 | console.warn('ag-Grid: Since version 11, event renderedRowRemoved is now called ' + events_1.Events.EVENT_VIRTUAL_ROW_REMOVED);
|
18988 | }
|
18989 | _super.prototype.addEventListener.call(this, eventType, listener);
|
18990 | };
|
18991 | RowComp.prototype.removeEventListener = function (eventType, listener) {
|
18992 | if (eventType === 'renderedRowRemoved' || eventType === 'rowRemoved') {
|
18993 | eventType = events_1.Events.EVENT_VIRTUAL_ROW_REMOVED;
|
18994 | console.warn('ag-Grid: Since version 11, event renderedRowRemoved and rowRemoved is now called ' + events_1.Events.EVENT_VIRTUAL_ROW_REMOVED);
|
18995 | }
|
18996 | _super.prototype.removeEventListener.call(this, eventType, listener);
|
18997 | };
|
18998 | RowComp.prototype.destroy = function (animate) {
|
18999 | if (animate === void 0) { animate = false; }
|
19000 | _super.prototype.destroy.call(this);
|
19001 | this.active = false;
|
19002 |
|
19003 |
|
19004 | this.destroyFullWidthComponents();
|
19005 | if (animate) {
|
19006 | this.removeFirstPassFuncs.forEach(function (func) { return func(); });
|
19007 | this.removeSecondPassFuncs.push(this.destroyContainingCells.bind(this));
|
19008 | }
|
19009 | else {
|
19010 | this.destroyContainingCells();
|
19011 |
|
19012 |
|
19013 | var delayedDestroyFunctions = this.getAndClearDelayedDestroyFunctions();
|
19014 | delayedDestroyFunctions.forEach(function (func) { return func(); });
|
19015 | }
|
19016 | var event = this.createRowEvent(events_1.Events.EVENT_VIRTUAL_ROW_REMOVED);
|
19017 | this.dispatchEvent(event);
|
19018 | this.beans.eventService.dispatchEvent(event);
|
19019 | };
|
19020 | RowComp.prototype.destroyContainingCells = function () {
|
19021 | this.forEachCellComp(function (renderedCell) { return renderedCell.destroy(); });
|
19022 | this.destroyFullWidthComponents();
|
19023 | };
|
19024 |
|
19025 | RowComp.prototype.getAndClearDelayedDestroyFunctions = function () {
|
19026 | var result = this.removeSecondPassFuncs;
|
19027 | this.removeSecondPassFuncs = [];
|
19028 | return result;
|
19029 | };
|
19030 | RowComp.prototype.onCellFocusChanged = function () {
|
19031 | var rowFocused = this.beans.focusedCellController.isRowFocused(this.rowNode.rowIndex, this.rowNode.rowPinned);
|
19032 | if (rowFocused !== this.rowFocused) {
|
19033 | this.eAllRowContainers.forEach(function (row) { return utils_1._.addOrRemoveCssClass(row, 'ag-row-focus', rowFocused); });
|
19034 | this.eAllRowContainers.forEach(function (row) { return utils_1._.addOrRemoveCssClass(row, 'ag-row-no-focus', !rowFocused); });
|
19035 | this.rowFocused = rowFocused;
|
19036 | }
|
19037 |
|
19038 | if (!rowFocused && this.editingRow) {
|
19039 | this.stopEditing(false);
|
19040 | }
|
19041 | };
|
19042 | RowComp.prototype.onPaginationChanged = function () {
|
19043 | var currentPage = this.beans.paginationProxy.getCurrentPage();
|
19044 |
|
19045 |
|
19046 | if (this.paginationPage !== currentPage) {
|
19047 | this.paginationPage = currentPage;
|
19048 | this.onTopChanged();
|
19049 | }
|
19050 | };
|
19051 | RowComp.prototype.onTopChanged = function () {
|
19052 | this.setRowTop(this.rowNode.rowTop);
|
19053 | };
|
19054 |
|
19055 |
|
19056 |
|
19057 | RowComp.prototype.applyPaginationOffset = function (topPx, reverse) {
|
19058 | if (reverse === void 0) { reverse = false; }
|
19059 | if (this.rowNode.isRowPinned()) {
|
19060 | return topPx;
|
19061 | }
|
19062 | else {
|
19063 | var pixelOffset = this.beans.paginationProxy.getPixelOffset();
|
19064 | if (reverse) {
|
19065 | return topPx + pixelOffset;
|
19066 | }
|
19067 | else {
|
19068 | return topPx - pixelOffset;
|
19069 | }
|
19070 | }
|
19071 | };
|
19072 | RowComp.prototype.setRowTop = function (pixels) {
|
19073 |
|
19074 |
|
19075 | if (utils_1._.exists(pixels)) {
|
19076 | var afterPaginationPixels = this.applyPaginationOffset(pixels);
|
19077 | var afterScalingPixels = this.beans.heightScaler.getRealPixelPosition(afterPaginationPixels);
|
19078 | var topPx_1 = afterScalingPixels + "px";
|
19079 | if (this.beans.gridOptionsWrapper.isSuppressRowTransform()) {
|
19080 | this.eAllRowContainers.forEach(function (row) { return row.style.top = "" + topPx_1; });
|
19081 | }
|
19082 | else {
|
19083 | this.eAllRowContainers.forEach(function (row) { return row.style.transform = "translateY(" + topPx_1 + ")"; });
|
19084 | }
|
19085 | }
|
19086 | };
|
19087 |
|
19088 | RowComp.prototype.getAndClearNextVMTurnFunctions = function () {
|
19089 | var result = this.createSecondPassFuncs;
|
19090 | this.createSecondPassFuncs = [];
|
19091 | return result;
|
19092 | };
|
19093 | RowComp.prototype.getRowNode = function () {
|
19094 | return this.rowNode;
|
19095 | };
|
19096 | RowComp.prototype.getRenderedCellForColumn = function (column) {
|
19097 | return this.cellComps[column.getColId()];
|
19098 | };
|
19099 | RowComp.prototype.onRowIndexChanged = function () {
|
19100 | this.onCellFocusChanged();
|
19101 | this.updateRowIndexes();
|
19102 | };
|
19103 | RowComp.prototype.updateRowIndexes = function () {
|
19104 | var rowIndexStr = this.rowNode.getRowIndexString();
|
19105 | var rowIsEven = this.rowNode.rowIndex % 2 === 0;
|
19106 | var rowIsEvenChanged = this.rowIsEven !== rowIsEven;
|
19107 | if (rowIsEvenChanged) {
|
19108 | this.rowIsEven = rowIsEven;
|
19109 | }
|
19110 | this.eAllRowContainers.forEach(function (eRow) {
|
19111 | eRow.setAttribute('row-index', rowIndexStr);
|
19112 | if (rowIsEvenChanged) {
|
19113 | utils_1._.addOrRemoveCssClass(eRow, 'ag-row-even', rowIsEven);
|
19114 | utils_1._.addOrRemoveCssClass(eRow, 'ag-row-odd', !rowIsEven);
|
19115 | }
|
19116 | });
|
19117 | };
|
19118 | RowComp.prototype.ensureDomOrder = function () {
|
19119 | var body = this.getBodyRowElement();
|
19120 | if (body) {
|
19121 | this.bodyContainerComp.ensureDomOrder(body);
|
19122 | }
|
19123 | var left = this.getPinnedLeftRowElement();
|
19124 | if (left) {
|
19125 | this.pinnedLeftContainerComp.ensureDomOrder(left);
|
19126 | }
|
19127 | var right = this.getPinnedRightRowElement();
|
19128 | if (right) {
|
19129 | this.pinnedRightContainerComp.ensureDomOrder(right);
|
19130 | }
|
19131 | var fullWidth = this.getFullWidthRowElement();
|
19132 | if (fullWidth) {
|
19133 | this.fullWidthContainerComp.ensureDomOrder(fullWidth);
|
19134 | }
|
19135 | };
|
19136 |
|
19137 | RowComp.prototype.getPinnedLeftRowElement = function () {
|
19138 | return this.ePinnedLeftRow ? this.ePinnedLeftRow : this.eFullWidthRowLeft;
|
19139 | };
|
19140 |
|
19141 | RowComp.prototype.getPinnedRightRowElement = function () {
|
19142 | return this.ePinnedRightRow ? this.ePinnedRightRow : this.eFullWidthRowRight;
|
19143 | };
|
19144 |
|
19145 | RowComp.prototype.getBodyRowElement = function () {
|
19146 | return this.eBodyRow ? this.eBodyRow : this.eFullWidthRowBody;
|
19147 | };
|
19148 |
|
19149 | RowComp.prototype.getFullWidthRowElement = function () {
|
19150 | return this.eFullWidthRow;
|
19151 | };
|
19152 | RowComp.DOM_DATA_KEY_RENDERED_ROW = 'renderedRow';
|
19153 | RowComp.FULL_WIDTH_CELL_RENDERER = 'fullWidthCellRenderer';
|
19154 | RowComp.GROUP_ROW_RENDERER = 'groupRowRenderer';
|
19155 | RowComp.GROUP_ROW_RENDERER_COMP_NAME = 'agGroupRowRenderer';
|
19156 | RowComp.LOADING_CELL_RENDERER = 'loadingCellRenderer';
|
19157 | RowComp.LOADING_CELL_RENDERER_COMP_NAME = 'agLoadingCellRenderer';
|
19158 | RowComp.DETAIL_CELL_RENDERER = 'detailCellRenderer';
|
19159 | RowComp.DETAIL_CELL_RENDERER_COMP_NAME = 'agDetailCellRenderer';
|
19160 | return RowComp;
|
19161 | }(component_1.Component));
|
19162 | exports.RowComp = RowComp;
|
19163 |
|
19164 |
|
19165 | }),
|
19166 |
|
19167 | (function(module, exports, __webpack_require__) {
|
19168 |
|
19169 | "use strict";
|
19170 |
|
19171 |
|
19172 |
|
19173 |
|
19174 |
|
19175 |
|
19176 |
|
19177 | var __extends = (this && this.__extends) || (function () {
|
19178 | var extendStatics = Object.setPrototypeOf ||
|
19179 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
19180 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
19181 | return function (d, b) {
|
19182 | extendStatics(d, b);
|
19183 | function __() { this.constructor = d; }
|
19184 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
19185 | };
|
19186 | })();
|
19187 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
19188 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
19189 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
19190 | 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;
|
19191 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
19192 | };
|
19193 | var __metadata = (this && this.__metadata) || function (k, v) {
|
19194 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
19195 | };
|
19196 | Object.defineProperty(exports, "__esModule", { value: true });
|
19197 | var component_1 = __webpack_require__(8);
|
19198 | var componentAnnotations_1 = __webpack_require__(11);
|
19199 | var context_1 = __webpack_require__(0);
|
19200 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
19201 | var utils_1 = __webpack_require__(1);
|
19202 | var FilterConditionType;
|
19203 | (function (FilterConditionType) {
|
19204 | FilterConditionType[FilterConditionType["MAIN"] = 0] = "MAIN";
|
19205 | FilterConditionType[FilterConditionType["CONDITION"] = 1] = "CONDITION";
|
19206 | })(FilterConditionType = exports.FilterConditionType || (exports.FilterConditionType = {}));
|
19207 | var DEFAULT_TRANSLATIONS = {
|
19208 | loadingOoo: 'Loading...',
|
19209 | equals: 'Equals',
|
19210 | notEqual: 'Not equal',
|
19211 | lessThan: 'Less than',
|
19212 | greaterThan: 'Greater than',
|
19213 | inRange: 'In range',
|
19214 | lessThanOrEqual: 'Less than or equals',
|
19215 | greaterThanOrEqual: 'Greater than or equals',
|
19216 | filterOoo: 'Filter...',
|
19217 | contains: 'Contains',
|
19218 | notContains: 'Not contains',
|
19219 | startsWith: 'Starts with',
|
19220 | endsWith: 'Ends with',
|
19221 | searchOoo: 'Search...',
|
19222 | selectAll: 'Select All',
|
19223 | applyFilter: 'Apply Filter',
|
19224 | clearFilter: 'Clear Filter'
|
19225 | };
|
19226 |
|
19227 |
|
19228 |
|
19229 |
|
19230 |
|
19231 |
|
19232 |
|
19233 |
|
19234 |
|
19235 | var BaseFilter = (function (_super) {
|
19236 | __extends(BaseFilter, _super);
|
19237 | function BaseFilter() {
|
19238 | return _super !== null && _super.apply(this, arguments) || this;
|
19239 | }
|
19240 | BaseFilter.prototype.init = function (params) {
|
19241 | this.filterParams = params;
|
19242 | this.defaultFilter = this.filterParams.defaultOption;
|
19243 | if (this.filterParams.filterOptions && !this.defaultFilter) {
|
19244 | if (this.filterParams.filterOptions.lastIndexOf(BaseFilter.EQUALS) < 0) {
|
19245 | this.defaultFilter = this.filterParams.filterOptions[0];
|
19246 | }
|
19247 | }
|
19248 | this.customInit();
|
19249 | this.filter = this.defaultFilter;
|
19250 | this.filterCondition = this.defaultFilter;
|
19251 | this.clearActive = params.clearButton === true;
|
19252 |
|
19253 | this.applyActive = ((params.applyButton === true) || (params.apply === true));
|
19254 | this.newRowsActionKeep = params.newRowsAction === 'keep';
|
19255 | this.setTemplate(this.generateTemplate());
|
19256 | utils_1._.setVisible(this.eApplyButton, this.applyActive);
|
19257 | if (this.applyActive) {
|
19258 | this.addDestroyableEventListener(this.eApplyButton, "click", this.filterParams.filterChangedCallback);
|
19259 | }
|
19260 | utils_1._.setVisible(this.eClearButton, this.clearActive);
|
19261 | if (this.clearActive) {
|
19262 | this.addDestroyableEventListener(this.eClearButton, "click", this.onClearButton.bind(this));
|
19263 | }
|
19264 | var anyButtonVisible = this.applyActive || this.clearActive;
|
19265 | utils_1._.setVisible(this.eButtonsPanel, anyButtonVisible);
|
19266 | this.instantiate(this.context);
|
19267 | this.initialiseFilterBodyUi(FilterConditionType.MAIN);
|
19268 | this.refreshFilterBodyUi(FilterConditionType.MAIN);
|
19269 | };
|
19270 | BaseFilter.prototype.onClearButton = function () {
|
19271 | this.setModel(null);
|
19272 | this.onFilterChanged();
|
19273 | };
|
19274 | BaseFilter.prototype.floatingFilter = function (from) {
|
19275 | if (from !== '') {
|
19276 | var model = this.modelFromFloatingFilter(from);
|
19277 | this.setModel(model);
|
19278 | }
|
19279 | else {
|
19280 | this.resetState();
|
19281 | }
|
19282 | this.onFilterChanged();
|
19283 | };
|
19284 | BaseFilter.prototype.onNewRowsLoaded = function () {
|
19285 | if (!this.newRowsActionKeep) {
|
19286 | this.resetState();
|
19287 | }
|
19288 | };
|
19289 | BaseFilter.prototype.getModel = function () {
|
19290 | if (this.isFilterActive()) {
|
19291 | if (!this.isFilterConditionActive(FilterConditionType.CONDITION)) {
|
19292 | return this.serialize(FilterConditionType.MAIN);
|
19293 | }
|
19294 | else {
|
19295 | return {
|
19296 | condition1: this.serialize(FilterConditionType.MAIN),
|
19297 | condition2: this.serialize(FilterConditionType.CONDITION),
|
19298 | operator: this.conditionValue
|
19299 | };
|
19300 | }
|
19301 | }
|
19302 | else {
|
19303 | return null;
|
19304 | }
|
19305 | };
|
19306 | BaseFilter.prototype.getNullableModel = function () {
|
19307 | if (!this.isFilterConditionActive(FilterConditionType.CONDITION)) {
|
19308 | return this.serialize(FilterConditionType.MAIN);
|
19309 | }
|
19310 | else {
|
19311 | return {
|
19312 | condition1: this.serialize(FilterConditionType.MAIN),
|
19313 | condition2: this.serialize(FilterConditionType.CONDITION),
|
19314 | operator: this.conditionValue
|
19315 | };
|
19316 | }
|
19317 | };
|
19318 | BaseFilter.prototype.setModel = function (model) {
|
19319 | if (model) {
|
19320 | if (!model.operator) {
|
19321 | this.resetState();
|
19322 | this.parse(model, FilterConditionType.MAIN);
|
19323 | }
|
19324 | else {
|
19325 | var asCombinedFilter = model;
|
19326 | this.parse((asCombinedFilter).condition1, FilterConditionType.MAIN);
|
19327 | this.parse((asCombinedFilter).condition2, FilterConditionType.CONDITION);
|
19328 | this.conditionValue = asCombinedFilter.operator;
|
19329 | }
|
19330 | }
|
19331 | else {
|
19332 | this.resetState();
|
19333 | }
|
19334 | this.redrawCondition();
|
19335 | this.refreshFilterBodyUi(FilterConditionType.MAIN);
|
19336 | this.refreshFilterBodyUi(FilterConditionType.CONDITION);
|
19337 | };
|
19338 | BaseFilter.prototype.doOnFilterChanged = function (applyNow) {
|
19339 | if (applyNow === void 0) { applyNow = false; }
|
19340 | this.filterParams.filterModifiedCallback();
|
19341 | var requiresApplyAndIsApplying = this.applyActive && applyNow;
|
19342 | var notRequiresApply = !this.applyActive;
|
19343 | var shouldFilter = notRequiresApply || requiresApplyAndIsApplying;
|
19344 | if (shouldFilter) {
|
19345 | this.filterParams.filterChangedCallback();
|
19346 | }
|
19347 | this.refreshFilterBodyUi(FilterConditionType.MAIN);
|
19348 | this.refreshFilterBodyUi(FilterConditionType.CONDITION);
|
19349 | return shouldFilter;
|
19350 | };
|
19351 | BaseFilter.prototype.onFilterChanged = function (applyNow) {
|
19352 | if (applyNow === void 0) { applyNow = false; }
|
19353 | this.doOnFilterChanged(applyNow);
|
19354 | this.redrawCondition();
|
19355 | this.refreshFilterBodyUi(FilterConditionType.MAIN);
|
19356 | this.refreshFilterBodyUi(FilterConditionType.CONDITION);
|
19357 | };
|
19358 | BaseFilter.prototype.redrawCondition = function () {
|
19359 | var _this = this;
|
19360 | var filterCondition = this.eFilterBodyWrapper.querySelector('.ag-filter-condition');
|
19361 | if (!filterCondition && this.isFilterActive() && this.acceptsBooleanLogic()) {
|
19362 | this.eConditionWrapper = utils_1._.loadTemplate(this.createConditionTemplate(FilterConditionType.CONDITION));
|
19363 | this.eFilterBodyWrapper.appendChild(this.eConditionWrapper);
|
19364 | this.wireQuerySelectors();
|
19365 | var _a = this.refreshOperatorUi(), andButton = _a.andButton, orButton = _a.orButton;
|
19366 | this.addDestroyableEventListener(andButton, 'change', function () {
|
19367 | _this.conditionValue = 'AND';
|
19368 | _this.onFilterChanged();
|
19369 | });
|
19370 | this.addDestroyableEventListener(orButton, 'change', function () {
|
19371 | _this.conditionValue = 'OR';
|
19372 | _this.onFilterChanged();
|
19373 | });
|
19374 | this.initialiseFilterBodyUi(FilterConditionType.CONDITION);
|
19375 | }
|
19376 | else if (filterCondition && !this.isFilterActive()) {
|
19377 | this.eFilterBodyWrapper.removeChild(this.eConditionWrapper);
|
19378 | this.eConditionWrapper = null;
|
19379 | }
|
19380 | else {
|
19381 | this.refreshFilterBodyUi(FilterConditionType.CONDITION);
|
19382 | if (this.eConditionWrapper) {
|
19383 | this.refreshOperatorUi();
|
19384 | }
|
19385 | }
|
19386 | };
|
19387 | BaseFilter.prototype.refreshOperatorUi = function () {
|
19388 | var andButton = this.eConditionWrapper.querySelector('.and');
|
19389 | var orButton = this.eConditionWrapper.querySelector('.or');
|
19390 | this.conditionValue = this.conditionValue == null ? 'AND' : this.conditionValue;
|
19391 | andButton.checked = this.conditionValue === 'AND';
|
19392 | orButton.checked = this.conditionValue === 'OR';
|
19393 | return { andButton: andButton, orButton: orButton };
|
19394 | };
|
19395 | BaseFilter.prototype.onFloatingFilterChanged = function (change) {
|
19396 |
|
19397 | var casted = change;
|
19398 | if (casted == null) {
|
19399 | this.setModel(null);
|
19400 | }
|
19401 | else if (!this.isFilterConditionActive(FilterConditionType.CONDITION)) {
|
19402 | this.setModel(casted ? casted.model : null);
|
19403 | }
|
19404 | else {
|
19405 | var combinedFilter = {
|
19406 | condition1: casted.model,
|
19407 | condition2: this.serialize(FilterConditionType.CONDITION),
|
19408 | operator: this.conditionValue
|
19409 | };
|
19410 | this.setModel(combinedFilter);
|
19411 | }
|
19412 | return this.doOnFilterChanged(casted ? casted.apply : false);
|
19413 | };
|
19414 | BaseFilter.prototype.generateFilterHeader = function (type) {
|
19415 | return '';
|
19416 | };
|
19417 | BaseFilter.prototype.generateTemplate = function () {
|
19418 | var translate = this.translate.bind(this);
|
19419 | var mainConditionBody = this.createConditionBody(FilterConditionType.MAIN);
|
19420 | var bodyWithBooleanLogic = !this.acceptsBooleanLogic() ?
|
19421 | mainConditionBody :
|
19422 | this.wrapCondition(mainConditionBody);
|
19423 | return "<div>\n <div class='ag-filter-body-wrapper'>" + bodyWithBooleanLogic + "</div>\n <div class=\"ag-filter-apply-panel\" id=\"applyPanel\">\n <button type=\"button\" id=\"clearButton\">" + translate('clearFilter') + "</button>\n <button type=\"button\" id=\"applyButton\">" + translate('applyFilter') + "</button>\n </div>\n </div>";
|
19424 | };
|
19425 | BaseFilter.prototype.acceptsBooleanLogic = function () {
|
19426 | return false;
|
19427 | };
|
19428 | BaseFilter.prototype.wrapCondition = function (mainCondition) {
|
19429 | if (!this.isFilterActive())
|
19430 | return mainCondition;
|
19431 | return "" + mainCondition + this.createConditionTemplate(FilterConditionType.CONDITION);
|
19432 | };
|
19433 | BaseFilter.prototype.createConditionTemplate = function (type) {
|
19434 | return "<div class=\"ag-filter-condition\">\n <input id=\"andId\" type=\"radio\" class=\"and\" name=\"booleanLogic\" value=\"AND\" checked=\"checked\" /><label style=\"display: inline\" for=\"andId\">AND</label>\n <input id=\"orId\" type=\"radio\" class=\"or\" name=\"booleanLogic\" value=\"OR\" /><label style=\"display: inline\" for=\"orId\">OR</label>\n <div>" + this.createConditionBody(type) + "</div>\n </div>";
|
19435 | };
|
19436 | BaseFilter.prototype.createConditionBody = function (type) {
|
19437 | var body = this.bodyTemplate(type);
|
19438 | return this.generateFilterHeader(type) + body;
|
19439 | };
|
19440 | BaseFilter.prototype.translate = function (toTranslate) {
|
19441 | var translate = this.gridOptionsWrapper.getLocaleTextFunc();
|
19442 | return translate(toTranslate, DEFAULT_TRANSLATIONS[toTranslate]);
|
19443 | };
|
19444 | BaseFilter.prototype.getDebounceMs = function (filterParams) {
|
19445 | if (filterParams.applyButton && filterParams.debounceMs) {
|
19446 | console.warn('ag-Grid: debounceMs is ignored when applyButton = true');
|
19447 | return 0;
|
19448 | }
|
19449 | return filterParams.debounceMs != null ? filterParams.debounceMs : 500;
|
19450 | };
|
19451 | BaseFilter.EQUALS = 'equals';
|
19452 | BaseFilter.NOT_EQUAL = 'notEqual';
|
19453 | BaseFilter.LESS_THAN = 'lessThan';
|
19454 | BaseFilter.LESS_THAN_OR_EQUAL = 'lessThanOrEqual';
|
19455 | BaseFilter.GREATER_THAN = 'greaterThan';
|
19456 | BaseFilter.GREATER_THAN_OR_EQUAL = 'greaterThanOrEqual';
|
19457 | BaseFilter.IN_RANGE = 'inRange';
|
19458 | BaseFilter.CONTAINS = 'contains';
|
19459 | BaseFilter.NOT_CONTAINS = 'notContains';
|
19460 | BaseFilter.STARTS_WITH = 'startsWith';
|
19461 | BaseFilter.ENDS_WITH = 'endsWith';
|
19462 | __decorate([
|
19463 | componentAnnotations_1.QuerySelector('#applyPanel'),
|
19464 | __metadata("design:type", HTMLElement)
|
19465 | ], BaseFilter.prototype, "eButtonsPanel", void 0);
|
19466 | __decorate([
|
19467 | componentAnnotations_1.QuerySelector('.ag-filter-body-wrapper'),
|
19468 | __metadata("design:type", HTMLElement)
|
19469 | ], BaseFilter.prototype, "eFilterBodyWrapper", void 0);
|
19470 | __decorate([
|
19471 | componentAnnotations_1.QuerySelector('#applyButton'),
|
19472 | __metadata("design:type", HTMLElement)
|
19473 | ], BaseFilter.prototype, "eApplyButton", void 0);
|
19474 | __decorate([
|
19475 | componentAnnotations_1.QuerySelector('#clearButton'),
|
19476 | __metadata("design:type", HTMLElement)
|
19477 | ], BaseFilter.prototype, "eClearButton", void 0);
|
19478 | __decorate([
|
19479 | context_1.Autowired('context'),
|
19480 | __metadata("design:type", context_1.Context)
|
19481 | ], BaseFilter.prototype, "context", void 0);
|
19482 | __decorate([
|
19483 | context_1.Autowired('gridOptionsWrapper'),
|
19484 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
19485 | ], BaseFilter.prototype, "gridOptionsWrapper", void 0);
|
19486 | return BaseFilter;
|
19487 | }(component_1.Component));
|
19488 | exports.BaseFilter = BaseFilter;
|
19489 |
|
19490 |
|
19491 |
|
19492 | var ComparableBaseFilter = (function (_super) {
|
19493 | __extends(ComparableBaseFilter, _super);
|
19494 | function ComparableBaseFilter() {
|
19495 | return _super !== null && _super.apply(this, arguments) || this;
|
19496 | }
|
19497 | ComparableBaseFilter.prototype.doesFilterPass = function (params) {
|
19498 | var mainFilterResult = this.individualFilterPasses(params, FilterConditionType.MAIN);
|
19499 | if (this.eTypeConditionSelector == null) {
|
19500 | return mainFilterResult;
|
19501 | }
|
19502 | var auxFilterResult = this.individualFilterPasses(params, FilterConditionType.CONDITION);
|
19503 | return this.conditionValue === 'AND' ? mainFilterResult && auxFilterResult : mainFilterResult || auxFilterResult;
|
19504 | };
|
19505 | ComparableBaseFilter.prototype.init = function (params) {
|
19506 | _super.prototype.init.call(this, params);
|
19507 | this.suppressAndOrCondition = params.suppressAndOrCondition;
|
19508 | };
|
19509 | ComparableBaseFilter.prototype.customInit = function () {
|
19510 | if (!this.defaultFilter) {
|
19511 | this.defaultFilter = this.getDefaultType();
|
19512 | }
|
19513 | };
|
19514 | ComparableBaseFilter.prototype.acceptsBooleanLogic = function () {
|
19515 | return this.suppressAndOrCondition !== true;
|
19516 | };
|
19517 | ComparableBaseFilter.prototype.generateFilterHeader = function (type) {
|
19518 | var _this = this;
|
19519 | var defaultFilterTypes = this.getApplicableFilterTypes();
|
19520 | var restrictedFilterTypes = this.filterParams.filterOptions;
|
19521 | var actualFilterTypes = restrictedFilterTypes ? restrictedFilterTypes : defaultFilterTypes;
|
19522 | var optionsHtml = actualFilterTypes.map(function (filterType) {
|
19523 | var localeFilterName = _this.translate(filterType);
|
19524 | return "<option value=\"" + filterType + "\">" + localeFilterName + "</option>";
|
19525 | });
|
19526 | var readOnly = optionsHtml.length == 1 ? 'disabled' : '';
|
19527 | var id = type == FilterConditionType.MAIN ? 'filterType' : 'filterConditionType';
|
19528 | return optionsHtml.length <= 0 ?
|
19529 | '' :
|
19530 | "<div>\n <select class=\"ag-filter-select\" id=\"" + id + "\" " + readOnly + ">\n " + optionsHtml.join('') + "\n </select>\n </div>";
|
19531 | };
|
19532 | ComparableBaseFilter.prototype.initialiseFilterBodyUi = function (type) {
|
19533 | var _this = this;
|
19534 | if (type === FilterConditionType.MAIN) {
|
19535 | this.setFilterType(this.filter, type);
|
19536 | this.addDestroyableEventListener(this.eTypeSelector, "change", function () { return _this.onFilterTypeChanged(type); });
|
19537 | }
|
19538 | else {
|
19539 | this.setFilterType(this.filterCondition, type);
|
19540 | this.addDestroyableEventListener(this.eTypeConditionSelector, "change", function () { return _this.onFilterTypeChanged(type); });
|
19541 | }
|
19542 | };
|
19543 | ComparableBaseFilter.prototype.onFilterTypeChanged = function (type) {
|
19544 | if (type === FilterConditionType.MAIN) {
|
19545 | this.filter = this.eTypeSelector.value;
|
19546 | }
|
19547 | else {
|
19548 | this.filterCondition = this.eTypeConditionSelector.value;
|
19549 | }
|
19550 | this.refreshFilterBodyUi(type);
|
19551 |
|
19552 |
|
19553 |
|
19554 | if (this.isFilterActive()) {
|
19555 | this.onFilterChanged();
|
19556 | }
|
19557 | };
|
19558 | ComparableBaseFilter.prototype.isFilterActive = function () {
|
19559 | var rawFilterValues = this.filterValues(FilterConditionType.MAIN);
|
19560 | if (this.filter === BaseFilter.IN_RANGE) {
|
19561 | var filterValueArray = rawFilterValues;
|
19562 | return filterValueArray[0] != null && filterValueArray[1] != null;
|
19563 | }
|
19564 | else {
|
19565 | return rawFilterValues != null;
|
19566 | }
|
19567 | };
|
19568 | ComparableBaseFilter.prototype.setFilterType = function (filterType, type) {
|
19569 | if (type === FilterConditionType.MAIN) {
|
19570 | this.filter = filterType;
|
19571 | if (!this.eTypeSelector)
|
19572 | return;
|
19573 | this.eTypeSelector.value = filterType;
|
19574 | }
|
19575 | else {
|
19576 | this.filterCondition = filterType;
|
19577 | if (!this.eTypeConditionSelector)
|
19578 | return;
|
19579 | this.eTypeConditionSelector.value = filterType;
|
19580 | }
|
19581 | };
|
19582 | ComparableBaseFilter.prototype.isFilterConditionActive = function (type) {
|
19583 | return this.filterValues(type) != null;
|
19584 | };
|
19585 | __decorate([
|
19586 | componentAnnotations_1.QuerySelector('#filterType'),
|
19587 | __metadata("design:type", HTMLSelectElement)
|
19588 | ], ComparableBaseFilter.prototype, "eTypeSelector", void 0);
|
19589 | __decorate([
|
19590 | componentAnnotations_1.QuerySelector('#filterConditionType'),
|
19591 | __metadata("design:type", HTMLSelectElement)
|
19592 | ], ComparableBaseFilter.prototype, "eTypeConditionSelector", void 0);
|
19593 | return ComparableBaseFilter;
|
19594 | }(BaseFilter));
|
19595 | exports.ComparableBaseFilter = ComparableBaseFilter;
|
19596 |
|
19597 |
|
19598 |
|
19599 |
|
19600 | var ScalarBaseFilter = (function (_super) {
|
19601 | __extends(ScalarBaseFilter, _super);
|
19602 | function ScalarBaseFilter() {
|
19603 | return _super !== null && _super.apply(this, arguments) || this;
|
19604 | }
|
19605 | ScalarBaseFilter.prototype.nullComparator = function (type) {
|
19606 | var _this = this;
|
19607 | return function (filterValue, gridValue) {
|
19608 | if (gridValue == null) {
|
19609 | var nullValue = _this.translateNull(type);
|
19610 | if (_this.filter === BaseFilter.EQUALS) {
|
19611 | return nullValue ? 0 : 1;
|
19612 | }
|
19613 | if (_this.filter === BaseFilter.GREATER_THAN) {
|
19614 | return nullValue ? 1 : -1;
|
19615 | }
|
19616 | if (_this.filter === BaseFilter.GREATER_THAN_OR_EQUAL) {
|
19617 | return nullValue ? 1 : -1;
|
19618 | }
|
19619 | if (_this.filter === BaseFilter.LESS_THAN_OR_EQUAL) {
|
19620 | return nullValue ? -1 : 1;
|
19621 | }
|
19622 | if (_this.filter === BaseFilter.LESS_THAN) {
|
19623 | return nullValue ? -1 : 1;
|
19624 | }
|
19625 | if (_this.filter === BaseFilter.NOT_EQUAL) {
|
19626 | return nullValue ? 1 : 0;
|
19627 | }
|
19628 | }
|
19629 | var actualComparator = _this.comparator();
|
19630 | return actualComparator(filterValue, gridValue);
|
19631 | };
|
19632 | };
|
19633 | ScalarBaseFilter.prototype.getDefaultType = function () {
|
19634 | return BaseFilter.EQUALS;
|
19635 | };
|
19636 | ScalarBaseFilter.prototype.translateNull = function (type) {
|
19637 | var reducedType = type.indexOf('greater') > -1 ? 'greaterThan' :
|
19638 | type.indexOf('lessThan') > -1 ? 'lessThan' :
|
19639 | 'equals';
|
19640 | if (this.filterParams.nullComparator && this.filterParams.nullComparator[reducedType]) {
|
19641 | return this.filterParams.nullComparator[reducedType];
|
19642 | }
|
19643 | return ScalarBaseFilter.DEFAULT_NULL_COMPARATOR[reducedType];
|
19644 | };
|
19645 | ScalarBaseFilter.prototype.individualFilterPasses = function (params, type) {
|
19646 | return this.doIndividualFilterPasses(params, type, type === FilterConditionType.MAIN ? this.filter : this.filterCondition);
|
19647 | };
|
19648 | ScalarBaseFilter.prototype.doIndividualFilterPasses = function (params, type, filter) {
|
19649 | var value = this.filterParams.valueGetter(params.node);
|
19650 | var comparator = this.nullComparator(filter);
|
19651 | var rawFilterValues = this.filterValues(type);
|
19652 | var from = Array.isArray(rawFilterValues) ? rawFilterValues[0] : rawFilterValues;
|
19653 | if (from == null) {
|
19654 | return type === FilterConditionType.MAIN ? true : this.conditionValue === 'AND';
|
19655 | }
|
19656 | var compareResult = comparator(from, value);
|
19657 | if (filter === BaseFilter.EQUALS) {
|
19658 | return compareResult === 0;
|
19659 | }
|
19660 | if (filter === BaseFilter.GREATER_THAN) {
|
19661 | return compareResult > 0;
|
19662 | }
|
19663 | if (filter === BaseFilter.GREATER_THAN_OR_EQUAL) {
|
19664 | return compareResult >= 0;
|
19665 | }
|
19666 | if (filter === BaseFilter.LESS_THAN_OR_EQUAL) {
|
19667 | return compareResult <= 0;
|
19668 | }
|
19669 | if (filter === BaseFilter.LESS_THAN) {
|
19670 | return compareResult < 0;
|
19671 | }
|
19672 | if (filter === BaseFilter.NOT_EQUAL) {
|
19673 | return compareResult != 0;
|
19674 | }
|
19675 |
|
19676 | var compareToResult = comparator(rawFilterValues[1], value);
|
19677 | if (filter === BaseFilter.IN_RANGE) {
|
19678 | if (!this.filterParams.inRangeInclusive) {
|
19679 | return compareResult > 0 && compareToResult < 0;
|
19680 | }
|
19681 | else {
|
19682 | return compareResult >= 0 && compareToResult <= 0;
|
19683 | }
|
19684 | }
|
19685 | throw new Error('Unexpected type of filter!: ' + filter);
|
19686 | };
|
19687 | ScalarBaseFilter.DEFAULT_NULL_COMPARATOR = {
|
19688 | equals: false,
|
19689 | lessThan: false,
|
19690 | greaterThan: false
|
19691 | };
|
19692 | return ScalarBaseFilter;
|
19693 | }(ComparableBaseFilter));
|
19694 | exports.ScalarBaseFilter = ScalarBaseFilter;
|
19695 |
|
19696 |
|
19697 | }),
|
19698 |
|
19699 | (function(module, exports, __webpack_require__) {
|
19700 |
|
19701 | "use strict";
|
19702 |
|
19703 |
|
19704 |
|
19705 |
|
19706 |
|
19707 |
|
19708 |
|
19709 | var __extends = (this && this.__extends) || (function () {
|
19710 | var extendStatics = Object.setPrototypeOf ||
|
19711 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
19712 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
19713 | return function (d, b) {
|
19714 | extendStatics(d, b);
|
19715 | function __() { this.constructor = d; }
|
19716 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
19717 | };
|
19718 | })();
|
19719 | Object.defineProperty(exports, "__esModule", { value: true });
|
19720 | var utils_1 = __webpack_require__(1);
|
19721 | var column_1 = __webpack_require__(10);
|
19722 | var beanStub_1 = __webpack_require__(13);
|
19723 | var SetLeftFeature = (function (_super) {
|
19724 | __extends(SetLeftFeature, _super);
|
19725 | function SetLeftFeature(columnOrGroup, eCell, beans, colsSpanning) {
|
19726 | var _this = _super.call(this) || this;
|
19727 | _this.columnOrGroup = columnOrGroup;
|
19728 | _this.eCell = eCell;
|
19729 | _this.colsSpanning = colsSpanning;
|
19730 | _this.beans = beans;
|
19731 | return _this;
|
19732 | }
|
19733 | SetLeftFeature.prototype.setColsSpanning = function (colsSpanning) {
|
19734 | this.colsSpanning = colsSpanning;
|
19735 | this.onLeftChanged();
|
19736 | };
|
19737 | SetLeftFeature.prototype.getColumnOrGroup = function () {
|
19738 | if (this.beans.gridOptionsWrapper.isEnableRtl() && this.colsSpanning) {
|
19739 | return this.colsSpanning[this.colsSpanning.length - 1];
|
19740 | }
|
19741 | else {
|
19742 | return this.columnOrGroup;
|
19743 | }
|
19744 | };
|
19745 | SetLeftFeature.prototype.init = function () {
|
19746 | this.addDestroyableEventListener(this.columnOrGroup, column_1.Column.EVENT_LEFT_CHANGED, this.onLeftChanged.bind(this));
|
19747 | this.setLeftFirstTime();
|
19748 | };
|
19749 | SetLeftFeature.prototype.setLeftFirstTime = function () {
|
19750 | var suppressMoveAnimation = this.beans.gridOptionsWrapper.isSuppressColumnMoveAnimation();
|
19751 | var oldLeftExists = utils_1.Utils.exists(this.columnOrGroup.getOldLeft());
|
19752 | var animateColumnMove = this.beans.columnAnimationService.isActive() && oldLeftExists && !suppressMoveAnimation;
|
19753 | if (animateColumnMove) {
|
19754 | this.animateInLeft();
|
19755 | }
|
19756 | else {
|
19757 | this.onLeftChanged();
|
19758 | }
|
19759 | };
|
19760 | SetLeftFeature.prototype.animateInLeft = function () {
|
19761 | var _this = this;
|
19762 | var left = this.getColumnOrGroup().getLeft();
|
19763 | var oldLeft = this.getColumnOrGroup().getOldLeft();
|
19764 | this.setLeft(oldLeft);
|
19765 |
|
19766 |
|
19767 |
|
19768 |
|
19769 |
|
19770 | this.actualLeft = left;
|
19771 | this.beans.columnAnimationService.executeNextVMTurn(function () {
|
19772 |
|
19773 | if (_this.actualLeft === left) {
|
19774 | _this.setLeft(left);
|
19775 | }
|
19776 | });
|
19777 | };
|
19778 | SetLeftFeature.prototype.onLeftChanged = function () {
|
19779 | this.actualLeft = this.getColumnOrGroup().getLeft();
|
19780 | this.setLeft(this.actualLeft);
|
19781 | };
|
19782 | SetLeftFeature.prototype.setLeft = function (value) {
|
19783 |
|
19784 |
|
19785 |
|
19786 | if (utils_1.Utils.exists(value)) {
|
19787 | this.eCell.style.left = value + 'px';
|
19788 | }
|
19789 | };
|
19790 | return SetLeftFeature;
|
19791 | }(beanStub_1.BeanStub));
|
19792 | exports.SetLeftFeature = SetLeftFeature;
|
19793 |
|
19794 |
|
19795 | }),
|
19796 |
|
19797 | (function(module, exports, __webpack_require__) {
|
19798 |
|
19799 | "use strict";
|
19800 |
|
19801 |
|
19802 |
|
19803 |
|
19804 |
|
19805 |
|
19806 |
|
19807 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
19808 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
19809 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
19810 | 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;
|
19811 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
19812 | };
|
19813 | var __metadata = (this && this.__metadata) || function (k, v) {
|
19814 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
19815 | };
|
19816 | Object.defineProperty(exports, "__esModule", { value: true });
|
19817 | var context_1 = __webpack_require__(0);
|
19818 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
19819 | var ColumnAnimationService = (function () {
|
19820 | function ColumnAnimationService() {
|
19821 | this.executeNextFuncs = [];
|
19822 | this.executeLaterFuncs = [];
|
19823 | this.active = false;
|
19824 | this.animationThreadCount = 0;
|
19825 | }
|
19826 | ColumnAnimationService.prototype.registerGridComp = function (gridPanel) {
|
19827 | this.gridPanel = gridPanel;
|
19828 | };
|
19829 | ColumnAnimationService.prototype.isActive = function () {
|
19830 | return this.active;
|
19831 | };
|
19832 | ColumnAnimationService.prototype.start = function () {
|
19833 | if (this.active) {
|
19834 | return;
|
19835 | }
|
19836 | if (this.gridOptionsWrapper.isSuppressColumnMoveAnimation()) {
|
19837 | return;
|
19838 | }
|
19839 |
|
19840 |
|
19841 |
|
19842 | if (this.gridOptionsWrapper.isEnableRtl()) {
|
19843 | return;
|
19844 | }
|
19845 | this.ensureAnimationCssClassPresent();
|
19846 | this.active = true;
|
19847 | };
|
19848 | ColumnAnimationService.prototype.finish = function () {
|
19849 | if (!this.active) {
|
19850 | return;
|
19851 | }
|
19852 | this.flush();
|
19853 | this.active = false;
|
19854 | };
|
19855 | ColumnAnimationService.prototype.executeNextVMTurn = function (func) {
|
19856 | if (this.active) {
|
19857 | this.executeNextFuncs.push(func);
|
19858 | }
|
19859 | else {
|
19860 | func();
|
19861 | }
|
19862 | };
|
19863 | ColumnAnimationService.prototype.executeLaterVMTurn = function (func) {
|
19864 | if (this.active) {
|
19865 | this.executeLaterFuncs.push(func);
|
19866 | }
|
19867 | else {
|
19868 | func();
|
19869 | }
|
19870 | };
|
19871 | ColumnAnimationService.prototype.ensureAnimationCssClassPresent = function () {
|
19872 | var _this = this;
|
19873 |
|
19874 |
|
19875 | this.animationThreadCount++;
|
19876 | var animationThreadCountCopy = this.animationThreadCount;
|
19877 | this.gridPanel.setColumnMovingCss(true);
|
19878 | this.executeLaterFuncs.push(function () {
|
19879 |
|
19880 | if (_this.animationThreadCount === animationThreadCountCopy) {
|
19881 | _this.gridPanel.setColumnMovingCss(false);
|
19882 | }
|
19883 | });
|
19884 | };
|
19885 | ColumnAnimationService.prototype.flush = function () {
|
19886 | var nowFuncs = this.executeNextFuncs;
|
19887 | this.executeNextFuncs = [];
|
19888 | var waitFuncs = this.executeLaterFuncs;
|
19889 | this.executeLaterFuncs = [];
|
19890 | if (nowFuncs.length === 0 && waitFuncs.length === 0) {
|
19891 | return;
|
19892 | }
|
19893 | setTimeout(function () { return nowFuncs.forEach(function (func) { return func(); }); }, 0);
|
19894 | setTimeout(function () { return waitFuncs.forEach(function (func) { return func(); }); }, 300);
|
19895 | };
|
19896 | __decorate([
|
19897 | context_1.Autowired('gridOptionsWrapper'),
|
19898 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
19899 | ], ColumnAnimationService.prototype, "gridOptionsWrapper", void 0);
|
19900 | ColumnAnimationService = __decorate([
|
19901 | context_1.Bean('columnAnimationService')
|
19902 | ], ColumnAnimationService);
|
19903 | return ColumnAnimationService;
|
19904 | }());
|
19905 | exports.ColumnAnimationService = ColumnAnimationService;
|
19906 |
|
19907 |
|
19908 | }),
|
19909 |
|
19910 | (function(module, exports, __webpack_require__) {
|
19911 |
|
19912 | "use strict";
|
19913 |
|
19914 |
|
19915 |
|
19916 |
|
19917 |
|
19918 |
|
19919 |
|
19920 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
19921 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
19922 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
19923 | 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;
|
19924 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
19925 | };
|
19926 | var __metadata = (this && this.__metadata) || function (k, v) {
|
19927 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
19928 | };
|
19929 | Object.defineProperty(exports, "__esModule", { value: true });
|
19930 | var context_1 = __webpack_require__(0);
|
19931 | var popupEditorWrapper_1 = __webpack_require__(69);
|
19932 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
19933 | var componentResolver_1 = __webpack_require__(27);
|
19934 | var CellEditorFactory = (function () {
|
19935 | function CellEditorFactory() {
|
19936 | }
|
19937 | CellEditorFactory.prototype.init = function () {
|
19938 | };
|
19939 | CellEditorFactory.prototype.addCellEditor = function (key, cellEditor) {
|
19940 | console.warn("ag-grid: since v13.3.1 this method is not supported anymore. If you want to register your own editor check the docs: https://www.ag-grid.com/javascript-grid-cell-editor/");
|
19941 | };
|
19942 |
|
19943 |
|
19944 |
|
19945 |
|
19946 |
|
19947 |
|
19948 | CellEditorFactory.prototype.createCellEditor = function (column, params) {
|
19949 | var _this = this;
|
19950 | var cellEditorPromise = this.componentResolver.createAgGridComponent(column, params, 'cellEditor', {
|
19951 | api: params.api,
|
19952 | columnApi: params.columnApi,
|
19953 | node: params.node,
|
19954 | data: params.node.data,
|
19955 | rowIndex: params.rowIndex,
|
19956 | column: params.column,
|
19957 | colDef: params.column.getColDef()
|
19958 | }, 'agCellEditor');
|
19959 | return cellEditorPromise.map(function (cellEditor) {
|
19960 | var isPopup = cellEditor.isPopup && cellEditor.isPopup();
|
19961 | if (!isPopup) {
|
19962 | return cellEditor;
|
19963 | }
|
19964 | if (_this.gridOptionsWrapper.isFullRowEdit()) {
|
19965 | console.warn('ag-Grid: popup cellEditor does not work with fullRowEdit - you cannot use them both ' +
|
19966 | '- either turn off fullRowEdit, or stop using popup editors.');
|
19967 | }
|
19968 |
|
19969 | var popupEditorWrapper = new popupEditorWrapper_1.PopupEditorWrapper(cellEditor);
|
19970 | _this.context.wireBean(popupEditorWrapper);
|
19971 | popupEditorWrapper.init(params);
|
19972 | return popupEditorWrapper;
|
19973 | });
|
19974 | };
|
19975 | __decorate([
|
19976 | context_1.Autowired('context'),
|
19977 | __metadata("design:type", context_1.Context)
|
19978 | ], CellEditorFactory.prototype, "context", void 0);
|
19979 | __decorate([
|
19980 | context_1.Autowired('componentResolver'),
|
19981 | __metadata("design:type", componentResolver_1.ComponentResolver)
|
19982 | ], CellEditorFactory.prototype, "componentResolver", void 0);
|
19983 | __decorate([
|
19984 | context_1.Autowired('gridOptionsWrapper'),
|
19985 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
19986 | ], CellEditorFactory.prototype, "gridOptionsWrapper", void 0);
|
19987 | __decorate([
|
19988 | context_1.PostConstruct,
|
19989 | __metadata("design:type", Function),
|
19990 | __metadata("design:paramtypes", []),
|
19991 | __metadata("design:returntype", void 0)
|
19992 | ], CellEditorFactory.prototype, "init", null);
|
19993 | CellEditorFactory = __decorate([
|
19994 | context_1.Bean('cellEditorFactory')
|
19995 | ], CellEditorFactory);
|
19996 | return CellEditorFactory;
|
19997 | }());
|
19998 | exports.CellEditorFactory = CellEditorFactory;
|
19999 |
|
20000 |
|
20001 | }),
|
20002 |
|
20003 | (function(module, exports, __webpack_require__) {
|
20004 |
|
20005 | "use strict";
|
20006 |
|
20007 |
|
20008 |
|
20009 |
|
20010 |
|
20011 |
|
20012 |
|
20013 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
20014 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
20015 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
20016 | 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;
|
20017 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
20018 | };
|
20019 | var __metadata = (this && this.__metadata) || function (k, v) {
|
20020 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
20021 | };
|
20022 | Object.defineProperty(exports, "__esModule", { value: true });
|
20023 | var context_1 = __webpack_require__(0);
|
20024 | var utils_1 = __webpack_require__(1);
|
20025 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
20026 | var eventService_1 = __webpack_require__(3);
|
20027 | var expressionService_1 = __webpack_require__(19);
|
20028 | var animateSlideCellRenderer_1 = __webpack_require__(70);
|
20029 | var animateShowChangeCellRenderer_1 = __webpack_require__(71);
|
20030 | var groupCellRenderer_1 = __webpack_require__(72);
|
20031 | var CellRendererFactory = (function () {
|
20032 | function CellRendererFactory() {
|
20033 | this.cellRendererMap = {};
|
20034 | }
|
20035 | CellRendererFactory_1 = CellRendererFactory;
|
20036 | CellRendererFactory.prototype.init = function () {
|
20037 | this.cellRendererMap[CellRendererFactory_1.ANIMATE_SLIDE] = animateSlideCellRenderer_1.AnimateSlideCellRenderer;
|
20038 | this.cellRendererMap[CellRendererFactory_1.ANIMATE_SHOW_CHANGE] = animateShowChangeCellRenderer_1.AnimateShowChangeCellRenderer;
|
20039 | this.cellRendererMap[CellRendererFactory_1.GROUP] = groupCellRenderer_1.GroupCellRenderer;
|
20040 |
|
20041 | };
|
20042 |
|
20043 |
|
20044 |
|
20045 |
|
20046 |
|
20047 |
|
20048 | CellRendererFactory.prototype.addCellRenderer = function (key, cellRenderer) {
|
20049 | this.cellRendererMap[key] = cellRenderer;
|
20050 | };
|
20051 | CellRendererFactory.prototype.getCellRenderer = function (key) {
|
20052 | var result = this.cellRendererMap[key];
|
20053 | if (utils_1.Utils.missing(result)) {
|
20054 | console.warn('ag-Grid: unable to find cellRenderer for key ' + key);
|
20055 | return null;
|
20056 | }
|
20057 | return result;
|
20058 | };
|
20059 | CellRendererFactory.ANIMATE_SLIDE = 'animateSlide';
|
20060 | CellRendererFactory.ANIMATE_SHOW_CHANGE = 'animateShowChange';
|
20061 | CellRendererFactory.GROUP = 'group';
|
20062 | __decorate([
|
20063 | context_1.Autowired('gridOptionsWrapper'),
|
20064 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
20065 | ], CellRendererFactory.prototype, "gridOptionsWrapper", void 0);
|
20066 | __decorate([
|
20067 | context_1.Autowired('expressionService'),
|
20068 | __metadata("design:type", expressionService_1.ExpressionService)
|
20069 | ], CellRendererFactory.prototype, "expressionService", void 0);
|
20070 | __decorate([
|
20071 | context_1.Autowired('eventService'),
|
20072 | __metadata("design:type", eventService_1.EventService)
|
20073 | ], CellRendererFactory.prototype, "eventService", void 0);
|
20074 | __decorate([
|
20075 | context_1.PostConstruct,
|
20076 | __metadata("design:type", Function),
|
20077 | __metadata("design:paramtypes", []),
|
20078 | __metadata("design:returntype", void 0)
|
20079 | ], CellRendererFactory.prototype, "init", null);
|
20080 | CellRendererFactory = CellRendererFactory_1 = __decorate([
|
20081 | context_1.Bean('cellRendererFactory')
|
20082 | ], CellRendererFactory);
|
20083 | return CellRendererFactory;
|
20084 | var CellRendererFactory_1;
|
20085 | }());
|
20086 | exports.CellRendererFactory = CellRendererFactory;
|
20087 |
|
20088 |
|
20089 | }),
|
20090 |
|
20091 | (function(module, exports, __webpack_require__) {
|
20092 |
|
20093 | "use strict";
|
20094 |
|
20095 |
|
20096 |
|
20097 |
|
20098 |
|
20099 |
|
20100 |
|
20101 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
20102 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
20103 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
20104 | 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;
|
20105 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
20106 | };
|
20107 | var __metadata = (this && this.__metadata) || function (k, v) {
|
20108 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
20109 | };
|
20110 | Object.defineProperty(exports, "__esModule", { value: true });
|
20111 | var context_1 = __webpack_require__(0);
|
20112 | var componentRecipes_1 = __webpack_require__(21);
|
20113 | var componentResolver_1 = __webpack_require__(27);
|
20114 | var utils_1 = __webpack_require__(1);
|
20115 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
20116 |
|
20117 | var CellRendererService = (function () {
|
20118 | function CellRendererService() {
|
20119 | }
|
20120 | CellRendererService.prototype.useCellRenderer = function (target, eTarget, params) {
|
20121 | var _this = this;
|
20122 | var cellRendererPromise = this.componentRecipes.newCellRenderer(target, params);
|
20123 | if (cellRendererPromise != null) {
|
20124 | cellRendererPromise.then(function (cellRenderer) {
|
20125 | if (cellRenderer == null) {
|
20126 | eTarget.innerText = params.valueFormatted != null ? params.valueFormatted : params.value;
|
20127 | }
|
20128 | else {
|
20129 | _this.bindToHtml(cellRendererPromise, eTarget);
|
20130 | }
|
20131 | });
|
20132 | }
|
20133 | else {
|
20134 | eTarget.innerText = params.valueFormatted != null ? params.valueFormatted : params.value;
|
20135 | }
|
20136 | return cellRendererPromise;
|
20137 | };
|
20138 | CellRendererService.prototype.useFilterCellRenderer = function (target, eTarget, params) {
|
20139 | var cellRendererPromise = this.componentRecipes.newCellRenderer(target.filterParams, params);
|
20140 | if (cellRendererPromise != null) {
|
20141 | this.bindToHtml(cellRendererPromise, eTarget);
|
20142 | }
|
20143 | else {
|
20144 | if (params.valueFormatted == null && params.value == null) {
|
20145 | var localeTextFunc = this.gridOptionsWrapper.getLocaleTextFunc();
|
20146 | eTarget.innerText = '(' + localeTextFunc('blanks', 'Blanks') + ')';
|
20147 | }
|
20148 | else {
|
20149 | eTarget.innerText = params.valueFormatted != null ? params.valueFormatted : params.value;
|
20150 | }
|
20151 | }
|
20152 | return cellRendererPromise;
|
20153 | };
|
20154 | CellRendererService.prototype.useRichSelectCellRenderer = function (target, eTarget, params) {
|
20155 | var cellRendererPromise = this.componentRecipes.newCellRenderer(target.cellEditorParams, params);
|
20156 | if (cellRendererPromise != null) {
|
20157 | this.bindToHtml(cellRendererPromise, eTarget);
|
20158 | }
|
20159 | else {
|
20160 | eTarget.innerText = params.valueFormatted != null ? params.valueFormatted : params.value;
|
20161 | }
|
20162 | return cellRendererPromise;
|
20163 | };
|
20164 | CellRendererService.prototype.useInnerCellRenderer = function (target, originalColumn, eTarget, params) {
|
20165 | var _this = this;
|
20166 | var rendererToUsePromise = null;
|
20167 | var componentToUse = this.componentResolver.getComponentToUse(target, "innerRenderer", null);
|
20168 | if (componentToUse && componentToUse.component != null && componentToUse.source != componentResolver_1.ComponentSource.DEFAULT) {
|
20169 |
|
20170 | rendererToUsePromise = this.componentRecipes.newInnerCellRenderer(target, params);
|
20171 | }
|
20172 | else {
|
20173 | var otherRenderer = this.componentResolver.getComponentToUse(originalColumn, "cellRenderer", null);
|
20174 | if (otherRenderer && otherRenderer.source != componentResolver_1.ComponentSource.DEFAULT) {
|
20175 |
|
20176 |
|
20177 |
|
20178 | rendererToUsePromise = this.componentRecipes.newCellRenderer(originalColumn, params);
|
20179 | }
|
20180 | else if (otherRenderer && otherRenderer.source == componentResolver_1.ComponentSource.DEFAULT && (utils_1._.get(originalColumn, 'cellRendererParams.innerRenderer', null))) {
|
20181 |
|
20182 |
|
20183 | rendererToUsePromise = this.componentRecipes.newInnerCellRenderer(originalColumn.cellRendererParams, params);
|
20184 | }
|
20185 | else {
|
20186 |
|
20187 | rendererToUsePromise = this.componentRecipes.newCellRenderer({}, params);
|
20188 | }
|
20189 | }
|
20190 | if (rendererToUsePromise != null) {
|
20191 | rendererToUsePromise.then(function (rendererToUse) {
|
20192 | if (rendererToUse == null) {
|
20193 | eTarget.innerText = params.valueFormatted != null ? params.valueFormatted : params.value;
|
20194 | return;
|
20195 | }
|
20196 | _this.bindToHtml(rendererToUsePromise, eTarget);
|
20197 | });
|
20198 | }
|
20199 | else {
|
20200 | eTarget.innerText = params.valueFormatted != null ? params.valueFormatted : params.value;
|
20201 | }
|
20202 | return rendererToUsePromise;
|
20203 | };
|
20204 | CellRendererService.prototype.useFullWidthGroupRowInnerCellRenderer = function (eTarget, params) {
|
20205 | var cellRendererPromise = this.componentRecipes.newFullWidthGroupRowInnerCellRenderer(params);
|
20206 | if (cellRendererPromise != null) {
|
20207 | this.bindToHtml(cellRendererPromise, eTarget);
|
20208 | }
|
20209 | else {
|
20210 | eTarget.innerText = params.valueFormatted != null ? params.valueFormatted : params.value;
|
20211 | }
|
20212 | return cellRendererPromise;
|
20213 | };
|
20214 | CellRendererService.prototype.bindToHtml = function (cellRendererPromise, eTarget) {
|
20215 | cellRendererPromise.then(function (cellRenderer) {
|
20216 | var gui = cellRenderer.getGui();
|
20217 | if (gui != null) {
|
20218 | if (typeof gui == 'object') {
|
20219 | eTarget.appendChild(gui);
|
20220 | }
|
20221 | else {
|
20222 | eTarget.innerHTML = gui;
|
20223 | }
|
20224 | }
|
20225 | });
|
20226 | return cellRendererPromise;
|
20227 | };
|
20228 | __decorate([
|
20229 | context_1.Autowired('componentRecipes'),
|
20230 | __metadata("design:type", componentRecipes_1.ComponentRecipes)
|
20231 | ], CellRendererService.prototype, "componentRecipes", void 0);
|
20232 | __decorate([
|
20233 | context_1.Autowired('componentResolver'),
|
20234 | __metadata("design:type", componentResolver_1.ComponentResolver)
|
20235 | ], CellRendererService.prototype, "componentResolver", void 0);
|
20236 | __decorate([
|
20237 | context_1.Autowired('gridOptionsWrapper'),
|
20238 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
20239 | ], CellRendererService.prototype, "gridOptionsWrapper", void 0);
|
20240 | CellRendererService = __decorate([
|
20241 | context_1.Bean('cellRendererService')
|
20242 | ], CellRendererService);
|
20243 | return CellRendererService;
|
20244 | }());
|
20245 | exports.CellRendererService = CellRendererService;
|
20246 |
|
20247 |
|
20248 | }),
|
20249 |
|
20250 | (function(module, exports, __webpack_require__) {
|
20251 |
|
20252 | "use strict";
|
20253 |
|
20254 |
|
20255 |
|
20256 |
|
20257 |
|
20258 |
|
20259 |
|
20260 | var __extends = (this && this.__extends) || (function () {
|
20261 | var extendStatics = Object.setPrototypeOf ||
|
20262 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
20263 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
20264 | return function (d, b) {
|
20265 | extendStatics(d, b);
|
20266 | function __() { this.constructor = d; }
|
20267 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
20268 | };
|
20269 | })();
|
20270 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
20271 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
20272 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
20273 | 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;
|
20274 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
20275 | };
|
20276 | var __metadata = (this && this.__metadata) || function (k, v) {
|
20277 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
20278 | };
|
20279 | Object.defineProperty(exports, "__esModule", { value: true });
|
20280 | var beanStub_1 = __webpack_require__(13);
|
20281 | var context_1 = __webpack_require__(0);
|
20282 | var eventService_1 = __webpack_require__(3);
|
20283 | var eventKeys_1 = __webpack_require__(25);
|
20284 | var utils_1 = __webpack_require__(1);
|
20285 |
|
20286 |
|
20287 |
|
20288 |
|
20289 | var HeightScaler = (function (_super) {
|
20290 | __extends(HeightScaler, _super);
|
20291 | function HeightScaler() {
|
20292 | var _this = _super !== null && _super.apply(this, arguments) || this;
|
20293 |
|
20294 | _this.scrollY = 0;
|
20295 |
|
20296 | _this.uiBodyHeight = 0;
|
20297 | return _this;
|
20298 | }
|
20299 | HeightScaler.prototype.postConstruct = function () {
|
20300 | this.addDestroyableEventListener(this.eventService, eventKeys_1.Events.EVENT_BODY_HEIGHT_CHANGED, this.update.bind(this));
|
20301 | this.scrollBarWidth = utils_1._.getScrollbarWidth();
|
20302 | this.maxDivHeight = utils_1._.getMaxDivHeight();
|
20303 | };
|
20304 | HeightScaler.prototype.registerGridComp = function (gridPanel) {
|
20305 | this.gridPanel = gridPanel;
|
20306 | };
|
20307 | HeightScaler.prototype.isScaling = function () {
|
20308 | return this.scaling;
|
20309 | };
|
20310 | HeightScaler.prototype.getOffset = function () {
|
20311 | return this.offset;
|
20312 | };
|
20313 | HeightScaler.prototype.update = function () {
|
20314 | if (!this.scaling) {
|
20315 | return;
|
20316 | }
|
20317 | var newScrollY = this.gridPanel.getVScrollPosition().top;
|
20318 | var newBodyHeight = this.getUiBodyHeight();
|
20319 | var atLeastOneChanged = newScrollY !== this.scrollY || newBodyHeight !== this.uiBodyHeight;
|
20320 | if (atLeastOneChanged) {
|
20321 | this.scrollY = newScrollY;
|
20322 | this.uiBodyHeight = newBodyHeight;
|
20323 | this.calculateOffset();
|
20324 | }
|
20325 | };
|
20326 | HeightScaler.prototype.calculateOffset = function () {
|
20327 | this.uiContainerHeight = this.maxDivHeight;
|
20328 | this.pixelsToShave = this.modelHeight - this.uiContainerHeight;
|
20329 | this.maxScrollY = this.uiContainerHeight - this.uiBodyHeight;
|
20330 | var scrollPercent = this.scrollY / this.maxScrollY;
|
20331 | this.setOffset(scrollPercent * this.pixelsToShave);
|
20332 | };
|
20333 | HeightScaler.prototype.clearOffset = function () {
|
20334 | this.uiContainerHeight = this.modelHeight;
|
20335 | this.pixelsToShave = 0;
|
20336 | this.setOffset(0);
|
20337 | };
|
20338 | HeightScaler.prototype.setOffset = function (newOffset) {
|
20339 |
|
20340 | var newOffsetFloor = typeof newOffset === 'number' ? Math.floor(newOffset) : null;
|
20341 | if (this.offset !== newOffsetFloor) {
|
20342 | this.offset = newOffsetFloor;
|
20343 | this.eventService.dispatchEvent({ type: eventKeys_1.Events.EVENT_HEIGHT_SCALE_CHANGED });
|
20344 | }
|
20345 | };
|
20346 | HeightScaler.prototype.setModelHeight = function (modelHeight) {
|
20347 | this.modelHeight = modelHeight;
|
20348 | this.scaling = this.maxDivHeight > 0 && modelHeight > this.maxDivHeight;
|
20349 | if (this.scaling) {
|
20350 | this.calculateOffset();
|
20351 | }
|
20352 | else {
|
20353 | this.clearOffset();
|
20354 | }
|
20355 | };
|
20356 | HeightScaler.prototype.getUiContainerHeight = function () {
|
20357 | return this.uiContainerHeight;
|
20358 | };
|
20359 | HeightScaler.prototype.getRealPixelPosition = function (modelPixel) {
|
20360 | var uiPixel = modelPixel - this.offset;
|
20361 | return uiPixel;
|
20362 | };
|
20363 | HeightScaler.prototype.getUiBodyHeight = function () {
|
20364 | var pos = this.gridPanel.getVScrollPosition();
|
20365 | var bodyHeight = pos.bottom - pos.top;
|
20366 | if (this.gridPanel.isHorizontalScrollShowing()) {
|
20367 | bodyHeight -= this.scrollBarWidth;
|
20368 | }
|
20369 | return bodyHeight;
|
20370 | };
|
20371 | HeightScaler.prototype.getScrollPositionForPixel = function (rowTop) {
|
20372 | if (this.pixelsToShave <= 0) {
|
20373 | return rowTop;
|
20374 | }
|
20375 | else {
|
20376 | var modelMaxScroll = this.modelHeight - this.getUiBodyHeight();
|
20377 | var scrollPercent = rowTop / modelMaxScroll;
|
20378 | var scrollPixel = this.maxScrollY * scrollPercent;
|
20379 | return scrollPixel;
|
20380 | }
|
20381 | };
|
20382 | __decorate([
|
20383 | context_1.Autowired('eventService'),
|
20384 | __metadata("design:type", eventService_1.EventService)
|
20385 | ], HeightScaler.prototype, "eventService", void 0);
|
20386 | __decorate([
|
20387 | context_1.PostConstruct,
|
20388 | __metadata("design:type", Function),
|
20389 | __metadata("design:paramtypes", []),
|
20390 | __metadata("design:returntype", void 0)
|
20391 | ], HeightScaler.prototype, "postConstruct", null);
|
20392 | HeightScaler = __decorate([
|
20393 | context_1.Bean('heightScaler')
|
20394 | ], HeightScaler);
|
20395 | return HeightScaler;
|
20396 | }(beanStub_1.BeanStub));
|
20397 | exports.HeightScaler = HeightScaler;
|
20398 |
|
20399 |
|
20400 | }),
|
20401 |
|
20402 | (function(module, exports, __webpack_require__) {
|
20403 |
|
20404 | "use strict";
|
20405 |
|
20406 |
|
20407 |
|
20408 |
|
20409 |
|
20410 |
|
20411 |
|
20412 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
20413 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
20414 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
20415 | 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;
|
20416 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
20417 | };
|
20418 | var __metadata = (this && this.__metadata) || function (k, v) {
|
20419 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
20420 | };
|
20421 | var __param = (this && this.__param) || function (paramIndex, decorator) {
|
20422 | return function (target, key) { decorator(target, key, paramIndex); }
|
20423 | };
|
20424 | Object.defineProperty(exports, "__esModule", { value: true });
|
20425 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
20426 | var columnController_1 = __webpack_require__(4);
|
20427 | var eventService_1 = __webpack_require__(3);
|
20428 | var logger_1 = __webpack_require__(12);
|
20429 | var events_1 = __webpack_require__(5);
|
20430 | var context_1 = __webpack_require__(0);
|
20431 | var context_2 = __webpack_require__(0);
|
20432 | var context_3 = __webpack_require__(0);
|
20433 | var context_4 = __webpack_require__(0);
|
20434 | var AlignedGridsService = (function () {
|
20435 | function AlignedGridsService() {
|
20436 |
|
20437 |
|
20438 |
|
20439 | this.consuming = false;
|
20440 | }
|
20441 | AlignedGridsService.prototype.setBeans = function (loggerFactory) {
|
20442 | this.logger = loggerFactory.create('AlignedGridsService');
|
20443 | };
|
20444 | AlignedGridsService.prototype.registerGridComp = function (gridPanel) {
|
20445 | this.gridPanel = gridPanel;
|
20446 | };
|
20447 | AlignedGridsService.prototype.init = function () {
|
20448 | this.eventService.addEventListener(events_1.Events.EVENT_COLUMN_MOVED, this.fireColumnEvent.bind(this));
|
20449 | this.eventService.addEventListener(events_1.Events.EVENT_COLUMN_VISIBLE, this.fireColumnEvent.bind(this));
|
20450 | this.eventService.addEventListener(events_1.Events.EVENT_COLUMN_PINNED, this.fireColumnEvent.bind(this));
|
20451 | this.eventService.addEventListener(events_1.Events.EVENT_COLUMN_GROUP_OPENED, this.fireColumnEvent.bind(this));
|
20452 | this.eventService.addEventListener(events_1.Events.EVENT_COLUMN_RESIZED, this.fireColumnEvent.bind(this));
|
20453 | this.eventService.addEventListener(events_1.Events.EVENT_BODY_SCROLL, this.fireScrollEvent.bind(this));
|
20454 | };
|
20455 |
|
20456 | AlignedGridsService.prototype.fireEvent = function (callback) {
|
20457 |
|
20458 |
|
20459 | if (this.consuming) {
|
20460 | return;
|
20461 | }
|
20462 |
|
20463 | var otherGrids = this.gridOptionsWrapper.getAlignedGrids();
|
20464 | if (otherGrids) {
|
20465 | otherGrids.forEach(function (otherGridOptions) {
|
20466 | if (otherGridOptions.api) {
|
20467 | var alignedGridService = otherGridOptions.api.__getAlignedGridService();
|
20468 | callback(alignedGridService);
|
20469 | }
|
20470 | });
|
20471 | }
|
20472 | };
|
20473 |
|
20474 |
|
20475 | AlignedGridsService.prototype.onEvent = function (callback) {
|
20476 | this.consuming = true;
|
20477 | callback();
|
20478 | this.consuming = false;
|
20479 | };
|
20480 | AlignedGridsService.prototype.fireColumnEvent = function (event) {
|
20481 | this.fireEvent(function (alignedGridsService) {
|
20482 | alignedGridsService.onColumnEvent(event);
|
20483 | });
|
20484 | };
|
20485 | AlignedGridsService.prototype.fireScrollEvent = function (event) {
|
20486 | if (event.direction !== 'horizontal') {
|
20487 | return;
|
20488 | }
|
20489 | this.fireEvent(function (alignedGridsService) {
|
20490 | alignedGridsService.onScrollEvent(event);
|
20491 | });
|
20492 | };
|
20493 | AlignedGridsService.prototype.onScrollEvent = function (event) {
|
20494 | var _this = this;
|
20495 | this.onEvent(function () {
|
20496 | _this.gridPanel.setHorizontalScrollPosition(event.left);
|
20497 | });
|
20498 | };
|
20499 | AlignedGridsService.prototype.getMasterColumns = function (event) {
|
20500 | var result = [];
|
20501 | if (event.columns) {
|
20502 | event.columns.forEach(function (column) {
|
20503 | result.push(column);
|
20504 | });
|
20505 | }
|
20506 | else if (event.column) {
|
20507 | result.push(event.column);
|
20508 | }
|
20509 | return result;
|
20510 | };
|
20511 | AlignedGridsService.prototype.getColumnIds = function (event) {
|
20512 | var result = [];
|
20513 | if (event.columns) {
|
20514 | event.columns.forEach(function (column) {
|
20515 | result.push(column.getColId());
|
20516 | });
|
20517 | }
|
20518 | else if (event.columns) {
|
20519 | result.push(event.column.getColId());
|
20520 | }
|
20521 | return result;
|
20522 | };
|
20523 | AlignedGridsService.prototype.onColumnEvent = function (event) {
|
20524 | var _this = this;
|
20525 | this.onEvent(function () {
|
20526 | switch (event.type) {
|
20527 | case events_1.Events.EVENT_COLUMN_MOVED:
|
20528 | case events_1.Events.EVENT_COLUMN_VISIBLE:
|
20529 | case events_1.Events.EVENT_COLUMN_PINNED:
|
20530 | case events_1.Events.EVENT_COLUMN_RESIZED:
|
20531 | var colEvent = event;
|
20532 | _this.processColumnEvent(colEvent);
|
20533 | break;
|
20534 | case events_1.Events.EVENT_COLUMN_GROUP_OPENED:
|
20535 | var groupOpenedEvent = event;
|
20536 | _this.processGroupOpenedEvent(groupOpenedEvent);
|
20537 | break;
|
20538 | case events_1.Events.EVENT_COLUMN_PIVOT_CHANGED:
|
20539 |
|
20540 |
|
20541 | console.warn('ag-Grid: pivoting is not supported with aligned grids. ' +
|
20542 | 'You can only use one of these features at a time in a grid.');
|
20543 | break;
|
20544 | }
|
20545 | });
|
20546 | };
|
20547 | AlignedGridsService.prototype.processGroupOpenedEvent = function (groupOpenedEvent) {
|
20548 |
|
20549 | var masterColumnGroup = groupOpenedEvent.columnGroup;
|
20550 | var otherColumnGroup;
|
20551 | if (masterColumnGroup) {
|
20552 | var groupId = masterColumnGroup.getGroupId();
|
20553 | otherColumnGroup = this.columnController.getOriginalColumnGroup(groupId);
|
20554 | }
|
20555 | if (masterColumnGroup && !otherColumnGroup) {
|
20556 | return;
|
20557 | }
|
20558 | this.logger.log('onColumnEvent-> processing ' + event + ' expanded = ' + masterColumnGroup.isExpanded());
|
20559 | this.columnController.setColumnGroupOpened(otherColumnGroup, masterColumnGroup.isExpanded(), "alignedGridChanged");
|
20560 | };
|
20561 | AlignedGridsService.prototype.processColumnEvent = function (colEvent) {
|
20562 | var _this = this;
|
20563 |
|
20564 |
|
20565 | var masterColumn = colEvent.column;
|
20566 | var otherColumn;
|
20567 | if (masterColumn) {
|
20568 | otherColumn = this.columnController.getPrimaryColumn(masterColumn.getColId());
|
20569 | }
|
20570 |
|
20571 |
|
20572 | if (masterColumn && !otherColumn) {
|
20573 | return;
|
20574 | }
|
20575 |
|
20576 |
|
20577 | var columnIds = this.getColumnIds(colEvent);
|
20578 | var masterColumns = this.getMasterColumns(colEvent);
|
20579 | switch (colEvent.type) {
|
20580 | case events_1.Events.EVENT_COLUMN_MOVED:
|
20581 | var movedEvent = colEvent;
|
20582 | this.logger.log('onColumnEvent-> processing ' + colEvent.type + ' toIndex = ' + movedEvent.toIndex);
|
20583 | this.columnController.moveColumns(columnIds, movedEvent.toIndex, "alignedGridChanged");
|
20584 | break;
|
20585 | case events_1.Events.EVENT_COLUMN_VISIBLE:
|
20586 | var visibleEvent = colEvent;
|
20587 | this.logger.log('onColumnEvent-> processing ' + colEvent.type + ' visible = ' + visibleEvent.visible);
|
20588 | this.columnController.setColumnsVisible(columnIds, visibleEvent.visible, "alignedGridChanged");
|
20589 | break;
|
20590 | case events_1.Events.EVENT_COLUMN_PINNED:
|
20591 | var pinnedEvent = colEvent;
|
20592 | this.logger.log('onColumnEvent-> processing ' + colEvent.type + ' pinned = ' + pinnedEvent.pinned);
|
20593 | this.columnController.setColumnsPinned(columnIds, pinnedEvent.pinned, "alignedGridChanged");
|
20594 | break;
|
20595 | case events_1.Events.EVENT_COLUMN_RESIZED:
|
20596 | var resizedEvent_1 = colEvent;
|
20597 | masterColumns.forEach(function (masterColumn) {
|
20598 | _this.logger.log('onColumnEvent-> processing ' + colEvent.type + ' actualWidth = ' + masterColumn.getActualWidth());
|
20599 | _this.columnController.setColumnWidth(masterColumn.getColId(), masterColumn.getActualWidth(), false, resizedEvent_1.finished, "alignedGridChanged");
|
20600 | });
|
20601 | break;
|
20602 | }
|
20603 | };
|
20604 | __decorate([
|
20605 | context_3.Autowired('gridOptionsWrapper'),
|
20606 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
20607 | ], AlignedGridsService.prototype, "gridOptionsWrapper", void 0);
|
20608 | __decorate([
|
20609 | context_3.Autowired('columnController'),
|
20610 | __metadata("design:type", columnController_1.ColumnController)
|
20611 | ], AlignedGridsService.prototype, "columnController", void 0);
|
20612 | __decorate([
|
20613 | context_3.Autowired('eventService'),
|
20614 | __metadata("design:type", eventService_1.EventService)
|
20615 | ], AlignedGridsService.prototype, "eventService", void 0);
|
20616 | __decorate([
|
20617 | __param(0, context_2.Qualifier('loggerFactory')),
|
20618 | __metadata("design:type", Function),
|
20619 | __metadata("design:paramtypes", [logger_1.LoggerFactory]),
|
20620 | __metadata("design:returntype", void 0)
|
20621 | ], AlignedGridsService.prototype, "setBeans", null);
|
20622 | __decorate([
|
20623 | context_4.PostConstruct,
|
20624 | __metadata("design:type", Function),
|
20625 | __metadata("design:paramtypes", []),
|
20626 | __metadata("design:returntype", void 0)
|
20627 | ], AlignedGridsService.prototype, "init", null);
|
20628 | AlignedGridsService = __decorate([
|
20629 | context_1.Bean('alignedGridsService')
|
20630 | ], AlignedGridsService);
|
20631 | return AlignedGridsService;
|
20632 | }());
|
20633 | exports.AlignedGridsService = AlignedGridsService;
|
20634 |
|
20635 |
|
20636 | }),
|
20637 |
|
20638 | (function(module, exports, __webpack_require__) {
|
20639 |
|
20640 | "use strict";
|
20641 |
|
20642 |
|
20643 |
|
20644 |
|
20645 |
|
20646 |
|
20647 |
|
20648 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
20649 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
20650 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
20651 | 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;
|
20652 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
20653 | };
|
20654 | var __metadata = (this && this.__metadata) || function (k, v) {
|
20655 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
20656 | };
|
20657 | Object.defineProperty(exports, "__esModule", { value: true });
|
20658 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
20659 | var context_1 = __webpack_require__(0);
|
20660 | var dragService_1 = __webpack_require__(40);
|
20661 | var HorizontalResizeService = (function () {
|
20662 | function HorizontalResizeService() {
|
20663 | }
|
20664 | HorizontalResizeService.prototype.addResizeBar = function (params) {
|
20665 | var _this = this;
|
20666 | var dragSource = {
|
20667 | dragStartPixels: 0,
|
20668 | eElement: params.eResizeBar,
|
20669 | onDragStart: this.onDragStart.bind(this, params),
|
20670 | onDragStop: this.onDragStop.bind(this, params),
|
20671 | onDragging: this.onDragging.bind(this, params)
|
20672 | };
|
20673 | this.dragService.addDragSource(dragSource, true);
|
20674 |
|
20675 |
|
20676 | var finishedWithResizeFunc = function () { return _this.dragService.removeDragSource(dragSource); };
|
20677 | return finishedWithResizeFunc;
|
20678 | };
|
20679 | HorizontalResizeService.prototype.onDragStart = function (params, mouseEvent) {
|
20680 | this.draggingStarted = true;
|
20681 | this.dragStartX = mouseEvent.clientX;
|
20682 | this.setResizeIcons();
|
20683 | var shiftKey = mouseEvent instanceof MouseEvent ? mouseEvent.shiftKey === true : false;
|
20684 | params.onResizeStart(shiftKey);
|
20685 | };
|
20686 | HorizontalResizeService.prototype.setResizeIcons = function () {
|
20687 | this.oldBodyCursor = this.eGridDiv.style.cursor;
|
20688 | this.oldMsUserSelect = this.eGridDiv.style.msUserSelect;
|
20689 | this.oldWebkitUserSelect = this.eGridDiv.style.webkitUserSelect;
|
20690 |
|
20691 | this.eGridDiv.style.cursor = 'col-resize';
|
20692 |
|
20693 | this.eGridDiv.style.msUserSelect = 'none';
|
20694 | this.eGridDiv.style.webkitUserSelect = 'none';
|
20695 | };
|
20696 | HorizontalResizeService.prototype.onDragStop = function (params, mouseEvent) {
|
20697 | params.onResizeEnd(this.resizeAmount);
|
20698 | this.resetIcons();
|
20699 | };
|
20700 | HorizontalResizeService.prototype.resetIcons = function () {
|
20701 |
|
20702 | this.eGridDiv.style.cursor = this.oldBodyCursor;
|
20703 | this.eGridDiv.style.msUserSelect = this.oldMsUserSelect;
|
20704 | this.eGridDiv.style.webkitUserSelect = this.oldWebkitUserSelect;
|
20705 | };
|
20706 | HorizontalResizeService.prototype.onDragging = function (params, mouseEvent) {
|
20707 | this.resizeAmount = mouseEvent.clientX - this.dragStartX;
|
20708 | params.onResizing(this.resizeAmount);
|
20709 | };
|
20710 | __decorate([
|
20711 | context_1.Autowired('gridOptionsWrapper'),
|
20712 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
20713 | ], HorizontalResizeService.prototype, "gridOptionsWrapper", void 0);
|
20714 | __decorate([
|
20715 | context_1.Autowired('dragService'),
|
20716 | __metadata("design:type", dragService_1.DragService)
|
20717 | ], HorizontalResizeService.prototype, "dragService", void 0);
|
20718 | __decorate([
|
20719 | context_1.Autowired('eGridDiv'),
|
20720 | __metadata("design:type", HTMLElement)
|
20721 | ], HorizontalResizeService.prototype, "eGridDiv", void 0);
|
20722 | HorizontalResizeService = __decorate([
|
20723 | context_1.Bean('horizontalResizeService')
|
20724 | ], HorizontalResizeService);
|
20725 | return HorizontalResizeService;
|
20726 | }());
|
20727 | exports.HorizontalResizeService = HorizontalResizeService;
|
20728 |
|
20729 |
|
20730 | }),
|
20731 |
|
20732 | (function(module, exports, __webpack_require__) {
|
20733 |
|
20734 | "use strict";
|
20735 |
|
20736 |
|
20737 |
|
20738 |
|
20739 |
|
20740 |
|
20741 |
|
20742 | var __extends = (this && this.__extends) || (function () {
|
20743 | var extendStatics = Object.setPrototypeOf ||
|
20744 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
20745 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
20746 | return function (d, b) {
|
20747 | extendStatics(d, b);
|
20748 | function __() { this.constructor = d; }
|
20749 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
20750 | };
|
20751 | })();
|
20752 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
20753 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
20754 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
20755 | 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;
|
20756 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
20757 | };
|
20758 | var __metadata = (this && this.__metadata) || function (k, v) {
|
20759 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
20760 | };
|
20761 | Object.defineProperty(exports, "__esModule", { value: true });
|
20762 | var component_1 = __webpack_require__(8);
|
20763 | var componentAnnotations_1 = __webpack_require__(11);
|
20764 | var utils_1 = __webpack_require__(1);
|
20765 | var context_1 = __webpack_require__(0);
|
20766 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
20767 | var AgCheckbox = (function (_super) {
|
20768 | __extends(AgCheckbox, _super);
|
20769 | function AgCheckbox() {
|
20770 | var _this = _super.call(this) || this;
|
20771 | _this.selected = false;
|
20772 | _this.readOnly = false;
|
20773 | _this.passive = false;
|
20774 | return _this;
|
20775 | }
|
20776 | AgCheckbox.prototype.preConstruct = function () {
|
20777 | this.setTemplate(AgCheckbox.TEMPLATE);
|
20778 | };
|
20779 | AgCheckbox.prototype.postConstruct = function () {
|
20780 | this.loadIcons();
|
20781 | this.updateIcons();
|
20782 | if (this.props.label) {
|
20783 | this.eLabel.innerText = this.props.label;
|
20784 | }
|
20785 | };
|
20786 | AgCheckbox.prototype.loadIcons = function () {
|
20787 | utils_1.Utils.removeAllChildren(this.eChecked);
|
20788 | utils_1.Utils.removeAllChildren(this.eUnchecked);
|
20789 | utils_1.Utils.removeAllChildren(this.eIndeterminate);
|
20790 | if (this.readOnly) {
|
20791 | this.eChecked.appendChild(utils_1.Utils.createIconNoSpan('checkboxCheckedReadOnly', this.gridOptionsWrapper, null));
|
20792 | this.eUnchecked.appendChild(utils_1.Utils.createIconNoSpan('checkboxUncheckedReadOnly', this.gridOptionsWrapper, null));
|
20793 | this.eIndeterminate.appendChild(utils_1.Utils.createIconNoSpan('checkboxIndeterminateReadOnly', this.gridOptionsWrapper, null));
|
20794 | }
|
20795 | else {
|
20796 | this.eChecked.appendChild(utils_1.Utils.createIconNoSpan('checkboxChecked', this.gridOptionsWrapper, null));
|
20797 | this.eUnchecked.appendChild(utils_1.Utils.createIconNoSpan('checkboxUnchecked', this.gridOptionsWrapper, null));
|
20798 | this.eIndeterminate.appendChild(utils_1.Utils.createIconNoSpan('checkboxIndeterminate', this.gridOptionsWrapper, null));
|
20799 | }
|
20800 | };
|
20801 | AgCheckbox.prototype.onClick = function (event) {
|
20802 |
|
20803 |
|
20804 |
|
20805 | utils_1.Utils.addAgGridEventPath(event);
|
20806 | if (!this.readOnly) {
|
20807 | this.toggle();
|
20808 | }
|
20809 | };
|
20810 | AgCheckbox.prototype.getNextValue = function () {
|
20811 | if (this.selected === undefined) {
|
20812 | return true;
|
20813 | }
|
20814 | else {
|
20815 | return !this.selected;
|
20816 | }
|
20817 | };
|
20818 | AgCheckbox.prototype.setPassive = function (passive) {
|
20819 | this.passive = passive;
|
20820 | };
|
20821 | AgCheckbox.prototype.setReadOnly = function (readOnly) {
|
20822 | this.readOnly = readOnly;
|
20823 | this.loadIcons();
|
20824 | };
|
20825 | AgCheckbox.prototype.isReadOnly = function () {
|
20826 | return this.readOnly;
|
20827 | };
|
20828 | AgCheckbox.prototype.isSelected = function () {
|
20829 | return this.selected;
|
20830 | };
|
20831 | AgCheckbox.prototype.toggle = function () {
|
20832 | var nextValue = this.getNextValue();
|
20833 | if (this.passive) {
|
20834 | var event_1 = {
|
20835 | type: AgCheckbox.EVENT_CHANGED,
|
20836 | selected: nextValue
|
20837 | };
|
20838 | this.dispatchEvent(event_1);
|
20839 | }
|
20840 | else {
|
20841 | this.setSelected(nextValue);
|
20842 | }
|
20843 | };
|
20844 | AgCheckbox.prototype.setSelected = function (selected) {
|
20845 | if (this.selected === selected) {
|
20846 | return;
|
20847 | }
|
20848 | if (selected === true) {
|
20849 | this.selected = true;
|
20850 | }
|
20851 | else if (selected === false) {
|
20852 | this.selected = false;
|
20853 | }
|
20854 | else {
|
20855 | this.selected = undefined;
|
20856 | }
|
20857 | this.updateIcons();
|
20858 | var event = {
|
20859 | type: AgCheckbox.EVENT_CHANGED,
|
20860 | selected: this.selected
|
20861 | };
|
20862 | this.dispatchEvent(event);
|
20863 | };
|
20864 | AgCheckbox.prototype.updateIcons = function () {
|
20865 | utils_1.Utils.setVisible(this.eChecked, this.selected === true);
|
20866 | utils_1.Utils.setVisible(this.eUnchecked, this.selected === false);
|
20867 | utils_1.Utils.setVisible(this.eIndeterminate, this.selected === undefined);
|
20868 | };
|
20869 | AgCheckbox.EVENT_CHANGED = 'change';
|
20870 | AgCheckbox.TEMPLATE = '<span class="ag-checkbox" role="presentation">' +
|
20871 | ' <span class="ag-checkbox-checked" role="presentation"></span>' +
|
20872 | ' <span class="ag-checkbox-unchecked" role="presentation"></span>' +
|
20873 | ' <span class="ag-checkbox-indeterminate" role="presentation"></span>' +
|
20874 | ' <span class="ag-checkbox-label" role="presentation"></span>' +
|
20875 | '</span>';
|
20876 | __decorate([
|
20877 | context_1.Autowired('gridOptionsWrapper'),
|
20878 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
20879 | ], AgCheckbox.prototype, "gridOptionsWrapper", void 0);
|
20880 | __decorate([
|
20881 | componentAnnotations_1.QuerySelector('.ag-checkbox-checked'),
|
20882 | __metadata("design:type", HTMLElement)
|
20883 | ], AgCheckbox.prototype, "eChecked", void 0);
|
20884 | __decorate([
|
20885 | componentAnnotations_1.QuerySelector('.ag-checkbox-unchecked'),
|
20886 | __metadata("design:type", HTMLElement)
|
20887 | ], AgCheckbox.prototype, "eUnchecked", void 0);
|
20888 | __decorate([
|
20889 | componentAnnotations_1.QuerySelector('.ag-checkbox-indeterminate'),
|
20890 | __metadata("design:type", HTMLElement)
|
20891 | ], AgCheckbox.prototype, "eIndeterminate", void 0);
|
20892 | __decorate([
|
20893 | componentAnnotations_1.QuerySelector('.ag-checkbox-label'),
|
20894 | __metadata("design:type", HTMLElement)
|
20895 | ], AgCheckbox.prototype, "eLabel", void 0);
|
20896 | __decorate([
|
20897 | context_1.PreConstruct,
|
20898 | __metadata("design:type", Function),
|
20899 | __metadata("design:paramtypes", []),
|
20900 | __metadata("design:returntype", void 0)
|
20901 | ], AgCheckbox.prototype, "preConstruct", null);
|
20902 | __decorate([
|
20903 | context_1.PostConstruct,
|
20904 | __metadata("design:type", Function),
|
20905 | __metadata("design:paramtypes", []),
|
20906 | __metadata("design:returntype", void 0)
|
20907 | ], AgCheckbox.prototype, "postConstruct", null);
|
20908 | __decorate([
|
20909 | componentAnnotations_1.Listener('click'),
|
20910 | __metadata("design:type", Function),
|
20911 | __metadata("design:paramtypes", [MouseEvent]),
|
20912 | __metadata("design:returntype", void 0)
|
20913 | ], AgCheckbox.prototype, "onClick", null);
|
20914 | return AgCheckbox;
|
20915 | }(component_1.Component));
|
20916 | exports.AgCheckbox = AgCheckbox;
|
20917 |
|
20918 |
|
20919 | }),
|
20920 |
|
20921 | (function(module, exports, __webpack_require__) {
|
20922 |
|
20923 | "use strict";
|
20924 |
|
20925 |
|
20926 |
|
20927 |
|
20928 |
|
20929 |
|
20930 |
|
20931 | var __extends = (this && this.__extends) || (function () {
|
20932 | var extendStatics = Object.setPrototypeOf ||
|
20933 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
20934 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
20935 | return function (d, b) {
|
20936 | extendStatics(d, b);
|
20937 | function __() { this.constructor = d; }
|
20938 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
20939 | };
|
20940 | })();
|
20941 | Object.defineProperty(exports, "__esModule", { value: true });
|
20942 | var utils_1 = __webpack_require__(1);
|
20943 | var rowNode_1 = __webpack_require__(16);
|
20944 | var beanStub_1 = __webpack_require__(13);
|
20945 | var RowNodeBlock = (function (_super) {
|
20946 | __extends(RowNodeBlock, _super);
|
20947 | function RowNodeBlock(blockNumber, rowNodeCacheParams) {
|
20948 | var _this = _super.call(this) || this;
|
20949 | _this.version = 0;
|
20950 | _this.state = RowNodeBlock.STATE_DIRTY;
|
20951 | _this.rowNodeCacheParams = rowNodeCacheParams;
|
20952 | _this.blockNumber = blockNumber;
|
20953 |
|
20954 |
|
20955 | _this.startRow = blockNumber * rowNodeCacheParams.blockSize;
|
20956 | _this.endRow = _this.startRow + rowNodeCacheParams.blockSize;
|
20957 | return _this;
|
20958 | }
|
20959 | RowNodeBlock.prototype.isAnyNodeOpen = function (rowCount) {
|
20960 | var result = false;
|
20961 | this.forEachNodeCallback(function (rowNode) {
|
20962 | if (rowNode.expanded) {
|
20963 | result = true;
|
20964 | }
|
20965 | }, rowCount);
|
20966 | return result;
|
20967 | };
|
20968 | RowNodeBlock.prototype.forEachNodeCallback = function (callback, rowCount) {
|
20969 | for (var rowIndex = this.startRow; rowIndex < this.endRow; rowIndex++) {
|
20970 |
|
20971 |
|
20972 | if (rowIndex < rowCount) {
|
20973 | var rowNode = this.getRowUsingLocalIndex(rowIndex);
|
20974 | callback(rowNode, rowIndex);
|
20975 | }
|
20976 | }
|
20977 | };
|
20978 | RowNodeBlock.prototype.forEachNode = function (callback, sequence, rowCount, deep) {
|
20979 | this.forEachNodeCallback(function (rowNode) {
|
20980 | callback(rowNode, sequence.next());
|
20981 |
|
20982 |
|
20983 | if (deep && rowNode.childrenCache) {
|
20984 | rowNode.childrenCache.forEachNodeDeep(callback, sequence);
|
20985 | }
|
20986 | }, rowCount);
|
20987 | };
|
20988 | RowNodeBlock.prototype.forEachNodeDeep = function (callback, sequence, rowCount) {
|
20989 | this.forEachNode(callback, sequence, rowCount, true);
|
20990 | };
|
20991 | RowNodeBlock.prototype.forEachNodeShallow = function (callback, sequence, rowCount) {
|
20992 | this.forEachNode(callback, sequence, rowCount, false);
|
20993 | };
|
20994 | RowNodeBlock.prototype.getVersion = function () {
|
20995 | return this.version;
|
20996 | };
|
20997 | RowNodeBlock.prototype.getLastAccessed = function () {
|
20998 | return this.lastAccessed;
|
20999 | };
|
21000 | RowNodeBlock.prototype.getRowUsingLocalIndex = function (rowIndex, dontTouchLastAccessed) {
|
21001 | if (dontTouchLastAccessed === void 0) { dontTouchLastAccessed = false; }
|
21002 | if (!dontTouchLastAccessed) {
|
21003 | this.lastAccessed = this.rowNodeCacheParams.lastAccessedSequence.next();
|
21004 | }
|
21005 | var localIndex = rowIndex - this.startRow;
|
21006 | return this.rowNodes[localIndex];
|
21007 | };
|
21008 | RowNodeBlock.prototype.init = function (beans) {
|
21009 | this.beans = beans;
|
21010 | this.createRowNodes();
|
21011 | };
|
21012 | RowNodeBlock.prototype.getStartRow = function () {
|
21013 | return this.startRow;
|
21014 | };
|
21015 | RowNodeBlock.prototype.getEndRow = function () {
|
21016 | return this.endRow;
|
21017 | };
|
21018 | RowNodeBlock.prototype.getBlockNumber = function () {
|
21019 | return this.blockNumber;
|
21020 | };
|
21021 | RowNodeBlock.prototype.setDirty = function () {
|
21022 |
|
21023 | this.version++;
|
21024 | this.state = RowNodeBlock.STATE_DIRTY;
|
21025 | };
|
21026 | RowNodeBlock.prototype.setDirtyAndPurge = function () {
|
21027 | this.setDirty();
|
21028 | this.rowNodes.forEach(function (rowNode) {
|
21029 | rowNode.setData(null);
|
21030 | });
|
21031 | };
|
21032 | RowNodeBlock.prototype.getState = function () {
|
21033 | return this.state;
|
21034 | };
|
21035 | RowNodeBlock.prototype.setRowNode = function (rowIndex, rowNode) {
|
21036 | var localIndex = rowIndex - this.startRow;
|
21037 | this.rowNodes[localIndex] = rowNode;
|
21038 | };
|
21039 | RowNodeBlock.prototype.setBlankRowNode = function (rowIndex) {
|
21040 | var localIndex = rowIndex - this.startRow;
|
21041 | var newRowNode = this.createBlankRowNode(rowIndex);
|
21042 | this.rowNodes[localIndex] = newRowNode;
|
21043 | return newRowNode;
|
21044 | };
|
21045 | RowNodeBlock.prototype.setNewData = function (rowIndex, dataItem) {
|
21046 | var newRowNode = this.setBlankRowNode(rowIndex);
|
21047 | this.setDataAndId(newRowNode, dataItem, this.startRow + rowIndex);
|
21048 | return newRowNode;
|
21049 | };
|
21050 | RowNodeBlock.prototype.createBlankRowNode = function (rowIndex) {
|
21051 | var rowNode = new rowNode_1.RowNode();
|
21052 | this.beans.context.wireBean(rowNode);
|
21053 | rowNode.setRowHeight(this.rowNodeCacheParams.rowHeight);
|
21054 | return rowNode;
|
21055 | };
|
21056 |
|
21057 | RowNodeBlock.prototype.createRowNodes = function () {
|
21058 | this.rowNodes = [];
|
21059 | for (var i = 0; i < this.rowNodeCacheParams.blockSize; i++) {
|
21060 | var rowIndex = this.startRow + i;
|
21061 | var rowNode = this.createBlankRowNode(rowIndex);
|
21062 | this.rowNodes.push(rowNode);
|
21063 | }
|
21064 | };
|
21065 | RowNodeBlock.prototype.load = function () {
|
21066 | this.state = RowNodeBlock.STATE_LOADING;
|
21067 | this.loadFromDatasource();
|
21068 | };
|
21069 | RowNodeBlock.prototype.pageLoadFailed = function () {
|
21070 | this.state = RowNodeBlock.STATE_FAILED;
|
21071 | var event = {
|
21072 | type: RowNodeBlock.EVENT_LOAD_COMPLETE,
|
21073 | success: false,
|
21074 | page: this,
|
21075 | lastRow: null
|
21076 | };
|
21077 | this.dispatchEvent(event);
|
21078 | };
|
21079 | RowNodeBlock.prototype.populateWithRowData = function (rows) {
|
21080 | var _this = this;
|
21081 | var rowNodesToRefresh = [];
|
21082 | this.rowNodes.forEach(function (rowNode, index) {
|
21083 | var data = rows[index];
|
21084 | if (rowNode.stub) {
|
21085 | rowNodesToRefresh.push(rowNode);
|
21086 | }
|
21087 | _this.setDataAndId(rowNode, data, _this.startRow + index);
|
21088 | });
|
21089 | if (rowNodesToRefresh.length > 0) {
|
21090 | this.beans.rowRenderer.redrawRows(rowNodesToRefresh);
|
21091 | }
|
21092 | };
|
21093 | RowNodeBlock.prototype.destroy = function () {
|
21094 | _super.prototype.destroy.call(this);
|
21095 | this.rowNodes.forEach(function (rowNode) {
|
21096 | if (rowNode.childrenCache) {
|
21097 | rowNode.childrenCache.destroy();
|
21098 | rowNode.childrenCache = null;
|
21099 | }
|
21100 |
|
21101 |
|
21102 |
|
21103 | rowNode.clearRowTop();
|
21104 | });
|
21105 | };
|
21106 | RowNodeBlock.prototype.pageLoaded = function (version, rows, lastRow) {
|
21107 |
|
21108 |
|
21109 |
|
21110 | if (version === this.version) {
|
21111 | this.state = RowNodeBlock.STATE_LOADED;
|
21112 | this.populateWithRowData(rows);
|
21113 | }
|
21114 | lastRow = utils_1.Utils.cleanNumber(lastRow);
|
21115 |
|
21116 | var event = {
|
21117 | type: RowNodeBlock.EVENT_LOAD_COMPLETE,
|
21118 | success: true,
|
21119 | page: this,
|
21120 | lastRow: lastRow
|
21121 | };
|
21122 | this.dispatchEvent(event);
|
21123 | };
|
21124 | RowNodeBlock.EVENT_LOAD_COMPLETE = 'loadComplete';
|
21125 | RowNodeBlock.STATE_DIRTY = 'dirty';
|
21126 | RowNodeBlock.STATE_LOADING = 'loading';
|
21127 | RowNodeBlock.STATE_LOADED = 'loaded';
|
21128 | RowNodeBlock.STATE_FAILED = 'failed';
|
21129 | return RowNodeBlock;
|
21130 | }(beanStub_1.BeanStub));
|
21131 | exports.RowNodeBlock = RowNodeBlock;
|
21132 |
|
21133 |
|
21134 | }),
|
21135 |
|
21136 | (function(module, exports, __webpack_require__) {
|
21137 |
|
21138 | "use strict";
|
21139 |
|
21140 |
|
21141 |
|
21142 |
|
21143 |
|
21144 |
|
21145 |
|
21146 | Object.defineProperty(exports, "__esModule", { value: true });
|
21147 | var events_1 = __webpack_require__(5);
|
21148 | var propertyKeys_1 = __webpack_require__(89);
|
21149 | var utils_1 = __webpack_require__(1);
|
21150 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
21151 | var ComponentUtil = (function () {
|
21152 | function ComponentUtil() {
|
21153 | }
|
21154 | ComponentUtil.getEventCallbacks = function () {
|
21155 | if (!ComponentUtil.EVENT_CALLBACKS) {
|
21156 | ComponentUtil.EVENT_CALLBACKS = [];
|
21157 | ComponentUtil.EVENT_CALLBACKS_NO_PREFIX = [];
|
21158 | ComponentUtil.EVENTS.forEach(function (eventName) {
|
21159 | ComponentUtil.EVENT_CALLBACKS.push(ComponentUtil.getCallbackForEvent(eventName));
|
21160 | ComponentUtil.EVENT_CALLBACKS_NO_PREFIX.push(eventName);
|
21161 | });
|
21162 | }
|
21163 | return ComponentUtil.EVENT_CALLBACKS;
|
21164 | };
|
21165 | ComponentUtil.copyAttributesToGridOptions = function (gridOptions, component, skipEventDeprecationCheck) {
|
21166 | if (skipEventDeprecationCheck === void 0) { skipEventDeprecationCheck = false; }
|
21167 | checkForDeprecated(component);
|
21168 |
|
21169 | if (typeof gridOptions !== 'object') {
|
21170 | gridOptions = {};
|
21171 | }
|
21172 |
|
21173 | var pGridOptions = gridOptions;
|
21174 |
|
21175 | ComponentUtil.ARRAY_PROPERTIES
|
21176 | .concat(ComponentUtil.STRING_PROPERTIES)
|
21177 | .concat(ComponentUtil.OBJECT_PROPERTIES)
|
21178 | .concat(ComponentUtil.FUNCTION_PROPERTIES)
|
21179 | .forEach(function (key) {
|
21180 | if (typeof component[key] !== 'undefined') {
|
21181 | pGridOptions[key] = component[key];
|
21182 | }
|
21183 | });
|
21184 | ComponentUtil.BOOLEAN_PROPERTIES.forEach(function (key) {
|
21185 | if (typeof component[key] !== 'undefined') {
|
21186 | pGridOptions[key] = ComponentUtil.toBoolean(component[key]);
|
21187 | }
|
21188 | });
|
21189 | ComponentUtil.NUMBER_PROPERTIES.forEach(function (key) {
|
21190 | if (typeof component[key] !== 'undefined') {
|
21191 | pGridOptions[key] = ComponentUtil.toNumber(component[key]);
|
21192 | }
|
21193 | });
|
21194 | ComponentUtil.getEventCallbacks().forEach(function (funcName) {
|
21195 | if (typeof component[funcName] !== 'undefined') {
|
21196 | pGridOptions[funcName] = component[funcName];
|
21197 | }
|
21198 | });
|
21199 |
|
21200 | if (!skipEventDeprecationCheck) {
|
21201 | ComponentUtil.EVENT_CALLBACKS_NO_PREFIX.forEach(function (funcName) {
|
21202 |
|
21203 | var onMethodName = ComponentUtil.getCallbackForEvent(funcName);
|
21204 | if (typeof component[funcName] !== 'undefined' ||
|
21205 | typeof component[onMethodName] !== 'undefined') {
|
21206 | gridOptionsWrapper_1.GridOptionsWrapper.checkEventDeprecation(funcName);
|
21207 | }
|
21208 | });
|
21209 | }
|
21210 | return gridOptions;
|
21211 | };
|
21212 | ComponentUtil.getCallbackForEvent = function (eventName) {
|
21213 | if (!eventName || eventName.length < 2) {
|
21214 | return eventName;
|
21215 | }
|
21216 | else {
|
21217 | return 'on' + eventName[0].toUpperCase() + eventName.substr(1);
|
21218 | }
|
21219 | };
|
21220 | ComponentUtil.processOnChange = function (changes, gridOptions, api, columnApi) {
|
21221 | if (!changes) {
|
21222 | return;
|
21223 | }
|
21224 | checkForDeprecated(changes);
|
21225 |
|
21226 | var pGridOptions = gridOptions;
|
21227 |
|
21228 | ComponentUtil.ARRAY_PROPERTIES
|
21229 | .concat(ComponentUtil.OBJECT_PROPERTIES)
|
21230 | .concat(ComponentUtil.STRING_PROPERTIES)
|
21231 | .forEach(function (key) {
|
21232 | if (changes[key]) {
|
21233 | pGridOptions[key] = changes[key].currentValue;
|
21234 | }
|
21235 | });
|
21236 | ComponentUtil.BOOLEAN_PROPERTIES.forEach(function (key) {
|
21237 | if (changes[key]) {
|
21238 | pGridOptions[key] = ComponentUtil.toBoolean(changes[key].currentValue);
|
21239 | }
|
21240 | });
|
21241 | ComponentUtil.NUMBER_PROPERTIES.forEach(function (key) {
|
21242 | if (changes[key]) {
|
21243 | pGridOptions[key] = ComponentUtil.toNumber(changes[key].currentValue);
|
21244 | }
|
21245 | });
|
21246 | ComponentUtil.getEventCallbacks().forEach(function (funcName) {
|
21247 | if (changes[funcName]) {
|
21248 | pGridOptions[funcName] = changes[funcName].currentValue;
|
21249 | }
|
21250 | });
|
21251 | if (changes.showToolPanel) {
|
21252 | api.showToolPanel(ComponentUtil.toBoolean(changes.showToolPanel.currentValue));
|
21253 | }
|
21254 | if (changes.quickFilterText) {
|
21255 | api.setQuickFilter(changes.quickFilterText.currentValue);
|
21256 | }
|
21257 | if (changes.rowData) {
|
21258 | api.setRowData(changes.rowData.currentValue);
|
21259 | }
|
21260 | if (changes.pinnedTopRowData) {
|
21261 | api.setPinnedTopRowData(changes.pinnedTopRowData.currentValue);
|
21262 | }
|
21263 | if (changes.pinnedBottomRowData) {
|
21264 | api.setPinnedBottomRowData(changes.pinnedBottomRowData.currentValue);
|
21265 | }
|
21266 | if (changes.columnDefs) {
|
21267 | api.setColumnDefs(changes.columnDefs.currentValue, "gridOptionsChanged");
|
21268 | }
|
21269 | if (changes.datasource) {
|
21270 | api.setDatasource(changes.datasource.currentValue);
|
21271 | }
|
21272 | if (changes.headerHeight) {
|
21273 | api.setHeaderHeight(ComponentUtil.toNumber(changes.headerHeight.currentValue));
|
21274 | }
|
21275 | if (changes.paginationPageSize) {
|
21276 | api.paginationSetPageSize(ComponentUtil.toNumber(changes.paginationPageSize.currentValue));
|
21277 | }
|
21278 | if (changes.pivotMode) {
|
21279 | columnApi.setPivotMode(ComponentUtil.toBoolean(changes.pivotMode.currentValue));
|
21280 | }
|
21281 | if (changes.groupRemoveSingleChildren) {
|
21282 | api.setGroupRemoveSingleChildren(ComponentUtil.toBoolean(changes.groupRemoveSingleChildren.currentValue));
|
21283 | }
|
21284 | if (changes.suppressRowDrag) {
|
21285 | api.setSuppressRowDrag(ComponentUtil.toBoolean(changes.suppressRowDrag.currentValue));
|
21286 | }
|
21287 | if (changes.gridAutoHeight) {
|
21288 | api.setGridAutoHeight(ComponentUtil.toBoolean(changes.gridAutoHeight.currentValue));
|
21289 | }
|
21290 | if (changes.suppressClipboardPaste) {
|
21291 | api.setSuppressClipboardPaste(ComponentUtil.toBoolean(changes.suppressClipboardPaste.currentValue));
|
21292 | }
|
21293 |
|
21294 | var event = {
|
21295 | type: events_1.Events.EVENT_COMPONENT_STATE_CHANGED,
|
21296 | api: gridOptions.api,
|
21297 | columnApi: gridOptions.columnApi
|
21298 | };
|
21299 | utils_1.Utils.iterateObject(changes, function (key, value) {
|
21300 | event[key] = value;
|
21301 | });
|
21302 | api.dispatchEvent(event);
|
21303 | };
|
21304 | ComponentUtil.toBoolean = function (value) {
|
21305 | if (typeof value === 'boolean') {
|
21306 | return value;
|
21307 | }
|
21308 | else if (typeof value === 'string') {
|
21309 |
|
21310 |
|
21311 | return value.toUpperCase() === 'TRUE' || value == '';
|
21312 | }
|
21313 | else {
|
21314 | return false;
|
21315 | }
|
21316 | };
|
21317 | ComponentUtil.toNumber = function (value) {
|
21318 | if (typeof value === 'number') {
|
21319 | return value;
|
21320 | }
|
21321 | else if (typeof value === 'string') {
|
21322 | return Number(value);
|
21323 | }
|
21324 | else {
|
21325 | return undefined;
|
21326 | }
|
21327 | };
|
21328 |
|
21329 | ComponentUtil.EVENTS = [];
|
21330 | ComponentUtil.STRING_PROPERTIES = propertyKeys_1.PropertyKeys.STRING_PROPERTIES;
|
21331 | ComponentUtil.OBJECT_PROPERTIES = propertyKeys_1.PropertyKeys.OBJECT_PROPERTIES;
|
21332 | ComponentUtil.ARRAY_PROPERTIES = propertyKeys_1.PropertyKeys.ARRAY_PROPERTIES;
|
21333 | ComponentUtil.NUMBER_PROPERTIES = propertyKeys_1.PropertyKeys.NUMBER_PROPERTIES;
|
21334 | ComponentUtil.BOOLEAN_PROPERTIES = propertyKeys_1.PropertyKeys.BOOLEAN_PROPERTIES;
|
21335 | ComponentUtil.FUNCTION_PROPERTIES = propertyKeys_1.PropertyKeys.FUNCTION_PROPERTIES;
|
21336 | ComponentUtil.ALL_PROPERTIES = propertyKeys_1.PropertyKeys.ALL_PROPERTIES;
|
21337 | return ComponentUtil;
|
21338 | }());
|
21339 | exports.ComponentUtil = ComponentUtil;
|
21340 | utils_1.Utils.iterateObject(events_1.Events, function (key, value) {
|
21341 | ComponentUtil.EVENTS.push(value);
|
21342 | });
|
21343 | function checkForDeprecated(changes) {
|
21344 | if (changes.rowDeselected || changes.onRowDeselected) {
|
21345 | console.warn('ag-grid: as of v3.4 rowDeselected no longer exists. Please check the docs.');
|
21346 | }
|
21347 | }
|
21348 |
|
21349 |
|
21350 | }),
|
21351 |
|
21352 | (function(module, exports, __webpack_require__) {
|
21353 |
|
21354 | "use strict";
|
21355 |
|
21356 |
|
21357 |
|
21358 |
|
21359 |
|
21360 |
|
21361 |
|
21362 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
21363 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
21364 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
21365 | 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;
|
21366 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
21367 | };
|
21368 | var __metadata = (this && this.__metadata) || function (k, v) {
|
21369 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
21370 | };
|
21371 | Object.defineProperty(exports, "__esModule", { value: true });
|
21372 | var context_1 = __webpack_require__(0);
|
21373 | var columnController_1 = __webpack_require__(4);
|
21374 | var constants_1 = __webpack_require__(9);
|
21375 | var utils_1 = __webpack_require__(1);
|
21376 | var selectionController_1 = __webpack_require__(17);
|
21377 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
21378 | var displayedGroupCreator_1 = __webpack_require__(48);
|
21379 | var balancedColumnTreeBuilder_1 = __webpack_require__(38);
|
21380 | var groupInstanceIdCreator_1 = __webpack_require__(83);
|
21381 | var columnGroup_1 = __webpack_require__(26);
|
21382 | var pinnedRowModel_1 = __webpack_require__(30);
|
21383 | var BaseGridSerializingSession = (function () {
|
21384 | function BaseGridSerializingSession(columnController, valueService, gridOptionsWrapper, processCellCallback, processHeaderCallback, cellAndHeaderEscaper) {
|
21385 | this.columnController = columnController;
|
21386 | this.valueService = valueService;
|
21387 | this.gridOptionsWrapper = gridOptionsWrapper;
|
21388 | this.processCellCallback = processCellCallback;
|
21389 | this.processHeaderCallback = processHeaderCallback;
|
21390 | this.cellAndHeaderEscaper = cellAndHeaderEscaper;
|
21391 | }
|
21392 | BaseGridSerializingSession.prototype.extractHeaderValue = function (column) {
|
21393 | var nameForCol = this.getHeaderName(this.processHeaderCallback, column);
|
21394 | if (nameForCol === null || nameForCol === undefined) {
|
21395 | nameForCol = '';
|
21396 | }
|
21397 | return this.cellAndHeaderEscaper ? this.cellAndHeaderEscaper(nameForCol) : nameForCol;
|
21398 | };
|
21399 | BaseGridSerializingSession.prototype.extractRowCellValue = function (column, index, type, node) {
|
21400 | var isRowGrouping = this.columnController.getRowGroupColumns().length > 0;
|
21401 | var valueForCell;
|
21402 | if (node.group && isRowGrouping && index === 0) {
|
21403 | valueForCell = this.createValueForGroupNode(node);
|
21404 | }
|
21405 | else {
|
21406 | valueForCell = this.valueService.getValue(column, node);
|
21407 | }
|
21408 | valueForCell = this.processCell(node, column, valueForCell, this.processCellCallback, type);
|
21409 | if (valueForCell === null || valueForCell === undefined) {
|
21410 | valueForCell = '';
|
21411 | }
|
21412 | return this.cellAndHeaderEscaper ? this.cellAndHeaderEscaper(valueForCell) : valueForCell;
|
21413 | };
|
21414 | BaseGridSerializingSession.prototype.getHeaderName = function (callback, column) {
|
21415 | if (callback) {
|
21416 | return callback({
|
21417 | column: column,
|
21418 | api: this.gridOptionsWrapper.getApi(),
|
21419 | columnApi: this.gridOptionsWrapper.getColumnApi(),
|
21420 | context: this.gridOptionsWrapper.getContext()
|
21421 | });
|
21422 | }
|
21423 | else {
|
21424 | return this.columnController.getDisplayNameForColumn(column, 'csv', true);
|
21425 | }
|
21426 | };
|
21427 | BaseGridSerializingSession.prototype.createValueForGroupNode = function (node) {
|
21428 | var keys = [node.key];
|
21429 | while (node.parent) {
|
21430 | node = node.parent;
|
21431 | keys.push(node.key);
|
21432 | }
|
21433 | return keys.reverse().join(' -> ');
|
21434 | };
|
21435 | BaseGridSerializingSession.prototype.processCell = function (rowNode, column, value, processCellCallback, type) {
|
21436 | if (processCellCallback) {
|
21437 | return processCellCallback({
|
21438 | column: column,
|
21439 | node: rowNode,
|
21440 | value: value,
|
21441 | api: this.gridOptionsWrapper.getApi(),
|
21442 | columnApi: this.gridOptionsWrapper.getColumnApi(),
|
21443 | context: this.gridOptionsWrapper.getContext(),
|
21444 | type: type
|
21445 | });
|
21446 | }
|
21447 | else {
|
21448 | return value;
|
21449 | }
|
21450 | };
|
21451 | return BaseGridSerializingSession;
|
21452 | }());
|
21453 | exports.BaseGridSerializingSession = BaseGridSerializingSession;
|
21454 | var GridSerializer = (function () {
|
21455 | function GridSerializer() {
|
21456 | }
|
21457 | GridSerializer.prototype.serialize = function (gridSerializingSession, params) {
|
21458 | var dontSkipRows = function () { return false; };
|
21459 | var skipGroups = params && params.skipGroups;
|
21460 | var skipHeader = params && params.skipHeader;
|
21461 | var columnGroups = params && params.columnGroups;
|
21462 | var skipFooters = params && params.skipFooters;
|
21463 | var skipPinnedTop = params && params.skipPinnedTop;
|
21464 | var skipPinnedBottom = params && params.skipPinnedBottom;
|
21465 | var includeCustomHeader = params && params.customHeader;
|
21466 | var includeCustomFooter = params && params.customFooter;
|
21467 | var allColumns = params && params.allColumns;
|
21468 | var onlySelected = params && params.onlySelected;
|
21469 | var columnKeys = params && params.columnKeys;
|
21470 | var onlySelectedAllPages = params && params.onlySelectedAllPages;
|
21471 | var rowSkipper = (params && params.shouldRowBeSkipped) || dontSkipRows;
|
21472 | var api = this.gridOptionsWrapper.getApi();
|
21473 | var context = this.gridOptionsWrapper.getContext();
|
21474 |
|
21475 | var isPivotMode = this.columnController.isPivotMode();
|
21476 | var rowModelNormal = this.rowModel.getType() === constants_1.Constants.ROW_MODEL_TYPE_CLIENT_SIDE;
|
21477 | var onlySelectedNonStandardModel = !rowModelNormal && onlySelected;
|
21478 | var columnsToExport;
|
21479 | if (utils_1.Utils.existsAndNotEmpty(columnKeys)) {
|
21480 | columnsToExport = this.columnController.getGridColumns(columnKeys);
|
21481 | }
|
21482 | else if (allColumns && !isPivotMode) {
|
21483 | columnsToExport = this.columnController.getAllPrimaryColumns();
|
21484 | }
|
21485 | else {
|
21486 | columnsToExport = this.columnController.getAllDisplayedColumns();
|
21487 | }
|
21488 | if (!columnsToExport || columnsToExport.length === 0) {
|
21489 | return '';
|
21490 | }
|
21491 | gridSerializingSession.prepare(columnsToExport);
|
21492 | if (includeCustomHeader) {
|
21493 | gridSerializingSession.addCustomHeader(params.customHeader);
|
21494 | }
|
21495 |
|
21496 | if (columnGroups) {
|
21497 | var groupInstanceIdCreator = new groupInstanceIdCreator_1.GroupInstanceIdCreator();
|
21498 | var displayedGroups = this.displayedGroupCreator.createDisplayedGroups(columnsToExport, this.columnController.getGridBalancedTree(), groupInstanceIdCreator);
|
21499 | this.recursivelyAddHeaderGroups(displayedGroups, gridSerializingSession);
|
21500 | }
|
21501 | if (!skipHeader) {
|
21502 | var gridRowIterator_1 = gridSerializingSession.onNewHeaderRow();
|
21503 | columnsToExport.forEach(function (column, index) {
|
21504 | gridRowIterator_1.onColumn(column, index, null);
|
21505 | });
|
21506 | }
|
21507 | this.pinnedRowModel.forEachPinnedTopRow(processRow);
|
21508 | if (isPivotMode) {
|
21509 | if (this.rowModel.forEachPivotNode) {
|
21510 | this.rowModel.forEachPivotNode(processRow);
|
21511 | }
|
21512 | else {
|
21513 |
|
21514 | this.rowModel.forEachNode(processRow);
|
21515 | }
|
21516 | }
|
21517 | else {
|
21518 |
|
21519 |
|
21520 |
|
21521 |
|
21522 |
|
21523 | if (onlySelectedAllPages || onlySelectedNonStandardModel) {
|
21524 | var selectedNodes = this.selectionController.getSelectedNodes();
|
21525 | selectedNodes.forEach(function (node) {
|
21526 | processRow(node);
|
21527 | });
|
21528 | }
|
21529 | else {
|
21530 |
|
21531 |
|
21532 |
|
21533 | if (rowModelNormal) {
|
21534 | this.rowModel.forEachNodeAfterFilterAndSort(processRow);
|
21535 | }
|
21536 | else {
|
21537 | this.rowModel.forEachNode(processRow);
|
21538 | }
|
21539 | }
|
21540 | }
|
21541 | this.pinnedRowModel.forEachPinnedBottomRow(processRow);
|
21542 | if (includeCustomFooter) {
|
21543 | gridSerializingSession.addCustomFooter(params.customFooter);
|
21544 | }
|
21545 | function processRow(node) {
|
21546 | if (skipGroups && node.group) {
|
21547 | return;
|
21548 | }
|
21549 | if (skipFooters && node.footer) {
|
21550 | return;
|
21551 | }
|
21552 | if (onlySelected && !node.isSelected()) {
|
21553 | return;
|
21554 | }
|
21555 | if (skipPinnedTop && node.rowPinned === 'top') {
|
21556 | return;
|
21557 | }
|
21558 | if (skipPinnedBottom && node.rowPinned === 'bottom') {
|
21559 | return;
|
21560 | }
|
21561 |
|
21562 |
|
21563 | var nodeIsRootNode = node.level === -1;
|
21564 | if (nodeIsRootNode && !node.leafGroup) {
|
21565 | return;
|
21566 | }
|
21567 | var shouldRowBeSkipped = rowSkipper({
|
21568 | node: node,
|
21569 | api: api,
|
21570 | context: context
|
21571 | });
|
21572 | if (shouldRowBeSkipped)
|
21573 | return;
|
21574 | var rowAccumulator = gridSerializingSession.onNewBodyRow();
|
21575 | columnsToExport.forEach(function (column, index) {
|
21576 | rowAccumulator.onColumn(column, index, node);
|
21577 | });
|
21578 | }
|
21579 | return gridSerializingSession.parse();
|
21580 | };
|
21581 | GridSerializer.prototype.recursivelyAddHeaderGroups = function (displayedGroups, gridSerializingSession) {
|
21582 | var directChildrenHeaderGroups = [];
|
21583 | displayedGroups.forEach(function (columnGroupChild) {
|
21584 | var columnGroup = columnGroupChild;
|
21585 | if (!columnGroup.getChildren)
|
21586 | return;
|
21587 | columnGroup.getChildren().forEach(function (it) { return directChildrenHeaderGroups.push(it); });
|
21588 | });
|
21589 | if (displayedGroups.length > 0 && displayedGroups[0] instanceof columnGroup_1.ColumnGroup) {
|
21590 | this.doAddHeaderHeader(gridSerializingSession, displayedGroups);
|
21591 | }
|
21592 | if (directChildrenHeaderGroups && directChildrenHeaderGroups.length > 0) {
|
21593 | this.recursivelyAddHeaderGroups(directChildrenHeaderGroups, gridSerializingSession);
|
21594 | }
|
21595 | };
|
21596 | GridSerializer.prototype.doAddHeaderHeader = function (gridSerializingSession, displayedGroups) {
|
21597 | var _this = this;
|
21598 | var gridRowIterator = gridSerializingSession.onNewHeaderGroupingRow();
|
21599 | var columnIndex = 0;
|
21600 | displayedGroups.forEach(function (columnGroupChild) {
|
21601 | var columnGroup = columnGroupChild;
|
21602 | var colDef = columnGroup.getDefinition();
|
21603 | var columnName = _this.columnController.getDisplayNameForColumnGroup(columnGroup, 'header');
|
21604 | gridRowIterator.onColumn(columnName, columnIndex++, columnGroup.getLeafColumns().length - 1);
|
21605 | });
|
21606 | };
|
21607 | __decorate([
|
21608 | context_1.Autowired('displayedGroupCreator'),
|
21609 | __metadata("design:type", displayedGroupCreator_1.DisplayedGroupCreator)
|
21610 | ], GridSerializer.prototype, "displayedGroupCreator", void 0);
|
21611 | __decorate([
|
21612 | context_1.Autowired('columnController'),
|
21613 | __metadata("design:type", columnController_1.ColumnController)
|
21614 | ], GridSerializer.prototype, "columnController", void 0);
|
21615 | __decorate([
|
21616 | context_1.Autowired('rowModel'),
|
21617 | __metadata("design:type", Object)
|
21618 | ], GridSerializer.prototype, "rowModel", void 0);
|
21619 | __decorate([
|
21620 | context_1.Autowired('pinnedRowModel'),
|
21621 | __metadata("design:type", pinnedRowModel_1.PinnedRowModel)
|
21622 | ], GridSerializer.prototype, "pinnedRowModel", void 0);
|
21623 | __decorate([
|
21624 | context_1.Autowired('selectionController'),
|
21625 | __metadata("design:type", selectionController_1.SelectionController)
|
21626 | ], GridSerializer.prototype, "selectionController", void 0);
|
21627 | __decorate([
|
21628 | context_1.Autowired('balancedColumnTreeBuilder'),
|
21629 | __metadata("design:type", balancedColumnTreeBuilder_1.BalancedColumnTreeBuilder)
|
21630 | ], GridSerializer.prototype, "balancedColumnTreeBuilder", void 0);
|
21631 | __decorate([
|
21632 | context_1.Autowired('gridOptionsWrapper'),
|
21633 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
21634 | ], GridSerializer.prototype, "gridOptionsWrapper", void 0);
|
21635 | GridSerializer = __decorate([
|
21636 | context_1.Bean("gridSerializer")
|
21637 | ], GridSerializer);
|
21638 | return GridSerializer;
|
21639 | }());
|
21640 | exports.GridSerializer = GridSerializer;
|
21641 | var RowType;
|
21642 | (function (RowType) {
|
21643 | RowType[RowType["HEADER_GROUPING"] = 0] = "HEADER_GROUPING";
|
21644 | RowType[RowType["HEADER"] = 1] = "HEADER";
|
21645 | RowType[RowType["BODY"] = 2] = "BODY";
|
21646 | })(RowType = exports.RowType || (exports.RowType = {}));
|
21647 |
|
21648 |
|
21649 | }),
|
21650 |
|
21651 | (function(module, exports, __webpack_require__) {
|
21652 |
|
21653 | "use strict";
|
21654 |
|
21655 |
|
21656 |
|
21657 |
|
21658 |
|
21659 |
|
21660 |
|
21661 | Object.defineProperty(exports, "__esModule", { value: true });
|
21662 | var constants_1 = __webpack_require__(9);
|
21663 | var utils_1 = __webpack_require__(1);
|
21664 | var gridCell_1 = __webpack_require__(23);
|
21665 | var GridRow = (function () {
|
21666 | function GridRow(rowIndex, floating) {
|
21667 | this.rowIndex = rowIndex;
|
21668 | this.floating = utils_1.Utils.makeNull(floating);
|
21669 | }
|
21670 | GridRow.prototype.isFloatingTop = function () {
|
21671 | return this.floating === constants_1.Constants.PINNED_TOP;
|
21672 | };
|
21673 | GridRow.prototype.isFloatingBottom = function () {
|
21674 | return this.floating === constants_1.Constants.PINNED_BOTTOM;
|
21675 | };
|
21676 | GridRow.prototype.isNotFloating = function () {
|
21677 | return !this.isFloatingBottom() && !this.isFloatingTop();
|
21678 | };
|
21679 | GridRow.prototype.equals = function (otherSelection) {
|
21680 | return this.rowIndex === otherSelection.rowIndex
|
21681 | && this.floating === otherSelection.floating;
|
21682 | };
|
21683 | GridRow.prototype.toString = function () {
|
21684 | return "rowIndex = " + this.rowIndex + ", floating = " + this.floating;
|
21685 | };
|
21686 | GridRow.prototype.getGridCell = function (column) {
|
21687 | var gridCellDef = { rowIndex: this.rowIndex, floating: this.floating, column: column };
|
21688 | return new gridCell_1.GridCell(gridCellDef);
|
21689 | };
|
21690 |
|
21691 | GridRow.prototype.before = function (otherSelection) {
|
21692 | var otherFloating = otherSelection.floating;
|
21693 | switch (this.floating) {
|
21694 | case constants_1.Constants.PINNED_TOP:
|
21695 |
|
21696 | if (otherFloating !== constants_1.Constants.PINNED_TOP) {
|
21697 | return true;
|
21698 | }
|
21699 | break;
|
21700 | case constants_1.Constants.PINNED_BOTTOM:
|
21701 |
|
21702 | if (otherFloating !== constants_1.Constants.PINNED_BOTTOM) {
|
21703 | return false;
|
21704 | }
|
21705 | break;
|
21706 | default:
|
21707 |
|
21708 | if (utils_1.Utils.exists(otherFloating)) {
|
21709 | if (otherFloating === constants_1.Constants.PINNED_TOP) {
|
21710 |
|
21711 | return false;
|
21712 | }
|
21713 | else {
|
21714 |
|
21715 | return true;
|
21716 | }
|
21717 | }
|
21718 | break;
|
21719 | }
|
21720 | return this.rowIndex < otherSelection.rowIndex;
|
21721 | };
|
21722 | return GridRow;
|
21723 | }());
|
21724 | exports.GridRow = GridRow;
|
21725 |
|
21726 |
|
21727 | }),
|
21728 |
|
21729 | (function(module, exports, __webpack_require__) {
|
21730 |
|
21731 | "use strict";
|
21732 |
|
21733 |
|
21734 |
|
21735 |
|
21736 |
|
21737 |
|
21738 |
|
21739 | var __extends = (this && this.__extends) || (function () {
|
21740 | var extendStatics = Object.setPrototypeOf ||
|
21741 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
21742 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
21743 | return function (d, b) {
|
21744 | extendStatics(d, b);
|
21745 | function __() { this.constructor = d; }
|
21746 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
21747 | };
|
21748 | })();
|
21749 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
21750 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
21751 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
21752 | 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;
|
21753 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
21754 | };
|
21755 | var __metadata = (this && this.__metadata) || function (k, v) {
|
21756 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
21757 | };
|
21758 | Object.defineProperty(exports, "__esModule", { value: true });
|
21759 | var component_1 = __webpack_require__(8);
|
21760 | var rowNode_1 = __webpack_require__(16);
|
21761 | var utils_1 = __webpack_require__(1);
|
21762 | var context_1 = __webpack_require__(0);
|
21763 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
21764 | var events_1 = __webpack_require__(5);
|
21765 | var eventService_1 = __webpack_require__(3);
|
21766 | var gridApi_1 = __webpack_require__(6);
|
21767 | var columnApi_1 = __webpack_require__(7);
|
21768 | var CheckboxSelectionComponent = (function (_super) {
|
21769 | __extends(CheckboxSelectionComponent, _super);
|
21770 | function CheckboxSelectionComponent() {
|
21771 | return _super.call(this, "<span class=\"ag-selection-checkbox\"/>") || this;
|
21772 | }
|
21773 | CheckboxSelectionComponent.prototype.createAndAddIcons = function () {
|
21774 | this.eCheckedIcon = utils_1.Utils.createIconNoSpan('checkboxChecked', this.gridOptionsWrapper, this.column);
|
21775 | this.eUncheckedIcon = utils_1.Utils.createIconNoSpan('checkboxUnchecked', this.gridOptionsWrapper, this.column);
|
21776 | this.eIndeterminateIcon = utils_1.Utils.createIconNoSpan('checkboxIndeterminate', this.gridOptionsWrapper, this.column);
|
21777 | var element = this.getGui();
|
21778 | element.appendChild(this.eCheckedIcon);
|
21779 | element.appendChild(this.eUncheckedIcon);
|
21780 | element.appendChild(this.eIndeterminateIcon);
|
21781 | };
|
21782 | CheckboxSelectionComponent.prototype.onDataChanged = function () {
|
21783 |
|
21784 |
|
21785 | this.onSelectionChanged();
|
21786 | };
|
21787 | CheckboxSelectionComponent.prototype.onSelectableChanged = function () {
|
21788 | this.showOrHideSelect();
|
21789 | };
|
21790 | CheckboxSelectionComponent.prototype.onSelectionChanged = function () {
|
21791 | var state = this.rowNode.isSelected();
|
21792 | utils_1.Utils.setVisible(this.eCheckedIcon, state === true);
|
21793 | utils_1.Utils.setVisible(this.eUncheckedIcon, state === false);
|
21794 | utils_1.Utils.setVisible(this.eIndeterminateIcon, typeof state !== 'boolean');
|
21795 | };
|
21796 | CheckboxSelectionComponent.prototype.onCheckedClicked = function () {
|
21797 | var groupSelectsFiltered = this.gridOptionsWrapper.isGroupSelectsFiltered();
|
21798 | var updatedCount = this.rowNode.setSelectedParams({ newValue: false, groupSelectsFiltered: groupSelectsFiltered });
|
21799 | return updatedCount;
|
21800 | };
|
21801 | CheckboxSelectionComponent.prototype.onUncheckedClicked = function (event) {
|
21802 | var groupSelectsFiltered = this.gridOptionsWrapper.isGroupSelectsFiltered();
|
21803 | var updatedCount = this.rowNode.setSelectedParams({ newValue: true, rangeSelect: event.shiftKey, groupSelectsFiltered: groupSelectsFiltered });
|
21804 | return updatedCount;
|
21805 | };
|
21806 | CheckboxSelectionComponent.prototype.onIndeterminateClicked = function (event) {
|
21807 | var result = this.onUncheckedClicked(event);
|
21808 | if (result === 0) {
|
21809 | this.onCheckedClicked();
|
21810 | }
|
21811 | };
|
21812 | CheckboxSelectionComponent.prototype.init = function (params) {
|
21813 | this.rowNode = params.rowNode;
|
21814 | this.column = params.column;
|
21815 | this.createAndAddIcons();
|
21816 | this.onSelectionChanged();
|
21817 |
|
21818 |
|
21819 | this.addGuiEventListener('click', function (event) { return utils_1.Utils.stopPropagationForAgGrid(event); });
|
21820 |
|
21821 | this.addGuiEventListener('dblclick', function (event) { return utils_1.Utils.stopPropagationForAgGrid(event); });
|
21822 | this.addDestroyableEventListener(this.eCheckedIcon, 'click', this.onCheckedClicked.bind(this));
|
21823 | this.addDestroyableEventListener(this.eUncheckedIcon, 'click', this.onUncheckedClicked.bind(this));
|
21824 | this.addDestroyableEventListener(this.eIndeterminateIcon, 'click', this.onIndeterminateClicked.bind(this));
|
21825 | this.addDestroyableEventListener(this.rowNode, rowNode_1.RowNode.EVENT_ROW_SELECTED, this.onSelectionChanged.bind(this));
|
21826 | this.addDestroyableEventListener(this.rowNode, rowNode_1.RowNode.EVENT_DATA_CHANGED, this.onDataChanged.bind(this));
|
21827 | this.addDestroyableEventListener(this.rowNode, rowNode_1.RowNode.EVENT_SELECTABLE_CHANGED, this.onSelectableChanged.bind(this));
|
21828 | this.isRowSelectableFunc = this.gridOptionsWrapper.getIsRowSelectableFunc();
|
21829 | var checkboxVisibleIsDynamic = this.isRowSelectableFunc || this.checkboxCallbackExists();
|
21830 | if (checkboxVisibleIsDynamic) {
|
21831 | this.addDestroyableEventListener(this.eventService, events_1.Events.EVENT_DISPLAYED_COLUMNS_CHANGED, this.showOrHideSelect.bind(this));
|
21832 | this.showOrHideSelect();
|
21833 | }
|
21834 | };
|
21835 | CheckboxSelectionComponent.prototype.showOrHideSelect = function () {
|
21836 |
|
21837 | var selectable = this.rowNode.selectable;
|
21838 |
|
21839 |
|
21840 |
|
21841 | if (selectable && this.checkboxCallbackExists()) {
|
21842 | selectable = this.column.isCellCheckboxSelection(this.rowNode);
|
21843 | }
|
21844 |
|
21845 | this.setVisible(selectable);
|
21846 | };
|
21847 | CheckboxSelectionComponent.prototype.checkboxCallbackExists = function () {
|
21848 |
|
21849 | var colDef = this.column ? this.column.getColDef() : null;
|
21850 | return colDef && typeof colDef.checkboxSelection === 'function';
|
21851 | };
|
21852 | __decorate([
|
21853 | context_1.Autowired('gridOptionsWrapper'),
|
21854 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
21855 | ], CheckboxSelectionComponent.prototype, "gridOptionsWrapper", void 0);
|
21856 | __decorate([
|
21857 | context_1.Autowired('eventService'),
|
21858 | __metadata("design:type", eventService_1.EventService)
|
21859 | ], CheckboxSelectionComponent.prototype, "eventService", void 0);
|
21860 | __decorate([
|
21861 | context_1.Autowired('gridApi'),
|
21862 | __metadata("design:type", gridApi_1.GridApi)
|
21863 | ], CheckboxSelectionComponent.prototype, "gridApi", void 0);
|
21864 | __decorate([
|
21865 | context_1.Autowired('columnApi'),
|
21866 | __metadata("design:type", columnApi_1.ColumnApi)
|
21867 | ], CheckboxSelectionComponent.prototype, "columnApi", void 0);
|
21868 | return CheckboxSelectionComponent;
|
21869 | }(component_1.Component));
|
21870 | exports.CheckboxSelectionComponent = CheckboxSelectionComponent;
|
21871 |
|
21872 |
|
21873 | }),
|
21874 |
|
21875 | (function(module, exports, __webpack_require__) {
|
21876 |
|
21877 | "use strict";
|
21878 |
|
21879 |
|
21880 |
|
21881 |
|
21882 |
|
21883 |
|
21884 |
|
21885 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
21886 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
21887 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
21888 | 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;
|
21889 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
21890 | };
|
21891 | var __metadata = (this && this.__metadata) || function (k, v) {
|
21892 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
21893 | };
|
21894 | Object.defineProperty(exports, "__esModule", { value: true });
|
21895 | var textCellEditor_1 = __webpack_require__(67);
|
21896 | var context_1 = __webpack_require__(0);
|
21897 | var dateFilter_1 = __webpack_require__(68);
|
21898 | var headerComp_1 = __webpack_require__(126);
|
21899 | var headerGroupComp_1 = __webpack_require__(127);
|
21900 | var floatingFilter_1 = __webpack_require__(90);
|
21901 | var componentResolver_1 = __webpack_require__(27);
|
21902 | var groupCellRenderer_1 = __webpack_require__(72);
|
21903 | var animateShowChangeCellRenderer_1 = __webpack_require__(71);
|
21904 | var animateSlideCellRenderer_1 = __webpack_require__(70);
|
21905 | var rowComp_1 = __webpack_require__(50);
|
21906 | var selectCellEditor_1 = __webpack_require__(75);
|
21907 | var popupTextCellEditor_1 = __webpack_require__(91);
|
21908 | var popupSelectCellEditor_1 = __webpack_require__(92);
|
21909 | var largeTextCellEditor_1 = __webpack_require__(93);
|
21910 | var textFilter_1 = __webpack_require__(94);
|
21911 | var numberFilter_1 = __webpack_require__(95);
|
21912 | var loadingOverlayComponent_1 = __webpack_require__(128);
|
21913 | var noRowsOverlayComponent_1 = __webpack_require__(129);
|
21914 | var utils_1 = __webpack_require__(1);
|
21915 | var RegisteredComponentSource;
|
21916 | (function (RegisteredComponentSource) {
|
21917 | RegisteredComponentSource[RegisteredComponentSource["DEFAULT"] = 0] = "DEFAULT";
|
21918 | RegisteredComponentSource[RegisteredComponentSource["REGISTERED"] = 1] = "REGISTERED";
|
21919 | })(RegisteredComponentSource = exports.RegisteredComponentSource || (exports.RegisteredComponentSource = {}));
|
21920 | var ComponentProvider = (function () {
|
21921 | function ComponentProvider() {
|
21922 | this.agGridDefaults = {
|
21923 |
|
21924 | agDateInput: dateFilter_1.DefaultDateComponent,
|
21925 |
|
21926 | agColumnHeader: headerComp_1.HeaderComp,
|
21927 | agColumnGroupHeader: headerGroupComp_1.HeaderGroupComp,
|
21928 |
|
21929 | agSetColumnFloatingFilter: floatingFilter_1.SetFloatingFilterComp,
|
21930 | agTextColumnFloatingFilter: floatingFilter_1.TextFloatingFilterComp,
|
21931 | agNumberColumnFloatingFilter: floatingFilter_1.NumberFloatingFilterComp,
|
21932 | agDateColumnFloatingFilter: floatingFilter_1.DateFloatingFilterComp,
|
21933 |
|
21934 | agAnimateShowChangeCellRenderer: animateShowChangeCellRenderer_1.AnimateShowChangeCellRenderer,
|
21935 | agAnimateSlideCellRenderer: animateSlideCellRenderer_1.AnimateSlideCellRenderer,
|
21936 | agGroupCellRenderer: groupCellRenderer_1.GroupCellRenderer,
|
21937 | agGroupRowRenderer: groupCellRenderer_1.GroupCellRenderer,
|
21938 | agLoadingCellRenderer: rowComp_1.LoadingCellRenderer,
|
21939 |
|
21940 | agCellEditor: textCellEditor_1.TextCellEditor,
|
21941 | agTextCellEditor: textCellEditor_1.TextCellEditor,
|
21942 | agSelectCellEditor: selectCellEditor_1.SelectCellEditor,
|
21943 | agPopupTextCellEditor: popupTextCellEditor_1.PopupTextCellEditor,
|
21944 | agPopupSelectCellEditor: popupSelectCellEditor_1.PopupSelectCellEditor,
|
21945 | agLargeTextCellEditor: largeTextCellEditor_1.LargeTextCellEditor,
|
21946 |
|
21947 | agTextColumnFilter: textFilter_1.TextFilter,
|
21948 | agNumberColumnFilter: numberFilter_1.NumberFilter,
|
21949 | agDateColumnFilter: dateFilter_1.DateFilter,
|
21950 |
|
21951 | agLoadingOverlay: loadingOverlayComponent_1.LoadingOverlayComponent,
|
21952 | agNoRowsOverlay: noRowsOverlayComponent_1.NoRowsOverlayComponent
|
21953 | };
|
21954 | this.agDeprecatedNames = {
|
21955 | set: {
|
21956 | newComponentName: 'agSetColumnFilter',
|
21957 | propertyHolder: 'filter'
|
21958 | },
|
21959 | text: {
|
21960 | newComponentName: 'agTextColumnFilter',
|
21961 | propertyHolder: 'filter'
|
21962 | },
|
21963 | number: {
|
21964 | newComponentName: 'agNumberColumnFilter',
|
21965 | propertyHolder: 'filter'
|
21966 | },
|
21967 | date: {
|
21968 | newComponentName: 'agDateColumnFilter',
|
21969 | propertyHolder: 'filter'
|
21970 | },
|
21971 | group: {
|
21972 | newComponentName: 'agGroupCellRenderer',
|
21973 | propertyHolder: 'cellRenderer'
|
21974 | },
|
21975 | animateShowChange: {
|
21976 | newComponentName: 'agAnimateShowChangeCellRenderer',
|
21977 | propertyHolder: 'cellRenderer'
|
21978 | },
|
21979 | animateSlide: {
|
21980 | newComponentName: 'agAnimateSlideCellRenderer',
|
21981 | propertyHolder: 'cellRenderer'
|
21982 | },
|
21983 | select: {
|
21984 | newComponentName: 'agSelectCellEditor',
|
21985 | propertyHolder: 'cellEditor'
|
21986 | },
|
21987 | largeText: {
|
21988 | newComponentName: 'agLargeTextCellEditor',
|
21989 | propertyHolder: 'cellEditor'
|
21990 | },
|
21991 | popupSelect: {
|
21992 | newComponentName: 'agPopupSelectCellEditor',
|
21993 | propertyHolder: 'cellEditor'
|
21994 | },
|
21995 | popupText: {
|
21996 | newComponentName: 'agPopupTextCellEditor',
|
21997 | propertyHolder: 'cellEditor'
|
21998 | },
|
21999 | richSelect: {
|
22000 | newComponentName: 'agRichSelectCellEditor',
|
22001 | propertyHolder: 'cellEditor'
|
22002 | },
|
22003 | headerComponent: {
|
22004 | newComponentName: 'agColumnHeader',
|
22005 | propertyHolder: 'headerComponent'
|
22006 | }
|
22007 | };
|
22008 | this.jsComponents = {};
|
22009 | this.frameworkComponents = {};
|
22010 | }
|
22011 | ComponentProvider.prototype.init = function () {
|
22012 | var _this = this;
|
22013 | if (this.gridOptions.components != null) {
|
22014 | Object.keys(this.gridOptions.components).forEach(function (it) {
|
22015 | _this.registerComponent(it, _this.gridOptions.components[it]);
|
22016 | });
|
22017 | }
|
22018 | if (this.gridOptions.frameworkComponents != null) {
|
22019 | Object.keys(this.gridOptions.frameworkComponents).forEach(function (it) {
|
22020 | _this.registerFwComponent(it, _this.gridOptions.frameworkComponents[it]);
|
22021 | });
|
22022 | }
|
22023 | };
|
22024 | ComponentProvider.prototype.registerDefaultComponent = function (rawName, component, overridable) {
|
22025 | if (overridable === void 0) { overridable = true; }
|
22026 | var name = this.translateIfDeprecated(rawName);
|
22027 | if (this.agGridDefaults[name]) {
|
22028 | console.error("Trying to overwrite a default component. You should call registerComponent");
|
22029 | return;
|
22030 | }
|
22031 | this.agGridDefaults[name] = component;
|
22032 | };
|
22033 | ComponentProvider.prototype.registerComponent = function (rawName, component) {
|
22034 | var name = this.translateIfDeprecated(rawName);
|
22035 | if (this.frameworkComponents[name]) {
|
22036 | console.error("Trying to register a component that you have already registered for frameworks: " + name);
|
22037 | return;
|
22038 | }
|
22039 | this.jsComponents[name] = component;
|
22040 | };
|
22041 | |
22042 |
|
22043 |
|
22044 |
|
22045 | ComponentProvider.prototype.registerFwComponent = function (rawName, component) {
|
22046 | var name = this.translateIfDeprecated(rawName);
|
22047 | if (this.jsComponents[name]) {
|
22048 | console.error("Trying to register a component that you have already registered for plain javascript: " + name);
|
22049 | return;
|
22050 | }
|
22051 | this.frameworkComponents[name] = component;
|
22052 | };
|
22053 | |
22054 |
|
22055 |
|
22056 |
|
22057 | ComponentProvider.prototype.retrieve = function (rawName) {
|
22058 | var name = this.translateIfDeprecated(rawName);
|
22059 | if (this.frameworkComponents[name]) {
|
22060 | return {
|
22061 | type: componentResolver_1.ComponentType.FRAMEWORK,
|
22062 | component: this.frameworkComponents[name],
|
22063 | source: RegisteredComponentSource.REGISTERED
|
22064 | };
|
22065 | }
|
22066 | if (this.jsComponents[name]) {
|
22067 | return {
|
22068 | type: componentResolver_1.ComponentType.AG_GRID,
|
22069 | component: this.jsComponents[name],
|
22070 | source: RegisteredComponentSource.REGISTERED
|
22071 | };
|
22072 | }
|
22073 | if (this.agGridDefaults[name]) {
|
22074 | return this.agGridDefaults[name] ?
|
22075 | {
|
22076 | type: componentResolver_1.ComponentType.AG_GRID,
|
22077 | component: this.agGridDefaults[name],
|
22078 | source: RegisteredComponentSource.DEFAULT
|
22079 | } :
|
22080 | null;
|
22081 | }
|
22082 | if (Object.keys(this.agGridDefaults).indexOf(name) < 0) {
|
22083 | console.warn("ag-grid: Looking for component [" + name + "] but it wasn't found.");
|
22084 | }
|
22085 | return null;
|
22086 | };
|
22087 | ComponentProvider.prototype.translateIfDeprecated = function (raw) {
|
22088 | var deprecatedInfo = this.agDeprecatedNames[raw];
|
22089 | if (deprecatedInfo != null) {
|
22090 | utils_1._.doOnce(function () {
|
22091 | console.warn("ag-grid. Since v15.0 component names have been renamed to be namespaced. You should rename " + deprecatedInfo.propertyHolder + ":" + raw + " to " + deprecatedInfo.propertyHolder + ":" + deprecatedInfo.newComponentName);
|
22092 | }, 'DEPREACTE_COMPONENT_' + raw);
|
22093 | return deprecatedInfo.newComponentName;
|
22094 | }
|
22095 | return raw;
|
22096 | };
|
22097 | __decorate([
|
22098 | context_1.Autowired('gridOptions'),
|
22099 | __metadata("design:type", Object)
|
22100 | ], ComponentProvider.prototype, "gridOptions", void 0);
|
22101 | __decorate([
|
22102 | context_1.PostConstruct,
|
22103 | __metadata("design:type", Function),
|
22104 | __metadata("design:paramtypes", []),
|
22105 | __metadata("design:returntype", void 0)
|
22106 | ], ComponentProvider.prototype, "init", null);
|
22107 | ComponentProvider = __decorate([
|
22108 | context_1.Bean('componentProvider')
|
22109 | ], ComponentProvider);
|
22110 | return ComponentProvider;
|
22111 | }());
|
22112 | exports.ComponentProvider = ComponentProvider;
|
22113 |
|
22114 |
|
22115 | }),
|
22116 |
|
22117 | (function(module, exports, __webpack_require__) {
|
22118 |
|
22119 | "use strict";
|
22120 |
|
22121 |
|
22122 |
|
22123 |
|
22124 |
|
22125 |
|
22126 |
|
22127 | var __extends = (this && this.__extends) || (function () {
|
22128 | var extendStatics = Object.setPrototypeOf ||
|
22129 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
22130 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
22131 | return function (d, b) {
|
22132 | extendStatics(d, b);
|
22133 | function __() { this.constructor = d; }
|
22134 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
22135 | };
|
22136 | })();
|
22137 | Object.defineProperty(exports, "__esModule", { value: true });
|
22138 | var constants_1 = __webpack_require__(9);
|
22139 | var component_1 = __webpack_require__(8);
|
22140 | var utils_1 = __webpack_require__(1);
|
22141 | var TextCellEditor = (function (_super) {
|
22142 | __extends(TextCellEditor, _super);
|
22143 | function TextCellEditor() {
|
22144 | return _super.call(this, TextCellEditor.TEMPLATE) || this;
|
22145 | }
|
22146 | TextCellEditor.prototype.init = function (params) {
|
22147 | this.params = params;
|
22148 | var eInput = this.getGui();
|
22149 | var startValue;
|
22150 |
|
22151 | if (params.cellStartedEdit) {
|
22152 | this.focusAfterAttached = true;
|
22153 | var keyPressBackspaceOrDelete = params.keyPress === constants_1.Constants.KEY_BACKSPACE
|
22154 | || params.keyPress === constants_1.Constants.KEY_DELETE;
|
22155 | if (keyPressBackspaceOrDelete) {
|
22156 | startValue = '';
|
22157 | }
|
22158 | else if (params.charPress) {
|
22159 | startValue = params.charPress;
|
22160 | }
|
22161 | else {
|
22162 | startValue = this.getStartValue(params);
|
22163 | if (params.keyPress !== constants_1.Constants.KEY_F2) {
|
22164 | this.highlightAllOnFocus = true;
|
22165 | }
|
22166 | }
|
22167 | }
|
22168 | else {
|
22169 | this.focusAfterAttached = false;
|
22170 | startValue = this.getStartValue(params);
|
22171 | }
|
22172 | if (utils_1.Utils.exists(startValue)) {
|
22173 | eInput.value = startValue;
|
22174 | }
|
22175 | this.addDestroyableEventListener(eInput, 'keydown', function (event) {
|
22176 | var isNavigationKey = event.keyCode === constants_1.Constants.KEY_LEFT
|
22177 | || event.keyCode === constants_1.Constants.KEY_RIGHT
|
22178 | || event.keyCode === constants_1.Constants.KEY_UP
|
22179 | || event.keyCode === constants_1.Constants.KEY_DOWN
|
22180 | || event.keyCode === constants_1.Constants.KEY_PAGE_DOWN
|
22181 | || event.keyCode === constants_1.Constants.KEY_PAGE_UP
|
22182 | || event.keyCode === constants_1.Constants.KEY_PAGE_HOME
|
22183 | || event.keyCode === constants_1.Constants.KEY_PAGE_END;
|
22184 | if (isNavigationKey) {
|
22185 |
|
22186 | event.stopPropagation();
|
22187 |
|
22188 | var pageUp = event.keyCode === constants_1.Constants.KEY_PAGE_UP;
|
22189 | var pageDown = event.keyCode === constants_1.Constants.KEY_PAGE_DOWN;
|
22190 | if (pageUp || pageDown) {
|
22191 | event.preventDefault();
|
22192 | }
|
22193 | }
|
22194 | });
|
22195 | };
|
22196 | TextCellEditor.prototype.afterGuiAttached = function () {
|
22197 | if (!this.focusAfterAttached) {
|
22198 | return;
|
22199 | }
|
22200 | var eInput = this.getGui();
|
22201 | eInput.focus();
|
22202 | if (this.highlightAllOnFocus) {
|
22203 | eInput.select();
|
22204 | }
|
22205 | else {
|
22206 |
|
22207 |
|
22208 |
|
22209 |
|
22210 | var length_1 = eInput.value ? eInput.value.length : 0;
|
22211 | if (length_1 > 0) {
|
22212 | eInput.setSelectionRange(length_1, length_1);
|
22213 | }
|
22214 | }
|
22215 | };
|
22216 |
|
22217 | TextCellEditor.prototype.focusIn = function () {
|
22218 | var eInput = this.getGui();
|
22219 | eInput.focus();
|
22220 | eInput.select();
|
22221 | };
|
22222 | TextCellEditor.prototype.getValue = function () {
|
22223 | var eInput = this.getGui();
|
22224 | return this.params.parseValue(eInput.value);
|
22225 | };
|
22226 | TextCellEditor.prototype.getStartValue = function (params) {
|
22227 | var formatValue = params.useFormatter || params.column.getColDef().refData;
|
22228 | return formatValue ? params.formatValue(params.value) : params.value;
|
22229 | };
|
22230 | TextCellEditor.TEMPLATE = '<input class="ag-cell-edit-input" type="text"/>';
|
22231 | return TextCellEditor;
|
22232 | }(component_1.Component));
|
22233 | exports.TextCellEditor = TextCellEditor;
|
22234 |
|
22235 |
|
22236 | }),
|
22237 |
|
22238 | (function(module, exports, __webpack_require__) {
|
22239 |
|
22240 | "use strict";
|
22241 |
|
22242 |
|
22243 |
|
22244 |
|
22245 |
|
22246 |
|
22247 |
|
22248 | var __extends = (this && this.__extends) || (function () {
|
22249 | var extendStatics = Object.setPrototypeOf ||
|
22250 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
22251 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
22252 | return function (d, b) {
|
22253 | extendStatics(d, b);
|
22254 | function __() { this.constructor = d; }
|
22255 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
22256 | };
|
22257 | })();
|
22258 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
22259 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
22260 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
22261 | 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;
|
22262 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
22263 | };
|
22264 | var __metadata = (this && this.__metadata) || function (k, v) {
|
22265 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
22266 | };
|
22267 | Object.defineProperty(exports, "__esModule", { value: true });
|
22268 | var component_1 = __webpack_require__(8);
|
22269 | var componentAnnotations_1 = __webpack_require__(11);
|
22270 | var utils_1 = __webpack_require__(1);
|
22271 | var baseFilter_1 = __webpack_require__(51);
|
22272 | var context_1 = __webpack_require__(0);
|
22273 | var componentRecipes_1 = __webpack_require__(21);
|
22274 | var DateFilter = (function (_super) {
|
22275 | __extends(DateFilter, _super);
|
22276 | function DateFilter() {
|
22277 | return _super !== null && _super.apply(this, arguments) || this;
|
22278 | }
|
22279 | DateFilter.prototype.modelFromFloatingFilter = function (from) {
|
22280 | return {
|
22281 | dateFrom: from,
|
22282 | dateTo: this.getDateTo(),
|
22283 | type: this.filter,
|
22284 | filterType: 'date'
|
22285 | };
|
22286 | };
|
22287 | DateFilter.prototype.getApplicableFilterTypes = function () {
|
22288 | return [baseFilter_1.BaseFilter.EQUALS, baseFilter_1.BaseFilter.GREATER_THAN, baseFilter_1.BaseFilter.LESS_THAN, baseFilter_1.BaseFilter.NOT_EQUAL, baseFilter_1.BaseFilter.IN_RANGE];
|
22289 | };
|
22290 | DateFilter.prototype.bodyTemplate = function (type) {
|
22291 | var fromPanelId = type == baseFilter_1.FilterConditionType.MAIN ? "filterDateFromPanel" : "filterDateFromConditionPanel";
|
22292 | var toPanelId = type == baseFilter_1.FilterConditionType.MAIN ? "filterDateToPanel" : "filterDateToConditionPanel";
|
22293 | return "<div class=\"ag-filter-body\">\n <div class=\"ag-filter-date-from\" id=\"" + fromPanelId + "\">\n </div>\n <div class=\"ag-filter-date-to\" id=\"" + toPanelId + "\">\n </div>\n </div>";
|
22294 | };
|
22295 | DateFilter.prototype.initialiseFilterBodyUi = function (type) {
|
22296 | _super.prototype.initialiseFilterBodyUi.call(this, type);
|
22297 | this.createComponents(type);
|
22298 | if (type === baseFilter_1.FilterConditionType.MAIN) {
|
22299 | this.setDateFrom_date(this.dateFrom, baseFilter_1.FilterConditionType.MAIN);
|
22300 | this.setDateTo_date(this.dateTo, baseFilter_1.FilterConditionType.MAIN);
|
22301 | this.setFilterType(this.filterCondition, baseFilter_1.FilterConditionType.MAIN);
|
22302 | }
|
22303 | else {
|
22304 | this.setDateFrom_date(this.dateFromCondition, baseFilter_1.FilterConditionType.CONDITION);
|
22305 | this.setDateTo_date(this.dateToCondition, baseFilter_1.FilterConditionType.CONDITION);
|
22306 | this.setFilterType(this.filterCondition, baseFilter_1.FilterConditionType.CONDITION);
|
22307 | }
|
22308 | };
|
22309 | DateFilter.prototype.createComponents = function (type) {
|
22310 | var _this = this;
|
22311 | var dateComponentParams = {
|
22312 | onDateChanged: function () { _this.onDateChanged(type); },
|
22313 | filterParams: this.filterParams
|
22314 | };
|
22315 | this.componentRecipes.newDateComponent(dateComponentParams).then(function (dateToComponent) {
|
22316 | if (type === baseFilter_1.FilterConditionType.MAIN) {
|
22317 | _this.dateToComponent = dateToComponent;
|
22318 | }
|
22319 | else {
|
22320 | _this.dateToConditionComponent = dateToComponent;
|
22321 | }
|
22322 | var dateToElement = dateToComponent.getGui();
|
22323 | if (type === baseFilter_1.FilterConditionType.MAIN) {
|
22324 | _this.eDateToPanel.appendChild(dateToElement);
|
22325 | if (_this.dateToComponent.afterGuiAttached) {
|
22326 | _this.dateToComponent.afterGuiAttached();
|
22327 | }
|
22328 | }
|
22329 | else {
|
22330 | _this.eDateToConditionPanel.appendChild(dateToElement);
|
22331 | if (_this.dateToConditionComponent.afterGuiAttached) {
|
22332 | _this.dateToConditionComponent.afterGuiAttached();
|
22333 | }
|
22334 | }
|
22335 | });
|
22336 | this.componentRecipes.newDateComponent(dateComponentParams).then(function (dateComponent) {
|
22337 | if (type === baseFilter_1.FilterConditionType.MAIN) {
|
22338 | _this.dateFromComponent = dateComponent;
|
22339 | }
|
22340 | else {
|
22341 | _this.dateFromConditionComponent = dateComponent;
|
22342 | }
|
22343 | var dateFromElement = dateComponent.getGui();
|
22344 | if (type === baseFilter_1.FilterConditionType.MAIN) {
|
22345 | _this.eDateFromPanel.appendChild(dateFromElement);
|
22346 | if (_this.dateFromComponent.afterGuiAttached) {
|
22347 | _this.dateFromComponent.afterGuiAttached();
|
22348 | }
|
22349 | }
|
22350 | else {
|
22351 | _this.eDateFromConditionPanel.appendChild(dateFromElement);
|
22352 | if (_this.dateFromConditionComponent.afterGuiAttached) {
|
22353 | _this.dateFromConditionComponent.afterGuiAttached();
|
22354 | }
|
22355 | }
|
22356 | });
|
22357 | };
|
22358 | DateFilter.prototype.onDateChanged = function (type) {
|
22359 | if (type === baseFilter_1.FilterConditionType.MAIN) {
|
22360 | this.dateFrom = DateFilter.removeTimezone(this.dateFromComponent.getDate());
|
22361 | this.dateTo = DateFilter.removeTimezone(this.dateToComponent.getDate());
|
22362 | }
|
22363 | else {
|
22364 | this.dateFromCondition = DateFilter.removeTimezone(this.dateFromComponent.getDate());
|
22365 | this.dateToCondition = DateFilter.removeTimezone(this.dateToComponent.getDate());
|
22366 | }
|
22367 | this.onFilterChanged();
|
22368 | };
|
22369 | DateFilter.prototype.refreshFilterBodyUi = function (type) {
|
22370 | var panel;
|
22371 | var filterTypeValue;
|
22372 | if (type === baseFilter_1.FilterConditionType.MAIN) {
|
22373 | panel = this.eDateToPanel;
|
22374 | filterTypeValue = this.filter;
|
22375 | }
|
22376 | else {
|
22377 | panel = this.eDateToConditionPanel;
|
22378 | filterTypeValue = this.filterCondition;
|
22379 | }
|
22380 | if (!panel)
|
22381 | return;
|
22382 | var visible = filterTypeValue === baseFilter_1.BaseFilter.IN_RANGE;
|
22383 | utils_1.Utils.setVisible(panel, visible);
|
22384 | };
|
22385 | DateFilter.prototype.comparator = function () {
|
22386 | return this.filterParams.comparator ? this.filterParams.comparator : this.defaultComparator.bind(this);
|
22387 | };
|
22388 | DateFilter.prototype.defaultComparator = function (filterDate, cellValue) {
|
22389 |
|
22390 | var cellAsDate = cellValue;
|
22391 | if (cellAsDate < filterDate) {
|
22392 | return -1;
|
22393 | }
|
22394 | if (cellAsDate > filterDate) {
|
22395 | return 1;
|
22396 | }
|
22397 | return cellValue != null ? 0 : -1;
|
22398 | };
|
22399 | DateFilter.prototype.serialize = function (type) {
|
22400 | var dateToComponent = type === baseFilter_1.FilterConditionType.MAIN ? this.dateToComponent : this.dateToConditionComponent;
|
22401 | var dateFromComponent = type === baseFilter_1.FilterConditionType.MAIN ? this.dateFromComponent : this.dateFromConditionComponent;
|
22402 | var filterType = type === baseFilter_1.FilterConditionType.MAIN ? this.filter : this.filterCondition;
|
22403 | return {
|
22404 | dateTo: utils_1.Utils.serializeDateToYyyyMmDd(dateToComponent.getDate(), "-"),
|
22405 | dateFrom: utils_1.Utils.serializeDateToYyyyMmDd(dateFromComponent.getDate(), "-"),
|
22406 | type: filterType ? filterType : this.defaultFilter,
|
22407 | filterType: 'date'
|
22408 | };
|
22409 | };
|
22410 | DateFilter.prototype.filterValues = function (type) {
|
22411 | if (type === baseFilter_1.FilterConditionType.MAIN) {
|
22412 | if (!this.dateFromComponent)
|
22413 | return null;
|
22414 | return this.filter !== baseFilter_1.BaseFilter.IN_RANGE ?
|
22415 | this.dateFromComponent.getDate() :
|
22416 | [this.dateFromComponent.getDate(), this.dateToComponent.getDate()];
|
22417 | }
|
22418 | if (!this.dateFromConditionComponent)
|
22419 | return null;
|
22420 | return this.filterCondition !== baseFilter_1.BaseFilter.IN_RANGE ?
|
22421 | this.dateFromConditionComponent.getDate() :
|
22422 | [this.dateFromConditionComponent.getDate(), this.dateToConditionComponent.getDate()];
|
22423 | };
|
22424 |
|
22425 | DateFilter.prototype.getDateFrom = function () {
|
22426 | return utils_1.Utils.serializeDateToYyyyMmDd(this.dateFromComponent.getDate(), "-");
|
22427 | };
|
22428 |
|
22429 | DateFilter.prototype.getDateTo = function () {
|
22430 | return utils_1.Utils.serializeDateToYyyyMmDd(this.dateToComponent.getDate(), "-");
|
22431 | };
|
22432 |
|
22433 | DateFilter.prototype.getFilterType = function () {
|
22434 | return this.filter;
|
22435 | };
|
22436 | DateFilter.prototype.setDateFrom = function (date, type) {
|
22437 | var parsedDate = utils_1.Utils.parseYyyyMmDdToDate(date, "-");
|
22438 | this.setDateFrom_date(parsedDate, type);
|
22439 | };
|
22440 | DateFilter.prototype.setDateFrom_date = function (parsedDate, type) {
|
22441 | if (type === baseFilter_1.FilterConditionType.MAIN) {
|
22442 | this.dateFrom = parsedDate;
|
22443 | if (!this.dateFromComponent)
|
22444 | return;
|
22445 | this.dateFromComponent.setDate(this.dateFrom);
|
22446 | }
|
22447 | else {
|
22448 | this.dateFromCondition = parsedDate;
|
22449 | if (!this.dateFromConditionComponent)
|
22450 | return;
|
22451 | this.dateFromConditionComponent.setDate(this.dateFromCondition);
|
22452 | }
|
22453 | };
|
22454 | DateFilter.prototype.setDateTo = function (date, type) {
|
22455 | var parsedDate = utils_1.Utils.parseYyyyMmDdToDate(date, "-");
|
22456 | this.setDateTo_date(parsedDate, type);
|
22457 | };
|
22458 | DateFilter.prototype.setDateTo_date = function (parsedDate, type) {
|
22459 | if (type === baseFilter_1.FilterConditionType.MAIN) {
|
22460 | this.dateTo = parsedDate;
|
22461 | if (!this.dateToComponent)
|
22462 | return;
|
22463 | this.dateToComponent.setDate(this.dateTo);
|
22464 | }
|
22465 | else {
|
22466 | this.dateToCondition = parsedDate;
|
22467 | if (!this.dateToConditionComponent)
|
22468 | return;
|
22469 | this.dateToConditionComponent.setDate(this.dateToCondition);
|
22470 | }
|
22471 | };
|
22472 | DateFilter.prototype.resetState = function () {
|
22473 | this.setDateFrom(null, baseFilter_1.FilterConditionType.MAIN);
|
22474 | this.setDateTo(null, baseFilter_1.FilterConditionType.MAIN);
|
22475 | this.setFilterType(this.defaultFilter, baseFilter_1.FilterConditionType.MAIN);
|
22476 | this.setDateFrom(null, baseFilter_1.FilterConditionType.CONDITION);
|
22477 | this.setDateTo(null, baseFilter_1.FilterConditionType.CONDITION);
|
22478 | this.setFilterType(this.defaultFilter, baseFilter_1.FilterConditionType.MAIN);
|
22479 | };
|
22480 | DateFilter.prototype.parse = function (model, type) {
|
22481 | this.setDateFrom(model.dateFrom, type);
|
22482 | this.setDateTo(model.dateTo, type);
|
22483 | this.setFilterType(model.type, type);
|
22484 | };
|
22485 | DateFilter.prototype.setType = function (filterType, type) {
|
22486 | this.setFilterType(filterType, type);
|
22487 | };
|
22488 | DateFilter.removeTimezone = function (from) {
|
22489 | if (!from) {
|
22490 | return null;
|
22491 | }
|
22492 | return new Date(from.getFullYear(), from.getMonth(), from.getDate());
|
22493 | };
|
22494 | __decorate([
|
22495 | context_1.Autowired('componentRecipes'),
|
22496 | __metadata("design:type", componentRecipes_1.ComponentRecipes)
|
22497 | ], DateFilter.prototype, "componentRecipes", void 0);
|
22498 | __decorate([
|
22499 | componentAnnotations_1.QuerySelector('#filterDateFromPanel'),
|
22500 | __metadata("design:type", HTMLElement)
|
22501 | ], DateFilter.prototype, "eDateFromPanel", void 0);
|
22502 | __decorate([
|
22503 | componentAnnotations_1.QuerySelector('#filterDateFromConditionPanel'),
|
22504 | __metadata("design:type", HTMLElement)
|
22505 | ], DateFilter.prototype, "eDateFromConditionPanel", void 0);
|
22506 | __decorate([
|
22507 | componentAnnotations_1.QuerySelector('#filterDateToPanel'),
|
22508 | __metadata("design:type", HTMLElement)
|
22509 | ], DateFilter.prototype, "eDateToPanel", void 0);
|
22510 | __decorate([
|
22511 | componentAnnotations_1.QuerySelector('#filterDateToConditionPanel'),
|
22512 | __metadata("design:type", HTMLElement)
|
22513 | ], DateFilter.prototype, "eDateToConditionPanel", void 0);
|
22514 | return DateFilter;
|
22515 | }(baseFilter_1.ScalarBaseFilter));
|
22516 | exports.DateFilter = DateFilter;
|
22517 | var DefaultDateComponent = (function (_super) {
|
22518 | __extends(DefaultDateComponent, _super);
|
22519 | function DefaultDateComponent() {
|
22520 | return _super.call(this, "<input class=\"ag-filter-filter\" type=\"text\" placeholder=\"yyyy-mm-dd\">") || this;
|
22521 | }
|
22522 | DefaultDateComponent.prototype.init = function (params) {
|
22523 | this.eDateInput = this.getGui();
|
22524 | if (utils_1.Utils.isBrowserChrome() || params.filterParams.browserDatePicker) {
|
22525 | if (utils_1.Utils.isBrowserIE()) {
|
22526 | console.warn('ag-grid: browserDatePicker is specified to true, but it is not supported in IE 11, reverting to plain text date picker');
|
22527 | }
|
22528 | else {
|
22529 | this.eDateInput.type = 'date';
|
22530 | }
|
22531 | }
|
22532 | this.listener = params.onDateChanged;
|
22533 | this.addGuiEventListener('input', this.listener);
|
22534 | };
|
22535 | DefaultDateComponent.prototype.getDate = function () {
|
22536 | return utils_1.Utils.parseYyyyMmDdToDate(this.eDateInput.value, "-");
|
22537 | };
|
22538 | DefaultDateComponent.prototype.setDate = function (date) {
|
22539 | this.eDateInput.value = utils_1.Utils.serializeDateToYyyyMmDd(date, "-");
|
22540 | };
|
22541 | return DefaultDateComponent;
|
22542 | }(component_1.Component));
|
22543 | exports.DefaultDateComponent = DefaultDateComponent;
|
22544 |
|
22545 |
|
22546 | }),
|
22547 |
|
22548 | (function(module, exports, __webpack_require__) {
|
22549 |
|
22550 | "use strict";
|
22551 |
|
22552 |
|
22553 |
|
22554 |
|
22555 |
|
22556 |
|
22557 |
|
22558 | var __extends = (this && this.__extends) || (function () {
|
22559 | var extendStatics = Object.setPrototypeOf ||
|
22560 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
22561 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
22562 | return function (d, b) {
|
22563 | extendStatics(d, b);
|
22564 | function __() { this.constructor = d; }
|
22565 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
22566 | };
|
22567 | })();
|
22568 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
22569 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
22570 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
22571 | 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;
|
22572 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
22573 | };
|
22574 | var __metadata = (this && this.__metadata) || function (k, v) {
|
22575 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
22576 | };
|
22577 | Object.defineProperty(exports, "__esModule", { value: true });
|
22578 | var component_1 = __webpack_require__(8);
|
22579 | var context_1 = __webpack_require__(0);
|
22580 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
22581 | var PopupEditorWrapper = (function (_super) {
|
22582 | __extends(PopupEditorWrapper, _super);
|
22583 | function PopupEditorWrapper(cellEditor) {
|
22584 | var _this = _super.call(this, "<div class=\"ag-popup-editor\" tabindex=\"-1\"/>") || this;
|
22585 | _this.getGuiCalledOnChild = false;
|
22586 | _this.cellEditor = cellEditor;
|
22587 | return _this;
|
22588 | }
|
22589 | PopupEditorWrapper.prototype.onKeyDown = function (event) {
|
22590 | this.params.onKeyDown(event);
|
22591 | };
|
22592 | PopupEditorWrapper.prototype.getGui = function () {
|
22593 |
|
22594 |
|
22595 | if (!this.getGuiCalledOnChild) {
|
22596 | this.appendChild(this.cellEditor.getGui());
|
22597 | this.getGuiCalledOnChild = true;
|
22598 | }
|
22599 | return _super.prototype.getGui.call(this);
|
22600 | };
|
22601 | PopupEditorWrapper.prototype.init = function (params) {
|
22602 | var _this = this;
|
22603 | this.params = params;
|
22604 | this.gridOptionsWrapper.setDomData(this.getGui(), PopupEditorWrapper.DOM_KEY_POPUP_EDITOR_WRAPPER, true);
|
22605 | this.addDestroyFunc(function () {
|
22606 | if (_this.cellEditor.destroy) {
|
22607 | _this.cellEditor.destroy();
|
22608 | }
|
22609 | });
|
22610 | this.addDestroyableEventListener(
|
22611 |
|
22612 |
|
22613 |
|
22614 | _super.prototype.getGui.call(this), 'keydown', this.onKeyDown.bind(this));
|
22615 | };
|
22616 | PopupEditorWrapper.prototype.afterGuiAttached = function () {
|
22617 | if (this.cellEditor.afterGuiAttached) {
|
22618 | this.cellEditor.afterGuiAttached();
|
22619 | }
|
22620 | };
|
22621 | PopupEditorWrapper.prototype.getValue = function () {
|
22622 | return this.cellEditor.getValue();
|
22623 | };
|
22624 | PopupEditorWrapper.prototype.isPopup = function () {
|
22625 | return true;
|
22626 | };
|
22627 | PopupEditorWrapper.prototype.isCancelBeforeStart = function () {
|
22628 | if (this.cellEditor.isCancelBeforeStart) {
|
22629 | return this.cellEditor.isCancelBeforeStart();
|
22630 | }
|
22631 | };
|
22632 | PopupEditorWrapper.prototype.isCancelAfterEnd = function () {
|
22633 | if (this.cellEditor.isCancelAfterEnd) {
|
22634 | return this.cellEditor.isCancelAfterEnd();
|
22635 | }
|
22636 | };
|
22637 | PopupEditorWrapper.prototype.focusIn = function () {
|
22638 | if (this.cellEditor.focusIn) {
|
22639 | this.cellEditor.focusIn();
|
22640 | }
|
22641 | };
|
22642 | PopupEditorWrapper.prototype.focusOut = function () {
|
22643 | if (this.cellEditor.focusOut) {
|
22644 | this.cellEditor.focusOut();
|
22645 | }
|
22646 | };
|
22647 | PopupEditorWrapper.DOM_KEY_POPUP_EDITOR_WRAPPER = 'popupEditorWrapper';
|
22648 | __decorate([
|
22649 | context_1.Autowired('gridOptionsWrapper'),
|
22650 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
22651 | ], PopupEditorWrapper.prototype, "gridOptionsWrapper", void 0);
|
22652 | return PopupEditorWrapper;
|
22653 | }(component_1.Component));
|
22654 | exports.PopupEditorWrapper = PopupEditorWrapper;
|
22655 |
|
22656 |
|
22657 | }),
|
22658 |
|
22659 | (function(module, exports, __webpack_require__) {
|
22660 |
|
22661 | "use strict";
|
22662 |
|
22663 |
|
22664 |
|
22665 |
|
22666 |
|
22667 |
|
22668 |
|
22669 | var __extends = (this && this.__extends) || (function () {
|
22670 | var extendStatics = Object.setPrototypeOf ||
|
22671 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
22672 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
22673 | return function (d, b) {
|
22674 | extendStatics(d, b);
|
22675 | function __() { this.constructor = d; }
|
22676 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
22677 | };
|
22678 | })();
|
22679 | Object.defineProperty(exports, "__esModule", { value: true });
|
22680 | var utils_1 = __webpack_require__(1);
|
22681 | var component_1 = __webpack_require__(8);
|
22682 | var AnimateSlideCellRenderer = (function (_super) {
|
22683 | __extends(AnimateSlideCellRenderer, _super);
|
22684 | function AnimateSlideCellRenderer() {
|
22685 | var _this = _super.call(this, AnimateSlideCellRenderer.TEMPLATE) || this;
|
22686 | _this.refreshCount = 0;
|
22687 | _this.eCurrent = _this.queryForHtmlElement('.ag-value-slide-current');
|
22688 | return _this;
|
22689 | }
|
22690 | AnimateSlideCellRenderer.prototype.init = function (params) {
|
22691 | this.params = params;
|
22692 | this.refresh(params);
|
22693 | };
|
22694 | AnimateSlideCellRenderer.prototype.addSlideAnimation = function () {
|
22695 | var _this = this;
|
22696 | this.refreshCount++;
|
22697 |
|
22698 |
|
22699 |
|
22700 | var refreshCountCopy = this.refreshCount;
|
22701 |
|
22702 | if (this.ePrevious) {
|
22703 | this.getGui().removeChild(this.ePrevious);
|
22704 | }
|
22705 | this.ePrevious = utils_1.Utils.loadTemplate('<span class="ag-value-slide-previous ag-value-slide-out"></span>');
|
22706 | this.ePrevious.innerHTML = this.eCurrent.innerHTML;
|
22707 | this.getGui().insertBefore(this.ePrevious, this.eCurrent);
|
22708 |
|
22709 |
|
22710 |
|
22711 | setTimeout(function () {
|
22712 | if (refreshCountCopy !== _this.refreshCount) {
|
22713 | return;
|
22714 | }
|
22715 | utils_1.Utils.addCssClass(_this.ePrevious, 'ag-value-slide-out-end');
|
22716 | }, 50);
|
22717 | setTimeout(function () {
|
22718 | if (refreshCountCopy !== _this.refreshCount) {
|
22719 | return;
|
22720 | }
|
22721 | _this.getGui().removeChild(_this.ePrevious);
|
22722 | _this.ePrevious = null;
|
22723 | }, 3000);
|
22724 | };
|
22725 | AnimateSlideCellRenderer.prototype.refresh = function (params) {
|
22726 | var value = params.value;
|
22727 | if (utils_1.Utils.missing(value)) {
|
22728 | value = '';
|
22729 | }
|
22730 | if (value === this.lastValue) {
|
22731 | return;
|
22732 | }
|
22733 | this.addSlideAnimation();
|
22734 | this.lastValue = value;
|
22735 | if (utils_1.Utils.exists(params.valueFormatted)) {
|
22736 | this.eCurrent.innerHTML = params.valueFormatted;
|
22737 | }
|
22738 | else if (utils_1.Utils.exists(params.value)) {
|
22739 | this.eCurrent.innerHTML = value;
|
22740 | }
|
22741 | else {
|
22742 | this.eCurrent.innerHTML = '';
|
22743 | }
|
22744 | return true;
|
22745 | };
|
22746 | AnimateSlideCellRenderer.TEMPLATE = '<span>' +
|
22747 | '<span class="ag-value-slide-current"></span>' +
|
22748 | '</span>';
|
22749 | return AnimateSlideCellRenderer;
|
22750 | }(component_1.Component));
|
22751 | exports.AnimateSlideCellRenderer = AnimateSlideCellRenderer;
|
22752 |
|
22753 |
|
22754 | }),
|
22755 |
|
22756 | (function(module, exports, __webpack_require__) {
|
22757 |
|
22758 | "use strict";
|
22759 |
|
22760 |
|
22761 |
|
22762 |
|
22763 |
|
22764 |
|
22765 |
|
22766 | var __extends = (this && this.__extends) || (function () {
|
22767 | var extendStatics = Object.setPrototypeOf ||
|
22768 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
22769 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
22770 | return function (d, b) {
|
22771 | extendStatics(d, b);
|
22772 | function __() { this.constructor = d; }
|
22773 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
22774 | };
|
22775 | })();
|
22776 | Object.defineProperty(exports, "__esModule", { value: true });
|
22777 | var utils_1 = __webpack_require__(1);
|
22778 | var component_1 = __webpack_require__(8);
|
22779 | var ARROW_UP = '↑';
|
22780 | var ARROW_DOWN = '↓';
|
22781 | var AnimateShowChangeCellRenderer = (function (_super) {
|
22782 | __extends(AnimateShowChangeCellRenderer, _super);
|
22783 | function AnimateShowChangeCellRenderer() {
|
22784 | var _this = _super.call(this, AnimateShowChangeCellRenderer.TEMPLATE) || this;
|
22785 | _this.refreshCount = 0;
|
22786 | return _this;
|
22787 | }
|
22788 | AnimateShowChangeCellRenderer.prototype.init = function (params) {
|
22789 |
|
22790 | this.eValue = this.queryForHtmlElement('.ag-value-change-value');
|
22791 | this.eDelta = this.queryForHtmlElement('.ag-value-change-delta');
|
22792 | this.refresh(params);
|
22793 | };
|
22794 | AnimateShowChangeCellRenderer.prototype.showDelta = function (params, delta) {
|
22795 | var absDelta = Math.abs(delta);
|
22796 | var valueFormatted = params.formatValue(absDelta);
|
22797 | var valueToUse = utils_1.Utils.exists(valueFormatted) ? valueFormatted : absDelta;
|
22798 | var deltaUp = (delta >= 0);
|
22799 | if (deltaUp) {
|
22800 | this.eDelta.innerHTML = ARROW_UP + valueToUse;
|
22801 | }
|
22802 | else {
|
22803 |
|
22804 | this.eDelta.innerHTML = ARROW_DOWN + valueToUse;
|
22805 | }
|
22806 |
|
22807 | utils_1.Utils.addOrRemoveCssClass(this.eDelta, 'ag-value-change-delta-up', deltaUp);
|
22808 |
|
22809 | utils_1.Utils.addOrRemoveCssClass(this.eDelta, 'ag-value-change-delta-down', !deltaUp);
|
22810 | };
|
22811 | AnimateShowChangeCellRenderer.prototype.setTimerToRemoveDelta = function () {
|
22812 | var _this = this;
|
22813 |
|
22814 |
|
22815 |
|
22816 | this.refreshCount++;
|
22817 | var refreshCountCopy = this.refreshCount;
|
22818 | setTimeout(function () {
|
22819 | if (refreshCountCopy === _this.refreshCount) {
|
22820 | _this.hideDeltaValue();
|
22821 | }
|
22822 | }, 2000);
|
22823 | };
|
22824 | AnimateShowChangeCellRenderer.prototype.hideDeltaValue = function () {
|
22825 | utils_1.Utils.removeCssClass(this.eValue, 'ag-value-change-value-highlight');
|
22826 | this.eDelta.innerHTML = '';
|
22827 | };
|
22828 | AnimateShowChangeCellRenderer.prototype.refresh = function (params) {
|
22829 | var value = params.value;
|
22830 | if (value === this.lastValue) {
|
22831 | return;
|
22832 | }
|
22833 | if (utils_1.Utils.exists(params.valueFormatted)) {
|
22834 | this.eValue.innerHTML = params.valueFormatted;
|
22835 | }
|
22836 | else if (utils_1.Utils.exists(params.value)) {
|
22837 | this.eValue.innerHTML = value;
|
22838 | }
|
22839 | else {
|
22840 | this.eValue.innerHTML = '';
|
22841 | }
|
22842 | if (typeof value === 'number' && typeof this.lastValue === 'number') {
|
22843 | var delta = value - this.lastValue;
|
22844 | this.showDelta(params, delta);
|
22845 | }
|
22846 |
|
22847 |
|
22848 | if (this.lastValue) {
|
22849 | utils_1.Utils.addCssClass(this.eValue, 'ag-value-change-value-highlight');
|
22850 | }
|
22851 | this.setTimerToRemoveDelta();
|
22852 | this.lastValue = value;
|
22853 | return true;
|
22854 | };
|
22855 | AnimateShowChangeCellRenderer.TEMPLATE = '<span>' +
|
22856 | '<span class="ag-value-change-delta"></span>' +
|
22857 | '<span class="ag-value-change-value"></span>' +
|
22858 | '</span>';
|
22859 | return AnimateShowChangeCellRenderer;
|
22860 | }(component_1.Component));
|
22861 | exports.AnimateShowChangeCellRenderer = AnimateShowChangeCellRenderer;
|
22862 |
|
22863 |
|
22864 | }),
|
22865 |
|
22866 | (function(module, exports, __webpack_require__) {
|
22867 |
|
22868 | "use strict";
|
22869 |
|
22870 |
|
22871 |
|
22872 |
|
22873 |
|
22874 |
|
22875 |
|
22876 | var __extends = (this && this.__extends) || (function () {
|
22877 | var extendStatics = Object.setPrototypeOf ||
|
22878 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
22879 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
22880 | return function (d, b) {
|
22881 | extendStatics(d, b);
|
22882 | function __() { this.constructor = d; }
|
22883 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
22884 | };
|
22885 | })();
|
22886 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
22887 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
22888 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
22889 | 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;
|
22890 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
22891 | };
|
22892 | var __metadata = (this && this.__metadata) || function (k, v) {
|
22893 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
22894 | };
|
22895 | Object.defineProperty(exports, "__esModule", { value: true });
|
22896 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
22897 | var expressionService_1 = __webpack_require__(19);
|
22898 | var eventService_1 = __webpack_require__(3);
|
22899 | var constants_1 = __webpack_require__(9);
|
22900 | var utils_1 = __webpack_require__(1);
|
22901 | var context_1 = __webpack_require__(0);
|
22902 | var component_1 = __webpack_require__(8);
|
22903 | var rowNode_1 = __webpack_require__(16);
|
22904 | var cellRendererService_1 = __webpack_require__(56);
|
22905 | var valueFormatterService_1 = __webpack_require__(43);
|
22906 | var checkboxSelectionComponent_1 = __webpack_require__(65);
|
22907 | var columnController_1 = __webpack_require__(4);
|
22908 | var column_1 = __webpack_require__(10);
|
22909 | var componentAnnotations_1 = __webpack_require__(11);
|
22910 | var mouseEventService_1 = __webpack_require__(44);
|
22911 | var GroupCellRenderer = (function (_super) {
|
22912 | __extends(GroupCellRenderer, _super);
|
22913 | function GroupCellRenderer() {
|
22914 | return _super.call(this, GroupCellRenderer.TEMPLATE) || this;
|
22915 | }
|
22916 | GroupCellRenderer.prototype.init = function (params) {
|
22917 | this.params = params;
|
22918 | if (this.gridOptionsWrapper.isGroupIncludeTotalFooter()) {
|
22919 | this.assignBlankValueToGroupFooterCell(params);
|
22920 | }
|
22921 | var embeddedRowMismatch = this.isEmbeddedRowMismatch();
|
22922 |
|
22923 |
|
22924 | var cellIsEmpty = params.value == null;
|
22925 | this.cellIsBlank = embeddedRowMismatch || cellIsEmpty;
|
22926 | if (this.cellIsBlank) {
|
22927 | return;
|
22928 | }
|
22929 | this.setupDragOpenParents();
|
22930 | this.addExpandAndContract();
|
22931 | this.addCheckboxIfNeeded();
|
22932 | this.addValueElement();
|
22933 | this.setupIndent();
|
22934 | };
|
22935 | GroupCellRenderer.prototype.assignBlankValueToGroupFooterCell = function (params) {
|
22936 |
|
22937 | if (!params.value && params.node.level == -1) {
|
22938 | params.value = '';
|
22939 | }
|
22940 | };
|
22941 |
|
22942 |
|
22943 |
|
22944 | GroupCellRenderer.prototype.isEmbeddedRowMismatch = function () {
|
22945 | if (this.params.fullWidth && this.gridOptionsWrapper.isEmbedFullWidthRows()) {
|
22946 | var pinnedLeftCell = this.params.pinned === column_1.Column.PINNED_LEFT;
|
22947 | var pinnedRightCell = this.params.pinned === column_1.Column.PINNED_RIGHT;
|
22948 | var bodyCell = !pinnedLeftCell && !pinnedRightCell;
|
22949 | if (this.gridOptionsWrapper.isEnableRtl()) {
|
22950 | if (this.columnController.isPinningLeft()) {
|
22951 | return !pinnedRightCell;
|
22952 | }
|
22953 | else {
|
22954 | return !bodyCell;
|
22955 | }
|
22956 | }
|
22957 | else {
|
22958 | if (this.columnController.isPinningLeft()) {
|
22959 | return !pinnedLeftCell;
|
22960 | }
|
22961 | else {
|
22962 | return !bodyCell;
|
22963 | }
|
22964 | }
|
22965 | }
|
22966 | else {
|
22967 | return false;
|
22968 | }
|
22969 | };
|
22970 | GroupCellRenderer.prototype.setIndent = function () {
|
22971 | if (this.gridOptionsWrapper.isGroupHideOpenParents()) {
|
22972 | return;
|
22973 | }
|
22974 | var params = this.params;
|
22975 | var rowNode = params.node;
|
22976 |
|
22977 | var paddingCount = rowNode.uiLevel;
|
22978 | var userProvidedPaddingPixelsTheDeprecatedWay = params.padding >= 0;
|
22979 | if (userProvidedPaddingPixelsTheDeprecatedWay) {
|
22980 | this.setPaddingDeprecatedWay(paddingCount, params.padding);
|
22981 | return;
|
22982 | }
|
22983 | if (this.indentClass) {
|
22984 | this.removeCssClass(this.indentClass);
|
22985 | }
|
22986 | this.indentClass = 'ag-row-group-indent-' + paddingCount;
|
22987 | this.addCssClass(this.indentClass);
|
22988 | };
|
22989 | GroupCellRenderer.prototype.setPaddingDeprecatedWay = function (paddingCount, padding) {
|
22990 | utils_1.Utils.doOnce(function () { return console.warn('ag-Grid: since v14.2, configuring padding for groupCellRenderer should be done with Sass variables and themes. Please see the ag-Grid documentation page for Themes, in particular the property $row-group-indent-size.'); }, 'groupCellRenderer->doDeprecatedWay');
|
22991 | var paddingPx = paddingCount * padding;
|
22992 | if (this.gridOptionsWrapper.isEnableRtl()) {
|
22993 |
|
22994 | this.getGui().style.paddingRight = paddingPx + 'px';
|
22995 | }
|
22996 | else {
|
22997 |
|
22998 | this.getGui().style.paddingLeft = paddingPx + 'px';
|
22999 | }
|
23000 | };
|
23001 | GroupCellRenderer.prototype.setupIndent = function () {
|
23002 |
|
23003 |
|
23004 |
|
23005 | var node = this.params.node;
|
23006 | var suppressPadding = this.params.suppressPadding;
|
23007 | if (!suppressPadding) {
|
23008 | this.addDestroyableEventListener(node, rowNode_1.RowNode.EVENT_UI_LEVEL_CHANGED, this.setIndent.bind(this));
|
23009 | this.setIndent();
|
23010 | }
|
23011 | };
|
23012 | GroupCellRenderer.prototype.addValueElement = function () {
|
23013 | var params = this.params;
|
23014 | var rowNode = this.displayedGroup;
|
23015 | if (rowNode.footer) {
|
23016 | this.createFooterCell();
|
23017 | }
|
23018 | else if (rowNode.hasChildren() ||
|
23019 | utils_1.Utils.get(params.colDef, 'cellRendererParams.innerRenderer', null) ||
|
23020 | utils_1.Utils.get(params.colDef, 'cellRendererParams.innerRendererFramework', null)) {
|
23021 | this.createGroupCell();
|
23022 | if (rowNode.hasChildren()) {
|
23023 | this.addChildCount();
|
23024 | }
|
23025 | }
|
23026 | else {
|
23027 | this.createLeafCell();
|
23028 | }
|
23029 | };
|
23030 | GroupCellRenderer.prototype.createFooterCell = function () {
|
23031 | var footerValue;
|
23032 | var footerValueGetter = this.params.footerValueGetter;
|
23033 | if (footerValueGetter) {
|
23034 |
|
23035 | var paramsClone = utils_1.Utils.cloneObject(this.params);
|
23036 | paramsClone.value = this.params.value;
|
23037 | if (typeof footerValueGetter === 'function') {
|
23038 | footerValue = footerValueGetter(paramsClone);
|
23039 | }
|
23040 | else if (typeof footerValueGetter === 'string') {
|
23041 | footerValue = this.expressionService.evaluate(footerValueGetter, paramsClone);
|
23042 | }
|
23043 | else {
|
23044 | console.warn('ag-Grid: footerValueGetter should be either a function or a string (expression)');
|
23045 | }
|
23046 | }
|
23047 | else {
|
23048 | footerValue = 'Total ' + this.params.value;
|
23049 | }
|
23050 | this.eValue.innerHTML = footerValue;
|
23051 | };
|
23052 | GroupCellRenderer.prototype.createGroupCell = function () {
|
23053 | var _this = this;
|
23054 | var params = this.params;
|
23055 | var rowGroupColumn = this.displayedGroup.rowGroupColumn;
|
23056 |
|
23057 | var columnToUse = rowGroupColumn ? rowGroupColumn : params.column;
|
23058 | var groupName = this.params.value;
|
23059 | var valueFormatted = columnToUse ?
|
23060 | this.valueFormatterService.formatValue(columnToUse, params.node, params.scope, groupName) : null;
|
23061 | params.valueFormatted = valueFormatted;
|
23062 | var rendererPromise;
|
23063 | if (params.fullWidth == true) {
|
23064 | rendererPromise = this.cellRendererService.useFullWidthGroupRowInnerCellRenderer(this.eValue, params);
|
23065 | }
|
23066 | else {
|
23067 | rendererPromise = this.cellRendererService.useInnerCellRenderer(this.params.colDef.cellRendererParams, columnToUse.getColDef(), this.eValue, params);
|
23068 | }
|
23069 |
|
23070 | if (rendererPromise) {
|
23071 | rendererPromise.then(function (value) {
|
23072 | _this.innerCellRenderer = value;
|
23073 | });
|
23074 | }
|
23075 | };
|
23076 | GroupCellRenderer.prototype.addChildCount = function () {
|
23077 |
|
23078 |
|
23079 | if (this.params.suppressCount) {
|
23080 | return;
|
23081 | }
|
23082 | this.addDestroyableEventListener(this.displayedGroup, rowNode_1.RowNode.EVENT_ALL_CHILDREN_COUNT_CHANGED, this.updateChildCount.bind(this));
|
23083 |
|
23084 | this.updateChildCount();
|
23085 | };
|
23086 | GroupCellRenderer.prototype.updateChildCount = function () {
|
23087 | var allChildrenCount = this.displayedGroup.allChildrenCount;
|
23088 | this.eChildCount.innerHTML = allChildrenCount >= 0 ? "(" + allChildrenCount + ")" : "";
|
23089 | };
|
23090 | GroupCellRenderer.prototype.createLeafCell = function () {
|
23091 | if (utils_1.Utils.exists(this.params.value)) {
|
23092 | this.eValue.innerHTML = this.params.valueFormatted ? this.params.valueFormatted : this.params.value;
|
23093 | }
|
23094 | };
|
23095 | GroupCellRenderer.prototype.isUserWantsSelected = function () {
|
23096 | var paramsCheckbox = this.params.checkbox;
|
23097 | if (typeof paramsCheckbox === 'function') {
|
23098 | return paramsCheckbox(this.params);
|
23099 | }
|
23100 | else {
|
23101 | return paramsCheckbox === true;
|
23102 | }
|
23103 | };
|
23104 | GroupCellRenderer.prototype.addCheckboxIfNeeded = function () {
|
23105 | var rowNode = this.displayedGroup;
|
23106 | var checkboxNeeded = this.isUserWantsSelected()
|
23107 | && !rowNode.footer
|
23108 | && !rowNode.rowPinned
|
23109 | && !rowNode.detail;
|
23110 | if (checkboxNeeded) {
|
23111 | var cbSelectionComponent_1 = new checkboxSelectionComponent_1.CheckboxSelectionComponent();
|
23112 | this.context.wireBean(cbSelectionComponent_1);
|
23113 | cbSelectionComponent_1.init({ rowNode: rowNode, column: this.params.column });
|
23114 | this.eCheckbox.appendChild(cbSelectionComponent_1.getGui());
|
23115 | this.addDestroyFunc(function () { return cbSelectionComponent_1.destroy(); });
|
23116 | }
|
23117 | };
|
23118 | GroupCellRenderer.prototype.addExpandAndContract = function () {
|
23119 | var params = this.params;
|
23120 | var eGroupCell = params.eGridCell;
|
23121 | var eExpandedIcon = utils_1.Utils.createIconNoSpan('groupExpanded', this.gridOptionsWrapper, null);
|
23122 | var eContractedIcon = utils_1.Utils.createIconNoSpan('groupContracted', this.gridOptionsWrapper, null);
|
23123 | this.eExpanded.appendChild(eExpandedIcon);
|
23124 | this.eContracted.appendChild(eContractedIcon);
|
23125 | this.addDestroyableEventListener(this.eExpanded, 'click', this.onExpandClicked.bind(this));
|
23126 | this.addDestroyableEventListener(this.eContracted, 'click', this.onExpandClicked.bind(this));
|
23127 |
|
23128 | this.addDestroyableEventListener(eGroupCell, 'keydown', this.onKeyDown.bind(this));
|
23129 | this.addDestroyableEventListener(params.node, rowNode_1.RowNode.EVENT_EXPANDED_CHANGED, this.showExpandAndContractIcons.bind(this));
|
23130 | this.showExpandAndContractIcons();
|
23131 |
|
23132 |
|
23133 | this.addDestroyableEventListener(this.displayedGroup, rowNode_1.RowNode.EVENT_ALL_CHILDREN_COUNT_CHANGED, this.onAllChildrenCountChanged.bind(this));
|
23134 |
|
23135 | if (!this.gridOptionsWrapper.isEnableGroupEdit() && this.isExpandable() && !params.suppressDoubleClickExpand) {
|
23136 | this.addDestroyableEventListener(eGroupCell, 'dblclick', this.onCellDblClicked.bind(this));
|
23137 | }
|
23138 | };
|
23139 | GroupCellRenderer.prototype.onAllChildrenCountChanged = function () {
|
23140 |
|
23141 | this.showExpandAndContractIcons();
|
23142 |
|
23143 | this.setIndent();
|
23144 | };
|
23145 | GroupCellRenderer.prototype.onKeyDown = function (event) {
|
23146 | if (utils_1.Utils.isKeyPressed(event, constants_1.Constants.KEY_ENTER)) {
|
23147 | var cellEditable = this.params.column.isCellEditable(this.params.node);
|
23148 | if (cellEditable) {
|
23149 | return;
|
23150 | }
|
23151 | event.preventDefault();
|
23152 | this.onExpandOrContract();
|
23153 | }
|
23154 | };
|
23155 | GroupCellRenderer.prototype.setupDragOpenParents = function () {
|
23156 | var column = this.params.column;
|
23157 | var rowNode = this.params.node;
|
23158 | if (!this.gridOptionsWrapper.isGroupHideOpenParents()) {
|
23159 | this.draggedFromHideOpenParents = false;
|
23160 | }
|
23161 | else if (!rowNode.hasChildren()) {
|
23162 |
|
23163 |
|
23164 | this.draggedFromHideOpenParents = true;
|
23165 | }
|
23166 | else {
|
23167 | var rowGroupColumn = rowNode.rowGroupColumn;
|
23168 |
|
23169 |
|
23170 | this.draggedFromHideOpenParents = !column.isRowGroupDisplayed(rowGroupColumn.getId());
|
23171 | }
|
23172 | if (this.draggedFromHideOpenParents) {
|
23173 | var pointer = rowNode.parent;
|
23174 | while (true) {
|
23175 | if (utils_1.Utils.missing(pointer)) {
|
23176 | break;
|
23177 | }
|
23178 | if (pointer.rowGroupColumn && column.isRowGroupDisplayed(pointer.rowGroupColumn.getId())) {
|
23179 | this.displayedGroup = pointer;
|
23180 | break;
|
23181 | }
|
23182 | pointer = pointer.parent;
|
23183 | }
|
23184 | }
|
23185 |
|
23186 | if (utils_1.Utils.missing(this.displayedGroup)) {
|
23187 | this.displayedGroup = rowNode;
|
23188 | }
|
23189 | };
|
23190 | GroupCellRenderer.prototype.onExpandClicked = function (mouseEvent) {
|
23191 | if (utils_1.Utils.isStopPropagationForAgGrid(mouseEvent)) {
|
23192 | return;
|
23193 | }
|
23194 |
|
23195 | utils_1.Utils.stopPropagationForAgGrid(mouseEvent);
|
23196 | this.onExpandOrContract();
|
23197 | };
|
23198 | GroupCellRenderer.prototype.onCellDblClicked = function (mouseEvent) {
|
23199 | if (utils_1.Utils.isStopPropagationForAgGrid(mouseEvent)) {
|
23200 | return;
|
23201 | }
|
23202 |
|
23203 |
|
23204 |
|
23205 |
|
23206 | var targetIsExpandIcon = utils_1.Utils.isElementInEventPath(this.eExpanded, mouseEvent)
|
23207 | || utils_1.Utils.isElementInEventPath(this.eContracted, mouseEvent);
|
23208 | if (!targetIsExpandIcon) {
|
23209 | this.onExpandOrContract();
|
23210 | }
|
23211 | };
|
23212 | GroupCellRenderer.prototype.onExpandOrContract = function () {
|
23213 |
|
23214 | var rowNode = this.displayedGroup;
|
23215 | rowNode.setExpanded(!rowNode.expanded);
|
23216 | };
|
23217 | GroupCellRenderer.prototype.isExpandable = function () {
|
23218 | var rowNode = this.params.node;
|
23219 | var reducedLeafNode = this.columnController.isPivotMode() && rowNode.leafGroup;
|
23220 | return this.draggedFromHideOpenParents ||
|
23221 | (rowNode.isExpandable() && !rowNode.footer && !reducedLeafNode);
|
23222 | };
|
23223 | GroupCellRenderer.prototype.showExpandAndContractIcons = function () {
|
23224 | var rowNode = this.params.node;
|
23225 | if (this.isExpandable()) {
|
23226 |
|
23227 |
|
23228 | var expanded = this.draggedFromHideOpenParents ? true : rowNode.expanded;
|
23229 | utils_1.Utils.setVisible(this.eContracted, !expanded);
|
23230 | utils_1.Utils.setVisible(this.eExpanded, expanded);
|
23231 | }
|
23232 | else {
|
23233 |
|
23234 | utils_1.Utils.setVisible(this.eExpanded, false);
|
23235 | utils_1.Utils.setVisible(this.eContracted, false);
|
23236 | }
|
23237 | var displayedGroup = this.displayedGroup;
|
23238 |
|
23239 | var pivotModeAndLeafGroup = this.columnController.isPivotMode() && displayedGroup.leafGroup;
|
23240 | var notExpandable = !displayedGroup.isExpandable();
|
23241 | var addLeafIndentClass = displayedGroup.footer || notExpandable || pivotModeAndLeafGroup;
|
23242 | this.addOrRemoveCssClass('ag-row-group-leaf-indent', addLeafIndentClass);
|
23243 | };
|
23244 | GroupCellRenderer.prototype.destroy = function () {
|
23245 | _super.prototype.destroy.call(this);
|
23246 | if (this.innerCellRenderer && this.innerCellRenderer.destroy) {
|
23247 | this.innerCellRenderer.destroy();
|
23248 | }
|
23249 | };
|
23250 | GroupCellRenderer.prototype.refresh = function () {
|
23251 | return false;
|
23252 | };
|
23253 | GroupCellRenderer.TEMPLATE = '<span>' +
|
23254 | '<span class="ag-group-expanded" ref="eExpanded"></span>' +
|
23255 | '<span class="ag-group-contracted" ref="eContracted"></span>' +
|
23256 | '<span class="ag-group-checkbox" ref="eCheckbox"></span>' +
|
23257 | '<span class="ag-group-value" ref="eValue"></span>' +
|
23258 | '<span class="ag-group-child-count" ref="eChildCount"></span>' +
|
23259 | '</span>';
|
23260 | __decorate([
|
23261 | context_1.Autowired('gridOptionsWrapper'),
|
23262 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
23263 | ], GroupCellRenderer.prototype, "gridOptionsWrapper", void 0);
|
23264 | __decorate([
|
23265 | context_1.Autowired('expressionService'),
|
23266 | __metadata("design:type", expressionService_1.ExpressionService)
|
23267 | ], GroupCellRenderer.prototype, "expressionService", void 0);
|
23268 | __decorate([
|
23269 | context_1.Autowired('eventService'),
|
23270 | __metadata("design:type", eventService_1.EventService)
|
23271 | ], GroupCellRenderer.prototype, "eventService", void 0);
|
23272 | __decorate([
|
23273 | context_1.Autowired('cellRendererService'),
|
23274 | __metadata("design:type", cellRendererService_1.CellRendererService)
|
23275 | ], GroupCellRenderer.prototype, "cellRendererService", void 0);
|
23276 | __decorate([
|
23277 | context_1.Autowired('valueFormatterService'),
|
23278 | __metadata("design:type", valueFormatterService_1.ValueFormatterService)
|
23279 | ], GroupCellRenderer.prototype, "valueFormatterService", void 0);
|
23280 | __decorate([
|
23281 | context_1.Autowired('context'),
|
23282 | __metadata("design:type", context_1.Context)
|
23283 | ], GroupCellRenderer.prototype, "context", void 0);
|
23284 | __decorate([
|
23285 | context_1.Autowired('columnController'),
|
23286 | __metadata("design:type", columnController_1.ColumnController)
|
23287 | ], GroupCellRenderer.prototype, "columnController", void 0);
|
23288 | __decorate([
|
23289 | context_1.Autowired('mouseEventService'),
|
23290 | __metadata("design:type", mouseEventService_1.MouseEventService)
|
23291 | ], GroupCellRenderer.prototype, "mouseEventService", void 0);
|
23292 | __decorate([
|
23293 | componentAnnotations_1.RefSelector('eExpanded'),
|
23294 | __metadata("design:type", HTMLElement)
|
23295 | ], GroupCellRenderer.prototype, "eExpanded", void 0);
|
23296 | __decorate([
|
23297 | componentAnnotations_1.RefSelector('eContracted'),
|
23298 | __metadata("design:type", HTMLElement)
|
23299 | ], GroupCellRenderer.prototype, "eContracted", void 0);
|
23300 | __decorate([
|
23301 | componentAnnotations_1.RefSelector('eCheckbox'),
|
23302 | __metadata("design:type", HTMLElement)
|
23303 | ], GroupCellRenderer.prototype, "eCheckbox", void 0);
|
23304 | __decorate([
|
23305 | componentAnnotations_1.RefSelector('eValue'),
|
23306 | __metadata("design:type", HTMLElement)
|
23307 | ], GroupCellRenderer.prototype, "eValue", void 0);
|
23308 | __decorate([
|
23309 | componentAnnotations_1.RefSelector('eChildCount'),
|
23310 | __metadata("design:type", HTMLElement)
|
23311 | ], GroupCellRenderer.prototype, "eChildCount", void 0);
|
23312 | return GroupCellRenderer;
|
23313 | }(component_1.Component));
|
23314 | exports.GroupCellRenderer = GroupCellRenderer;
|
23315 |
|
23316 |
|
23317 | }),
|
23318 |
|
23319 | (function(module, exports, __webpack_require__) {
|
23320 |
|
23321 | "use strict";
|
23322 |
|
23323 |
|
23324 |
|
23325 |
|
23326 |
|
23327 |
|
23328 |
|
23329 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
23330 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
23331 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
23332 | 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;
|
23333 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
23334 | };
|
23335 | var __metadata = (this && this.__metadata) || function (k, v) {
|
23336 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
23337 | };
|
23338 | Object.defineProperty(exports, "__esModule", { value: true });
|
23339 | var context_1 = __webpack_require__(0);
|
23340 | var expressionService_1 = __webpack_require__(19);
|
23341 | var StylingService = (function () {
|
23342 | function StylingService() {
|
23343 | }
|
23344 | StylingService.prototype.processAllCellClasses = function (colDef, params, onApplicableClass, onNotApplicableClass) {
|
23345 | this.processClassRules(colDef.cellClassRules, params, onApplicableClass, onNotApplicableClass);
|
23346 | this.processStaticCellClasses(colDef, params, onApplicableClass);
|
23347 | };
|
23348 | StylingService.prototype.processClassRules = function (classRules, params, onApplicableClass, onNotApplicableClass) {
|
23349 | if (typeof classRules === 'object' && classRules !== null) {
|
23350 | var classNames = Object.keys(classRules);
|
23351 | for (var i = 0; i < classNames.length; i++) {
|
23352 | var className = classNames[i];
|
23353 | var rule = classRules[className];
|
23354 | var resultOfRule = void 0;
|
23355 | if (typeof rule === 'string') {
|
23356 | resultOfRule = this.expressionService.evaluate(rule, params);
|
23357 | }
|
23358 | else if (typeof rule === 'function') {
|
23359 | resultOfRule = rule(params);
|
23360 | }
|
23361 | if (resultOfRule) {
|
23362 | onApplicableClass(className);
|
23363 | }
|
23364 | else if (onNotApplicableClass) {
|
23365 | onNotApplicableClass(className);
|
23366 | }
|
23367 | }
|
23368 | }
|
23369 | };
|
23370 | StylingService.prototype.processStaticCellClasses = function (colDef, params, onApplicableClass) {
|
23371 | var cellClass = colDef.cellClass;
|
23372 | if (cellClass) {
|
23373 | var classOrClasses = void 0;
|
23374 | if (typeof colDef.cellClass === 'function') {
|
23375 | var cellClassFunc = colDef.cellClass;
|
23376 | classOrClasses = cellClassFunc(params);
|
23377 | }
|
23378 | else {
|
23379 | classOrClasses = colDef.cellClass;
|
23380 | }
|
23381 | if (typeof classOrClasses === 'string') {
|
23382 | onApplicableClass(classOrClasses);
|
23383 | }
|
23384 | else if (Array.isArray(classOrClasses)) {
|
23385 | classOrClasses.forEach(function (cssClassItem) {
|
23386 | onApplicableClass(cssClassItem);
|
23387 | });
|
23388 | }
|
23389 | }
|
23390 | };
|
23391 | __decorate([
|
23392 | context_1.Autowired('expressionService'),
|
23393 | __metadata("design:type", expressionService_1.ExpressionService)
|
23394 | ], StylingService.prototype, "expressionService", void 0);
|
23395 | StylingService = __decorate([
|
23396 | context_1.Bean('stylingService')
|
23397 | ], StylingService);
|
23398 | return StylingService;
|
23399 | }());
|
23400 | exports.StylingService = StylingService;
|
23401 |
|
23402 |
|
23403 | }),
|
23404 |
|
23405 | (function(module, exports, __webpack_require__) {
|
23406 |
|
23407 | "use strict";
|
23408 |
|
23409 |
|
23410 |
|
23411 |
|
23412 |
|
23413 |
|
23414 |
|
23415 | var __extends = (this && this.__extends) || (function () {
|
23416 | var extendStatics = Object.setPrototypeOf ||
|
23417 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
23418 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
23419 | return function (d, b) {
|
23420 | extendStatics(d, b);
|
23421 | function __() { this.constructor = d; }
|
23422 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
23423 | };
|
23424 | })();
|
23425 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
23426 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
23427 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
23428 | 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;
|
23429 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
23430 | };
|
23431 | var __metadata = (this && this.__metadata) || function (k, v) {
|
23432 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
23433 | };
|
23434 | Object.defineProperty(exports, "__esModule", { value: true });
|
23435 | var beanStub_1 = __webpack_require__(13);
|
23436 | var context_1 = __webpack_require__(0);
|
23437 | var columnHoverService_1 = __webpack_require__(45);
|
23438 | var HoverFeature = (function (_super) {
|
23439 | __extends(HoverFeature, _super);
|
23440 | function HoverFeature(columns, element) {
|
23441 | var _this = _super.call(this) || this;
|
23442 | _this.columns = columns;
|
23443 | _this.addMouseHoverListeners(element);
|
23444 | return _this;
|
23445 | }
|
23446 | HoverFeature.prototype.addMouseHoverListeners = function (element) {
|
23447 | this.addDestroyableEventListener(element, 'mouseout', this.onMouseOut.bind(this));
|
23448 | this.addDestroyableEventListener(element, 'mouseover', this.onMouseOver.bind(this));
|
23449 | };
|
23450 | HoverFeature.prototype.onMouseOut = function () {
|
23451 | this.columnHoverService.clearMouseOver();
|
23452 | };
|
23453 | HoverFeature.prototype.onMouseOver = function () {
|
23454 | this.columnHoverService.setMouseOver(this.columns);
|
23455 | };
|
23456 | __decorate([
|
23457 | context_1.Autowired('columnHoverService'),
|
23458 | __metadata("design:type", columnHoverService_1.ColumnHoverService)
|
23459 | ], HoverFeature.prototype, "columnHoverService", void 0);
|
23460 | return HoverFeature;
|
23461 | }(beanStub_1.BeanStub));
|
23462 | exports.HoverFeature = HoverFeature;
|
23463 |
|
23464 |
|
23465 | }),
|
23466 |
|
23467 | (function(module, exports, __webpack_require__) {
|
23468 |
|
23469 | "use strict";
|
23470 |
|
23471 |
|
23472 |
|
23473 |
|
23474 |
|
23475 |
|
23476 |
|
23477 | var __extends = (this && this.__extends) || (function () {
|
23478 | var extendStatics = Object.setPrototypeOf ||
|
23479 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
23480 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
23481 | return function (d, b) {
|
23482 | extendStatics(d, b);
|
23483 | function __() { this.constructor = d; }
|
23484 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
23485 | };
|
23486 | })();
|
23487 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
23488 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
23489 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
23490 | 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;
|
23491 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
23492 | };
|
23493 | var __metadata = (this && this.__metadata) || function (k, v) {
|
23494 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
23495 | };
|
23496 | Object.defineProperty(exports, "__esModule", { value: true });
|
23497 | var component_1 = __webpack_require__(8);
|
23498 | var utils_1 = __webpack_require__(1);
|
23499 | var constants_1 = __webpack_require__(9);
|
23500 | var context_1 = __webpack_require__(0);
|
23501 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
23502 | var valueFormatterService_1 = __webpack_require__(43);
|
23503 | var SelectCellEditor = (function (_super) {
|
23504 | __extends(SelectCellEditor, _super);
|
23505 | function SelectCellEditor() {
|
23506 | var _this = _super.call(this, '<div class="ag-cell-edit-input"><select class="ag-cell-edit-input"/></div>') || this;
|
23507 | _this.eSelect = _this.getGui().querySelector('select');
|
23508 | return _this;
|
23509 | }
|
23510 | SelectCellEditor.prototype.init = function (params) {
|
23511 | var _this = this;
|
23512 | this.focusAfterAttached = params.cellStartedEdit;
|
23513 | if (utils_1.Utils.missing(params.values)) {
|
23514 | console.log('ag-Grid: no values found for select cellEditor');
|
23515 | return;
|
23516 | }
|
23517 | params.values.forEach(function (value) {
|
23518 | var option = document.createElement('option');
|
23519 | option.value = value;
|
23520 | var valueFormatted = _this.valueFormatterService.formatValue(params.column, null, null, value);
|
23521 | var valueFormattedExits = valueFormatted !== null && valueFormatted !== undefined;
|
23522 | option.text = valueFormattedExits ? valueFormatted : value;
|
23523 | if (params.value === value) {
|
23524 | option.selected = true;
|
23525 | }
|
23526 | _this.eSelect.appendChild(option);
|
23527 | });
|
23528 |
|
23529 |
|
23530 | if (!this.gridOptionsWrapper.isFullRowEdit()) {
|
23531 | this.addDestroyableEventListener(this.eSelect, 'change', function () { return params.stopEditing(); });
|
23532 | }
|
23533 | this.addDestroyableEventListener(this.eSelect, 'keydown', function (event) {
|
23534 | var isNavigationKey = event.keyCode === constants_1.Constants.KEY_UP || event.keyCode === constants_1.Constants.KEY_DOWN;
|
23535 | if (isNavigationKey) {
|
23536 | event.stopPropagation();
|
23537 | }
|
23538 | });
|
23539 | this.addDestroyableEventListener(this.eSelect, 'mousedown', function (event) {
|
23540 | event.stopPropagation();
|
23541 | });
|
23542 | };
|
23543 | SelectCellEditor.prototype.afterGuiAttached = function () {
|
23544 | if (this.focusAfterAttached) {
|
23545 | this.eSelect.focus();
|
23546 | }
|
23547 | };
|
23548 | SelectCellEditor.prototype.focusIn = function () {
|
23549 | this.eSelect.focus();
|
23550 | };
|
23551 | SelectCellEditor.prototype.getValue = function () {
|
23552 | return this.eSelect.value;
|
23553 | };
|
23554 | __decorate([
|
23555 | context_1.Autowired('gridOptionsWrapper'),
|
23556 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
23557 | ], SelectCellEditor.prototype, "gridOptionsWrapper", void 0);
|
23558 | __decorate([
|
23559 | context_1.Autowired('valueFormatterService'),
|
23560 | __metadata("design:type", valueFormatterService_1.ValueFormatterService)
|
23561 | ], SelectCellEditor.prototype, "valueFormatterService", void 0);
|
23562 | return SelectCellEditor;
|
23563 | }(component_1.Component));
|
23564 | exports.SelectCellEditor = SelectCellEditor;
|
23565 |
|
23566 |
|
23567 | }),
|
23568 |
|
23569 | (function(module, exports, __webpack_require__) {
|
23570 |
|
23571 | "use strict";
|
23572 |
|
23573 |
|
23574 |
|
23575 |
|
23576 |
|
23577 |
|
23578 |
|
23579 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
23580 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
23581 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
23582 | 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;
|
23583 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
23584 | };
|
23585 | var __metadata = (this && this.__metadata) || function (k, v) {
|
23586 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
23587 | };
|
23588 | Object.defineProperty(exports, "__esModule", { value: true });
|
23589 | var context_1 = __webpack_require__(0);
|
23590 | var componentMetadataProvider_1 = __webpack_require__(77);
|
23591 | var utils_1 = __webpack_require__(1);
|
23592 | var AgComponentUtils = (function () {
|
23593 | function AgComponentUtils() {
|
23594 | }
|
23595 | AgComponentUtils.prototype.adaptFunction = function (propertyName, hardcodedJsFunction, type, source) {
|
23596 | if (hardcodedJsFunction == null)
|
23597 | return {
|
23598 | component: null,
|
23599 | type: type,
|
23600 | source: source,
|
23601 | dynamicParams: null
|
23602 | };
|
23603 | var metadata = this.componentMetadataProvider.retrieve(propertyName);
|
23604 | if (metadata && metadata.functionAdapter) {
|
23605 | return {
|
23606 | type: type,
|
23607 | component: metadata.functionAdapter(hardcodedJsFunction),
|
23608 | source: source,
|
23609 | dynamicParams: null
|
23610 | };
|
23611 | }
|
23612 | return null;
|
23613 | };
|
23614 | AgComponentUtils.prototype.adaptCellRendererFunction = function (callback) {
|
23615 | var Adapter = (function () {
|
23616 | function Adapter() {
|
23617 | }
|
23618 | Adapter.prototype.refresh = function (params) {
|
23619 | return false;
|
23620 | };
|
23621 | Adapter.prototype.getGui = function () {
|
23622 | var callbackResult = callback(this.params);
|
23623 | var type = typeof callbackResult;
|
23624 | if (type === 'string' || type === 'number' || type === 'boolean') {
|
23625 | return utils_1._.loadTemplate('<span>' + callbackResult + '</span>');
|
23626 | }
|
23627 | else {
|
23628 | return callbackResult;
|
23629 | }
|
23630 | };
|
23631 | Adapter.prototype.init = function (params) {
|
23632 | this.params = params;
|
23633 | };
|
23634 | return Adapter;
|
23635 | }());
|
23636 | return Adapter;
|
23637 | };
|
23638 | AgComponentUtils.prototype.doesImplementIComponent = function (candidate) {
|
23639 | if (!candidate)
|
23640 | return false;
|
23641 | return candidate.prototype && 'getGui' in candidate.prototype;
|
23642 | };
|
23643 | __decorate([
|
23644 | context_1.Autowired("componentMetadataProvider"),
|
23645 | __metadata("design:type", componentMetadataProvider_1.ComponentMetadataProvider)
|
23646 | ], AgComponentUtils.prototype, "componentMetadataProvider", void 0);
|
23647 | AgComponentUtils = __decorate([
|
23648 | context_1.Bean("agComponentUtils")
|
23649 | ], AgComponentUtils);
|
23650 | return AgComponentUtils;
|
23651 | }());
|
23652 | exports.AgComponentUtils = AgComponentUtils;
|
23653 |
|
23654 |
|
23655 | }),
|
23656 |
|
23657 | (function(module, exports, __webpack_require__) {
|
23658 |
|
23659 | "use strict";
|
23660 |
|
23661 |
|
23662 |
|
23663 |
|
23664 |
|
23665 |
|
23666 |
|
23667 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
23668 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
23669 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
23670 | 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;
|
23671 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
23672 | };
|
23673 | var __metadata = (this && this.__metadata) || function (k, v) {
|
23674 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
23675 | };
|
23676 | Object.defineProperty(exports, "__esModule", { value: true });
|
23677 | var context_1 = __webpack_require__(0);
|
23678 | var agComponentUtils_1 = __webpack_require__(76);
|
23679 | var ComponentMetadataProvider = (function () {
|
23680 | function ComponentMetadataProvider() {
|
23681 | }
|
23682 | ComponentMetadataProvider.prototype.postConstruct = function () {
|
23683 | this.componentMetaData = {
|
23684 | dateComponent: {
|
23685 | mandatoryMethodList: ['getDate', 'setDate'],
|
23686 | optionalMethodList: ['afterGuiAttached']
|
23687 | },
|
23688 | detailCellRenderer: {
|
23689 | mandatoryMethodList: [],
|
23690 | optionalMethodList: []
|
23691 | },
|
23692 | headerComponent: {
|
23693 | mandatoryMethodList: [],
|
23694 | optionalMethodList: []
|
23695 | },
|
23696 | headerGroupComponent: {
|
23697 | mandatoryMethodList: [],
|
23698 | optionalMethodList: []
|
23699 | },
|
23700 | loadingOverlayComponent: {
|
23701 | mandatoryMethodList: [],
|
23702 | optionalMethodList: []
|
23703 | },
|
23704 | noRowsOverlayComponent: {
|
23705 | mandatoryMethodList: [],
|
23706 | optionalMethodList: []
|
23707 | },
|
23708 | floatingFilterComponent: {
|
23709 | mandatoryMethodList: ['onParentModelChanged'],
|
23710 | optionalMethodList: ['afterGuiAttached']
|
23711 | },
|
23712 | floatingFilterWrapperComponent: {
|
23713 | mandatoryMethodList: [],
|
23714 | optionalMethodList: []
|
23715 | },
|
23716 | cellRenderer: {
|
23717 | mandatoryMethodList: [],
|
23718 | optionalMethodList: ['refresh', 'afterGuiAttached'],
|
23719 | functionAdapter: this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)
|
23720 | },
|
23721 | cellEditor: {
|
23722 | mandatoryMethodList: ['getValue'],
|
23723 | optionalMethodList: ['isPopup', 'isCancelBeforeStart', 'isCancelAfterEnd', 'focusIn', 'focusOut', 'afterGuiAttached']
|
23724 | },
|
23725 | innerRenderer: {
|
23726 | mandatoryMethodList: [],
|
23727 | optionalMethodList: ['afterGuiAttached'],
|
23728 | functionAdapter: this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)
|
23729 | },
|
23730 | fullWidthCellRenderer: {
|
23731 | mandatoryMethodList: [],
|
23732 | optionalMethodList: ['afterGuiAttached'],
|
23733 | functionAdapter: this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)
|
23734 | },
|
23735 | pinnedRowCellRenderer: {
|
23736 | mandatoryMethodList: [],
|
23737 | optionalMethodList: ['afterGuiAttached'],
|
23738 | functionAdapter: this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)
|
23739 | },
|
23740 | groupRowInnerRenderer: {
|
23741 | mandatoryMethodList: [],
|
23742 | optionalMethodList: ['afterGuiAttached'],
|
23743 | functionAdapter: this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)
|
23744 | },
|
23745 | groupRowRenderer: {
|
23746 | mandatoryMethodList: [],
|
23747 | optionalMethodList: ['afterGuiAttached'],
|
23748 | functionAdapter: this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)
|
23749 | },
|
23750 | filter: {
|
23751 | mandatoryMethodList: ['isFilterActive', 'doesFilterPass', 'getModel', 'setModel'],
|
23752 | optionalMethodList: ['afterGuiAttached', 'onNewRowsLoaded', 'getModelAsString', 'onFloatingFilterChanged', 'afterGuiAttached']
|
23753 | },
|
23754 | filterComponent: {
|
23755 | mandatoryMethodList: ['isFilterActive', 'doesFilterPass', 'getModel', 'setModel'],
|
23756 | optionalMethodList: ['afterGuiAttached', 'onNewRowsLoaded', 'getModelAsString', 'onFloatingFilterChanged', 'afterGuiAttached']
|
23757 | }
|
23758 | };
|
23759 | };
|
23760 | ComponentMetadataProvider.prototype.retrieve = function (name) {
|
23761 | return this.componentMetaData[name];
|
23762 | };
|
23763 | __decorate([
|
23764 | context_1.Autowired("agComponentUtils"),
|
23765 | __metadata("design:type", agComponentUtils_1.AgComponentUtils)
|
23766 | ], ComponentMetadataProvider.prototype, "agComponentUtils", void 0);
|
23767 | __decorate([
|
23768 | context_1.PostConstruct,
|
23769 | __metadata("design:type", Function),
|
23770 | __metadata("design:paramtypes", []),
|
23771 | __metadata("design:returntype", void 0)
|
23772 | ], ComponentMetadataProvider.prototype, "postConstruct", null);
|
23773 | ComponentMetadataProvider = __decorate([
|
23774 | context_1.Bean("componentMetadataProvider")
|
23775 | ], ComponentMetadataProvider);
|
23776 | return ComponentMetadataProvider;
|
23777 | }());
|
23778 | exports.ComponentMetadataProvider = ComponentMetadataProvider;
|
23779 |
|
23780 |
|
23781 | }),
|
23782 |
|
23783 | (function(module, exports, __webpack_require__) {
|
23784 |
|
23785 | "use strict";
|
23786 |
|
23787 |
|
23788 |
|
23789 |
|
23790 |
|
23791 |
|
23792 |
|
23793 | var __extends = (this && this.__extends) || (function () {
|
23794 | var extendStatics = Object.setPrototypeOf ||
|
23795 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
23796 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
23797 | return function (d, b) {
|
23798 | extendStatics(d, b);
|
23799 | function __() { this.constructor = d; }
|
23800 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
23801 | };
|
23802 | })();
|
23803 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
23804 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
23805 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
23806 | 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;
|
23807 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
23808 | };
|
23809 | var __metadata = (this && this.__metadata) || function (k, v) {
|
23810 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
23811 | };
|
23812 | Object.defineProperty(exports, "__esModule", { value: true });
|
23813 | var utils_1 = __webpack_require__(1);
|
23814 | var resizeObserver_1 = __webpack_require__(96);
|
23815 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
23816 | var columnController_1 = __webpack_require__(4);
|
23817 | var columnApi_1 = __webpack_require__(7);
|
23818 | var rowRenderer_1 = __webpack_require__(20);
|
23819 | var context_1 = __webpack_require__(0);
|
23820 | var eventService_1 = __webpack_require__(3);
|
23821 | var events_1 = __webpack_require__(5);
|
23822 | var dragService_1 = __webpack_require__(40);
|
23823 | var constants_1 = __webpack_require__(9);
|
23824 | var selectionController_1 = __webpack_require__(17);
|
23825 | var csvCreator_1 = __webpack_require__(47);
|
23826 | var mouseEventService_1 = __webpack_require__(44);
|
23827 | var focusedCellController_1 = __webpack_require__(22);
|
23828 | var scrollVisibleService_1 = __webpack_require__(36);
|
23829 | var rowContainerComponent_1 = __webpack_require__(130);
|
23830 | var paginationProxy_1 = __webpack_require__(29);
|
23831 | var popupEditorWrapper_1 = __webpack_require__(69);
|
23832 | var alignedGridsService_1 = __webpack_require__(58);
|
23833 | var pinnedRowModel_1 = __webpack_require__(30);
|
23834 | var gridApi_1 = __webpack_require__(6);
|
23835 | var animationFrameService_1 = __webpack_require__(37);
|
23836 | var rowComp_1 = __webpack_require__(50);
|
23837 | var navigationService_1 = __webpack_require__(97);
|
23838 | var valueService_1 = __webpack_require__(15);
|
23839 | var touchListener_1 = __webpack_require__(46);
|
23840 | var componentRecipes_1 = __webpack_require__(21);
|
23841 | var dragAndDropService_1 = __webpack_require__(14);
|
23842 | var rowDragFeature_1 = __webpack_require__(131);
|
23843 | var heightScaler_1 = __webpack_require__(57);
|
23844 | var component_1 = __webpack_require__(8);
|
23845 | var autoHeightCalculator_1 = __webpack_require__(79);
|
23846 | var columnAnimationService_1 = __webpack_require__(53);
|
23847 | var autoWidthCalculator_1 = __webpack_require__(39);
|
23848 | var beans_1 = __webpack_require__(28);
|
23849 | var componentAnnotations_1 = __webpack_require__(11);
|
23850 | var headerRootComp_1 = __webpack_require__(80);
|
23851 |
|
23852 |
|
23853 | var 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>";
|
23854 | var GridPanel = (function (_super) {
|
23855 | __extends(GridPanel, _super);
|
23856 | function GridPanel() {
|
23857 | var _this = _super.call(this, GRID_PANEL_NORMAL_TEMPLATE) || this;
|
23858 | _this.scrollLeft = -1;
|
23859 | _this.nextScrollLeft = -1;
|
23860 | _this.scrollTop = -1;
|
23861 | _this.nextScrollTop = -1;
|
23862 | _this.verticalRedrawNeeded = false;
|
23863 | return _this;
|
23864 | }
|
23865 | GridPanel.prototype.getVScrollPosition = function () {
|
23866 | var result = {
|
23867 | top: this.eBodyViewport.scrollTop,
|
23868 | bottom: this.eBodyViewport.scrollTop + this.eBodyViewport.offsetHeight
|
23869 | };
|
23870 | return result;
|
23871 | };
|
23872 |
|
23873 | GridPanel.prototype.getHScrollPosition = function () {
|
23874 | var result = {
|
23875 | left: this.eBodyViewport.scrollLeft,
|
23876 | right: this.eBodyViewport.scrollTop + this.eBodyViewport.offsetWidth
|
23877 | };
|
23878 | return result;
|
23879 | };
|
23880 |
|
23881 | GridPanel.prototype.destroy = function () {
|
23882 | _super.prototype.destroy.call(this);
|
23883 | };
|
23884 | GridPanel.prototype.onRowDataChanged = function () {
|
23885 | this.showOrHideOverlay();
|
23886 | };
|
23887 | GridPanel.prototype.showOrHideOverlay = function () {
|
23888 | if (this.paginationProxy.isEmpty() && !this.gridOptionsWrapper.isSuppressNoRowsOverlay()) {
|
23889 | this.showNoRowsOverlay();
|
23890 | }
|
23891 | else {
|
23892 | this.hideOverlay();
|
23893 | }
|
23894 | };
|
23895 | GridPanel.prototype.onNewColumnsLoaded = function () {
|
23896 |
|
23897 |
|
23898 |
|
23899 |
|
23900 | if (this.columnController.isReady() && !this.paginationProxy.isEmpty()) {
|
23901 | this.hideOverlay();
|
23902 | }
|
23903 | };
|
23904 | GridPanel.prototype.init = function () {
|
23905 | this.instantiate(this.context);
|
23906 |
|
23907 | this.scrollWidth = this.gridOptionsWrapper.getScrollbarWidth();
|
23908 | this.enableRtl = this.gridOptionsWrapper.isEnableRtl();
|
23909 | this.useAnimationFrame = !this.gridOptionsWrapper.isSuppressAnimationFrame();
|
23910 |
|
23911 |
|
23912 |
|
23913 | this.scrollClipWidth = this.scrollWidth > 0 ? this.scrollWidth : 20;
|
23914 |
|
23915 | this.gridOptionsWrapper.addLayoutElement(this.getGui());
|
23916 | this.gridOptionsWrapper.addLayoutElement(this.eBody);
|
23917 | this.gridOptionsWrapper.addLayoutElement(this.eBodyViewport);
|
23918 | this.gridOptionsWrapper.addLayoutElement(this.eTopViewport);
|
23919 | this.gridOptionsWrapper.addLayoutElement(this.eBodyContainer);
|
23920 | this.suppressScrollOnFloatingRow();
|
23921 | this.setupRowAnimationCssClass();
|
23922 | this.buildRowContainerComponents();
|
23923 | this.addEventListeners();
|
23924 | this.addDragListeners();
|
23925 | this.addScrollListener();
|
23926 | if (this.gridOptionsWrapper.isSuppressHorizontalScroll()) {
|
23927 | this.eBodyViewport.style.overflowX = 'hidden';
|
23928 | }
|
23929 | this.setupOverlay();
|
23930 | if (this.gridOptionsWrapper.isRowModelDefault() && !this.gridOptionsWrapper.getRowData()) {
|
23931 | this.showLoadingOverlay();
|
23932 | }
|
23933 | this.setPinnedContainersVisible();
|
23934 | this.setBodyAndHeaderHeights();
|
23935 | this.disableBrowserDragging();
|
23936 | this.addShortcutKeyListeners();
|
23937 | this.addMouseListeners();
|
23938 | this.addKeyboardEvents();
|
23939 | this.addBodyViewportListener();
|
23940 | this.addStopEditingWhenGridLosesFocus();
|
23941 | this.mockContextMenuForIPad();
|
23942 | this.addRowDragListener();
|
23943 | if (this.$scope) {
|
23944 | this.addAngularApplyCheck();
|
23945 | }
|
23946 | this.onDisplayedColumnsWidthChanged();
|
23947 |
|
23948 | this.gridApi.registerGridComp(this);
|
23949 | this.alignedGridsService.registerGridComp(this);
|
23950 | this.headerRootComp.registerGridComp(this);
|
23951 | this.animationFrameService.registerGridComp(this);
|
23952 | this.navigationService.registerGridComp(this);
|
23953 | this.heightScaler.registerGridComp(this);
|
23954 | this.autoHeightCalculator.registerGridComp(this);
|
23955 | this.columnAnimationService.registerGridComp(this);
|
23956 | this.autoWidthCalculator.registerGridComp(this);
|
23957 | this.paginationAutoPageSizeService.registerGridComp(this);
|
23958 | this.beans.registerGridComp(this);
|
23959 | this.rowRenderer.registerGridComp(this);
|
23960 | if (this.rangeController) {
|
23961 | this.rangeController.registerGridComp(this);
|
23962 | }
|
23963 | var unsubscribeFromResize = resizeObserver_1.observeResize(this.eBodyViewport, this.onBodyViewportResized.bind(this));
|
23964 | this.addDestroyFunc(function () { return unsubscribeFromResize(); });
|
23965 | };
|
23966 | GridPanel.prototype.onBodyViewportResized = function () {
|
23967 | this.checkViewportAndScrolls();
|
23968 | };
|
23969 |
|
23970 | GridPanel.prototype.setColumnMovingCss = function (moving) {
|
23971 | this.addOrRemoveCssClass('ag-column-moving', moving);
|
23972 | };
|
23973 | GridPanel.prototype.setupOverlay = function () {
|
23974 | this.overlayWrapper = this.componentRecipes.newOverlayWrapperComponent();
|
23975 | this.eOverlay = this.queryForHtmlElement('[ref="eOverlay"]');
|
23976 | this.overlayWrapper.hideOverlay(this.eOverlay);
|
23977 | };
|
23978 | GridPanel.prototype.addRowDragListener = function () {
|
23979 | var rowDragFeature = new rowDragFeature_1.RowDragFeature(this.eBody, this);
|
23980 | this.context.wireBean(rowDragFeature);
|
23981 | this.dragAndDropService.addDropTarget(rowDragFeature);
|
23982 | };
|
23983 | GridPanel.prototype.addStopEditingWhenGridLosesFocus = function () {
|
23984 | var _this = this;
|
23985 | if (this.gridOptionsWrapper.isStopEditingWhenGridLosesFocus()) {
|
23986 | this.addDestroyableEventListener(this.eBody, 'focusout', function (event) {
|
23987 |
|
23988 | var elementWithFocus = event.relatedTarget;
|
23989 |
|
23990 | var clickInsideGrid = false;
|
23991 | var pointer = elementWithFocus;
|
23992 | while (utils_1.Utils.exists(pointer) && !clickInsideGrid) {
|
23993 | var isPopup = !!_this.gridOptionsWrapper.getDomData(pointer, popupEditorWrapper_1.PopupEditorWrapper.DOM_KEY_POPUP_EDITOR_WRAPPER);
|
23994 | var isBody = _this.eBody == pointer;
|
23995 | clickInsideGrid = isPopup || isBody;
|
23996 | pointer = pointer.parentNode;
|
23997 | }
|
23998 | if (!clickInsideGrid) {
|
23999 | _this.rowRenderer.stopEditing();
|
24000 | }
|
24001 | });
|
24002 | }
|
24003 | };
|
24004 | GridPanel.prototype.addAngularApplyCheck = function () {
|
24005 | var _this = this;
|
24006 |
|
24007 | var applyTriggered = false;
|
24008 | var listener = function () {
|
24009 |
|
24010 | if (applyTriggered) {
|
24011 | return;
|
24012 | }
|
24013 | applyTriggered = true;
|
24014 | setTimeout(function () {
|
24015 | applyTriggered = false;
|
24016 | _this.$scope.$apply();
|
24017 | }, 0);
|
24018 | };
|
24019 |
|
24020 |
|
24021 | this.addDestroyableEventListener(this.eventService, events_1.Events.EVENT_DISPLAYED_COLUMNS_CHANGED, listener);
|
24022 | this.addDestroyableEventListener(this.eventService, events_1.Events.EVENT_VIRTUAL_COLUMNS_CHANGED, listener);
|
24023 | };
|
24024 |
|
24025 |
|
24026 | GridPanel.prototype.disableBrowserDragging = function () {
|
24027 | this.getGui().addEventListener('dragstart', function (event) {
|
24028 | if (event.target instanceof HTMLImageElement) {
|
24029 | event.preventDefault();
|
24030 | return false;
|
24031 | }
|
24032 | });
|
24033 | };
|
24034 | GridPanel.prototype.addEventListeners = function () {
|
24035 | this.addDestroyableEventListener(this.eventService, events_1.Events.EVENT_DISPLAYED_COLUMNS_CHANGED, this.onDisplayedColumnsChanged.bind(this));
|
24036 | this.addDestroyableEventListener(this.eventService, events_1.Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED, this.onDisplayedColumnsWidthChanged.bind(this));
|
24037 | this.addDestroyableEventListener(this.eventService, events_1.Events.EVENT_PINNED_ROW_DATA_CHANGED, this.setBodyAndHeaderHeights.bind(this));
|
24038 | this.addDestroyableEventListener(this.eventService, events_1.Events.EVENT_ROW_DATA_CHANGED, this.onRowDataChanged.bind(this));
|
24039 | this.addDestroyableEventListener(this.eventService, events_1.Events.EVENT_ROW_DATA_UPDATED, this.onRowDataChanged.bind(this));
|
24040 | this.addDestroyableEventListener(this.eventService, events_1.Events.EVENT_NEW_COLUMNS_LOADED, this.onNewColumnsLoaded.bind(this));
|
24041 | this.addDestroyableEventListener(this.gridOptionsWrapper, gridOptionsWrapper_1.GridOptionsWrapper.PROP_HEADER_HEIGHT, this.setBodyAndHeaderHeights.bind(this));
|
24042 | this.addDestroyableEventListener(this.gridOptionsWrapper, gridOptionsWrapper_1.GridOptionsWrapper.PROP_PIVOT_HEADER_HEIGHT, this.setBodyAndHeaderHeights.bind(this));
|
24043 | this.addDestroyableEventListener(this.gridOptionsWrapper, gridOptionsWrapper_1.GridOptionsWrapper.PROP_GROUP_HEADER_HEIGHT, this.setBodyAndHeaderHeights.bind(this));
|
24044 | this.addDestroyableEventListener(this.gridOptionsWrapper, gridOptionsWrapper_1.GridOptionsWrapper.PROP_PIVOT_GROUP_HEADER_HEIGHT, this.setBodyAndHeaderHeights.bind(this));
|
24045 | this.addDestroyableEventListener(this.gridOptionsWrapper, gridOptionsWrapper_1.GridOptionsWrapper.PROP_FLOATING_FILTERS_HEIGHT, this.setBodyAndHeaderHeights.bind(this));
|
24046 | };
|
24047 | GridPanel.prototype.addDragListeners = function () {
|
24048 | var _this = this;
|
24049 | if (!this.gridOptionsWrapper.isEnableRangeSelection()
|
24050 | || utils_1.Utils.missing(this.rangeController)) {
|
24051 | return;
|
24052 | }
|
24053 | var containers = [this.eLeftContainer, this.eRightContainer, this.eBodyContainer,
|
24054 | this.eTop, this.eBottom];
|
24055 | containers.forEach(function (container) {
|
24056 | var params = {
|
24057 | eElement: container,
|
24058 | onDragStart: _this.rangeController.onDragStart.bind(_this.rangeController),
|
24059 | onDragStop: _this.rangeController.onDragStop.bind(_this.rangeController),
|
24060 | onDragging: _this.rangeController.onDragging.bind(_this.rangeController),
|
24061 |
|
24062 |
|
24063 | skipMouseEvent: function (mouseEvent) { return mouseEvent.shiftKey; }
|
24064 | };
|
24065 | _this.dragService.addDragSource(params);
|
24066 | _this.addDestroyFunc(function () { return _this.dragService.removeDragSource(params); });
|
24067 | });
|
24068 | };
|
24069 | GridPanel.prototype.addMouseListeners = function () {
|
24070 | var _this = this;
|
24071 | var eventNames = ['click', 'mousedown', 'dblclick', 'contextmenu', 'mouseover', 'mouseout'];
|
24072 | eventNames.forEach(function (eventName) {
|
24073 | var listener = _this.processMouseEvent.bind(_this, eventName);
|
24074 | _this.eAllCellContainers.forEach(function (container) {
|
24075 | return _this.addDestroyableEventListener(container, eventName, listener);
|
24076 | });
|
24077 | });
|
24078 | };
|
24079 | GridPanel.prototype.addKeyboardEvents = function () {
|
24080 | var _this = this;
|
24081 | var eventNames = ['keydown', 'keypress'];
|
24082 | eventNames.forEach(function (eventName) {
|
24083 | var listener = _this.processKeyboardEvent.bind(_this, eventName);
|
24084 | _this.eAllCellContainers.forEach(function (container) {
|
24085 | _this.addDestroyableEventListener(container, eventName, listener);
|
24086 | });
|
24087 | });
|
24088 | };
|
24089 | GridPanel.prototype.addBodyViewportListener = function () {
|
24090 | var _this = this;
|
24091 |
|
24092 |
|
24093 | var listener = function (mouseEvent) {
|
24094 | var target = utils_1.Utils.getTarget(mouseEvent);
|
24095 | if (target === _this.eBodyViewport || target === _this.eLeftViewport || target === _this.eRightViewport) {
|
24096 |
|
24097 | _this.onContextMenu(mouseEvent, null, null, null, null);
|
24098 | _this.preventDefaultOnContextMenu(mouseEvent);
|
24099 | }
|
24100 | };
|
24101 |
|
24102 |
|
24103 |
|
24104 | this.addDestroyableEventListener(this.eBodyViewport, 'contextmenu', listener);
|
24105 | this.addDestroyableEventListener(this.eRightViewport, 'contextmenu', listener);
|
24106 | this.addDestroyableEventListener(this.eLeftViewport, 'contextmenu', listener);
|
24107 | };
|
24108 |
|
24109 | GridPanel.prototype.getBodyClientRect = function () {
|
24110 | if (this.eBody) {
|
24111 | return this.eBody.getBoundingClientRect();
|
24112 | }
|
24113 | };
|
24114 | GridPanel.prototype.getRowForEvent = function (event) {
|
24115 | var sourceElement = utils_1.Utils.getTarget(event);
|
24116 | while (sourceElement) {
|
24117 | var renderedRow = this.gridOptionsWrapper.getDomData(sourceElement, rowComp_1.RowComp.DOM_DATA_KEY_RENDERED_ROW);
|
24118 | if (renderedRow) {
|
24119 | return renderedRow;
|
24120 | }
|
24121 | sourceElement = sourceElement.parentElement;
|
24122 | }
|
24123 | return null;
|
24124 | };
|
24125 | GridPanel.prototype.processKeyboardEvent = function (eventName, keyboardEvent) {
|
24126 | var renderedCell = this.mouseEventService.getRenderedCellForEvent(keyboardEvent);
|
24127 | if (!renderedCell) {
|
24128 | return;
|
24129 | }
|
24130 | switch (eventName) {
|
24131 | case 'keydown':
|
24132 |
|
24133 | var wasScrollKey = this.navigationService.handlePageScrollingKey(keyboardEvent);
|
24134 |
|
24135 | if (!wasScrollKey) {
|
24136 | renderedCell.onKeyDown(keyboardEvent);
|
24137 | }
|
24138 | break;
|
24139 | case 'keypress':
|
24140 | renderedCell.onKeyPress(keyboardEvent);
|
24141 | break;
|
24142 | }
|
24143 | };
|
24144 |
|
24145 | GridPanel.prototype.scrollToTop = function () {
|
24146 | this.eBodyViewport.scrollTop = 0;
|
24147 | };
|
24148 | GridPanel.prototype.processMouseEvent = function (eventName, mouseEvent) {
|
24149 | if (!this.mouseEventService.isEventFromThisGrid(mouseEvent)) {
|
24150 | return;
|
24151 | }
|
24152 | if (utils_1.Utils.isStopPropagationForAgGrid(mouseEvent)) {
|
24153 | return;
|
24154 | }
|
24155 | var rowComp = this.getRowForEvent(mouseEvent);
|
24156 | var cellComp = this.mouseEventService.getRenderedCellForEvent(mouseEvent);
|
24157 | if (eventName === "contextmenu") {
|
24158 | this.handleContextMenuMouseEvent(mouseEvent, null, rowComp, cellComp);
|
24159 | }
|
24160 | else {
|
24161 | if (cellComp) {
|
24162 | cellComp.onMouseEvent(eventName, mouseEvent);
|
24163 | }
|
24164 | if (rowComp) {
|
24165 | rowComp.onMouseEvent(eventName, mouseEvent);
|
24166 | }
|
24167 | }
|
24168 | this.preventDefaultOnContextMenu(mouseEvent);
|
24169 | };
|
24170 | GridPanel.prototype.mockContextMenuForIPad = function () {
|
24171 | var _this = this;
|
24172 |
|
24173 | if (!utils_1.Utils.isUserAgentIPad()) {
|
24174 | return;
|
24175 | }
|
24176 | this.eAllCellContainers.forEach(function (container) {
|
24177 | var touchListener = new touchListener_1.TouchListener(container);
|
24178 | var longTapListener = function (event) {
|
24179 | var rowComp = _this.getRowForEvent(event.touchEvent);
|
24180 | var cellComp = _this.mouseEventService.getRenderedCellForEvent(event.touchEvent);
|
24181 | _this.handleContextMenuMouseEvent(null, event.touchEvent, rowComp, cellComp);
|
24182 | };
|
24183 | _this.addDestroyableEventListener(touchListener, touchListener_1.TouchListener.EVENT_LONG_TAP, longTapListener);
|
24184 | _this.addDestroyFunc(function () { return touchListener.destroy(); });
|
24185 | });
|
24186 | };
|
24187 | GridPanel.prototype.handleContextMenuMouseEvent = function (mouseEvent, touchEvent, rowComp, cellComp) {
|
24188 | var rowNode = rowComp ? rowComp.getRowNode() : null;
|
24189 | var column = cellComp ? cellComp.getColumn() : null;
|
24190 | var value = null;
|
24191 | if (column) {
|
24192 | var event_1 = mouseEvent ? mouseEvent : touchEvent;
|
24193 | cellComp.dispatchCellContextMenuEvent(event_1);
|
24194 | value = this.valueService.getValue(column, rowNode);
|
24195 | }
|
24196 | this.onContextMenu(mouseEvent, touchEvent, rowNode, column, value);
|
24197 | };
|
24198 | GridPanel.prototype.onContextMenu = function (mouseEvent, touchEvent, rowNode, column, value) {
|
24199 |
|
24200 |
|
24201 | if (!this.gridOptionsWrapper.isAllowContextMenuWithControlKey()) {
|
24202 |
|
24203 | if (mouseEvent && (mouseEvent.ctrlKey || mouseEvent.metaKey)) {
|
24204 | return;
|
24205 | }
|
24206 | }
|
24207 | if (this.contextMenuFactory && !this.gridOptionsWrapper.isSuppressContextMenu()) {
|
24208 | var eventOrTouch = mouseEvent ? mouseEvent : touchEvent.touches[0];
|
24209 | this.contextMenuFactory.showMenu(rowNode, column, value, eventOrTouch);
|
24210 | var event_2 = mouseEvent ? mouseEvent : touchEvent;
|
24211 | event_2.preventDefault();
|
24212 | }
|
24213 | };
|
24214 | GridPanel.prototype.preventDefaultOnContextMenu = function (mouseEvent) {
|
24215 |
|
24216 |
|
24217 |
|
24218 |
|
24219 | if (this.gridOptionsWrapper.isSuppressMiddleClickScrolls() && mouseEvent.which === 2) {
|
24220 | mouseEvent.preventDefault();
|
24221 | }
|
24222 | };
|
24223 | GridPanel.prototype.addShortcutKeyListeners = function () {
|
24224 | var _this = this;
|
24225 | this.eAllCellContainers.forEach(function (container) {
|
24226 | container.addEventListener('keydown', function (event) {
|
24227 |
|
24228 |
|
24229 |
|
24230 | var renderedCell = _this.mouseEventService.getRenderedCellForEvent(event);
|
24231 | if (renderedCell && renderedCell.isEditing()) {
|
24232 | return;
|
24233 | }
|
24234 |
|
24235 |
|
24236 | if (!_this.mouseEventService.isEventFromThisGrid(event)) {
|
24237 | return;
|
24238 | }
|
24239 | if (event.ctrlKey || event.metaKey) {
|
24240 | switch (event.which) {
|
24241 | case constants_1.Constants.KEY_A: return _this.onCtrlAndA(event);
|
24242 | case constants_1.Constants.KEY_C: return _this.onCtrlAndC(event);
|
24243 | case constants_1.Constants.KEY_V: return _this.onCtrlAndV(event);
|
24244 | case constants_1.Constants.KEY_D: return _this.onCtrlAndD(event);
|
24245 | }
|
24246 | }
|
24247 | });
|
24248 | });
|
24249 | };
|
24250 | GridPanel.prototype.onCtrlAndA = function (event) {
|
24251 | if (this.rangeController && this.paginationProxy.isRowsToRender()) {
|
24252 | var rowEnd = void 0;
|
24253 | var floatingStart = void 0;
|
24254 | var floatingEnd = void 0;
|
24255 | if (this.pinnedRowModel.isEmpty(constants_1.Constants.PINNED_TOP)) {
|
24256 | floatingStart = null;
|
24257 | }
|
24258 | else {
|
24259 | floatingStart = constants_1.Constants.PINNED_TOP;
|
24260 | }
|
24261 | if (this.pinnedRowModel.isEmpty(constants_1.Constants.PINNED_BOTTOM)) {
|
24262 | floatingEnd = null;
|
24263 | rowEnd = this.paginationProxy.getTotalRowCount() - 1;
|
24264 | }
|
24265 | else {
|
24266 | floatingEnd = constants_1.Constants.PINNED_BOTTOM;
|
24267 | rowEnd = this.pinnedRowModel.getPinnedBottomRowData().length - 1;
|
24268 | }
|
24269 | var allDisplayedColumns = this.columnController.getAllDisplayedColumns();
|
24270 | if (utils_1.Utils.missingOrEmpty(allDisplayedColumns)) {
|
24271 | return;
|
24272 | }
|
24273 | this.rangeController.setRange({
|
24274 | rowStart: 0,
|
24275 | floatingStart: floatingStart,
|
24276 | rowEnd: rowEnd,
|
24277 | floatingEnd: floatingEnd,
|
24278 | columnStart: allDisplayedColumns[0],
|
24279 | columnEnd: allDisplayedColumns[allDisplayedColumns.length - 1]
|
24280 | });
|
24281 | }
|
24282 | event.preventDefault();
|
24283 | return false;
|
24284 | };
|
24285 | GridPanel.prototype.onCtrlAndC = function (event) {
|
24286 | if (!this.clipboardService) {
|
24287 | return;
|
24288 | }
|
24289 | var focusedCell = this.focusedCellController.getFocusedCell();
|
24290 | this.clipboardService.copyToClipboard();
|
24291 | event.preventDefault();
|
24292 |
|
24293 |
|
24294 |
|
24295 | if (focusedCell) {
|
24296 | this.focusedCellController.setFocusedCell(focusedCell.rowIndex, focusedCell.column, focusedCell.floating, true);
|
24297 | }
|
24298 | return false;
|
24299 | };
|
24300 | GridPanel.prototype.onCtrlAndV = function (event) {
|
24301 | if (!this.enterprise) {
|
24302 | return;
|
24303 | }
|
24304 | if (this.gridOptionsWrapper.isSuppressClipboardPaste()) {
|
24305 | return;
|
24306 | }
|
24307 | this.clipboardService.pasteFromClipboard();
|
24308 | return false;
|
24309 | };
|
24310 | GridPanel.prototype.onCtrlAndD = function (event) {
|
24311 | if (!this.enterprise) {
|
24312 | return;
|
24313 | }
|
24314 | this.clipboardService.copyRangeDown();
|
24315 | event.preventDefault();
|
24316 | return false;
|
24317 | };
|
24318 |
|
24319 |
|
24320 |
|
24321 |
|
24322 |
|
24323 |
|
24324 | GridPanel.prototype.ensureIndexVisible = function (index, position) {
|
24325 |
|
24326 | if (this.gridOptionsWrapper.isGridAutoHeight()) {
|
24327 | return;
|
24328 | }
|
24329 | var rowCount = this.paginationProxy.getTotalRowCount();
|
24330 | if (typeof index !== 'number' || index < 0 || index >= rowCount) {
|
24331 | console.warn('invalid row index for ensureIndexVisible: ' + index);
|
24332 | return;
|
24333 | }
|
24334 | this.paginationProxy.goToPageWithIndex(index);
|
24335 | var rowNode = this.paginationProxy.getRow(index);
|
24336 | var paginationOffset = this.paginationProxy.getPixelOffset();
|
24337 | var rowTopPixel = rowNode.rowTop - paginationOffset;
|
24338 | var rowBottomPixel = rowTopPixel + rowNode.rowHeight;
|
24339 | var scrollPosition = this.getVScrollPosition();
|
24340 | var heightOffset = this.heightScaler.getOffset();
|
24341 | var vScrollTop = scrollPosition.top + heightOffset;
|
24342 | var vScrollBottom = scrollPosition.bottom + heightOffset;
|
24343 | if (this.isHorizontalScrollShowing()) {
|
24344 | vScrollBottom -= this.scrollWidth;
|
24345 | }
|
24346 | var viewportHeight = vScrollBottom - vScrollTop;
|
24347 | var newScrollPosition = null;
|
24348 |
|
24349 |
|
24350 | var pxTop = this.heightScaler.getScrollPositionForPixel(rowTopPixel);
|
24351 | var pxBottom = this.heightScaler.getScrollPositionForPixel(rowBottomPixel - viewportHeight);
|
24352 | var pxMiddle = (pxTop + pxBottom) / 2;
|
24353 |
|
24354 | if (pxMiddle > rowTopPixel) {
|
24355 | pxMiddle = rowTopPixel;
|
24356 | }
|
24357 | var rowBelowViewport = vScrollTop > rowTopPixel;
|
24358 | var rowAboveViewport = vScrollBottom < rowBottomPixel;
|
24359 | if (position === 'top') {
|
24360 | newScrollPosition = pxTop;
|
24361 | }
|
24362 | else if (position === 'bottom') {
|
24363 | newScrollPosition = pxBottom;
|
24364 | }
|
24365 | else if (position === 'middle') {
|
24366 | newScrollPosition = pxMiddle;
|
24367 | }
|
24368 | else if (rowBelowViewport) {
|
24369 |
|
24370 | newScrollPosition = pxTop;
|
24371 | }
|
24372 | else if (rowAboveViewport) {
|
24373 |
|
24374 | newScrollPosition = pxBottom;
|
24375 | }
|
24376 | if (newScrollPosition !== null) {
|
24377 | this.eBodyViewport.scrollTop = newScrollPosition;
|
24378 | this.rowRenderer.redrawAfterScroll();
|
24379 | }
|
24380 | };
|
24381 |
|
24382 | GridPanel.prototype.getCenterWidth = function () {
|
24383 | return this.eBodyViewport.clientWidth;
|
24384 | };
|
24385 | GridPanel.prototype.isHorizontalScrollShowing = function () {
|
24386 | return utils_1.Utils.isHorizontalScrollShowing(this.eBodyViewport);
|
24387 | };
|
24388 | GridPanel.prototype.isVerticalScrollShowing = function () {
|
24389 | return utils_1.Utils.isVerticalScrollShowing(this.eBodyViewport);
|
24390 | };
|
24391 |
|
24392 |
|
24393 | GridPanel.prototype.checkViewportAndScrolls = function () {
|
24394 |
|
24395 | this.updateScrollVisibleService();
|
24396 |
|
24397 | this.checkBodyHeight();
|
24398 |
|
24399 | this.onHorizontalViewportChanged();
|
24400 | this.setPinnedLeftWidth();
|
24401 | this.setPinnedRightWidth();
|
24402 | this.setBottomPaddingOnPinned();
|
24403 | this.hideVerticalScrollOnCenter();
|
24404 | this.hideFullWidthViewportScrollbars();
|
24405 | };
|
24406 | GridPanel.prototype.updateScrollVisibleService = function () {
|
24407 | var params = {
|
24408 | bodyHorizontalScrollShowing: false,
|
24409 | leftVerticalScrollShowing: false,
|
24410 | rightVerticalScrollShowing: false
|
24411 | };
|
24412 | if (this.enableRtl && this.columnController.isPinningLeft()) {
|
24413 | params.leftVerticalScrollShowing = utils_1.Utils.isVerticalScrollShowing(this.eLeftViewport);
|
24414 | }
|
24415 | if (!this.enableRtl && this.columnController.isPinningRight()) {
|
24416 | params.rightVerticalScrollShowing = utils_1.Utils.isVerticalScrollShowing(this.eRightViewport);
|
24417 | }
|
24418 | params.bodyHorizontalScrollShowing = this.isHorizontalScrollShowing();
|
24419 | this.scrollVisibleService.setScrollsVisible(params);
|
24420 | };
|
24421 |
|
24422 |
|
24423 |
|
24424 | GridPanel.prototype.setBottomPaddingOnPinned = function () {
|
24425 |
|
24426 | if (this.scrollWidth <= 0) {
|
24427 | return;
|
24428 | }
|
24429 | if (this.isHorizontalScrollShowing()) {
|
24430 | this.eRightContainer.style.marginBottom = this.scrollWidth + 'px';
|
24431 | this.eLeftContainer.style.marginBottom = this.scrollWidth + 'px';
|
24432 | }
|
24433 | else {
|
24434 | this.eRightContainer.style.marginBottom = '';
|
24435 | this.eLeftContainer.style.marginBottom = '';
|
24436 | }
|
24437 | };
|
24438 | GridPanel.prototype.hideFullWidthViewportScrollbars = function () {
|
24439 |
|
24440 |
|
24441 |
|
24442 | var scrollWidthPx = this.scrollClipWidth > 0 ? this.scrollWidth + 'px' : '';
|
24443 |
|
24444 |
|
24445 | this.eFullWidthViewportWrapper.style.paddingBottom = this.isHorizontalScrollShowing() ? scrollWidthPx : '';
|
24446 |
|
24447 |
|
24448 |
|
24449 | var takeOutVScroll = this.isVerticalScrollShowing();
|
24450 | if (this.enableRtl) {
|
24451 | this.eFullWidthViewportWrapper.style.marginLeft = takeOutVScroll ? scrollWidthPx : '';
|
24452 | this.eFullWidthViewport.style.marginLeft = takeOutVScroll ? ('-' + scrollWidthPx) : '';
|
24453 | }
|
24454 | else {
|
24455 | this.eFullWidthViewportWrapper.style.width = takeOutVScroll ? "calc(100% - " + scrollWidthPx + ")" : '';
|
24456 | this.eFullWidthViewport.style.width = takeOutVScroll ? "calc(100% + " + scrollWidthPx + ")" : '';
|
24457 | }
|
24458 | };
|
24459 | GridPanel.prototype.ensureColumnVisible = function (key) {
|
24460 | var column = this.columnController.getGridColumn(key);
|
24461 | if (!column) {
|
24462 | return;
|
24463 | }
|
24464 | if (column.isPinned()) {
|
24465 | console.warn('calling ensureIndexVisible on a ' + column.getPinned() + ' pinned column doesn\'t make sense for column ' + column.getColId());
|
24466 | return;
|
24467 | }
|
24468 | if (!this.columnController.isColumnDisplayed(column)) {
|
24469 | console.warn('column is not currently visible');
|
24470 | return;
|
24471 | }
|
24472 | var colLeftPixel = column.getLeft();
|
24473 | var colRightPixel = colLeftPixel + column.getActualWidth();
|
24474 | var viewportWidth = this.eBodyViewport.clientWidth;
|
24475 | var scrollPosition = this.getBodyViewportScrollLeft();
|
24476 | var bodyWidth = this.columnController.getBodyContainerWidth();
|
24477 | var viewportLeftPixel;
|
24478 | var viewportRightPixel;
|
24479 |
|
24480 |
|
24481 | if (this.enableRtl) {
|
24482 | viewportLeftPixel = bodyWidth - scrollPosition - viewportWidth;
|
24483 | viewportRightPixel = bodyWidth - scrollPosition;
|
24484 | }
|
24485 | else {
|
24486 | viewportLeftPixel = scrollPosition;
|
24487 | viewportRightPixel = viewportWidth + scrollPosition;
|
24488 | }
|
24489 | var viewportScrolledPastCol = viewportLeftPixel > colLeftPixel;
|
24490 | var viewportScrolledBeforeCol = viewportRightPixel < colRightPixel;
|
24491 | var colToSmallForViewport = viewportWidth < column.getActualWidth();
|
24492 | var alignColToLeft = viewportScrolledPastCol || colToSmallForViewport;
|
24493 | var alignColToRight = viewportScrolledBeforeCol;
|
24494 | if (alignColToLeft) {
|
24495 |
|
24496 | if (this.enableRtl) {
|
24497 | var newScrollPosition = bodyWidth - viewportWidth - colLeftPixel;
|
24498 | this.setBodyViewportScrollLeft(newScrollPosition);
|
24499 | }
|
24500 | else {
|
24501 | this.setBodyViewportScrollLeft(colLeftPixel);
|
24502 | }
|
24503 | }
|
24504 | else if (alignColToRight) {
|
24505 |
|
24506 | if (this.enableRtl) {
|
24507 | var newScrollPosition = bodyWidth - colRightPixel;
|
24508 | this.setBodyViewportScrollLeft(newScrollPosition);
|
24509 | }
|
24510 | else {
|
24511 | var newScrollPosition = colRightPixel - viewportWidth;
|
24512 | this.setBodyViewportScrollLeft(newScrollPosition);
|
24513 | }
|
24514 | }
|
24515 | else {
|
24516 |
|
24517 | }
|
24518 |
|
24519 |
|
24520 |
|
24521 |
|
24522 | this.onHorizontalViewportChanged();
|
24523 | };
|
24524 | GridPanel.prototype.showLoadingOverlay = function () {
|
24525 | if (!this.gridOptionsWrapper.isSuppressLoadingOverlay()) {
|
24526 | this.overlayWrapper.showLoadingOverlay(this.eOverlay);
|
24527 | }
|
24528 | };
|
24529 | GridPanel.prototype.showNoRowsOverlay = function () {
|
24530 | if (!this.gridOptionsWrapper.isSuppressNoRowsOverlay()) {
|
24531 | this.overlayWrapper.showNoRowsOverlay(this.eOverlay);
|
24532 | }
|
24533 | };
|
24534 | GridPanel.prototype.hideOverlay = function () {
|
24535 | this.overlayWrapper.hideOverlay(this.eOverlay);
|
24536 | };
|
24537 | GridPanel.prototype.getWidthForSizeColsToFit = function () {
|
24538 | var availableWidth = this.eBody.clientWidth;
|
24539 |
|
24540 |
|
24541 |
|
24542 | var removeVerticalScrollWidth = this.isVerticalScrollShowing();
|
24543 | if (removeVerticalScrollWidth) {
|
24544 | availableWidth -= this.scrollWidth;
|
24545 | }
|
24546 | return availableWidth;
|
24547 | };
|
24548 |
|
24549 |
|
24550 | GridPanel.prototype.sizeColumnsToFit = function (nextTimeout) {
|
24551 | var _this = this;
|
24552 | var availableWidth = this.getWidthForSizeColsToFit();
|
24553 | if (availableWidth > 0) {
|
24554 | this.columnController.sizeColumnsToFit(availableWidth, "sizeColumnsToFit");
|
24555 | }
|
24556 | else {
|
24557 | if (nextTimeout === undefined) {
|
24558 | setTimeout(function () {
|
24559 | _this.sizeColumnsToFit(100);
|
24560 | }, 0);
|
24561 | }
|
24562 | else if (nextTimeout === 100) {
|
24563 | setTimeout(function () {
|
24564 | _this.sizeColumnsToFit(500);
|
24565 | }, 100);
|
24566 | }
|
24567 | else if (nextTimeout === 500) {
|
24568 | setTimeout(function () {
|
24569 | _this.sizeColumnsToFit(-1);
|
24570 | }, 500);
|
24571 | }
|
24572 | else {
|
24573 | console.log('ag-Grid: tried to call sizeColumnsToFit() but the grid is coming back with ' +
|
24574 | 'zero width, maybe the grid is not visible yet on the screen?');
|
24575 | }
|
24576 | }
|
24577 | };
|
24578 | GridPanel.prototype.getBodyContainer = function () {
|
24579 | return this.eBodyContainer;
|
24580 | };
|
24581 | GridPanel.prototype.getDropTargetBodyContainers = function () {
|
24582 | return [this.eBodyViewport, this.eTopViewport, this.eBottomViewport];
|
24583 | };
|
24584 | GridPanel.prototype.getDropTargetLeftContainers = function () {
|
24585 | return [this.eLeftViewport, this.eLeftBottom, this.eLeftTop];
|
24586 | };
|
24587 | GridPanel.prototype.getDropTargetRightContainers = function () {
|
24588 | return [this.eRightViewport, this.eRightBottom, this.eRightTop];
|
24589 | };
|
24590 | GridPanel.prototype.buildRowContainerComponents = function () {
|
24591 | var _this = this;
|
24592 | this.eAllCellContainers = [
|
24593 | this.eLeftContainer, this.eRightContainer, this.eBodyContainer,
|
24594 | this.eTop, this.eBottom, this.eFullWidthContainer
|
24595 | ];
|
24596 | this.rowContainerComponents = {
|
24597 | body: new rowContainerComponent_1.RowContainerComponent({ eContainer: this.eBodyContainer, eViewport: this.eBodyViewport }),
|
24598 | fullWidth: new rowContainerComponent_1.RowContainerComponent({ eContainer: this.eFullWidthContainer, hideWhenNoChildren: true, eViewport: this.eFullWidthViewport }),
|
24599 | pinnedLeft: new rowContainerComponent_1.RowContainerComponent({ eContainer: this.eLeftContainer, eViewport: this.eLeftViewport }),
|
24600 | pinnedRight: new rowContainerComponent_1.RowContainerComponent({ eContainer: this.eRightContainer, eViewport: this.eRightViewport }),
|
24601 | floatingTop: new rowContainerComponent_1.RowContainerComponent({ eContainer: this.eTopContainer }),
|
24602 | floatingTopPinnedLeft: new rowContainerComponent_1.RowContainerComponent({ eContainer: this.eLeftTop }),
|
24603 | floatingTopPinnedRight: new rowContainerComponent_1.RowContainerComponent({ eContainer: this.eRightTop }),
|
24604 | floatingTopFullWidth: new rowContainerComponent_1.RowContainerComponent({ eContainer: this.eTopFullWidthContainer, hideWhenNoChildren: true }),
|
24605 | floatingBottom: new rowContainerComponent_1.RowContainerComponent({ eContainer: this.eBottomContainer }),
|
24606 | floatingBottomPinnedLeft: new rowContainerComponent_1.RowContainerComponent({ eContainer: this.eLeftBottom }),
|
24607 | floatingBottomPinnedRight: new rowContainerComponent_1.RowContainerComponent({ eContainer: this.eRightBottom }),
|
24608 | floatingBottomFullWith: new rowContainerComponent_1.RowContainerComponent({ eContainer: this.eBottomFullWidthContainer, hideWhenNoChildren: true }),
|
24609 | };
|
24610 | utils_1.Utils.iterateObject(this.rowContainerComponents, function (key, container) {
|
24611 | if (container) {
|
24612 | _this.context.wireBean(container);
|
24613 | }
|
24614 | });
|
24615 | };
|
24616 | GridPanel.prototype.setupRowAnimationCssClass = function () {
|
24617 | var _this = this;
|
24618 | var listener = function () {
|
24619 |
|
24620 |
|
24621 | var animateRows = _this.gridOptionsWrapper.isAnimateRows() && !_this.heightScaler.isScaling();
|
24622 | utils_1.Utils.addOrRemoveCssClass(_this.eBody, 'ag-row-animation', animateRows);
|
24623 | utils_1.Utils.addOrRemoveCssClass(_this.eBody, 'ag-row-no-animation', !animateRows);
|
24624 | };
|
24625 | listener();
|
24626 | this.addDestroyableEventListener(this.eventService, events_1.Events.EVENT_HEIGHT_SCALE_CHANGED, listener);
|
24627 | };
|
24628 |
|
24629 |
|
24630 |
|
24631 | GridPanel.prototype.suppressScrollOnFloatingRow = function () {
|
24632 | var _this = this;
|
24633 | var resetTopScroll = function () { return _this.eTopViewport.scrollLeft = 0; };
|
24634 | var resetBottomScroll = function () { return _this.eTopViewport.scrollLeft = 0; };
|
24635 | this.addDestroyableEventListener(this.eTopViewport, 'scroll', resetTopScroll);
|
24636 | this.addDestroyableEventListener(this.eBottomViewport, 'scroll', resetBottomScroll);
|
24637 | };
|
24638 | GridPanel.prototype.getRowContainers = function () {
|
24639 | return this.rowContainerComponents;
|
24640 | };
|
24641 | GridPanel.prototype.onDisplayedColumnsChanged = function () {
|
24642 | this.setPinnedContainersVisible();
|
24643 | this.setBodyAndHeaderHeights();
|
24644 | this.onHorizontalViewportChanged();
|
24645 | };
|
24646 | GridPanel.prototype.onDisplayedColumnsWidthChanged = function () {
|
24647 | this.setWidthsOfContainers();
|
24648 | this.onHorizontalViewportChanged();
|
24649 | if (this.enableRtl) {
|
24650 |
|
24651 |
|
24652 |
|
24653 |
|
24654 |
|
24655 | this.horizontallyScrollHeaderCenterAndFloatingCenter();
|
24656 | }
|
24657 | };
|
24658 | GridPanel.prototype.setWidthsOfContainers = function () {
|
24659 | this.setCenterWidth();
|
24660 | this.setPinnedLeftWidth();
|
24661 | this.setPinnedRightWidth();
|
24662 | };
|
24663 | GridPanel.prototype.setCenterWidth = function () {
|
24664 | var widthPx = this.columnController.getBodyContainerWidth() + 'px';
|
24665 | this.eBodyContainer.style.width = widthPx;
|
24666 | this.eBottomContainer.style.width = widthPx;
|
24667 | this.eTopContainer.style.width = widthPx;
|
24668 | };
|
24669 | GridPanel.prototype.setPinnedLeftWidth = function () {
|
24670 | var widthOfCols = this.columnController.getPinnedLeftContainerWidth();
|
24671 | var widthOfColsAndScroll = widthOfCols + this.scrollWidth;
|
24672 | var widthOfColsAndClippedScroll = widthOfCols + this.scrollClipWidth;
|
24673 | var viewportWidth;
|
24674 | var wrapperWidth;
|
24675 | if (utils_1.Utils.isVerticalScrollShowing(this.eLeftViewport)) {
|
24676 | if (this.enableRtl) {
|
24677 |
|
24678 | viewportWidth = widthOfColsAndScroll;
|
24679 | wrapperWidth = widthOfColsAndScroll;
|
24680 | }
|
24681 | else {
|
24682 |
|
24683 | viewportWidth = widthOfColsAndClippedScroll;
|
24684 | wrapperWidth = widthOfCols;
|
24685 | }
|
24686 | }
|
24687 | else {
|
24688 |
|
24689 | viewportWidth = widthOfCols;
|
24690 | wrapperWidth = widthOfCols;
|
24691 | }
|
24692 | this.setElementWidth(this.eLeftViewportWrapper, wrapperWidth);
|
24693 | this.setElementWidth(this.eLeftViewport, viewportWidth);
|
24694 | this.setElementWidth(this.eLeftContainer, widthOfCols);
|
24695 | this.setElementWidth(this.eLeftBottom, wrapperWidth);
|
24696 | this.setElementWidth(this.eLeftTop, wrapperWidth);
|
24697 | };
|
24698 | GridPanel.prototype.setPinnedRightWidth = function () {
|
24699 | var widthOfCols = this.columnController.getPinnedRightContainerWidth();
|
24700 | var widthOfColsAndScroll = widthOfCols + this.scrollWidth;
|
24701 | var widthOfColsAndClippedScroll = widthOfCols + this.scrollClipWidth;
|
24702 | var viewportWidth;
|
24703 | var wrapperWidth;
|
24704 | if (utils_1.Utils.isVerticalScrollShowing(this.eRightViewport)) {
|
24705 | if (!this.enableRtl) {
|
24706 |
|
24707 | viewportWidth = widthOfColsAndScroll;
|
24708 | wrapperWidth = widthOfColsAndScroll;
|
24709 | }
|
24710 | else {
|
24711 |
|
24712 | viewportWidth = widthOfColsAndClippedScroll;
|
24713 | wrapperWidth = widthOfCols;
|
24714 | }
|
24715 | }
|
24716 | else {
|
24717 |
|
24718 | viewportWidth = widthOfCols;
|
24719 | wrapperWidth = widthOfCols;
|
24720 | }
|
24721 | this.setElementWidth(this.eRightViewportWrapper, wrapperWidth);
|
24722 | this.setElementWidth(this.eRightViewport, viewportWidth);
|
24723 | this.setElementWidth(this.eRightContainer, widthOfCols);
|
24724 | this.setElementWidth(this.eRightBottom, wrapperWidth);
|
24725 | this.setElementWidth(this.eRightTop, wrapperWidth);
|
24726 | };
|
24727 | GridPanel.prototype.setElementWidth = function (element, width) {
|
24728 |
|
24729 | element.style.width = width + 'px';
|
24730 | element.style.minWidth = width + 'px';
|
24731 | };
|
24732 | GridPanel.prototype.setPinnedContainersVisible = function () {
|
24733 | var changeDetected = false;
|
24734 | var showLeftPinned = this.columnController.isPinningLeft();
|
24735 | if (showLeftPinned !== this.pinningLeft) {
|
24736 | this.pinningLeft = showLeftPinned;
|
24737 | this.headerRootComp.setLeftVisible(showLeftPinned);
|
24738 | utils_1.Utils.setVisible(this.eLeftViewportWrapper, showLeftPinned);
|
24739 | changeDetected = true;
|
24740 | if (showLeftPinned) {
|
24741 |
|
24742 | this.eLeftViewport.scrollTop = this.eBodyViewport.scrollTop;
|
24743 | }
|
24744 | }
|
24745 | var showRightPinned = this.columnController.isPinningRight();
|
24746 | if (showRightPinned !== this.pinningRight) {
|
24747 | this.pinningRight = showRightPinned;
|
24748 | this.headerRootComp.setRightVisible(showRightPinned);
|
24749 | utils_1.Utils.setVisible(this.eRightViewportWrapper, showRightPinned);
|
24750 | if (showRightPinned) {
|
24751 |
|
24752 | this.eRightViewport.scrollTop = this.eBodyViewport.scrollTop;
|
24753 | }
|
24754 | changeDetected = true;
|
24755 | }
|
24756 | if (changeDetected) {
|
24757 | this.hideVerticalScrollOnCenter();
|
24758 | this.setPinnedLeftWidth();
|
24759 | this.setPinnedRightWidth();
|
24760 | }
|
24761 | };
|
24762 | GridPanel.prototype.hideVerticalScrollOnCenter = function () {
|
24763 | var neverShowScroll = this.enableRtl ?
|
24764 | this.columnController.isPinningLeft()
|
24765 | : this.columnController.isPinningRight();
|
24766 | var scrollActive = utils_1.Utils.isVerticalScrollShowing(this.eBodyViewport);
|
24767 | var hideScroll = neverShowScroll && scrollActive;
|
24768 | var margin = hideScroll ? '-' + this.scrollClipWidth + 'px' : '';
|
24769 | if (this.enableRtl) {
|
24770 | this.eBodyViewport.style.marginLeft = margin;
|
24771 | }
|
24772 | else {
|
24773 | this.eBodyViewport.style.marginRight = margin;
|
24774 | }
|
24775 | };
|
24776 | GridPanel.prototype.checkBodyHeight = function () {
|
24777 | var bodyHeight = this.eBody.clientHeight;
|
24778 | if (this.bodyHeight !== bodyHeight) {
|
24779 | this.bodyHeight = bodyHeight;
|
24780 | var event_3 = {
|
24781 | type: events_1.Events.EVENT_BODY_HEIGHT_CHANGED,
|
24782 | api: this.gridApi,
|
24783 | columnApi: this.columnApi
|
24784 | };
|
24785 | this.eventService.dispatchEvent(event_3);
|
24786 | }
|
24787 | };
|
24788 | GridPanel.prototype.setBodyAndHeaderHeights = function () {
|
24789 | var headerRowCount = this.columnController.getHeaderRowCount();
|
24790 | var totalHeaderHeight;
|
24791 | var numberOfFloating = 0;
|
24792 | var groupHeight;
|
24793 | var headerHeight;
|
24794 | if (!this.columnController.isPivotMode()) {
|
24795 | if (this.gridOptionsWrapper.isFloatingFilter()) {
|
24796 | headerRowCount++;
|
24797 | }
|
24798 | numberOfFloating = (this.gridOptionsWrapper.isFloatingFilter()) ? 1 : 0;
|
24799 | groupHeight = this.gridOptionsWrapper.getGroupHeaderHeight();
|
24800 | headerHeight = this.gridOptionsWrapper.getHeaderHeight();
|
24801 | }
|
24802 | else {
|
24803 | numberOfFloating = 0;
|
24804 | groupHeight = this.gridOptionsWrapper.getPivotGroupHeaderHeight();
|
24805 | headerHeight = this.gridOptionsWrapper.getPivotHeaderHeight();
|
24806 | }
|
24807 | var numberOfNonGroups = 1 + numberOfFloating;
|
24808 | var numberOfGroups = headerRowCount - numberOfNonGroups;
|
24809 | totalHeaderHeight = numberOfFloating * this.gridOptionsWrapper.getFloatingFiltersHeight();
|
24810 | totalHeaderHeight += numberOfGroups * groupHeight;
|
24811 | totalHeaderHeight += headerHeight;
|
24812 | this.headerRootComp.setHeight(totalHeaderHeight);
|
24813 | var floatingTopHeight = this.pinnedRowModel.getPinnedTopTotalHeight();
|
24814 | var floatingBottomHeight = this.pinnedRowModel.getPinnedBottomTotalHeight();
|
24815 | this.eTop.style.minHeight = floatingTopHeight + 'px';
|
24816 | this.eTop.style.height = floatingTopHeight + 'px';
|
24817 | this.eBottom.style.minHeight = floatingBottomHeight + 'px';
|
24818 | this.eBottom.style.height = floatingBottomHeight + 'px';
|
24819 | this.checkBodyHeight();
|
24820 | };
|
24821 | GridPanel.prototype.getBodyHeight = function () {
|
24822 | return this.bodyHeight;
|
24823 | };
|
24824 | GridPanel.prototype.setHorizontalScrollPosition = function (hScrollPosition) {
|
24825 | this.eBodyViewport.scrollLeft = hScrollPosition;
|
24826 |
|
24827 |
|
24828 |
|
24829 |
|
24830 | if (this.nextScrollLeft !== hScrollPosition) {
|
24831 | this.nextScrollLeft = hScrollPosition;
|
24832 | this.doHorizontalScroll();
|
24833 | }
|
24834 | };
|
24835 | GridPanel.prototype.setVerticalScrollPosition = function (vScrollPosition) {
|
24836 | this.eBodyViewport.scrollTop = vScrollPosition;
|
24837 | };
|
24838 |
|
24839 | GridPanel.prototype.scrollHorizontally = function (pixels) {
|
24840 | var oldScrollPosition = this.eBodyViewport.scrollLeft;
|
24841 | this.setHorizontalScrollPosition(oldScrollPosition + pixels);
|
24842 | var newScrollPosition = this.eBodyViewport.scrollLeft;
|
24843 | return newScrollPosition - oldScrollPosition;
|
24844 | };
|
24845 |
|
24846 | GridPanel.prototype.scrollVertically = function (pixels) {
|
24847 | var oldScrollPosition = this.eBodyViewport.scrollTop;
|
24848 | this.setVerticalScrollPosition(oldScrollPosition + pixels);
|
24849 | var newScrollPosition = this.eBodyViewport.scrollTop;
|
24850 | return newScrollPosition - oldScrollPosition;
|
24851 | };
|
24852 | GridPanel.prototype.addScrollListener = function () {
|
24853 | var _this = this;
|
24854 | this.addDestroyableEventListener(this.eBodyViewport, 'scroll', function () {
|
24855 | _this.onBodyHorizontalScroll();
|
24856 | _this.onAnyBodyScroll(_this.eBodyViewport);
|
24857 | });
|
24858 | this.addDestroyableEventListener(this.eRightViewport, 'scroll', this.onAnyBodyScroll.bind(this, this.eRightViewport));
|
24859 | this.addDestroyableEventListener(this.eLeftViewport, 'scroll', this.onAnyBodyScroll.bind(this, this.eLeftViewport));
|
24860 | this.addDestroyableEventListener(this.eFullWidthViewport, 'scroll', this.onAnyBodyScroll.bind(this, this.eFullWidthViewport));
|
24861 | };
|
24862 | GridPanel.prototype.onAnyBodyScroll = function (source) {
|
24863 | var now = new Date().getTime();
|
24864 | var diff = now - this.lastVScrollTime;
|
24865 | var elementIsNotControllingTheScroll = source !== this.lastVScrollElement && diff < 500;
|
24866 | if (elementIsNotControllingTheScroll) {
|
24867 | return;
|
24868 | }
|
24869 | this.lastVScrollElement = source;
|
24870 | this.lastVScrollTime = now;
|
24871 | var scrollTop = source.scrollTop;
|
24872 | if (this.useAnimationFrame) {
|
24873 | if (this.nextScrollTop !== scrollTop) {
|
24874 | this.nextScrollTop = scrollTop;
|
24875 | this.animationFrameService.schedule();
|
24876 | }
|
24877 | }
|
24878 | else {
|
24879 | if (scrollTop !== this.scrollTop) {
|
24880 | this.scrollTop = scrollTop;
|
24881 | this.synchroniseVerticalScrollPositions(scrollTop);
|
24882 | this.redrawRowsAfterScroll();
|
24883 | }
|
24884 | }
|
24885 | };
|
24886 | GridPanel.prototype.onBodyHorizontalScroll = function () {
|
24887 | var scrollLeft = this.eBodyViewport.scrollLeft;
|
24888 | if (this.nextScrollLeft !== scrollLeft) {
|
24889 | this.nextScrollLeft = scrollLeft;
|
24890 | if (this.useAnimationFrame) {
|
24891 | this.animationFrameService.schedule();
|
24892 | }
|
24893 | else {
|
24894 | this.doHorizontalScroll();
|
24895 | }
|
24896 | }
|
24897 | };
|
24898 | GridPanel.prototype.doHorizontalScroll = function () {
|
24899 | this.scrollLeft = this.nextScrollLeft;
|
24900 | var event = {
|
24901 | type: events_1.Events.EVENT_BODY_SCROLL,
|
24902 | api: this.gridApi,
|
24903 | columnApi: this.columnApi,
|
24904 | direction: 'horizontal',
|
24905 | left: this.scrollLeft,
|
24906 | top: this.scrollTop
|
24907 | };
|
24908 | this.eventService.dispatchEvent(event);
|
24909 | this.horizontallyScrollHeaderCenterAndFloatingCenter();
|
24910 | this.onHorizontalViewportChanged();
|
24911 | };
|
24912 | GridPanel.prototype.executeFrame = function () {
|
24913 | if (this.scrollLeft !== this.nextScrollLeft) {
|
24914 | this.doHorizontalScroll();
|
24915 | return true;
|
24916 | }
|
24917 | else if (this.scrollTop !== this.nextScrollTop) {
|
24918 | this.scrollTop = this.nextScrollTop;
|
24919 | this.synchroniseVerticalScrollPositions(this.scrollTop);
|
24920 | this.verticalRedrawNeeded = true;
|
24921 | return true;
|
24922 | }
|
24923 | else if (this.verticalRedrawNeeded) {
|
24924 | this.redrawRowsAfterScroll();
|
24925 | this.verticalRedrawNeeded = false;
|
24926 | return true;
|
24927 | }
|
24928 | else {
|
24929 | return false;
|
24930 | }
|
24931 | };
|
24932 | GridPanel.prototype.redrawRowsAfterScroll = function () {
|
24933 | var event = {
|
24934 | type: events_1.Events.EVENT_BODY_SCROLL,
|
24935 | direction: 'vertical',
|
24936 | api: this.gridApi,
|
24937 | columnApi: this.columnApi,
|
24938 | left: this.scrollLeft,
|
24939 | top: this.scrollTop
|
24940 | };
|
24941 | this.eventService.dispatchEvent(event);
|
24942 | };
|
24943 |
|
24944 |
|
24945 |
|
24946 | GridPanel.prototype.onHorizontalViewportChanged = function () {
|
24947 | var scrollWidth = this.eBodyViewport.clientWidth;
|
24948 | var scrollPosition = this.getBodyViewportScrollLeft();
|
24949 | this.columnController.setVirtualViewportPosition(scrollWidth, scrollPosition);
|
24950 | };
|
24951 | GridPanel.prototype.getBodyViewportScrollLeft = function () {
|
24952 |
|
24953 | return utils_1.Utils.getScrollLeft(this.eBodyViewport, this.enableRtl);
|
24954 | };
|
24955 | GridPanel.prototype.setBodyViewportScrollLeft = function (value) {
|
24956 |
|
24957 | utils_1.Utils.setScrollLeft(this.eBodyViewport, value, this.enableRtl);
|
24958 | };
|
24959 | GridPanel.prototype.horizontallyScrollHeaderCenterAndFloatingCenter = function () {
|
24960 | var scrollLeft = this.getBodyViewportScrollLeft();
|
24961 | var offset = this.enableRtl ? scrollLeft : -scrollLeft;
|
24962 | this.headerRootComp.setHorizontalScroll(offset);
|
24963 | this.eBottomContainer.style.left = offset + 'px';
|
24964 | this.eTopContainer.style.left = offset + 'px';
|
24965 | };
|
24966 | GridPanel.prototype.synchroniseVerticalScrollPositions = function (position) {
|
24967 | if (this.lastVScrollElement !== this.eBodyViewport) {
|
24968 | this.eBodyViewport.scrollTop = position;
|
24969 | }
|
24970 | if (this.lastVScrollElement !== this.eLeftViewport && this.pinningLeft) {
|
24971 | this.eLeftViewport.scrollTop = position;
|
24972 | }
|
24973 | if (this.lastVScrollElement !== this.eRightViewport && this.pinningRight) {
|
24974 | this.eRightViewport.scrollTop = position;
|
24975 | }
|
24976 | if (this.lastVScrollElement !== this.eFullWidthViewport) {
|
24977 | this.eFullWidthViewport.scrollTop = position;
|
24978 | }
|
24979 |
|
24980 |
|
24981 | this.rowContainerComponents.body.setVerticalScrollPosition(position);
|
24982 | this.rowContainerComponents.pinnedLeft.setVerticalScrollPosition(position);
|
24983 | this.rowContainerComponents.pinnedRight.setVerticalScrollPosition(position);
|
24984 | this.rowContainerComponents.fullWidth.setVerticalScrollPosition(position);
|
24985 | this.redrawRowsAfterScroll();
|
24986 | };
|
24987 | GridPanel.prototype.addScrollEventListener = function (listener) {
|
24988 | this.eBodyViewport.addEventListener('scroll', listener);
|
24989 | };
|
24990 | GridPanel.prototype.removeScrollEventListener = function (listener) {
|
24991 | this.eBodyViewport.removeEventListener('scroll', listener);
|
24992 | };
|
24993 | __decorate([
|
24994 | context_1.Autowired('alignedGridsService'),
|
24995 | __metadata("design:type", alignedGridsService_1.AlignedGridsService)
|
24996 | ], GridPanel.prototype, "alignedGridsService", void 0);
|
24997 | __decorate([
|
24998 | context_1.Autowired('gridOptionsWrapper'),
|
24999 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
25000 | ], GridPanel.prototype, "gridOptionsWrapper", void 0);
|
25001 | __decorate([
|
25002 | context_1.Autowired('columnController'),
|
25003 | __metadata("design:type", columnController_1.ColumnController)
|
25004 | ], GridPanel.prototype, "columnController", void 0);
|
25005 | __decorate([
|
25006 | context_1.Autowired('rowRenderer'),
|
25007 | __metadata("design:type", rowRenderer_1.RowRenderer)
|
25008 | ], GridPanel.prototype, "rowRenderer", void 0);
|
25009 | __decorate([
|
25010 | context_1.Autowired('pinnedRowModel'),
|
25011 | __metadata("design:type", pinnedRowModel_1.PinnedRowModel)
|
25012 | ], GridPanel.prototype, "pinnedRowModel", void 0);
|
25013 | __decorate([
|
25014 | context_1.Autowired('eventService'),
|
25015 | __metadata("design:type", eventService_1.EventService)
|
25016 | ], GridPanel.prototype, "eventService", void 0);
|
25017 | __decorate([
|
25018 | context_1.Autowired('context'),
|
25019 | __metadata("design:type", context_1.Context)
|
25020 | ], GridPanel.prototype, "context", void 0);
|
25021 | __decorate([
|
25022 | context_1.Autowired('animationFrameService'),
|
25023 | __metadata("design:type", animationFrameService_1.AnimationFrameService)
|
25024 | ], GridPanel.prototype, "animationFrameService", void 0);
|
25025 | __decorate([
|
25026 | context_1.Autowired('navigationService'),
|
25027 | __metadata("design:type", navigationService_1.NavigationService)
|
25028 | ], GridPanel.prototype, "navigationService", void 0);
|
25029 | __decorate([
|
25030 | context_1.Autowired('autoHeightCalculator'),
|
25031 | __metadata("design:type", autoHeightCalculator_1.AutoHeightCalculator)
|
25032 | ], GridPanel.prototype, "autoHeightCalculator", void 0);
|
25033 | __decorate([
|
25034 | context_1.Autowired('columnAnimationService'),
|
25035 | __metadata("design:type", columnAnimationService_1.ColumnAnimationService)
|
25036 | ], GridPanel.prototype, "columnAnimationService", void 0);
|
25037 | __decorate([
|
25038 | context_1.Autowired('autoWidthCalculator'),
|
25039 | __metadata("design:type", autoWidthCalculator_1.AutoWidthCalculator)
|
25040 | ], GridPanel.prototype, "autoWidthCalculator", void 0);
|
25041 | __decorate([
|
25042 | context_1.Autowired('paginationAutoPageSizeService'),
|
25043 | __metadata("design:type", paginationProxy_1.PaginationAutoPageSizeService)
|
25044 | ], GridPanel.prototype, "paginationAutoPageSizeService", void 0);
|
25045 | __decorate([
|
25046 | context_1.Autowired('beans'),
|
25047 | __metadata("design:type", beans_1.Beans)
|
25048 | ], GridPanel.prototype, "beans", void 0);
|
25049 | __decorate([
|
25050 | context_1.Autowired('paginationProxy'),
|
25051 | __metadata("design:type", paginationProxy_1.PaginationProxy)
|
25052 | ], GridPanel.prototype, "paginationProxy", void 0);
|
25053 | __decorate([
|
25054 | context_1.Autowired('columnApi'),
|
25055 | __metadata("design:type", columnApi_1.ColumnApi)
|
25056 | ], GridPanel.prototype, "columnApi", void 0);
|
25057 | __decorate([
|
25058 | context_1.Autowired('gridApi'),
|
25059 | __metadata("design:type", gridApi_1.GridApi)
|
25060 | ], GridPanel.prototype, "gridApi", void 0);
|
25061 | __decorate([
|
25062 | context_1.Autowired('dragService'),
|
25063 | __metadata("design:type", dragService_1.DragService)
|
25064 | ], GridPanel.prototype, "dragService", void 0);
|
25065 | __decorate([
|
25066 | context_1.Autowired('selectionController'),
|
25067 | __metadata("design:type", selectionController_1.SelectionController)
|
25068 | ], GridPanel.prototype, "selectionController", void 0);
|
25069 | __decorate([
|
25070 | context_1.Autowired('csvCreator'),
|
25071 | __metadata("design:type", csvCreator_1.CsvCreator)
|
25072 | ], GridPanel.prototype, "csvCreator", void 0);
|
25073 | __decorate([
|
25074 | context_1.Autowired('mouseEventService'),
|
25075 | __metadata("design:type", mouseEventService_1.MouseEventService)
|
25076 | ], GridPanel.prototype, "mouseEventService", void 0);
|
25077 | __decorate([
|
25078 | context_1.Autowired('focusedCellController'),
|
25079 | __metadata("design:type", focusedCellController_1.FocusedCellController)
|
25080 | ], GridPanel.prototype, "focusedCellController", void 0);
|
25081 | __decorate([
|
25082 | context_1.Autowired('$scope'),
|
25083 | __metadata("design:type", Object)
|
25084 | ], GridPanel.prototype, "$scope", void 0);
|
25085 | __decorate([
|
25086 | context_1.Autowired('scrollVisibleService'),
|
25087 | __metadata("design:type", scrollVisibleService_1.ScrollVisibleService)
|
25088 | ], GridPanel.prototype, "scrollVisibleService", void 0);
|
25089 | __decorate([
|
25090 | context_1.Autowired('frameworkFactory'),
|
25091 | __metadata("design:type", Object)
|
25092 | ], GridPanel.prototype, "frameworkFactory", void 0);
|
25093 | __decorate([
|
25094 | context_1.Autowired('valueService'),
|
25095 | __metadata("design:type", valueService_1.ValueService)
|
25096 | ], GridPanel.prototype, "valueService", void 0);
|
25097 | __decorate([
|
25098 | context_1.Autowired('componentRecipes'),
|
25099 | __metadata("design:type", componentRecipes_1.ComponentRecipes)
|
25100 | ], GridPanel.prototype, "componentRecipes", void 0);
|
25101 | __decorate([
|
25102 | context_1.Autowired('dragAndDropService'),
|
25103 | __metadata("design:type", dragAndDropService_1.DragAndDropService)
|
25104 | ], GridPanel.prototype, "dragAndDropService", void 0);
|
25105 | __decorate([
|
25106 | context_1.Autowired('heightScaler'),
|
25107 | __metadata("design:type", heightScaler_1.HeightScaler)
|
25108 | ], GridPanel.prototype, "heightScaler", void 0);
|
25109 | __decorate([
|
25110 | context_1.Autowired('enterprise'),
|
25111 | __metadata("design:type", Boolean)
|
25112 | ], GridPanel.prototype, "enterprise", void 0);
|
25113 | __decorate([
|
25114 | context_1.Optional('rangeController'),
|
25115 | __metadata("design:type", Object)
|
25116 | ], GridPanel.prototype, "rangeController", void 0);
|
25117 | __decorate([
|
25118 | context_1.Optional('contextMenuFactory'),
|
25119 | __metadata("design:type", Object)
|
25120 | ], GridPanel.prototype, "contextMenuFactory", void 0);
|
25121 | __decorate([
|
25122 | context_1.Optional('clipboardService'),
|
25123 | __metadata("design:type", Object)
|
25124 | ], GridPanel.prototype, "clipboardService", void 0);
|
25125 | __decorate([
|
25126 | componentAnnotations_1.RefSelector('eBody'),
|
25127 | __metadata("design:type", HTMLElement)
|
25128 | ], GridPanel.prototype, "eBody", void 0);
|
25129 | __decorate([
|
25130 | componentAnnotations_1.RefSelector('eBodyViewport'),
|
25131 | __metadata("design:type", HTMLElement)
|
25132 | ], GridPanel.prototype, "eBodyViewport", void 0);
|
25133 | __decorate([
|
25134 | componentAnnotations_1.RefSelector('eBodyContainer'),
|
25135 | __metadata("design:type", HTMLElement)
|
25136 | ], GridPanel.prototype, "eBodyContainer", void 0);
|
25137 | __decorate([
|
25138 | componentAnnotations_1.RefSelector('eLeftContainer'),
|
25139 | __metadata("design:type", HTMLElement)
|
25140 | ], GridPanel.prototype, "eLeftContainer", void 0);
|
25141 | __decorate([
|
25142 | componentAnnotations_1.RefSelector('eRightContainer'),
|
25143 | __metadata("design:type", HTMLElement)
|
25144 | ], GridPanel.prototype, "eRightContainer", void 0);
|
25145 | __decorate([
|
25146 | componentAnnotations_1.RefSelector('eFullWidthViewportWrapper'),
|
25147 | __metadata("design:type", HTMLElement)
|
25148 | ], GridPanel.prototype, "eFullWidthViewportWrapper", void 0);
|
25149 | __decorate([
|
25150 | componentAnnotations_1.RefSelector('eFullWidthViewport'),
|
25151 | __metadata("design:type", HTMLElement)
|
25152 | ], GridPanel.prototype, "eFullWidthViewport", void 0);
|
25153 | __decorate([
|
25154 | componentAnnotations_1.RefSelector('eFullWidthContainer'),
|
25155 | __metadata("design:type", HTMLElement)
|
25156 | ], GridPanel.prototype, "eFullWidthContainer", void 0);
|
25157 | __decorate([
|
25158 | componentAnnotations_1.RefSelector('eLeftViewport'),
|
25159 | __metadata("design:type", HTMLElement)
|
25160 | ], GridPanel.prototype, "eLeftViewport", void 0);
|
25161 | __decorate([
|
25162 | componentAnnotations_1.RefSelector('eLeftViewportWrapper'),
|
25163 | __metadata("design:type", HTMLElement)
|
25164 | ], GridPanel.prototype, "eLeftViewportWrapper", void 0);
|
25165 | __decorate([
|
25166 | componentAnnotations_1.RefSelector('eRightViewport'),
|
25167 | __metadata("design:type", HTMLElement)
|
25168 | ], GridPanel.prototype, "eRightViewport", void 0);
|
25169 | __decorate([
|
25170 | componentAnnotations_1.RefSelector('eRightViewportWrapper'),
|
25171 | __metadata("design:type", HTMLElement)
|
25172 | ], GridPanel.prototype, "eRightViewportWrapper", void 0);
|
25173 | __decorate([
|
25174 | componentAnnotations_1.RefSelector('eTop'),
|
25175 | __metadata("design:type", HTMLElement)
|
25176 | ], GridPanel.prototype, "eTop", void 0);
|
25177 | __decorate([
|
25178 | componentAnnotations_1.RefSelector('eLeftTop'),
|
25179 | __metadata("design:type", HTMLElement)
|
25180 | ], GridPanel.prototype, "eLeftTop", void 0);
|
25181 | __decorate([
|
25182 | componentAnnotations_1.RefSelector('eRightTop'),
|
25183 | __metadata("design:type", HTMLElement)
|
25184 | ], GridPanel.prototype, "eRightTop", void 0);
|
25185 | __decorate([
|
25186 | componentAnnotations_1.RefSelector('eTopContainer'),
|
25187 | __metadata("design:type", HTMLElement)
|
25188 | ], GridPanel.prototype, "eTopContainer", void 0);
|
25189 | __decorate([
|
25190 | componentAnnotations_1.RefSelector('eTopViewport'),
|
25191 | __metadata("design:type", HTMLElement)
|
25192 | ], GridPanel.prototype, "eTopViewport", void 0);
|
25193 | __decorate([
|
25194 | componentAnnotations_1.RefSelector('eTopFullWidthContainer'),
|
25195 | __metadata("design:type", HTMLElement)
|
25196 | ], GridPanel.prototype, "eTopFullWidthContainer", void 0);
|
25197 | __decorate([
|
25198 | componentAnnotations_1.RefSelector('eBottom'),
|
25199 | __metadata("design:type", HTMLElement)
|
25200 | ], GridPanel.prototype, "eBottom", void 0);
|
25201 | __decorate([
|
25202 | componentAnnotations_1.RefSelector('eLeftBottom'),
|
25203 | __metadata("design:type", HTMLElement)
|
25204 | ], GridPanel.prototype, "eLeftBottom", void 0);
|
25205 | __decorate([
|
25206 | componentAnnotations_1.RefSelector('eRightBottom'),
|
25207 | __metadata("design:type", HTMLElement)
|
25208 | ], GridPanel.prototype, "eRightBottom", void 0);
|
25209 | __decorate([
|
25210 | componentAnnotations_1.RefSelector('eBottomContainer'),
|
25211 | __metadata("design:type", HTMLElement)
|
25212 | ], GridPanel.prototype, "eBottomContainer", void 0);
|
25213 | __decorate([
|
25214 | componentAnnotations_1.RefSelector('eBottomViewport'),
|
25215 | __metadata("design:type", HTMLElement)
|
25216 | ], GridPanel.prototype, "eBottomViewport", void 0);
|
25217 | __decorate([
|
25218 | componentAnnotations_1.RefSelector('eBottomFullWidthContainer'),
|
25219 | __metadata("design:type", HTMLElement)
|
25220 | ], GridPanel.prototype, "eBottomFullWidthContainer", void 0);
|
25221 | __decorate([
|
25222 | componentAnnotations_1.RefSelector('headerRoot'),
|
25223 | __metadata("design:type", headerRootComp_1.HeaderRootComp)
|
25224 | ], GridPanel.prototype, "headerRootComp", void 0);
|
25225 | __decorate([
|
25226 | context_1.PreDestroy,
|
25227 | __metadata("design:type", Function),
|
25228 | __metadata("design:paramtypes", []),
|
25229 | __metadata("design:returntype", void 0)
|
25230 | ], GridPanel.prototype, "destroy", null);
|
25231 | __decorate([
|
25232 | context_1.PostConstruct,
|
25233 | __metadata("design:type", Function),
|
25234 | __metadata("design:paramtypes", []),
|
25235 | __metadata("design:returntype", void 0)
|
25236 | ], GridPanel.prototype, "init", null);
|
25237 | return GridPanel;
|
25238 | }(component_1.Component));
|
25239 | exports.GridPanel = GridPanel;
|
25240 |
|
25241 |
|
25242 | }),
|
25243 |
|
25244 | (function(module, exports, __webpack_require__) {
|
25245 |
|
25246 | "use strict";
|
25247 |
|
25248 |
|
25249 |
|
25250 |
|
25251 |
|
25252 |
|
25253 |
|
25254 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
25255 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
25256 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
25257 | 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;
|
25258 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
25259 | };
|
25260 | var __metadata = (this && this.__metadata) || function (k, v) {
|
25261 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
25262 | };
|
25263 | Object.defineProperty(exports, "__esModule", { value: true });
|
25264 | var context_1 = __webpack_require__(0);
|
25265 | var beans_1 = __webpack_require__(28);
|
25266 | var cellComp_1 = __webpack_require__(34);
|
25267 | var columnController_1 = __webpack_require__(4);
|
25268 | var utils_1 = __webpack_require__(1);
|
25269 | var AutoHeightCalculator = (function () {
|
25270 | function AutoHeightCalculator() {
|
25271 | }
|
25272 | AutoHeightCalculator.prototype.registerGridComp = function (gridPanel) {
|
25273 | this.gridPanel = gridPanel;
|
25274 | };
|
25275 | AutoHeightCalculator.prototype.getPreferredHeightForRow = function (rowNode) {
|
25276 | var _this = this;
|
25277 | if (!this.eDummyContainer) {
|
25278 | this.eDummyContainer = document.createElement('div');
|
25279 |
|
25280 |
|
25281 | utils_1._.addCssClass(this.eDummyContainer, 'ag-row ag-row-no-focus');
|
25282 | }
|
25283 |
|
25284 |
|
25285 | var eBodyContainer = this.gridPanel.getBodyContainer();
|
25286 | eBodyContainer.appendChild(this.eDummyContainer);
|
25287 | var cellComps = [];
|
25288 | var cols = this.columnController.getAllAutoRowHeightCols();
|
25289 | console.log();
|
25290 | cols.forEach(function (col) {
|
25291 | var cellComp = new cellComp_1.CellComp(_this.$scope, _this.beans, col, rowNode, null, true);
|
25292 | cellComp.setParentRow(_this.eDummyContainer);
|
25293 | cellComps.push(cellComp);
|
25294 | });
|
25295 | var template = cellComps.map(function (cellComp) { return cellComp.getCreateTemplate(); }).join(' ');
|
25296 | this.eDummyContainer.innerHTML = template;
|
25297 |
|
25298 | cellComps.forEach(function (cellComp) { return cellComp.afterAttached(); });
|
25299 |
|
25300 |
|
25301 |
|
25302 | var maxCellHeight = 0;
|
25303 | for (var i = 0; i < this.eDummyContainer.children.length; i++) {
|
25304 | var child = this.eDummyContainer.children[i];
|
25305 | if (child.offsetHeight > maxCellHeight) {
|
25306 | maxCellHeight = child.offsetHeight;
|
25307 | }
|
25308 | }
|
25309 |
|
25310 | eBodyContainer.removeChild(this.eDummyContainer);
|
25311 | cellComps.forEach(function (cellComp) {
|
25312 |
|
25313 | cellComp.detach();
|
25314 | cellComp.destroy();
|
25315 | });
|
25316 |
|
25317 | utils_1._.removeAllChildren(this.eDummyContainer);
|
25318 | return maxCellHeight;
|
25319 | };
|
25320 | __decorate([
|
25321 | context_1.Autowired('beans'),
|
25322 | __metadata("design:type", beans_1.Beans)
|
25323 | ], AutoHeightCalculator.prototype, "beans", void 0);
|
25324 | __decorate([
|
25325 | context_1.Autowired("$scope"),
|
25326 | __metadata("design:type", Object)
|
25327 | ], AutoHeightCalculator.prototype, "$scope", void 0);
|
25328 | __decorate([
|
25329 | context_1.Autowired("columnController"),
|
25330 | __metadata("design:type", columnController_1.ColumnController)
|
25331 | ], AutoHeightCalculator.prototype, "columnController", void 0);
|
25332 | AutoHeightCalculator = __decorate([
|
25333 | context_1.Bean('autoHeightCalculator')
|
25334 | ], AutoHeightCalculator);
|
25335 | return AutoHeightCalculator;
|
25336 | }());
|
25337 | exports.AutoHeightCalculator = AutoHeightCalculator;
|
25338 |
|
25339 |
|
25340 | }),
|
25341 |
|
25342 | (function(module, exports, __webpack_require__) {
|
25343 |
|
25344 | "use strict";
|
25345 |
|
25346 |
|
25347 |
|
25348 |
|
25349 |
|
25350 |
|
25351 |
|
25352 | var __extends = (this && this.__extends) || (function () {
|
25353 | var extendStatics = Object.setPrototypeOf ||
|
25354 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
25355 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
25356 | return function (d, b) {
|
25357 | extendStatics(d, b);
|
25358 | function __() { this.constructor = d; }
|
25359 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
25360 | };
|
25361 | })();
|
25362 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
25363 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
25364 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
25365 | 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;
|
25366 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
25367 | };
|
25368 | var __metadata = (this && this.__metadata) || function (k, v) {
|
25369 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
25370 | };
|
25371 | Object.defineProperty(exports, "__esModule", { value: true });
|
25372 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
25373 | var columnController_1 = __webpack_require__(4);
|
25374 | var column_1 = __webpack_require__(10);
|
25375 | var context_1 = __webpack_require__(0);
|
25376 | var headerContainer_1 = __webpack_require__(98);
|
25377 | var eventService_1 = __webpack_require__(3);
|
25378 | var events_1 = __webpack_require__(5);
|
25379 | var scrollVisibleService_1 = __webpack_require__(36);
|
25380 | var component_1 = __webpack_require__(8);
|
25381 | var componentAnnotations_1 = __webpack_require__(11);
|
25382 | var utils_1 = __webpack_require__(1);
|
25383 | var gridApi_1 = __webpack_require__(6);
|
25384 | var autoWidthCalculator_1 = __webpack_require__(39);
|
25385 | var HeaderRootComp = (function (_super) {
|
25386 | __extends(HeaderRootComp, _super);
|
25387 | function HeaderRootComp() {
|
25388 | return _super.call(this, HeaderRootComp.TEMPLATE) || this;
|
25389 | }
|
25390 | HeaderRootComp.prototype.registerGridComp = function (gridPanel) {
|
25391 | this.gridPanel = gridPanel;
|
25392 | this.centerContainer.registerGridComp(gridPanel);
|
25393 | this.pinnedLeftContainer.registerGridComp(gridPanel);
|
25394 | this.pinnedRightContainer.registerGridComp(gridPanel);
|
25395 | };
|
25396 | HeaderRootComp.prototype.postConstruct = function () {
|
25397 | var _this = this;
|
25398 | this.gridApi.registerHeaderRootComp(this);
|
25399 | this.autoWidthCalculator.registerHeaderRootComp(this);
|
25400 | this.centerContainer = new headerContainer_1.HeaderContainer(this.eHeaderContainer, this.eHeaderViewport, null);
|
25401 | this.childContainers = [this.centerContainer];
|
25402 | this.pinnedLeftContainer = new headerContainer_1.HeaderContainer(this.ePinnedLeftHeader, null, column_1.Column.PINNED_LEFT);
|
25403 | this.pinnedRightContainer = new headerContainer_1.HeaderContainer(this.ePinnedRightHeader, null, column_1.Column.PINNED_RIGHT);
|
25404 | this.childContainers.push(this.pinnedLeftContainer);
|
25405 | this.childContainers.push(this.pinnedRightContainer);
|
25406 | this.childContainers.forEach(function (container) { return _this.context.wireBean(container); });
|
25407 |
|
25408 | this.eventService.addEventListener(events_1.Events.EVENT_COLUMN_VALUE_CHANGED, this.refreshHeader.bind(this));
|
25409 |
|
25410 | this.eventService.addEventListener(events_1.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED, this.onPivotModeChanged.bind(this));
|
25411 | this.addPreventHeaderScroll();
|
25412 | if (this.columnController.isReady()) {
|
25413 | this.refreshHeader();
|
25414 | }
|
25415 | };
|
25416 | HeaderRootComp.prototype.setHorizontalScroll = function (offset) {
|
25417 | this.eHeaderContainer.style.left = offset + 'px';
|
25418 | };
|
25419 | HeaderRootComp.prototype.forEachHeaderElement = function (callback) {
|
25420 | this.childContainers.forEach(function (childContainer) { return childContainer.forEachHeaderElement(callback); });
|
25421 | };
|
25422 | HeaderRootComp.prototype.destroy = function () {
|
25423 | this.childContainers.forEach(function (container) { return container.destroy(); });
|
25424 | };
|
25425 | HeaderRootComp.prototype.refreshHeader = function () {
|
25426 | this.childContainers.forEach(function (container) { return container.refresh(); });
|
25427 | };
|
25428 | HeaderRootComp.prototype.onPivotModeChanged = function () {
|
25429 | var pivotMode = this.columnController.isPivotMode();
|
25430 | utils_1.Utils.addOrRemoveCssClass(this.getGui(), 'ag-pivot-on', pivotMode);
|
25431 | utils_1.Utils.addOrRemoveCssClass(this.getGui(), 'ag-pivot-off', !pivotMode);
|
25432 | };
|
25433 | HeaderRootComp.prototype.setHeight = function (height) {
|
25434 | this.getGui().style.height = height + 'px';
|
25435 | this.getGui().style.minHeight = height + 'px';
|
25436 | };
|
25437 |
|
25438 |
|
25439 |
|
25440 | HeaderRootComp.prototype.addPreventHeaderScroll = function () {
|
25441 | var _this = this;
|
25442 | this.addDestroyableEventListener(this.eHeaderViewport, 'scroll', function () {
|
25443 |
|
25444 |
|
25445 |
|
25446 | var scrollLeft = _this.eHeaderViewport.scrollLeft;
|
25447 | if (scrollLeft !== 0) {
|
25448 | _this.gridPanel.scrollHorizontally(scrollLeft);
|
25449 | _this.eHeaderViewport.scrollLeft = 0;
|
25450 | }
|
25451 | });
|
25452 | };
|
25453 | HeaderRootComp.prototype.setLeftVisible = function (visible) {
|
25454 | utils_1.Utils.setVisible(this.ePinnedLeftHeader, visible);
|
25455 | };
|
25456 | HeaderRootComp.prototype.setRightVisible = function (visible) {
|
25457 | utils_1.Utils.setVisible(this.ePinnedRightHeader, visible);
|
25458 | };
|
25459 | HeaderRootComp.TEMPLATE = "<div class=\"ag-header\" role=\"row\">\n <div class=\"ag-pinned-left-header\" ref=\"ePinnedLeftHeader\" role=\"presentation\"></div>\n <div class=\"ag-header-viewport\" ref=\"eHeaderViewport\" role=\"presentation\">\n <div class=\"ag-header-container\" ref=\"eHeaderContainer\" role=\"presentation\"></div>\n </div>\n <div class=\"ag-pinned-right-header\" ref=\"ePinnedRightHeader\" role=\"presentation\"></div>\n </div>";
|
25460 | __decorate([
|
25461 | componentAnnotations_1.RefSelector('ePinnedLeftHeader'),
|
25462 | __metadata("design:type", HTMLElement)
|
25463 | ], HeaderRootComp.prototype, "ePinnedLeftHeader", void 0);
|
25464 | __decorate([
|
25465 | componentAnnotations_1.RefSelector('ePinnedRightHeader'),
|
25466 | __metadata("design:type", HTMLElement)
|
25467 | ], HeaderRootComp.prototype, "ePinnedRightHeader", void 0);
|
25468 | __decorate([
|
25469 | componentAnnotations_1.RefSelector('eHeaderContainer'),
|
25470 | __metadata("design:type", HTMLElement)
|
25471 | ], HeaderRootComp.prototype, "eHeaderContainer", void 0);
|
25472 | __decorate([
|
25473 | componentAnnotations_1.RefSelector('eHeaderViewport'),
|
25474 | __metadata("design:type", HTMLElement)
|
25475 | ], HeaderRootComp.prototype, "eHeaderViewport", void 0);
|
25476 | __decorate([
|
25477 | context_1.Autowired('gridOptionsWrapper'),
|
25478 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
25479 | ], HeaderRootComp.prototype, "gridOptionsWrapper", void 0);
|
25480 | __decorate([
|
25481 | context_1.Autowired('columnController'),
|
25482 | __metadata("design:type", columnController_1.ColumnController)
|
25483 | ], HeaderRootComp.prototype, "columnController", void 0);
|
25484 | __decorate([
|
25485 | context_1.Autowired('context'),
|
25486 | __metadata("design:type", context_1.Context)
|
25487 | ], HeaderRootComp.prototype, "context", void 0);
|
25488 | __decorate([
|
25489 | context_1.Autowired('eventService'),
|
25490 | __metadata("design:type", eventService_1.EventService)
|
25491 | ], HeaderRootComp.prototype, "eventService", void 0);
|
25492 | __decorate([
|
25493 | context_1.Autowired('scrollVisibleService'),
|
25494 | __metadata("design:type", scrollVisibleService_1.ScrollVisibleService)
|
25495 | ], HeaderRootComp.prototype, "scrollVisibleService", void 0);
|
25496 | __decorate([
|
25497 | context_1.Autowired('gridApi'),
|
25498 | __metadata("design:type", gridApi_1.GridApi)
|
25499 | ], HeaderRootComp.prototype, "gridApi", void 0);
|
25500 | __decorate([
|
25501 | context_1.Autowired('autoWidthCalculator'),
|
25502 | __metadata("design:type", autoWidthCalculator_1.AutoWidthCalculator)
|
25503 | ], HeaderRootComp.prototype, "autoWidthCalculator", void 0);
|
25504 | __decorate([
|
25505 | context_1.PostConstruct,
|
25506 | __metadata("design:type", Function),
|
25507 | __metadata("design:paramtypes", []),
|
25508 | __metadata("design:returntype", void 0)
|
25509 | ], HeaderRootComp.prototype, "postConstruct", null);
|
25510 | __decorate([
|
25511 | context_1.PreDestroy,
|
25512 | __metadata("design:type", Function),
|
25513 | __metadata("design:paramtypes", []),
|
25514 | __metadata("design:returntype", void 0)
|
25515 | ], HeaderRootComp.prototype, "destroy", null);
|
25516 | return HeaderRootComp;
|
25517 | }(component_1.Component));
|
25518 | exports.HeaderRootComp = HeaderRootComp;
|
25519 |
|
25520 |
|
25521 | }),
|
25522 |
|
25523 | (function(module, exports, __webpack_require__) {
|
25524 |
|
25525 | "use strict";
|
25526 |
|
25527 |
|
25528 |
|
25529 |
|
25530 |
|
25531 |
|
25532 |
|
25533 | Object.defineProperty(exports, "__esModule", { value: true });
|
25534 | var utils_1 = __webpack_require__(1);
|
25535 | var CssClassApplier = (function () {
|
25536 | function CssClassApplier() {
|
25537 | }
|
25538 | CssClassApplier.addHeaderClassesFromColDef = function (abstractColDef, eHeaderCell, gridOptionsWrapper, column, columnGroup) {
|
25539 | if (utils_1.Utils.missing(abstractColDef)) {
|
25540 | return;
|
25541 | }
|
25542 | this.addColumnClassesFromCollDef(abstractColDef.headerClass, abstractColDef, eHeaderCell, gridOptionsWrapper, column, columnGroup);
|
25543 | };
|
25544 | CssClassApplier.addToolPanelClassesFromColDef = function (abstractColDef, eHeaderCell, gridOptionsWrapper, column, columnGroup) {
|
25545 | if (utils_1.Utils.missing(abstractColDef)) {
|
25546 | return;
|
25547 | }
|
25548 | this.addColumnClassesFromCollDef(abstractColDef.toolPanelClass, abstractColDef, eHeaderCell, gridOptionsWrapper, column, columnGroup);
|
25549 | };
|
25550 | CssClassApplier.addColumnClassesFromCollDef = function (classesOrFunc, abstractColDef, eHeaderCell, gridOptionsWrapper, column, columnGroup) {
|
25551 | if (utils_1.Utils.missing(classesOrFunc)) {
|
25552 | return;
|
25553 | }
|
25554 | var classToUse;
|
25555 | if (typeof classesOrFunc === 'function') {
|
25556 | var params = {
|
25557 |
|
25558 |
|
25559 |
|
25560 | colDef: abstractColDef,
|
25561 | column: column,
|
25562 | columnGroup: columnGroup,
|
25563 | context: gridOptionsWrapper.getContext(),
|
25564 | api: gridOptionsWrapper.getApi()
|
25565 | };
|
25566 | var headerClassFunc = classesOrFunc;
|
25567 | classToUse = headerClassFunc(params);
|
25568 | }
|
25569 | else {
|
25570 | classToUse = classesOrFunc;
|
25571 | }
|
25572 | if (typeof classToUse === 'string') {
|
25573 | utils_1.Utils.addCssClass(eHeaderCell, classToUse);
|
25574 | }
|
25575 | else if (Array.isArray(classToUse)) {
|
25576 | classToUse.forEach(function (cssClassItem) {
|
25577 | utils_1.Utils.addCssClass(eHeaderCell, cssClassItem);
|
25578 | });
|
25579 | }
|
25580 | };
|
25581 | return CssClassApplier;
|
25582 | }());
|
25583 | exports.CssClassApplier = CssClassApplier;
|
25584 |
|
25585 |
|
25586 | }),
|
25587 |
|
25588 | (function(module, exports, __webpack_require__) {
|
25589 |
|
25590 | "use strict";
|
25591 |
|
25592 |
|
25593 |
|
25594 |
|
25595 |
|
25596 |
|
25597 |
|
25598 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
25599 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
25600 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
25601 | 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;
|
25602 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
25603 | };
|
25604 | var __metadata = (this && this.__metadata) || function (k, v) {
|
25605 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
25606 | };
|
25607 | Object.defineProperty(exports, "__esModule", { value: true });
|
25608 | var context_1 = __webpack_require__(0);
|
25609 | var constants_1 = __webpack_require__(9);
|
25610 | var columnController_1 = __webpack_require__(4);
|
25611 | var utils_1 = __webpack_require__(1);
|
25612 | var gridRow_1 = __webpack_require__(64);
|
25613 | var gridCell_1 = __webpack_require__(23);
|
25614 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
25615 | var pinnedRowModel_1 = __webpack_require__(30);
|
25616 | var CellNavigationService = (function () {
|
25617 | function CellNavigationService() {
|
25618 | }
|
25619 |
|
25620 | CellNavigationService.prototype.getNextCellToFocus = function (key, lastCellToFocus) {
|
25621 |
|
25622 |
|
25623 | var pointer = lastCellToFocus;
|
25624 | var finished = false;
|
25625 |
|
25626 |
|
25627 |
|
25628 | while (!finished) {
|
25629 | switch (key) {
|
25630 | case constants_1.Constants.KEY_UP:
|
25631 | pointer = this.getCellAbove(pointer);
|
25632 | break;
|
25633 | case constants_1.Constants.KEY_DOWN:
|
25634 | pointer = this.getCellBelow(pointer);
|
25635 | break;
|
25636 | case constants_1.Constants.KEY_RIGHT:
|
25637 | if (this.gridOptionsWrapper.isEnableRtl()) {
|
25638 | pointer = this.getCellToLeft(pointer);
|
25639 | }
|
25640 | else {
|
25641 | pointer = this.getCellToRight(pointer);
|
25642 | }
|
25643 | break;
|
25644 | case constants_1.Constants.KEY_LEFT:
|
25645 | if (this.gridOptionsWrapper.isEnableRtl()) {
|
25646 | pointer = this.getCellToRight(pointer);
|
25647 | }
|
25648 | else {
|
25649 | pointer = this.getCellToLeft(pointer);
|
25650 | }
|
25651 | break;
|
25652 | default:
|
25653 | console.log('ag-Grid: unknown key for navigation ' + key);
|
25654 | pointer = null;
|
25655 | break;
|
25656 | }
|
25657 | if (pointer) {
|
25658 | finished = this.isCellGoodToFocusOn(pointer);
|
25659 | }
|
25660 | else {
|
25661 | finished = true;
|
25662 | }
|
25663 | }
|
25664 | return pointer;
|
25665 | };
|
25666 | CellNavigationService.prototype.isCellGoodToFocusOn = function (gridCell) {
|
25667 | var column = gridCell.column;
|
25668 | var rowNode;
|
25669 | switch (gridCell.floating) {
|
25670 | case constants_1.Constants.PINNED_TOP:
|
25671 | rowNode = this.pinnedRowModel.getPinnedTopRow(gridCell.rowIndex);
|
25672 | break;
|
25673 | case constants_1.Constants.PINNED_BOTTOM:
|
25674 | rowNode = this.pinnedRowModel.getPinnedBottomRow(gridCell.rowIndex);
|
25675 | break;
|
25676 | default:
|
25677 | rowNode = this.rowModel.getRow(gridCell.rowIndex);
|
25678 | break;
|
25679 | }
|
25680 | var suppressNavigable = column.isSuppressNavigable(rowNode);
|
25681 | return !suppressNavigable;
|
25682 | };
|
25683 | CellNavigationService.prototype.getCellToLeft = function (lastCell) {
|
25684 | var colToLeft = this.columnController.getDisplayedColBefore(lastCell.column);
|
25685 | if (!colToLeft) {
|
25686 | return null;
|
25687 | }
|
25688 | else {
|
25689 | var gridCellDef = { rowIndex: lastCell.rowIndex, column: colToLeft, floating: lastCell.floating };
|
25690 | return new gridCell_1.GridCell(gridCellDef);
|
25691 | }
|
25692 | };
|
25693 | CellNavigationService.prototype.getCellToRight = function (lastCell) {
|
25694 | var colToRight = this.columnController.getDisplayedColAfter(lastCell.column);
|
25695 |
|
25696 | if (!colToRight) {
|
25697 | return null;
|
25698 | }
|
25699 | else {
|
25700 | var gridCellDef = { rowIndex: lastCell.rowIndex, column: colToRight, floating: lastCell.floating };
|
25701 | return new gridCell_1.GridCell(gridCellDef);
|
25702 | }
|
25703 | };
|
25704 | CellNavigationService.prototype.getRowBelow = function (lastRow) {
|
25705 |
|
25706 | if (this.isLastRowInContainer(lastRow)) {
|
25707 | if (lastRow.isFloatingBottom()) {
|
25708 | return null;
|
25709 | }
|
25710 | else if (lastRow.isNotFloating()) {
|
25711 | if (this.pinnedRowModel.isRowsToRender(constants_1.Constants.PINNED_BOTTOM)) {
|
25712 | return new gridRow_1.GridRow(0, constants_1.Constants.PINNED_BOTTOM);
|
25713 | }
|
25714 | else {
|
25715 | return null;
|
25716 | }
|
25717 | }
|
25718 | else {
|
25719 | if (this.rowModel.isRowsToRender()) {
|
25720 | return new gridRow_1.GridRow(0, null);
|
25721 | }
|
25722 | else if (this.pinnedRowModel.isRowsToRender(constants_1.Constants.PINNED_BOTTOM)) {
|
25723 | return new gridRow_1.GridRow(0, constants_1.Constants.PINNED_BOTTOM);
|
25724 | }
|
25725 | else {
|
25726 | return null;
|
25727 | }
|
25728 | }
|
25729 | }
|
25730 | else {
|
25731 | return new gridRow_1.GridRow(lastRow.rowIndex + 1, lastRow.floating);
|
25732 | }
|
25733 | };
|
25734 | CellNavigationService.prototype.getCellBelow = function (lastCell) {
|
25735 | var rowBelow = this.getRowBelow(lastCell.getGridRow());
|
25736 | if (rowBelow) {
|
25737 | var gridCellDef = { rowIndex: rowBelow.rowIndex, column: lastCell.column, floating: rowBelow.floating };
|
25738 | return new gridCell_1.GridCell(gridCellDef);
|
25739 | }
|
25740 | else {
|
25741 | return null;
|
25742 | }
|
25743 | };
|
25744 | CellNavigationService.prototype.isLastRowInContainer = function (gridRow) {
|
25745 | if (gridRow.isFloatingTop()) {
|
25746 | var lastTopIndex = this.pinnedRowModel.getPinnedTopRowData().length - 1;
|
25747 | return lastTopIndex <= gridRow.rowIndex;
|
25748 | }
|
25749 | else if (gridRow.isFloatingBottom()) {
|
25750 | var lastBottomIndex = this.pinnedRowModel.getPinnedBottomRowData().length - 1;
|
25751 | return lastBottomIndex <= gridRow.rowIndex;
|
25752 | }
|
25753 | else {
|
25754 | var lastBodyIndex = this.rowModel.getPageLastRow();
|
25755 | return lastBodyIndex <= gridRow.rowIndex;
|
25756 | }
|
25757 | };
|
25758 | CellNavigationService.prototype.getRowAbove = function (lastRow) {
|
25759 |
|
25760 | if (lastRow.rowIndex === 0) {
|
25761 | if (lastRow.isFloatingTop()) {
|
25762 | return null;
|
25763 | }
|
25764 | else if (lastRow.isNotFloating()) {
|
25765 | if (this.pinnedRowModel.isRowsToRender(constants_1.Constants.PINNED_TOP)) {
|
25766 | return this.getLastFloatingTopRow();
|
25767 | }
|
25768 | else {
|
25769 | return null;
|
25770 | }
|
25771 | }
|
25772 | else {
|
25773 |
|
25774 | if (this.rowModel.isRowsToRender()) {
|
25775 | return this.getLastBodyCell();
|
25776 | }
|
25777 | else if (this.pinnedRowModel.isRowsToRender(constants_1.Constants.PINNED_TOP)) {
|
25778 | return this.getLastFloatingTopRow();
|
25779 | }
|
25780 | else {
|
25781 | return null;
|
25782 | }
|
25783 | }
|
25784 | }
|
25785 | else {
|
25786 | return new gridRow_1.GridRow(lastRow.rowIndex - 1, lastRow.floating);
|
25787 | }
|
25788 | };
|
25789 | CellNavigationService.prototype.getCellAbove = function (lastCell) {
|
25790 | var rowAbove = this.getRowAbove(lastCell.getGridRow());
|
25791 | if (rowAbove) {
|
25792 | var gridCellDef = { rowIndex: rowAbove.rowIndex, column: lastCell.column, floating: rowAbove.floating };
|
25793 | return new gridCell_1.GridCell(gridCellDef);
|
25794 | }
|
25795 | else {
|
25796 | return null;
|
25797 | }
|
25798 | };
|
25799 | CellNavigationService.prototype.getLastBodyCell = function () {
|
25800 | var lastBodyRow = this.rowModel.getPageLastRow();
|
25801 | return new gridRow_1.GridRow(lastBodyRow, null);
|
25802 | };
|
25803 | CellNavigationService.prototype.getLastFloatingTopRow = function () {
|
25804 | var lastFloatingRow = this.pinnedRowModel.getPinnedTopRowData().length - 1;
|
25805 | return new gridRow_1.GridRow(lastFloatingRow, constants_1.Constants.PINNED_TOP);
|
25806 | };
|
25807 | CellNavigationService.prototype.getNextTabbedCell = function (gridCell, backwards) {
|
25808 | if (backwards) {
|
25809 | return this.getNextTabbedCellBackwards(gridCell);
|
25810 | }
|
25811 | else {
|
25812 | return this.getNextTabbedCellForwards(gridCell);
|
25813 | }
|
25814 | };
|
25815 | CellNavigationService.prototype.getNextTabbedCellForwards = function (gridCell) {
|
25816 | var displayedColumns = this.columnController.getAllDisplayedColumns();
|
25817 | var newRowIndex = gridCell.rowIndex;
|
25818 | var newFloating = gridCell.floating;
|
25819 |
|
25820 | var newColumn = this.columnController.getDisplayedColAfter(gridCell.column);
|
25821 |
|
25822 | if (!newColumn) {
|
25823 | newColumn = displayedColumns[0];
|
25824 | var rowBelow = this.getRowBelow(gridCell.getGridRow());
|
25825 | if (utils_1.Utils.missing(rowBelow)) {
|
25826 | return;
|
25827 | }
|
25828 | newRowIndex = rowBelow.rowIndex;
|
25829 | newFloating = rowBelow.floating;
|
25830 | }
|
25831 | var gridCellDef = { rowIndex: newRowIndex, column: newColumn, floating: newFloating };
|
25832 | return new gridCell_1.GridCell(gridCellDef);
|
25833 | };
|
25834 | CellNavigationService.prototype.getNextTabbedCellBackwards = function (gridCell) {
|
25835 | var displayedColumns = this.columnController.getAllDisplayedColumns();
|
25836 | var newRowIndex = gridCell.rowIndex;
|
25837 | var newFloating = gridCell.floating;
|
25838 |
|
25839 | var newColumn = this.columnController.getDisplayedColBefore(gridCell.column);
|
25840 |
|
25841 | if (!newColumn) {
|
25842 | newColumn = displayedColumns[displayedColumns.length - 1];
|
25843 | var rowAbove = this.getRowAbove(gridCell.getGridRow());
|
25844 | if (utils_1.Utils.missing(rowAbove)) {
|
25845 | return;
|
25846 | }
|
25847 | newRowIndex = rowAbove.rowIndex;
|
25848 | newFloating = rowAbove.floating;
|
25849 | }
|
25850 | var gridCellDef = { rowIndex: newRowIndex, column: newColumn, floating: newFloating };
|
25851 | return new gridCell_1.GridCell(gridCellDef);
|
25852 | };
|
25853 | __decorate([
|
25854 | context_1.Autowired('columnController'),
|
25855 | __metadata("design:type", columnController_1.ColumnController)
|
25856 | ], CellNavigationService.prototype, "columnController", void 0);
|
25857 | __decorate([
|
25858 | context_1.Autowired('rowModel'),
|
25859 | __metadata("design:type", Object)
|
25860 | ], CellNavigationService.prototype, "rowModel", void 0);
|
25861 | __decorate([
|
25862 | context_1.Autowired('pinnedRowModel'),
|
25863 | __metadata("design:type", pinnedRowModel_1.PinnedRowModel)
|
25864 | ], CellNavigationService.prototype, "pinnedRowModel", void 0);
|
25865 | __decorate([
|
25866 | context_1.Autowired('gridOptionsWrapper'),
|
25867 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
25868 | ], CellNavigationService.prototype, "gridOptionsWrapper", void 0);
|
25869 | CellNavigationService = __decorate([
|
25870 | context_1.Bean('cellNavigationService')
|
25871 | ], CellNavigationService);
|
25872 | return CellNavigationService;
|
25873 | }());
|
25874 | exports.CellNavigationService = CellNavigationService;
|
25875 |
|
25876 |
|
25877 | }),
|
25878 |
|
25879 | (function(module, exports, __webpack_require__) {
|
25880 |
|
25881 | "use strict";
|
25882 |
|
25883 |
|
25884 |
|
25885 |
|
25886 |
|
25887 |
|
25888 |
|
25889 | Object.defineProperty(exports, "__esModule", { value: true });
|
25890 |
|
25891 |
|
25892 |
|
25893 |
|
25894 |
|
25895 |
|
25896 |
|
25897 |
|
25898 |
|
25899 |
|
25900 | var GroupInstanceIdCreator = (function () {
|
25901 | function GroupInstanceIdCreator() {
|
25902 |
|
25903 | this.existingIds = {};
|
25904 | }
|
25905 | GroupInstanceIdCreator.prototype.getInstanceIdForKey = function (key) {
|
25906 | var lastResult = this.existingIds[key];
|
25907 | var result;
|
25908 | if (typeof lastResult !== 'number') {
|
25909 |
|
25910 | result = 0;
|
25911 | }
|
25912 | else {
|
25913 | result = lastResult + 1;
|
25914 | }
|
25915 | this.existingIds[key] = result;
|
25916 | return result;
|
25917 | };
|
25918 | return GroupInstanceIdCreator;
|
25919 | }());
|
25920 | exports.GroupInstanceIdCreator = GroupInstanceIdCreator;
|
25921 |
|
25922 |
|
25923 | }),
|
25924 |
|
25925 | (function(module, exports, __webpack_require__) {
|
25926 |
|
25927 | "use strict";
|
25928 |
|
25929 |
|
25930 |
|
25931 |
|
25932 |
|
25933 |
|
25934 |
|
25935 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
25936 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
25937 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
25938 | 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;
|
25939 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
25940 | };
|
25941 | Object.defineProperty(exports, "__esModule", { value: true });
|
25942 | var context_1 = __webpack_require__(0);
|
25943 | var Downloader = (function () {
|
25944 | function Downloader() {
|
25945 | }
|
25946 | Downloader.prototype.download = function (fileName, content, mimeType) {
|
25947 |
|
25948 |
|
25949 |
|
25950 | if (window.navigator.msSaveOrOpenBlob) {
|
25951 | var blobObject = new Blob(["\ufeff", content], {
|
25952 | type: mimeType
|
25953 | });
|
25954 | window.navigator.msSaveOrOpenBlob(blobObject, fileName);
|
25955 | }
|
25956 | else {
|
25957 |
|
25958 | var element = document.createElement("a");
|
25959 | var blob = new Blob(["\ufeff", content], { type: "octet/stream" });
|
25960 | var url = window.URL.createObjectURL(blob);
|
25961 | element.setAttribute("href", url);
|
25962 | element.setAttribute("download", fileName);
|
25963 | element.style.display = "none";
|
25964 | document.body.appendChild(element);
|
25965 | element.click();
|
25966 | window.URL.revokeObjectURL(url);
|
25967 | document.body.removeChild(element);
|
25968 | }
|
25969 | };
|
25970 | Downloader = __decorate([
|
25971 | context_1.Bean("downloader")
|
25972 | ], Downloader);
|
25973 | return Downloader;
|
25974 | }());
|
25975 | exports.Downloader = Downloader;
|
25976 |
|
25977 |
|
25978 | }),
|
25979 |
|
25980 | (function(module, exports, __webpack_require__) {
|
25981 |
|
25982 | "use strict";
|
25983 |
|
25984 |
|
25985 |
|
25986 |
|
25987 |
|
25988 |
|
25989 |
|
25990 | Object.defineProperty(exports, "__esModule", { value: true });
|
25991 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
25992 | var selectionController_1 = __webpack_require__(17);
|
25993 | var columnApi_1 = __webpack_require__(7);
|
25994 | var columnController_1 = __webpack_require__(4);
|
25995 | var rowRenderer_1 = __webpack_require__(20);
|
25996 | var headerRootComp_1 = __webpack_require__(80);
|
25997 | var filterManager_1 = __webpack_require__(18);
|
25998 | var valueService_1 = __webpack_require__(15);
|
25999 | var eventService_1 = __webpack_require__(3);
|
26000 | var gridPanel_1 = __webpack_require__(78);
|
26001 | var gridApi_1 = __webpack_require__(6);
|
26002 | var balancedColumnTreeBuilder_1 = __webpack_require__(38);
|
26003 | var displayedGroupCreator_1 = __webpack_require__(48);
|
26004 | var expressionService_1 = __webpack_require__(19);
|
26005 | var templateService_1 = __webpack_require__(49);
|
26006 | var popupService_1 = __webpack_require__(35);
|
26007 | var logger_1 = __webpack_require__(12);
|
26008 | var columnUtils_1 = __webpack_require__(31);
|
26009 | var autoWidthCalculator_1 = __webpack_require__(39);
|
26010 | var horizontalResizeService_1 = __webpack_require__(59);
|
26011 | var context_1 = __webpack_require__(0);
|
26012 | var csvCreator_1 = __webpack_require__(47);
|
26013 | var gridCore_1 = __webpack_require__(42);
|
26014 | var standardMenu_1 = __webpack_require__(108);
|
26015 | var dragAndDropService_1 = __webpack_require__(14);
|
26016 | var dragService_1 = __webpack_require__(40);
|
26017 | var sortController_1 = __webpack_require__(24);
|
26018 | var focusedCellController_1 = __webpack_require__(22);
|
26019 | var mouseEventService_1 = __webpack_require__(44);
|
26020 | var cellNavigationService_1 = __webpack_require__(82);
|
26021 | var utils_1 = __webpack_require__(1);
|
26022 | var filterStage_1 = __webpack_require__(109);
|
26023 | var sortStage_1 = __webpack_require__(111);
|
26024 | var flattenStage_1 = __webpack_require__(113);
|
26025 | var cellEditorFactory_1 = __webpack_require__(54);
|
26026 | var events_1 = __webpack_require__(5);
|
26027 | var infiniteRowModel_1 = __webpack_require__(114);
|
26028 | var clientSideRowModel_1 = __webpack_require__(116);
|
26029 | var cellRendererFactory_1 = __webpack_require__(55);
|
26030 | var cellRendererService_1 = __webpack_require__(56);
|
26031 | var valueFormatterService_1 = __webpack_require__(43);
|
26032 | var agCheckbox_1 = __webpack_require__(60);
|
26033 | var baseFrameworkFactory_1 = __webpack_require__(118);
|
26034 | var scrollVisibleService_1 = __webpack_require__(36);
|
26035 | var downloader_1 = __webpack_require__(84);
|
26036 | var xmlFactory_1 = __webpack_require__(119);
|
26037 | var gridSerializer_1 = __webpack_require__(63);
|
26038 | var stylingService_1 = __webpack_require__(73);
|
26039 | var columnHoverService_1 = __webpack_require__(45);
|
26040 | var columnAnimationService_1 = __webpack_require__(53);
|
26041 | var sortService_1 = __webpack_require__(112);
|
26042 | var filterService_1 = __webpack_require__(110);
|
26043 | var autoGroupColService_1 = __webpack_require__(104);
|
26044 | var paginationProxy_1 = __webpack_require__(29);
|
26045 | var immutableService_1 = __webpack_require__(105);
|
26046 | var constants_1 = __webpack_require__(9);
|
26047 | var valueCache_1 = __webpack_require__(33);
|
26048 | var changeDetectionService_1 = __webpack_require__(138);
|
26049 | var alignedGridsService_1 = __webpack_require__(58);
|
26050 | var pinnedRowModel_1 = __webpack_require__(30);
|
26051 | var componentResolver_1 = __webpack_require__(27);
|
26052 | var componentRecipes_1 = __webpack_require__(21);
|
26053 | var componentProvider_1 = __webpack_require__(66);
|
26054 | var agComponentUtils_1 = __webpack_require__(76);
|
26055 | var componentMetadataProvider_1 = __webpack_require__(77);
|
26056 | var beans_1 = __webpack_require__(28);
|
26057 | var environment_1 = __webpack_require__(41);
|
26058 | var animationFrameService_1 = __webpack_require__(37);
|
26059 | var navigationService_1 = __webpack_require__(97);
|
26060 | var heightScaler_1 = __webpack_require__(57);
|
26061 | var selectableService_1 = __webpack_require__(86);
|
26062 | var autoHeightCalculator_1 = __webpack_require__(79);
|
26063 | var paginationComp_1 = __webpack_require__(139);
|
26064 | var Grid = (function () {
|
26065 | function Grid(eGridDiv, gridOptions, params) {
|
26066 | if (!eGridDiv) {
|
26067 | console.error('ag-Grid: no div element provided to the grid');
|
26068 | }
|
26069 | if (!gridOptions) {
|
26070 | console.error('ag-Grid: no gridOptions provided to the grid');
|
26071 | }
|
26072 | var rowModelClass = this.getRowModelClass(gridOptions);
|
26073 | var enterprise = utils_1.Utils.exists(Grid.enterpriseBeans);
|
26074 | var frameworkFactory = params ? params.frameworkFactory : null;
|
26075 | if (utils_1.Utils.missing(frameworkFactory)) {
|
26076 | frameworkFactory = new baseFrameworkFactory_1.BaseFrameworkFactory();
|
26077 | }
|
26078 | var overrideBeans = [];
|
26079 | if (Grid.enterpriseBeans) {
|
26080 | overrideBeans = overrideBeans.concat(Grid.enterpriseBeans);
|
26081 | }
|
26082 | if (Grid.frameworkBeans) {
|
26083 | overrideBeans = overrideBeans.concat(Grid.frameworkBeans);
|
26084 | }
|
26085 | var seed = {
|
26086 | enterprise: enterprise,
|
26087 | gridOptions: gridOptions,
|
26088 | eGridDiv: eGridDiv,
|
26089 | $scope: params ? params.$scope : null,
|
26090 | $compile: params ? params.$compile : null,
|
26091 | quickFilterOnScope: params ? params.quickFilterOnScope : null,
|
26092 | globalEventListener: params ? params.globalEventListener : null,
|
26093 | frameworkFactory: frameworkFactory
|
26094 | };
|
26095 | if (params && params.seedBeanInstances) {
|
26096 | utils_1.Utils.assign(seed, params.seedBeanInstances);
|
26097 | }
|
26098 | var components = [
|
26099 | { componentName: 'AgCheckbox', theClass: agCheckbox_1.AgCheckbox },
|
26100 | { componentName: 'AgGridComp', theClass: gridPanel_1.GridPanel },
|
26101 | { componentName: 'AgHeaderRoot', theClass: headerRootComp_1.HeaderRootComp },
|
26102 | { componentName: 'AgPagination', theClass: paginationComp_1.PaginationComp },
|
26103 | ];
|
26104 | if (Grid.enterpriseComponents) {
|
26105 | components = components.concat(Grid.enterpriseComponents);
|
26106 | }
|
26107 | var contextParams = {
|
26108 | overrideBeans: overrideBeans,
|
26109 | seed: seed,
|
26110 |
|
26111 | beans: [rowModelClass, beans_1.Beans, paginationProxy_1.PaginationAutoPageSizeService, gridApi_1.GridApi, componentProvider_1.ComponentProvider, agComponentUtils_1.AgComponentUtils, componentMetadataProvider_1.ComponentMetadataProvider,
|
26112 | componentProvider_1.ComponentProvider, componentResolver_1.ComponentResolver, componentRecipes_1.ComponentRecipes, heightScaler_1.HeightScaler, autoHeightCalculator_1.AutoHeightCalculator,
|
26113 | cellRendererFactory_1.CellRendererFactory, horizontalResizeService_1.HorizontalResizeService, pinnedRowModel_1.PinnedRowModel, dragService_1.DragService,
|
26114 | displayedGroupCreator_1.DisplayedGroupCreator, eventService_1.EventService, gridOptionsWrapper_1.GridOptionsWrapper, selectionController_1.SelectionController,
|
26115 | filterManager_1.FilterManager, columnController_1.ColumnController, paginationProxy_1.PaginationProxy, rowRenderer_1.RowRenderer, expressionService_1.ExpressionService,
|
26116 | balancedColumnTreeBuilder_1.BalancedColumnTreeBuilder, csvCreator_1.CsvCreator, downloader_1.Downloader, xmlFactory_1.XmlFactory, gridSerializer_1.GridSerializer, templateService_1.TemplateService,
|
26117 | navigationService_1.NavigationService, popupService_1.PopupService, valueCache_1.ValueCache, valueService_1.ValueService, alignedGridsService_1.AlignedGridsService,
|
26118 | logger_1.LoggerFactory, columnUtils_1.ColumnUtils, autoWidthCalculator_1.AutoWidthCalculator, popupService_1.PopupService, gridCore_1.GridCore, standardMenu_1.StandardMenuFactory,
|
26119 | dragAndDropService_1.DragAndDropService, columnApi_1.ColumnApi, focusedCellController_1.FocusedCellController, mouseEventService_1.MouseEventService,
|
26120 | cellNavigationService_1.CellNavigationService, filterStage_1.FilterStage, sortStage_1.SortStage, flattenStage_1.FlattenStage, filterService_1.FilterService,
|
26121 | cellEditorFactory_1.CellEditorFactory, cellRendererService_1.CellRendererService, valueFormatterService_1.ValueFormatterService, stylingService_1.StylingService, scrollVisibleService_1.ScrollVisibleService,
|
26122 | columnHoverService_1.ColumnHoverService, columnAnimationService_1.ColumnAnimationService, sortService_1.SortService, selectableService_1.SelectableService, autoGroupColService_1.AutoGroupColService,
|
26123 | immutableService_1.ImmutableService, changeDetectionService_1.ChangeDetectionService, environment_1.Environment, animationFrameService_1.AnimationFrameService, sortController_1.SortController],
|
26124 | components: components,
|
26125 | debug: !!gridOptions.debug
|
26126 | };
|
26127 | var isLoggingFunc = function () { return contextParams.debug; };
|
26128 | this.context = new context_1.Context(contextParams, new logger_1.Logger('Context', isLoggingFunc));
|
26129 | this.setColumnsAndData();
|
26130 | this.dispatchGridReadyEvent(gridOptions);
|
26131 | if (gridOptions.debug) {
|
26132 | console.log('ag-Grid -> initialised successfully, enterprise = ' + enterprise);
|
26133 | }
|
26134 | }
|
26135 | Grid.setEnterpriseBeans = function (enterpriseBeans, rowModelClasses) {
|
26136 | this.enterpriseBeans = enterpriseBeans;
|
26137 |
|
26138 | utils_1.Utils.iterateObject(rowModelClasses, function (key, value) { return Grid.RowModelClasses[key] = value; });
|
26139 | };
|
26140 | Grid.setEnterpriseComponents = function (components) {
|
26141 | this.enterpriseComponents = components;
|
26142 | };
|
26143 | Grid.setFrameworkBeans = function (frameworkBeans) {
|
26144 | this.frameworkBeans = frameworkBeans;
|
26145 | };
|
26146 | Grid.prototype.setColumnsAndData = function () {
|
26147 | var gridOptionsWrapper = this.context.getBean('gridOptionsWrapper');
|
26148 | var columnController = this.context.getBean('columnController');
|
26149 | var rowModel = this.context.getBean('rowModel');
|
26150 | var columnDefs = gridOptionsWrapper.getColumnDefs();
|
26151 | var rowData = gridOptionsWrapper.getRowData();
|
26152 | var nothingToSet = utils_1.Utils.missing(columnDefs) && utils_1.Utils.missing(rowData);
|
26153 | if (nothingToSet) {
|
26154 | return;
|
26155 | }
|
26156 | if (utils_1.Utils.exists(columnDefs)) {
|
26157 | columnController.setColumnDefs(columnDefs, "gridInitializing");
|
26158 | }
|
26159 | if (utils_1.Utils.exists(rowData) && rowModel.getType() === constants_1.Constants.ROW_MODEL_TYPE_CLIENT_SIDE) {
|
26160 | var clientSideRowModel = rowModel;
|
26161 | clientSideRowModel.setRowData(rowData);
|
26162 | }
|
26163 | };
|
26164 | Grid.prototype.dispatchGridReadyEvent = function (gridOptions) {
|
26165 | var eventService = this.context.getBean('eventService');
|
26166 | var readyEvent = {
|
26167 | type: events_1.Events.EVENT_GRID_READY,
|
26168 | api: gridOptions.api,
|
26169 | columnApi: gridOptions.columnApi
|
26170 | };
|
26171 | eventService.dispatchEvent(readyEvent);
|
26172 | };
|
26173 | Grid.prototype.getRowModelClass = function (gridOptions) {
|
26174 | var rowModelType = gridOptions.rowModelType;
|
26175 |
|
26176 | rowModelType = rowModelType === 'enterprise' ? constants_1.Constants.ROW_MODEL_TYPE_SERVER_SIDE : rowModelType;
|
26177 | if (utils_1.Utils.exists(rowModelType)) {
|
26178 | var rowModelClass = Grid.RowModelClasses[rowModelType];
|
26179 | if (utils_1.Utils.exists(rowModelClass)) {
|
26180 | return rowModelClass;
|
26181 | }
|
26182 | else {
|
26183 | if (rowModelType === 'normal') {
|
26184 | console.warn("ag-Grid: normal rowModel deprecated. Should now be called client side row model instead.");
|
26185 | return clientSideRowModel_1.ClientSideRowModel;
|
26186 | }
|
26187 | console.error('ag-Grid: could not find matching row model for rowModelType ' + rowModelType);
|
26188 | if (rowModelType === constants_1.Constants.ROW_MODEL_TYPE_VIEWPORT) {
|
26189 | console.error('ag-Grid: rowModelType viewport is only available in ag-Grid Enterprise');
|
26190 | }
|
26191 | if (rowModelType === constants_1.Constants.ROW_MODEL_TYPE_SERVER_SIDE) {
|
26192 | console.error('ag-Grid: rowModelType server side is only available in ag-Grid Enterprise');
|
26193 | }
|
26194 | }
|
26195 | }
|
26196 | return clientSideRowModel_1.ClientSideRowModel;
|
26197 | };
|
26198 | ;
|
26199 | Grid.prototype.destroy = function () {
|
26200 | this.context.destroy();
|
26201 | };
|
26202 |
|
26203 |
|
26204 | Grid.RowModelClasses = {
|
26205 | infinite: infiniteRowModel_1.InfiniteRowModel,
|
26206 | clientSide: clientSideRowModel_1.ClientSideRowModel
|
26207 | };
|
26208 | return Grid;
|
26209 | }());
|
26210 | exports.Grid = Grid;
|
26211 |
|
26212 |
|
26213 | }),
|
26214 |
|
26215 | (function(module, exports, __webpack_require__) {
|
26216 |
|
26217 | "use strict";
|
26218 |
|
26219 |
|
26220 |
|
26221 |
|
26222 |
|
26223 |
|
26224 |
|
26225 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
26226 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
26227 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
26228 | 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;
|
26229 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
26230 | };
|
26231 | var __metadata = (this && this.__metadata) || function (k, v) {
|
26232 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
26233 | };
|
26234 | Object.defineProperty(exports, "__esModule", { value: true });
|
26235 | var context_1 = __webpack_require__(0);
|
26236 | var utils_1 = __webpack_require__(1);
|
26237 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
26238 | var SelectableService = (function () {
|
26239 | function SelectableService() {
|
26240 | }
|
26241 | SelectableService.prototype.init = function () {
|
26242 | this.groupSelectsChildren = this.gridOptionsWrapper.isGroupSelectsChildren();
|
26243 | this.isRowSelectableFunc = this.gridOptionsWrapper.getIsRowSelectableFunc();
|
26244 | };
|
26245 | SelectableService.prototype.updateSelectableAfterGrouping = function (rowNode) {
|
26246 | if (this.isRowSelectableFunc) {
|
26247 | var nextChildrenFunc = function (rowNode) { return rowNode.childrenAfterGroup; };
|
26248 | this.recurseDown(rowNode.childrenAfterGroup, nextChildrenFunc);
|
26249 | }
|
26250 | };
|
26251 | SelectableService.prototype.updateSelectableAfterFiltering = function (rowNode) {
|
26252 | if (this.isRowSelectableFunc) {
|
26253 | var nextChildrenFunc = function (rowNode) { return rowNode.childrenAfterFilter; };
|
26254 | this.recurseDown(rowNode.childrenAfterGroup, nextChildrenFunc);
|
26255 | }
|
26256 | };
|
26257 | SelectableService.prototype.recurseDown = function (children, nextChildrenFunc) {
|
26258 | var _this = this;
|
26259 | children.forEach(function (child) {
|
26260 | if (!child.group) {
|
26261 | return;
|
26262 | }
|
26263 | if (child.hasChildren()) {
|
26264 | _this.recurseDown(nextChildrenFunc(child), nextChildrenFunc);
|
26265 | }
|
26266 | var rowSelectable;
|
26267 | if (_this.groupSelectsChildren) {
|
26268 |
|
26269 | var firstSelectable = utils_1._.find(nextChildrenFunc(child), 'selectable', true);
|
26270 | rowSelectable = utils_1._.exists(firstSelectable);
|
26271 | }
|
26272 | else {
|
26273 |
|
26274 | rowSelectable = _this.isRowSelectableFunc(child);
|
26275 | }
|
26276 | child.setRowSelectable(rowSelectable);
|
26277 | });
|
26278 | };
|
26279 | __decorate([
|
26280 | context_1.Autowired('gridOptionsWrapper'),
|
26281 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
26282 | ], SelectableService.prototype, "gridOptionsWrapper", void 0);
|
26283 | __decorate([
|
26284 | context_1.PostConstruct,
|
26285 | __metadata("design:type", Function),
|
26286 | __metadata("design:paramtypes", []),
|
26287 | __metadata("design:returntype", void 0)
|
26288 | ], SelectableService.prototype, "init", null);
|
26289 | SelectableService = __decorate([
|
26290 | context_1.Bean('selectableService')
|
26291 | ], SelectableService);
|
26292 | return SelectableService;
|
26293 | }());
|
26294 | exports.SelectableService = SelectableService;
|
26295 |
|
26296 |
|
26297 | }),
|
26298 |
|
26299 | (function(module, exports, __webpack_require__) {
|
26300 |
|
26301 | "use strict";
|
26302 |
|
26303 |
|
26304 |
|
26305 |
|
26306 |
|
26307 |
|
26308 |
|
26309 | var __extends = (this && this.__extends) || (function () {
|
26310 | var extendStatics = Object.setPrototypeOf ||
|
26311 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
26312 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
26313 | return function (d, b) {
|
26314 | extendStatics(d, b);
|
26315 | function __() { this.constructor = d; }
|
26316 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
26317 | };
|
26318 | })();
|
26319 | Object.defineProperty(exports, "__esModule", { value: true });
|
26320 | var utils_1 = __webpack_require__(1);
|
26321 | var beanStub_1 = __webpack_require__(13);
|
26322 | var rowNodeBlock_1 = __webpack_require__(61);
|
26323 | var RowNodeCache = (function (_super) {
|
26324 | __extends(RowNodeCache, _super);
|
26325 | function RowNodeCache(cacheParams) {
|
26326 | var _this = _super.call(this) || this;
|
26327 | _this.maxRowFound = false;
|
26328 | _this.blocks = {};
|
26329 | _this.blockCount = 0;
|
26330 | _this.virtualRowCount = cacheParams.initialRowCount;
|
26331 | _this.cacheParams = cacheParams;
|
26332 | return _this;
|
26333 | }
|
26334 | RowNodeCache.prototype.destroy = function () {
|
26335 | var _this = this;
|
26336 | _super.prototype.destroy.call(this);
|
26337 | this.forEachBlockInOrder(function (block) { return _this.destroyBlock(block); });
|
26338 | };
|
26339 | RowNodeCache.prototype.init = function () {
|
26340 | var _this = this;
|
26341 | this.active = true;
|
26342 | this.addDestroyFunc(function () { return _this.active = false; });
|
26343 | };
|
26344 | RowNodeCache.prototype.isActive = function () {
|
26345 | return this.active;
|
26346 | };
|
26347 | RowNodeCache.prototype.getVirtualRowCount = function () {
|
26348 | return this.virtualRowCount;
|
26349 | };
|
26350 | RowNodeCache.prototype.hack_setVirtualRowCount = function (virtualRowCount) {
|
26351 | this.virtualRowCount = virtualRowCount;
|
26352 | };
|
26353 | RowNodeCache.prototype.isMaxRowFound = function () {
|
26354 | return this.maxRowFound;
|
26355 | };
|
26356 |
|
26357 | RowNodeCache.prototype.onPageLoaded = function (event) {
|
26358 | this.cacheParams.rowNodeBlockLoader.loadComplete();
|
26359 | this.checkBlockToLoad();
|
26360 |
|
26361 |
|
26362 | if (!this.isActive()) {
|
26363 | return;
|
26364 | }
|
26365 | this.logger.log("onPageLoaded: page = " + event.page.getBlockNumber() + ", lastRow = " + event.lastRow);
|
26366 | if (event.success) {
|
26367 | this.checkVirtualRowCount(event.page, event.lastRow);
|
26368 | }
|
26369 | };
|
26370 | RowNodeCache.prototype.purgeBlocksIfNeeded = function (blockToExclude) {
|
26371 | var _this = this;
|
26372 |
|
26373 | if (utils_1.Utils.missing(this.cacheParams.maxBlocksInCache)) {
|
26374 | return;
|
26375 | }
|
26376 |
|
26377 | if (this.blockCount <= this.cacheParams.maxBlocksInCache) {
|
26378 | return;
|
26379 | }
|
26380 |
|
26381 | var blocksForPurging = [];
|
26382 | this.forEachBlockInOrder(function (block) {
|
26383 |
|
26384 |
|
26385 | if (block === blockToExclude) {
|
26386 | return;
|
26387 | }
|
26388 | blocksForPurging.push(block);
|
26389 | });
|
26390 |
|
26391 | blocksForPurging.sort(function (a, b) { return b.getLastAccessed() - a.getLastAccessed(); });
|
26392 |
|
26393 |
|
26394 |
|
26395 | var blocksToKeep = this.cacheParams.maxBlocksInCache - 1;
|
26396 | blocksForPurging.splice(0, blocksToKeep);
|
26397 |
|
26398 | blocksForPurging.forEach(function (block) {
|
26399 |
|
26400 |
|
26401 |
|
26402 |
|
26403 |
|
26404 | if (block.isAnyNodeOpen(_this.virtualRowCount)) {
|
26405 | return;
|
26406 | }
|
26407 |
|
26408 | _this.removeBlockFromCache(block);
|
26409 | });
|
26410 | };
|
26411 | RowNodeCache.prototype.postCreateBlock = function (newBlock) {
|
26412 | newBlock.addEventListener(rowNodeBlock_1.RowNodeBlock.EVENT_LOAD_COMPLETE, this.onPageLoaded.bind(this));
|
26413 | this.setBlock(newBlock.getBlockNumber(), newBlock);
|
26414 | this.purgeBlocksIfNeeded(newBlock);
|
26415 | this.checkBlockToLoad();
|
26416 | };
|
26417 | RowNodeCache.prototype.removeBlockFromCache = function (blockToRemove) {
|
26418 | if (!blockToRemove) {
|
26419 | return;
|
26420 | }
|
26421 | this.destroyBlock(blockToRemove);
|
26422 |
|
26423 |
|
26424 |
|
26425 | };
|
26426 |
|
26427 | RowNodeCache.prototype.checkBlockToLoad = function () {
|
26428 | this.cacheParams.rowNodeBlockLoader.checkBlockToLoad();
|
26429 | };
|
26430 | RowNodeCache.prototype.checkVirtualRowCount = function (block, lastRow) {
|
26431 |
|
26432 |
|
26433 | if (typeof lastRow === 'number' && lastRow >= 0) {
|
26434 | this.virtualRowCount = lastRow;
|
26435 | this.maxRowFound = true;
|
26436 | this.onCacheUpdated();
|
26437 | }
|
26438 | else if (!this.maxRowFound) {
|
26439 |
|
26440 | var lastRowIndex = (block.getBlockNumber() + 1) * this.cacheParams.blockSize;
|
26441 | var lastRowIndexPlusOverflow = lastRowIndex + this.cacheParams.overflowSize;
|
26442 | if (this.virtualRowCount < lastRowIndexPlusOverflow) {
|
26443 | this.virtualRowCount = lastRowIndexPlusOverflow;
|
26444 | this.onCacheUpdated();
|
26445 | }
|
26446 | else if (this.cacheParams.dynamicRowHeight) {
|
26447 |
|
26448 |
|
26449 |
|
26450 | this.onCacheUpdated();
|
26451 | }
|
26452 | }
|
26453 | };
|
26454 | RowNodeCache.prototype.setVirtualRowCount = function (rowCount, maxRowFound) {
|
26455 | this.virtualRowCount = rowCount;
|
26456 |
|
26457 |
|
26458 | if (utils_1.Utils.exists(maxRowFound)) {
|
26459 | this.maxRowFound = maxRowFound;
|
26460 | }
|
26461 |
|
26462 |
|
26463 |
|
26464 | if (!this.maxRowFound) {
|
26465 | if (this.virtualRowCount % this.cacheParams.blockSize === 0) {
|
26466 | this.virtualRowCount++;
|
26467 | }
|
26468 | }
|
26469 | this.onCacheUpdated();
|
26470 | };
|
26471 | RowNodeCache.prototype.forEachNodeDeep = function (callback, sequence) {
|
26472 | var _this = this;
|
26473 | this.forEachBlockInOrder(function (block) {
|
26474 | block.forEachNodeDeep(callback, sequence, _this.virtualRowCount);
|
26475 | });
|
26476 | };
|
26477 | RowNodeCache.prototype.forEachBlockInOrder = function (callback) {
|
26478 | var ids = this.getBlockIdsSorted();
|
26479 | this.forEachBlockId(ids, callback);
|
26480 | };
|
26481 | RowNodeCache.prototype.forEachBlockInReverseOrder = function (callback) {
|
26482 | var ids = this.getBlockIdsSorted().reverse();
|
26483 | this.forEachBlockId(ids, callback);
|
26484 | };
|
26485 | RowNodeCache.prototype.forEachBlockId = function (ids, callback) {
|
26486 | var _this = this;
|
26487 | ids.forEach(function (id) {
|
26488 | var block = _this.blocks[id];
|
26489 | callback(block, id);
|
26490 | });
|
26491 | };
|
26492 | RowNodeCache.prototype.getBlockIdsSorted = function () {
|
26493 |
|
26494 | var numberComparator = function (a, b) { return a - b; };
|
26495 | var blockIds = Object.keys(this.blocks).map(function (idStr) { return parseInt(idStr); }).sort(numberComparator);
|
26496 | return blockIds;
|
26497 | };
|
26498 | RowNodeCache.prototype.getBlock = function (blockId) {
|
26499 | return this.blocks[blockId];
|
26500 | };
|
26501 | RowNodeCache.prototype.setBlock = function (id, block) {
|
26502 | this.blocks[id] = block;
|
26503 | this.blockCount++;
|
26504 | this.cacheParams.rowNodeBlockLoader.addBlock(block);
|
26505 | };
|
26506 | RowNodeCache.prototype.destroyBlock = function (block) {
|
26507 | delete this.blocks[block.getBlockNumber()];
|
26508 | block.destroy();
|
26509 | this.blockCount--;
|
26510 | this.cacheParams.rowNodeBlockLoader.removeBlock(block);
|
26511 | };
|
26512 |
|
26513 | RowNodeCache.prototype.onCacheUpdated = function () {
|
26514 | if (this.isActive()) {
|
26515 |
|
26516 |
|
26517 | var event_1 = {
|
26518 | type: RowNodeCache.EVENT_CACHE_UPDATED
|
26519 | };
|
26520 | this.dispatchEvent(event_1);
|
26521 | }
|
26522 | };
|
26523 | RowNodeCache.prototype.purgeCache = function () {
|
26524 | var _this = this;
|
26525 | this.forEachBlockInOrder(function (block) { return _this.removeBlockFromCache(block); });
|
26526 | this.onCacheUpdated();
|
26527 | };
|
26528 | RowNodeCache.prototype.getRowNodesInRange = function (firstInRange, lastInRange) {
|
26529 | var _this = this;
|
26530 | var result = [];
|
26531 | var lastBlockId = -1;
|
26532 | var inActiveRange = false;
|
26533 | var numberSequence = new utils_1.NumberSequence();
|
26534 |
|
26535 | if (utils_1.Utils.missing(firstInRange)) {
|
26536 | inActiveRange = true;
|
26537 | }
|
26538 | var foundGapInSelection = false;
|
26539 | this.forEachBlockInOrder(function (block, id) {
|
26540 | if (foundGapInSelection)
|
26541 | return;
|
26542 | if (inActiveRange && (lastBlockId + 1 !== id)) {
|
26543 | foundGapInSelection = true;
|
26544 | return;
|
26545 | }
|
26546 | lastBlockId = id;
|
26547 | block.forEachNodeShallow(function (rowNode) {
|
26548 | var hitFirstOrLast = rowNode === firstInRange || rowNode === lastInRange;
|
26549 | if (inActiveRange || hitFirstOrLast) {
|
26550 | result.push(rowNode);
|
26551 | }
|
26552 | if (hitFirstOrLast) {
|
26553 | inActiveRange = !inActiveRange;
|
26554 | }
|
26555 | }, numberSequence, _this.virtualRowCount);
|
26556 | });
|
26557 |
|
26558 | var invalidRange = foundGapInSelection || inActiveRange;
|
26559 | return invalidRange ? [] : result;
|
26560 | };
|
26561 | RowNodeCache.EVENT_CACHE_UPDATED = 'cacheUpdated';
|
26562 | return RowNodeCache;
|
26563 | }(beanStub_1.BeanStub));
|
26564 | exports.RowNodeCache = RowNodeCache;
|
26565 |
|
26566 |
|
26567 | }),
|
26568 |
|
26569 | (function(module, exports, __webpack_require__) {
|
26570 |
|
26571 | "use strict";
|
26572 |
|
26573 |
|
26574 |
|
26575 |
|
26576 |
|
26577 |
|
26578 |
|
26579 | Object.defineProperty(exports, "__esModule", { value: true });
|
26580 | var ChangedPath = (function () {
|
26581 | function ChangedPath(keepingColumns) {
|
26582 | this.active = true;
|
26583 | this.nodeIdsToBoolean = {};
|
26584 | this.nodeIdsToColumns = {};
|
26585 | this.keepingColumns = keepingColumns;
|
26586 | }
|
26587 | ChangedPath.prototype.setInactive = function () {
|
26588 | this.active = false;
|
26589 | };
|
26590 | ChangedPath.prototype.isActive = function () {
|
26591 | return this.active;
|
26592 | };
|
26593 | ChangedPath.prototype.addParentNode = function (rowNode, columns) {
|
26594 | var _this = this;
|
26595 | this.validateActive();
|
26596 | var pointer = rowNode;
|
26597 | while (pointer) {
|
26598 |
|
26599 | this.nodeIdsToBoolean[pointer.id] = true;
|
26600 |
|
26601 |
|
26602 | if (this.keepingColumns && columns) {
|
26603 | if (!this.nodeIdsToColumns[pointer.id]) {
|
26604 | this.nodeIdsToColumns[pointer.id] = {};
|
26605 | }
|
26606 | columns.forEach(function (col) { return _this.nodeIdsToColumns[pointer.id][col.getId()] = true; });
|
26607 | }
|
26608 | pointer = pointer.parent;
|
26609 | }
|
26610 | };
|
26611 | ChangedPath.prototype.isInPath = function (rowNode) {
|
26612 | this.validateActive();
|
26613 | return this.nodeIdsToBoolean[rowNode.id];
|
26614 | };
|
26615 | ChangedPath.prototype.getValueColumnsForNode = function (rowNode, valueColumns) {
|
26616 | this.validateActive();
|
26617 | if (!this.keepingColumns) {
|
26618 | return valueColumns;
|
26619 | }
|
26620 | var colsForThisNode = this.nodeIdsToColumns[rowNode.id];
|
26621 | var result = valueColumns.filter(function (col) { return colsForThisNode[col.getId()]; });
|
26622 | return result;
|
26623 | };
|
26624 | ChangedPath.prototype.getNotValueColumnsForNode = function (rowNode, valueColumns) {
|
26625 | this.validateActive();
|
26626 | if (!this.keepingColumns) {
|
26627 | return null;
|
26628 | }
|
26629 | var colsForThisNode = this.nodeIdsToColumns[rowNode.id];
|
26630 | var result = valueColumns.filter(function (col) { return !colsForThisNode[col.getId()]; });
|
26631 | return result;
|
26632 | };
|
26633 |
|
26634 |
|
26635 | ChangedPath.prototype.validateActive = function () {
|
26636 | if (!this.active) {
|
26637 | throw "ag-Grid: tried to work on an invalid changed path";
|
26638 | }
|
26639 | };
|
26640 | return ChangedPath;
|
26641 | }());
|
26642 | exports.ChangedPath = ChangedPath;
|
26643 |
|
26644 |
|
26645 | }),
|
26646 |
|
26647 | (function(module, exports, __webpack_require__) {
|
26648 |
|
26649 | "use strict";
|
26650 |
|
26651 |
|
26652 |
|
26653 |
|
26654 |
|
26655 |
|
26656 |
|
26657 | Object.defineProperty(exports, "__esModule", { value: true });
|
26658 | var PropertyKeys = (function () {
|
26659 | function PropertyKeys() {
|
26660 | }
|
26661 | PropertyKeys.STRING_PROPERTIES = [
|
26662 | 'sortingOrder', 'rowClass', 'rowSelection', 'overlayLoadingTemplate',
|
26663 | 'overlayNoRowsTemplate', 'quickFilterText', 'rowModelType',
|
26664 | 'editType', 'domLayout', 'clipboardDeliminator', 'rowGroupPanelShow',
|
26665 | 'multiSortKey', 'pivotColumnGroupTotals', 'pivotRowTotals', 'pivotPanelShow'
|
26666 | ];
|
26667 | PropertyKeys.OBJECT_PROPERTIES = [
|
26668 | 'components', 'frameworkComponents', 'rowStyle', 'context', 'autoGroupColumnDef', 'groupColumnDef', 'localeText',
|
26669 | 'icons', 'datasource', 'serverSideDatasource', 'viewportDatasource', 'groupRowRendererParams', 'aggFuncs',
|
26670 | 'fullWidthCellRendererParams', 'defaultColGroupDef', 'defaultColDef', 'defaultExportParams', 'columnTypes',
|
26671 | 'rowClassRules', 'detailGridOptions', 'detailCellRendererParams', 'loadingOverlayComponentParams',
|
26672 | 'noRowsOverlayComponentParams', 'popupParent', 'colResizeDefault'
|
26673 |
|
26674 | ];
|
26675 | PropertyKeys.ARRAY_PROPERTIES = [
|
26676 | 'slaveGrids', 'alignedGrids', 'rowData',
|
26677 | 'columnDefs', 'excelStyles', 'pinnedTopRowData', 'pinnedBottomRowData'
|
26678 |
|
26679 | ];
|
26680 | PropertyKeys.NUMBER_PROPERTIES = [
|
26681 | 'rowHeight', 'detailRowHeight', 'rowBuffer', 'colWidth', 'headerHeight', 'groupHeaderHeight',
|
26682 | 'floatingFiltersHeight', 'pivotHeaderHeight', 'pivotGroupHeaderHeight', 'groupDefaultExpanded',
|
26683 | 'minColWidth', 'maxColWidth', 'viewportRowModelPageSize', 'viewportRowModelBufferSize',
|
26684 | 'autoSizePadding', 'maxBlocksInCache', 'maxConcurrentDatasourceRequests',
|
26685 | 'cacheOverflowSize', 'paginationPageSize', 'cacheBlockSize', 'infiniteInitialRowCount',
|
26686 | 'scrollbarWidth', 'paginationStartPage', 'infiniteBlockSize', 'batchUpdateWaitMillis'
|
26687 | ];
|
26688 | PropertyKeys.BOOLEAN_PROPERTIES = [
|
26689 | 'toolPanelSuppressRowGroups', 'toolPanelSuppressValues', 'toolPanelSuppressPivots', 'toolPanelSuppressPivotMode',
|
26690 | 'toolPanelSuppressSideButtons', 'toolPanelSuppressColumnFilter', 'toolPanelSuppressColumnSelectAll',
|
26691 | 'toolPanelSuppressColumnExpandAll', 'suppressMakeColumnVisibleAfterUnGroup',
|
26692 | 'suppressRowClickSelection', 'suppressCellSelection', 'suppressHorizontalScroll', 'debug',
|
26693 | 'enableColResize', 'enableCellExpressions', 'enableSorting', 'enableServerSideSorting',
|
26694 | 'enableFilter', 'enableServerSideFilter', 'angularCompileRows', 'angularCompileFilters',
|
26695 | 'angularCompileHeaders', 'groupSuppressAutoColumn', 'groupSelectsChildren',
|
26696 | 'groupIncludeFooter', 'groupIncludeTotalFooter', 'groupUseEntireRow', 'groupSuppressRow', 'groupSuppressBlankHeader',
|
26697 | 'forPrint', 'suppressMenuHide', 'rowDeselection', 'unSortIcon', 'suppressMultiSort',
|
26698 | 'singleClickEdit', 'suppressLoadingOverlay', 'suppressNoRowsOverlay', 'suppressAutoSize',
|
26699 | 'suppressParentsInRowNodes', 'showToolPanel', 'suppressColumnMoveAnimation', 'suppressMovableColumns',
|
26700 | 'suppressFieldDotNotation', 'enableRangeSelection',
|
26701 | 'suppressTouch', 'suppressAsyncEvents', 'allowContextMenuWithControlKey',
|
26702 | 'suppressContextMenu', 'suppressMenuFilterPanel', 'suppressMenuMainPanel', 'suppressMenuColumnPanel',
|
26703 | 'enableStatusBar', 'alwaysShowStatusBar', 'rememberGroupStateWhenNewData', 'enableCellChangeFlash', 'suppressDragLeaveHidesColumns',
|
26704 | 'suppressMiddleClickScrolls', 'suppressPreventDefaultOnMouseWheel', 'suppressUseColIdForGroups',
|
26705 | 'suppressCopyRowsToClipboard', 'pivotMode', 'suppressAggFuncInHeader', 'suppressColumnVirtualisation', 'suppressAggAtRootLevel',
|
26706 | 'suppressFocusAfterRefresh', 'functionsPassive', 'functionsReadOnly',
|
26707 | 'animateRows', 'groupSelectsFiltered', 'groupRemoveSingleChildren', 'groupRemoveLowestSingleChildren',
|
26708 | 'enableRtl', 'suppressClickEdit', 'rowDragManaged', 'suppressRowDrag',
|
26709 | 'enableGroupEdit', 'embedFullWidthRows', 'suppressTabbing', 'suppressPaginationPanel', 'floatingFilter',
|
26710 | 'groupHideOpenParents', 'groupMultiAutoColumn', 'pagination', 'stopEditingWhenGridLosesFocus',
|
26711 | 'paginationAutoPageSize', 'suppressScrollOnNewData', 'purgeClosedRowNodes', 'cacheQuickFilter',
|
26712 | 'deltaRowDataMode', 'ensureDomOrder', 'accentedSort', 'pivotTotals', 'suppressChangeDetection',
|
26713 | 'valueCache', 'valueCacheNeverExpires', 'aggregateOnlyChangedColumns', 'suppressAnimationFrame',
|
26714 | 'suppressExcelExport', 'suppressCsvExport', 'treeData', 'masterDetail', 'suppressMultiRangeSelection',
|
26715 | 'enterMovesDownAfterEdit', 'enterMovesDown', 'suppressPropertyNamesCheck', 'rowMultiSelectWithClick',
|
26716 | 'contractColumnSelection', 'suppressEnterpriseResetOnNewColumns', 'enableOldSetFilterModel',
|
26717 | 'suppressRowHoverHighlight', 'gridAutoHeight', 'suppressRowTransform', 'suppressClipboardPaste',
|
26718 | 'serverSideSortingAlwaysResets'
|
26719 | ];
|
26720 | PropertyKeys.FUNCTION_PROPERTIES = ['localeTextFunc', 'groupRowInnerRenderer', 'groupRowInnerRendererFramework',
|
26721 | 'dateComponent', 'dateComponentFramework', 'groupRowRenderer', 'groupRowRendererFramework', 'isExternalFilterPresent',
|
26722 | 'getRowHeight', 'doesExternalFilterPass', 'getRowClass', 'getRowStyle', 'getRowClassRules',
|
26723 | 'traverseNode', 'getContextMenuItems', 'getMainMenuItems', 'processRowPostCreate', 'processCellForClipboard',
|
26724 | 'getNodeChildDetails', 'groupRowAggNodes', 'getRowNodeId', 'isFullWidthCell', 'fullWidthCellRenderer',
|
26725 | 'fullWidthCellRendererFramework', 'doesDataFlower', 'processSecondaryColDef', 'processSecondaryColGroupDef',
|
26726 | 'getBusinessKeyForNode', 'sendToClipboard', 'navigateToNextCell', 'tabToNextCell', 'getDetailRowData',
|
26727 | 'processCellFromClipboard', 'getDocument', 'postProcessPopup', 'getChildCount', 'getDataPath', 'loadingOverlayComponent',
|
26728 | 'loadingOverlayComponentFramework', 'noRowsOverlayComponent', 'noRowsOverlayComponentFramework', 'detailCellRenderer',
|
26729 | 'detailCellRendererFramework', 'onGridReady', 'defaultGroupSortComparator', 'isRowMaster', 'isRowSelectable', 'postSort',
|
26730 | 'processHeaderForClipboard', 'paginationNumberFormatter', 'processDataFromClipboard'];
|
26731 | PropertyKeys.ALL_PROPERTIES = PropertyKeys.ARRAY_PROPERTIES
|
26732 | .concat(PropertyKeys.OBJECT_PROPERTIES)
|
26733 | .concat(PropertyKeys.STRING_PROPERTIES)
|
26734 | .concat(PropertyKeys.NUMBER_PROPERTIES)
|
26735 | .concat(PropertyKeys.FUNCTION_PROPERTIES)
|
26736 | .concat(PropertyKeys.BOOLEAN_PROPERTIES);
|
26737 |
|
26738 |
|
26739 | PropertyKeys.FRAMEWORK_PROPERTIES = ['__ob__', '__metadata__', 'mappedColumnProperties', 'hasChildColumns',
|
26740 | 'toColDef', 'createColDefFromGridColumn'];
|
26741 | return PropertyKeys;
|
26742 | }());
|
26743 | exports.PropertyKeys = PropertyKeys;
|
26744 |
|
26745 |
|
26746 | }),
|
26747 |
|
26748 | (function(module, exports, __webpack_require__) {
|
26749 |
|
26750 | "use strict";
|
26751 |
|
26752 |
|
26753 |
|
26754 |
|
26755 |
|
26756 |
|
26757 |
|
26758 | var __extends = (this && this.__extends) || (function () {
|
26759 | var extendStatics = Object.setPrototypeOf ||
|
26760 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
26761 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
26762 | return function (d, b) {
|
26763 | extendStatics(d, b);
|
26764 | function __() { this.constructor = d; }
|
26765 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
26766 | };
|
26767 | })();
|
26768 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
26769 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
26770 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
26771 | 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;
|
26772 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
26773 | };
|
26774 | var __metadata = (this && this.__metadata) || function (k, v) {
|
26775 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
26776 | };
|
26777 | Object.defineProperty(exports, "__esModule", { value: true });
|
26778 | var context_1 = __webpack_require__(0);
|
26779 | var dateFilter_1 = __webpack_require__(68);
|
26780 | var componentAnnotations_1 = __webpack_require__(11);
|
26781 | var utils_1 = __webpack_require__(1);
|
26782 | var componentRecipes_1 = __webpack_require__(21);
|
26783 | var component_1 = __webpack_require__(8);
|
26784 | var constants_1 = __webpack_require__(9);
|
26785 | var InputTextFloatingFilterComp = (function (_super) {
|
26786 | __extends(InputTextFloatingFilterComp, _super);
|
26787 | function InputTextFloatingFilterComp() {
|
26788 | var _this = _super.call(this, "<div><input ref=\"eColumnFloatingFilter\" class=\"ag-floating-filter-input\"></div>") || this;
|
26789 | _this.lastKnownModel = null;
|
26790 | return _this;
|
26791 | }
|
26792 | InputTextFloatingFilterComp.prototype.init = function (params) {
|
26793 | this.onFloatingFilterChanged = params.onFloatingFilterChanged;
|
26794 | this.currentParentModel = params.currentParentModel;
|
26795 | var debounceMs = params.debounceMs != null ? params.debounceMs : 500;
|
26796 | var toDebounce = utils_1._.debounce(this.syncUpWithParentFilter.bind(this), debounceMs);
|
26797 | this.addDestroyableEventListener(this.eColumnFloatingFilter, 'input', toDebounce);
|
26798 | this.addDestroyableEventListener(this.eColumnFloatingFilter, 'keypress', toDebounce);
|
26799 | this.addDestroyableEventListener(this.eColumnFloatingFilter, 'keydown', toDebounce);
|
26800 | var columnDef = params.column.getDefinition();
|
26801 | if (columnDef.filterParams && columnDef.filterParams.filterOptions && columnDef.filterParams.filterOptions.length === 1 && columnDef.filterParams.filterOptions[0] === 'inRange') {
|
26802 | this.eColumnFloatingFilter.disabled = true;
|
26803 | }
|
26804 | };
|
26805 | InputTextFloatingFilterComp.prototype.onParentModelChanged = function (parentModel, combinedFilter) {
|
26806 | if (combinedFilter != null) {
|
26807 | this.eColumnFloatingFilter.value = this.parseAsText(combinedFilter.condition1) + " " + combinedFilter.operator + " " + this.parseAsText(combinedFilter.condition2);
|
26808 | this.eColumnFloatingFilter.disabled = true;
|
26809 | this.lastKnownModel = null;
|
26810 | this.eColumnFloatingFilter.title = this.eColumnFloatingFilter.value;
|
26811 | this.eColumnFloatingFilter.style.cursor = 'default';
|
26812 | return;
|
26813 | }
|
26814 | else {
|
26815 | this.eColumnFloatingFilter.disabled = false;
|
26816 | }
|
26817 | if (this.equalModels(this.lastKnownModel, parentModel)) {
|
26818 |
|
26819 | if (!this.lastKnownModel && !parentModel) {
|
26820 | this.eColumnFloatingFilter.value = '';
|
26821 | }
|
26822 | return;
|
26823 | }
|
26824 | this.lastKnownModel = parentModel;
|
26825 | var incomingTextValue = this.asFloatingFilterText(parentModel);
|
26826 | if (incomingTextValue === this.eColumnFloatingFilter.value) {
|
26827 | return;
|
26828 | }
|
26829 | this.eColumnFloatingFilter.value = incomingTextValue;
|
26830 | this.eColumnFloatingFilter.title = '';
|
26831 | };
|
26832 | InputTextFloatingFilterComp.prototype.syncUpWithParentFilter = function (e) {
|
26833 | var model = this.asParentModel();
|
26834 | if (this.equalModels(this.lastKnownModel, model)) {
|
26835 | return;
|
26836 | }
|
26837 | var modelUpdated = null;
|
26838 | if (utils_1._.isKeyPressed(e, constants_1.Constants.KEY_ENTER)) {
|
26839 | modelUpdated = this.onFloatingFilterChanged({
|
26840 | model: model,
|
26841 | apply: true
|
26842 | });
|
26843 | }
|
26844 | else {
|
26845 | modelUpdated = this.onFloatingFilterChanged({
|
26846 | model: model,
|
26847 | apply: false
|
26848 | });
|
26849 | }
|
26850 | if (modelUpdated) {
|
26851 | this.lastKnownModel = model;
|
26852 | }
|
26853 | };
|
26854 | InputTextFloatingFilterComp.prototype.equalModels = function (left, right) {
|
26855 | if (utils_1._.referenceCompare(left, right)) {
|
26856 | return true;
|
26857 | }
|
26858 | if (!left || !right) {
|
26859 | return false;
|
26860 | }
|
26861 | if (Array.isArray(left) || Array.isArray(right)) {
|
26862 | return false;
|
26863 | }
|
26864 | return (utils_1._.referenceCompare(left.type, right.type) &&
|
26865 | utils_1._.referenceCompare(left.filter, right.filter) &&
|
26866 | utils_1._.referenceCompare(left.filterTo, right.filterTo) &&
|
26867 | utils_1._.referenceCompare(left.filterType, right.filterType));
|
26868 | };
|
26869 | __decorate([
|
26870 | componentAnnotations_1.RefSelector('eColumnFloatingFilter'),
|
26871 | __metadata("design:type", HTMLInputElement)
|
26872 | ], InputTextFloatingFilterComp.prototype, "eColumnFloatingFilter", void 0);
|
26873 | return InputTextFloatingFilterComp;
|
26874 | }(component_1.Component));
|
26875 | exports.InputTextFloatingFilterComp = InputTextFloatingFilterComp;
|
26876 | var TextFloatingFilterComp = (function (_super) {
|
26877 | __extends(TextFloatingFilterComp, _super);
|
26878 | function TextFloatingFilterComp() {
|
26879 | return _super !== null && _super.apply(this, arguments) || this;
|
26880 | }
|
26881 | TextFloatingFilterComp.prototype.asFloatingFilterText = function (parentModel) {
|
26882 | if (!parentModel) {
|
26883 | return '';
|
26884 | }
|
26885 | return parentModel.filter;
|
26886 | };
|
26887 | TextFloatingFilterComp.prototype.asParentModel = function () {
|
26888 | var currentParentModel = this.currentParentModel();
|
26889 | return {
|
26890 | type: currentParentModel.type,
|
26891 | filter: this.eColumnFloatingFilter.value,
|
26892 | filterType: 'text'
|
26893 | };
|
26894 | };
|
26895 | TextFloatingFilterComp.prototype.parseAsText = function (model) {
|
26896 | return this.asFloatingFilterText(model);
|
26897 | };
|
26898 | return TextFloatingFilterComp;
|
26899 | }(InputTextFloatingFilterComp));
|
26900 | exports.TextFloatingFilterComp = TextFloatingFilterComp;
|
26901 | var DateFloatingFilterComp = (function (_super) {
|
26902 | __extends(DateFloatingFilterComp, _super);
|
26903 | function DateFloatingFilterComp() {
|
26904 | var _this = _super !== null && _super.apply(this, arguments) || this;
|
26905 | _this.lastKnownModel = null;
|
26906 | return _this;
|
26907 | }
|
26908 | DateFloatingFilterComp.prototype.init = function (params) {
|
26909 | this.onFloatingFilterChanged = params.onFloatingFilterChanged;
|
26910 | this.currentParentModel = params.currentParentModel;
|
26911 | var debounceMs = params.debounceMs != null ? params.debounceMs : 500;
|
26912 | var toDebounce = utils_1._.debounce(this.onDateChanged.bind(this), debounceMs);
|
26913 | var dateComponentParams = {
|
26914 | onDateChanged: toDebounce,
|
26915 | filterParams: params.column.getColDef().filterParams
|
26916 | };
|
26917 | this.dateComponentPromise = this.componentRecipes.newDateComponent(dateComponentParams);
|
26918 | var body = utils_1._.loadTemplate("<div></div>");
|
26919 | this.dateComponentPromise.then(function (dateComponent) {
|
26920 | body.appendChild(dateComponent.getGui());
|
26921 | var columnDef = params.column.getDefinition();
|
26922 | var isInRange = (columnDef.filterParams &&
|
26923 | columnDef.filterParams.filterOptions &&
|
26924 | columnDef.filterParams.filterOptions.length === 1 &&
|
26925 | columnDef.filterParams.filterOptions[0] === 'inRange');
|
26926 | if (dateComponent.eDateInput) {
|
26927 | dateComponent.eDateInput.disabled = isInRange;
|
26928 | }
|
26929 | });
|
26930 | this.setTemplateFromElement(body);
|
26931 | };
|
26932 | DateFloatingFilterComp.prototype.onDateChanged = function () {
|
26933 | var parentModel = this.currentParentModel();
|
26934 | var model = this.asParentModel();
|
26935 | if (this.equalModels(parentModel, model)) {
|
26936 | return;
|
26937 | }
|
26938 | this.onFloatingFilterChanged({
|
26939 | model: model,
|
26940 | apply: true
|
26941 | });
|
26942 | this.lastKnownModel = model;
|
26943 | };
|
26944 | DateFloatingFilterComp.prototype.equalModels = function (left, right) {
|
26945 | if (utils_1._.referenceCompare(left, right)) {
|
26946 | return true;
|
26947 | }
|
26948 | if (!left || !right) {
|
26949 | return false;
|
26950 | }
|
26951 | if (Array.isArray(left) || Array.isArray(right)) {
|
26952 | return false;
|
26953 | }
|
26954 | return (utils_1._.referenceCompare(left.type, right.type) &&
|
26955 | utils_1._.referenceCompare(left.dateFrom, right.dateFrom) &&
|
26956 | utils_1._.referenceCompare(left.dateTo, right.dateTo) &&
|
26957 | utils_1._.referenceCompare(left.filterType, right.filterType));
|
26958 | };
|
26959 | DateFloatingFilterComp.prototype.asParentModel = function () {
|
26960 | var currentParentModel = this.currentParentModel();
|
26961 | var filterValueDate = this.dateComponentPromise.resolveNow(null, function (dateComponent) { return dateComponent.getDate(); });
|
26962 | var filterValueText = utils_1._.serializeDateToYyyyMmDd(dateFilter_1.DateFilter.removeTimezone(filterValueDate), "-");
|
26963 | return {
|
26964 | type: currentParentModel.type,
|
26965 | dateFrom: filterValueText,
|
26966 | dateTo: currentParentModel ? currentParentModel.dateTo : null,
|
26967 | filterType: 'date'
|
26968 | };
|
26969 | };
|
26970 | DateFloatingFilterComp.prototype.onParentModelChanged = function (parentModel) {
|
26971 | var _this = this;
|
26972 | this.lastKnownModel = parentModel;
|
26973 | this.dateComponentPromise.then(function (dateComponent) {
|
26974 | if (!parentModel || !parentModel.dateFrom) {
|
26975 | dateComponent.setDate(null);
|
26976 | return;
|
26977 | }
|
26978 | _this.enrichDateInput(parentModel.type, parentModel.dateFrom, parentModel.dateTo, dateComponent);
|
26979 | dateComponent.setDate(utils_1._.parseYyyyMmDdToDate(parentModel.dateFrom, '-'));
|
26980 | });
|
26981 | };
|
26982 | DateFloatingFilterComp.prototype.enrichDateInput = function (type, dateFrom, dateTo, dateComponent) {
|
26983 | if (dateComponent.eDateInput) {
|
26984 | if (type === 'inRange') {
|
26985 | dateComponent.eDateInput.title = dateFrom + " to " + dateTo;
|
26986 | dateComponent.eDateInput.disabled = true;
|
26987 | }
|
26988 | else {
|
26989 | dateComponent.eDateInput.title = '';
|
26990 | dateComponent.eDateInput.disabled = true;
|
26991 | }
|
26992 | }
|
26993 | };
|
26994 | __decorate([
|
26995 | context_1.Autowired('componentRecipes'),
|
26996 | __metadata("design:type", componentRecipes_1.ComponentRecipes)
|
26997 | ], DateFloatingFilterComp.prototype, "componentRecipes", void 0);
|
26998 | return DateFloatingFilterComp;
|
26999 | }(component_1.Component));
|
27000 | exports.DateFloatingFilterComp = DateFloatingFilterComp;
|
27001 | var NumberFloatingFilterComp = (function (_super) {
|
27002 | __extends(NumberFloatingFilterComp, _super);
|
27003 | function NumberFloatingFilterComp() {
|
27004 | return _super !== null && _super.apply(this, arguments) || this;
|
27005 | }
|
27006 | NumberFloatingFilterComp.prototype.asFloatingFilterText = function (toParse) {
|
27007 | var currentParentModel = this.currentParentModel();
|
27008 | if (toParse == null && currentParentModel == null) {
|
27009 | return '';
|
27010 | }
|
27011 | if (toParse == null && currentParentModel != null && currentParentModel.type !== 'inRange') {
|
27012 | this.eColumnFloatingFilter.disabled = false;
|
27013 | return '';
|
27014 | }
|
27015 | if (currentParentModel != null && currentParentModel.type === 'inRange') {
|
27016 | this.eColumnFloatingFilter.disabled = true;
|
27017 | return this.parseAsText(currentParentModel);
|
27018 | }
|
27019 | this.eColumnFloatingFilter.disabled = false;
|
27020 | return this.parseAsText(toParse);
|
27021 | };
|
27022 | NumberFloatingFilterComp.prototype.parseAsText = function (model) {
|
27023 | if (model.type && model.type === 'inRange') {
|
27024 | var number_1 = this.asNumber(model.filter);
|
27025 | var numberTo = this.asNumber(model.filterTo);
|
27026 | return (number_1 ? number_1 + '' : '') +
|
27027 | '-' +
|
27028 | (numberTo ? numberTo + '' : '');
|
27029 | }
|
27030 | var number = this.asNumber(model.filter);
|
27031 | return number != null ? number + '' : '';
|
27032 | };
|
27033 | NumberFloatingFilterComp.prototype.asParentModel = function () {
|
27034 | var currentParentModel = this.currentParentModel();
|
27035 | var filterValueNumber = this.asNumber(this.eColumnFloatingFilter.value);
|
27036 | var filterValueText = this.eColumnFloatingFilter.value;
|
27037 | var modelFilterValue = null;
|
27038 | if (filterValueNumber == null && filterValueText === '') {
|
27039 | modelFilterValue = null;
|
27040 | }
|
27041 | else if (filterValueNumber == null) {
|
27042 | modelFilterValue = currentParentModel.filter;
|
27043 | }
|
27044 | else {
|
27045 | modelFilterValue = filterValueNumber;
|
27046 | }
|
27047 | return {
|
27048 | type: currentParentModel.type,
|
27049 | filter: modelFilterValue,
|
27050 | filterTo: !currentParentModel ? null : currentParentModel.filterTo,
|
27051 | filterType: 'number'
|
27052 | };
|
27053 | };
|
27054 | NumberFloatingFilterComp.prototype.asNumber = function (value) {
|
27055 | if (value == null) {
|
27056 | return null;
|
27057 | }
|
27058 | if (value === '') {
|
27059 | return null;
|
27060 | }
|
27061 | var asNumber = Number(value);
|
27062 | var invalidNumber = !utils_1._.isNumeric(asNumber);
|
27063 | return invalidNumber ? null : asNumber;
|
27064 | };
|
27065 | return NumberFloatingFilterComp;
|
27066 | }(InputTextFloatingFilterComp));
|
27067 | exports.NumberFloatingFilterComp = NumberFloatingFilterComp;
|
27068 | var SetFloatingFilterComp = (function (_super) {
|
27069 | __extends(SetFloatingFilterComp, _super);
|
27070 | function SetFloatingFilterComp() {
|
27071 | return _super !== null && _super.apply(this, arguments) || this;
|
27072 | }
|
27073 | SetFloatingFilterComp.prototype.init = function (params) {
|
27074 | _super.prototype.init.call(this, params);
|
27075 | this.eColumnFloatingFilter.disabled = true;
|
27076 | };
|
27077 | SetFloatingFilterComp.prototype.asFloatingFilterText = function (parentModel) {
|
27078 | this.eColumnFloatingFilter.disabled = true;
|
27079 | if (!parentModel)
|
27080 | return '';
|
27081 |
|
27082 | var values = (parentModel instanceof Array) ? parentModel : parentModel.values;
|
27083 | if (values.length === 0) {
|
27084 | return '';
|
27085 | }
|
27086 | var arrayToDisplay = values.length > 10 ? values.slice(0, 10).concat('...') : values;
|
27087 | return "(" + values.length + ") " + arrayToDisplay.join(",");
|
27088 | };
|
27089 | SetFloatingFilterComp.prototype.parseAsText = function (model) {
|
27090 | return this.asFloatingFilterText(model);
|
27091 | };
|
27092 | SetFloatingFilterComp.prototype.asParentModel = function () {
|
27093 | if (this.eColumnFloatingFilter.value == null || this.eColumnFloatingFilter.value === '') {
|
27094 | return {
|
27095 | values: [],
|
27096 | filterType: 'set'
|
27097 | };
|
27098 | }
|
27099 | return {
|
27100 | values: this.eColumnFloatingFilter.value.split(","),
|
27101 | filterType: 'set'
|
27102 | };
|
27103 | };
|
27104 | SetFloatingFilterComp.prototype.equalModels = function (left, right) {
|
27105 | return false;
|
27106 | };
|
27107 | return SetFloatingFilterComp;
|
27108 | }(InputTextFloatingFilterComp));
|
27109 | exports.SetFloatingFilterComp = SetFloatingFilterComp;
|
27110 | var ReadModelAsStringFloatingFilterComp = (function (_super) {
|
27111 | __extends(ReadModelAsStringFloatingFilterComp, _super);
|
27112 | function ReadModelAsStringFloatingFilterComp() {
|
27113 | return _super !== null && _super.apply(this, arguments) || this;
|
27114 | }
|
27115 | ReadModelAsStringFloatingFilterComp.prototype.init = function (params) {
|
27116 | _super.prototype.init.call(this, params);
|
27117 | this.eColumnFloatingFilter.disabled = true;
|
27118 | };
|
27119 | ReadModelAsStringFloatingFilterComp.prototype.onParentModelChanged = function (parentModel) {
|
27120 | this.eColumnFloatingFilter.value = this.asFloatingFilterText(this.currentParentModel());
|
27121 | };
|
27122 | ReadModelAsStringFloatingFilterComp.prototype.asFloatingFilterText = function (parentModel) {
|
27123 | return parentModel;
|
27124 | };
|
27125 | ReadModelAsStringFloatingFilterComp.prototype.parseAsText = function (model) {
|
27126 | return model;
|
27127 | };
|
27128 | ReadModelAsStringFloatingFilterComp.prototype.asParentModel = function () {
|
27129 | return null;
|
27130 | };
|
27131 | return ReadModelAsStringFloatingFilterComp;
|
27132 | }(InputTextFloatingFilterComp));
|
27133 | exports.ReadModelAsStringFloatingFilterComp = ReadModelAsStringFloatingFilterComp;
|
27134 |
|
27135 |
|
27136 | }),
|
27137 |
|
27138 | (function(module, exports, __webpack_require__) {
|
27139 |
|
27140 | "use strict";
|
27141 |
|
27142 |
|
27143 |
|
27144 |
|
27145 |
|
27146 |
|
27147 |
|
27148 | var __extends = (this && this.__extends) || (function () {
|
27149 | var extendStatics = Object.setPrototypeOf ||
|
27150 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
27151 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
27152 | return function (d, b) {
|
27153 | extendStatics(d, b);
|
27154 | function __() { this.constructor = d; }
|
27155 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
27156 | };
|
27157 | })();
|
27158 | Object.defineProperty(exports, "__esModule", { value: true });
|
27159 | var textCellEditor_1 = __webpack_require__(67);
|
27160 | var PopupTextCellEditor = (function (_super) {
|
27161 | __extends(PopupTextCellEditor, _super);
|
27162 | function PopupTextCellEditor() {
|
27163 | return _super !== null && _super.apply(this, arguments) || this;
|
27164 | }
|
27165 | PopupTextCellEditor.prototype.isPopup = function () {
|
27166 | return true;
|
27167 | };
|
27168 | return PopupTextCellEditor;
|
27169 | }(textCellEditor_1.TextCellEditor));
|
27170 | exports.PopupTextCellEditor = PopupTextCellEditor;
|
27171 |
|
27172 |
|
27173 | }),
|
27174 |
|
27175 | (function(module, exports, __webpack_require__) {
|
27176 |
|
27177 | "use strict";
|
27178 |
|
27179 |
|
27180 |
|
27181 |
|
27182 |
|
27183 |
|
27184 |
|
27185 | var __extends = (this && this.__extends) || (function () {
|
27186 | var extendStatics = Object.setPrototypeOf ||
|
27187 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
27188 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
27189 | return function (d, b) {
|
27190 | extendStatics(d, b);
|
27191 | function __() { this.constructor = d; }
|
27192 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
27193 | };
|
27194 | })();
|
27195 | Object.defineProperty(exports, "__esModule", { value: true });
|
27196 | var selectCellEditor_1 = __webpack_require__(75);
|
27197 | var PopupSelectCellEditor = (function (_super) {
|
27198 | __extends(PopupSelectCellEditor, _super);
|
27199 | function PopupSelectCellEditor() {
|
27200 | return _super !== null && _super.apply(this, arguments) || this;
|
27201 | }
|
27202 | PopupSelectCellEditor.prototype.isPopup = function () {
|
27203 | return true;
|
27204 | };
|
27205 | return PopupSelectCellEditor;
|
27206 | }(selectCellEditor_1.SelectCellEditor));
|
27207 | exports.PopupSelectCellEditor = PopupSelectCellEditor;
|
27208 |
|
27209 |
|
27210 | }),
|
27211 |
|
27212 | (function(module, exports, __webpack_require__) {
|
27213 |
|
27214 | "use strict";
|
27215 |
|
27216 |
|
27217 |
|
27218 |
|
27219 |
|
27220 |
|
27221 |
|
27222 | var __extends = (this && this.__extends) || (function () {
|
27223 | var extendStatics = Object.setPrototypeOf ||
|
27224 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
27225 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
27226 | return function (d, b) {
|
27227 | extendStatics(d, b);
|
27228 | function __() { this.constructor = d; }
|
27229 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
27230 | };
|
27231 | })();
|
27232 | Object.defineProperty(exports, "__esModule", { value: true });
|
27233 | var component_1 = __webpack_require__(8);
|
27234 | var constants_1 = __webpack_require__(9);
|
27235 | var utils_1 = __webpack_require__(1);
|
27236 | var LargeTextCellEditor = (function (_super) {
|
27237 | __extends(LargeTextCellEditor, _super);
|
27238 | function LargeTextCellEditor() {
|
27239 | return _super.call(this, LargeTextCellEditor.TEMPLATE) || this;
|
27240 | }
|
27241 | LargeTextCellEditor.prototype.init = function (params) {
|
27242 | this.params = params;
|
27243 | this.focusAfterAttached = params.cellStartedEdit;
|
27244 | this.textarea = document.createElement("textarea");
|
27245 | this.textarea.maxLength = params.maxLength ? params.maxLength : "200";
|
27246 | this.textarea.cols = params.cols ? params.cols : "60";
|
27247 | this.textarea.rows = params.rows ? params.rows : "10";
|
27248 | if (utils_1.Utils.exists(params.value)) {
|
27249 | this.textarea.value = params.value.toString();
|
27250 | }
|
27251 | this.getGui().querySelector('.ag-large-textarea').appendChild(this.textarea);
|
27252 | this.addGuiEventListener('keydown', this.onKeyDown.bind(this));
|
27253 | };
|
27254 | LargeTextCellEditor.prototype.onKeyDown = function (event) {
|
27255 | var key = event.which || event.keyCode;
|
27256 | if (key == constants_1.Constants.KEY_LEFT ||
|
27257 | key == constants_1.Constants.KEY_UP ||
|
27258 | key == constants_1.Constants.KEY_RIGHT ||
|
27259 | key == constants_1.Constants.KEY_DOWN ||
|
27260 | (event.shiftKey && key == constants_1.Constants.KEY_ENTER)) {
|
27261 | event.stopPropagation();
|
27262 | }
|
27263 | };
|
27264 | LargeTextCellEditor.prototype.afterGuiAttached = function () {
|
27265 | if (this.focusAfterAttached) {
|
27266 | this.textarea.focus();
|
27267 | }
|
27268 | };
|
27269 | LargeTextCellEditor.prototype.getValue = function () {
|
27270 | return this.textarea.value;
|
27271 | };
|
27272 | LargeTextCellEditor.prototype.isPopup = function () {
|
27273 | return true;
|
27274 | };
|
27275 | LargeTextCellEditor.TEMPLATE =
|
27276 |
|
27277 | '<div class="ag-large-text" tabindex="0">' +
|
27278 | '<div class="ag-large-textarea"></div>' +
|
27279 | '</div>';
|
27280 | return LargeTextCellEditor;
|
27281 | }(component_1.Component));
|
27282 | exports.LargeTextCellEditor = LargeTextCellEditor;
|
27283 |
|
27284 |
|
27285 | }),
|
27286 |
|
27287 | (function(module, exports, __webpack_require__) {
|
27288 |
|
27289 | "use strict";
|
27290 |
|
27291 |
|
27292 |
|
27293 |
|
27294 |
|
27295 |
|
27296 |
|
27297 | var __extends = (this && this.__extends) || (function () {
|
27298 | var extendStatics = Object.setPrototypeOf ||
|
27299 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
27300 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
27301 | return function (d, b) {
|
27302 | extendStatics(d, b);
|
27303 | function __() { this.constructor = d; }
|
27304 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
27305 | };
|
27306 | })();
|
27307 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
27308 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
27309 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
27310 | 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;
|
27311 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
27312 | };
|
27313 | var __metadata = (this && this.__metadata) || function (k, v) {
|
27314 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
27315 | };
|
27316 | Object.defineProperty(exports, "__esModule", { value: true });
|
27317 | var utils_1 = __webpack_require__(1);
|
27318 | var baseFilter_1 = __webpack_require__(51);
|
27319 | var componentAnnotations_1 = __webpack_require__(11);
|
27320 | var TextFilter = (function (_super) {
|
27321 | __extends(TextFilter, _super);
|
27322 | function TextFilter() {
|
27323 | return _super !== null && _super.apply(this, arguments) || this;
|
27324 | }
|
27325 | TextFilter.prototype.getDefaultType = function () {
|
27326 | return baseFilter_1.BaseFilter.CONTAINS;
|
27327 | };
|
27328 | TextFilter.prototype.customInit = function () {
|
27329 | this.comparator = this.filterParams.textCustomComparator ? this.filterParams.textCustomComparator : TextFilter.DEFAULT_COMPARATOR;
|
27330 | this.formatter =
|
27331 | this.filterParams.textFormatter ? this.filterParams.textFormatter :
|
27332 | this.filterParams.caseSensitive == true ? TextFilter.DEFAULT_FORMATTER :
|
27333 | TextFilter.DEFAULT_LOWERCASE_FORMATTER;
|
27334 | _super.prototype.customInit.call(this);
|
27335 | };
|
27336 | TextFilter.prototype.modelFromFloatingFilter = function (from) {
|
27337 | return {
|
27338 | type: this.filter,
|
27339 | filter: from,
|
27340 | filterType: 'text'
|
27341 | };
|
27342 | };
|
27343 | TextFilter.prototype.getApplicableFilterTypes = function () {
|
27344 | return [baseFilter_1.BaseFilter.EQUALS, baseFilter_1.BaseFilter.NOT_EQUAL, baseFilter_1.BaseFilter.STARTS_WITH, baseFilter_1.BaseFilter.ENDS_WITH,
|
27345 | baseFilter_1.BaseFilter.CONTAINS, baseFilter_1.BaseFilter.NOT_CONTAINS];
|
27346 | };
|
27347 | TextFilter.prototype.bodyTemplate = function (type) {
|
27348 | var translate = this.translate.bind(this);
|
27349 | var fieldId = type == baseFilter_1.FilterConditionType.MAIN ? "filterText" : "filterConditionText";
|
27350 | return "<div class=\"ag-filter-body\">\n <input class=\"ag-filter-filter\" id=" + fieldId + " type=\"text\" placeholder=\"" + translate('filterOoo', 'Filter...') + "\"/>\n </div>";
|
27351 | };
|
27352 | TextFilter.prototype.initialiseFilterBodyUi = function (type) {
|
27353 | _super.prototype.initialiseFilterBodyUi.call(this, type);
|
27354 | this.addFilterChangedListener(type);
|
27355 | this.setFilter(this.filterConditionText, baseFilter_1.FilterConditionType.CONDITION);
|
27356 | this.setFilterType(this.filterCondition, baseFilter_1.FilterConditionType.CONDITION);
|
27357 | };
|
27358 | TextFilter.prototype.addFilterChangedListener = function (type) {
|
27359 | var _this = this;
|
27360 | var eElement = type === baseFilter_1.FilterConditionType.MAIN ? this.eFilterTextField : this.eFilterConditionTextField;
|
27361 | var debounceMs = this.getDebounceMs(this.filterParams);
|
27362 | var toDebounce = utils_1.Utils.debounce(function () { return _this.onFilterTextFieldChanged(type); }, debounceMs);
|
27363 | this.addDestroyableEventListener(eElement, 'input', toDebounce);
|
27364 | };
|
27365 | TextFilter.prototype.refreshFilterBodyUi = function (type) {
|
27366 | if (this.eFilterConditionTextField) {
|
27367 | this.addFilterChangedListener(baseFilter_1.FilterConditionType.CONDITION);
|
27368 | }
|
27369 | };
|
27370 | TextFilter.prototype.afterGuiAttached = function () {
|
27371 | this.eFilterTextField.focus();
|
27372 | };
|
27373 | TextFilter.prototype.filterValues = function (type) {
|
27374 | return type === baseFilter_1.FilterConditionType.MAIN ? this.filterText : this.filterConditionText;
|
27375 | };
|
27376 | TextFilter.prototype.individualFilterPasses = function (params, type) {
|
27377 | var filterText = type == baseFilter_1.FilterConditionType.MAIN ? this.filterText : this.filterConditionText;
|
27378 | var filter = type == baseFilter_1.FilterConditionType.MAIN ? this.filter : this.filterCondition;
|
27379 | if (!filterText) {
|
27380 | return type === baseFilter_1.FilterConditionType.MAIN ? true : this.conditionValue === 'AND';
|
27381 | }
|
27382 | else {
|
27383 | return this.checkIndividualFilter(params, filter, filterText);
|
27384 | }
|
27385 | };
|
27386 | TextFilter.prototype.checkIndividualFilter = function (params, filterType, filterText) {
|
27387 | var value = this.filterParams.valueGetter(params.node);
|
27388 | if (value == null || value === undefined) {
|
27389 | return filterType === baseFilter_1.BaseFilter.NOT_EQUAL || filterType === baseFilter_1.BaseFilter.NOT_CONTAINS;
|
27390 | }
|
27391 | var valueFormatted = this.formatter(value);
|
27392 | return this.comparator(filterType, valueFormatted, filterText);
|
27393 | };
|
27394 | TextFilter.prototype.onFilterTextFieldChanged = function (type) {
|
27395 | var value = type === baseFilter_1.FilterConditionType.MAIN ? this.eFilterTextField.value : this.eFilterConditionTextField.value;
|
27396 | var current = type === baseFilter_1.FilterConditionType.MAIN ? this.filterText : this.filterConditionText;
|
27397 | var filterText = utils_1.Utils.makeNull(value);
|
27398 | if (filterText && filterText.trim() === '') {
|
27399 | filterText = null;
|
27400 | }
|
27401 | if (current !== filterText) {
|
27402 | var newLowerCase = filterText && this.filterParams.caseSensitive != true ? filterText.toLowerCase() :
|
27403 | filterText;
|
27404 | var previousLowerCase = current && this.filterParams.caseSensitive != true ? current.toLowerCase() :
|
27405 | current;
|
27406 | if (type === baseFilter_1.FilterConditionType.MAIN) {
|
27407 | this.filterText = this.formatter(filterText);
|
27408 | }
|
27409 | else {
|
27410 | this.filterConditionText = this.formatter(filterText);
|
27411 | }
|
27412 | if (previousLowerCase !== newLowerCase) {
|
27413 | this.onFilterChanged();
|
27414 | }
|
27415 | }
|
27416 | };
|
27417 | TextFilter.prototype.setFilter = function (filter, type) {
|
27418 | filter = utils_1.Utils.makeNull(filter);
|
27419 | if (type === baseFilter_1.FilterConditionType.MAIN) {
|
27420 | if (filter) {
|
27421 | this.filterText = this.formatter(filter);
|
27422 | if (!this.eFilterTextField)
|
27423 | return;
|
27424 | this.eFilterTextField.value = filter;
|
27425 | }
|
27426 | else {
|
27427 | this.filterText = null;
|
27428 | if (!this.eFilterTextField)
|
27429 | return;
|
27430 | this.eFilterTextField.value = null;
|
27431 | }
|
27432 | }
|
27433 | else {
|
27434 | if (filter) {
|
27435 | this.filterConditionText = this.formatter(filter);
|
27436 | if (!this.eFilterConditionTextField)
|
27437 | return;
|
27438 | this.eFilterConditionTextField.value = filter;
|
27439 | }
|
27440 | else {
|
27441 | this.filterConditionText = null;
|
27442 | if (!this.eFilterConditionTextField)
|
27443 | return;
|
27444 | this.eFilterConditionTextField.value = null;
|
27445 | }
|
27446 | }
|
27447 | };
|
27448 | TextFilter.prototype.getFilter = function () {
|
27449 | return this.filterText;
|
27450 | };
|
27451 | TextFilter.prototype.resetState = function () {
|
27452 | this.setFilter(null, baseFilter_1.FilterConditionType.MAIN);
|
27453 | this.setFilterType(this.defaultFilter, baseFilter_1.FilterConditionType.MAIN);
|
27454 | this.setFilter(null, baseFilter_1.FilterConditionType.CONDITION);
|
27455 | this.setFilterType(this.defaultFilter, baseFilter_1.FilterConditionType.CONDITION);
|
27456 | };
|
27457 | TextFilter.prototype.serialize = function (type) {
|
27458 | var filter = type === baseFilter_1.FilterConditionType.MAIN ? this.filter : this.filterCondition;
|
27459 | var filterText = type === baseFilter_1.FilterConditionType.MAIN ? this.filterText : this.filterConditionText;
|
27460 | return {
|
27461 | type: filter ? filter : this.defaultFilter,
|
27462 | filter: filterText,
|
27463 | filterType: 'text'
|
27464 | };
|
27465 | };
|
27466 | TextFilter.prototype.parse = function (model, type) {
|
27467 | this.setFilterType(model.type, type);
|
27468 | this.setFilter(model.filter, type);
|
27469 | };
|
27470 | TextFilter.prototype.setType = function (filterType, type) {
|
27471 | this.setFilterType(filterType, type);
|
27472 | };
|
27473 | TextFilter.DEFAULT_FORMATTER = function (from) {
|
27474 | return from;
|
27475 | };
|
27476 | TextFilter.DEFAULT_LOWERCASE_FORMATTER = function (from) {
|
27477 | if (from == null) {
|
27478 | return null;
|
27479 | }
|
27480 | return from.toString().toLowerCase();
|
27481 | };
|
27482 | TextFilter.DEFAULT_COMPARATOR = function (filter, value, filterText) {
|
27483 | switch (filter) {
|
27484 | case TextFilter.CONTAINS:
|
27485 | return value.indexOf(filterText) >= 0;
|
27486 | case TextFilter.NOT_CONTAINS:
|
27487 | return value.indexOf(filterText) === -1;
|
27488 | case TextFilter.EQUALS:
|
27489 | return value === filterText;
|
27490 | case TextFilter.NOT_EQUAL:
|
27491 | return value != filterText;
|
27492 | case TextFilter.STARTS_WITH:
|
27493 | return value.indexOf(filterText) === 0;
|
27494 | case TextFilter.ENDS_WITH:
|
27495 | var index = value.lastIndexOf(filterText);
|
27496 | return index >= 0 && index === (value.length - filterText.length);
|
27497 | default:
|
27498 |
|
27499 | console.warn('invalid filter type ' + filter);
|
27500 | return false;
|
27501 | }
|
27502 | };
|
27503 | __decorate([
|
27504 | componentAnnotations_1.QuerySelector('#filterText'),
|
27505 | __metadata("design:type", HTMLInputElement)
|
27506 | ], TextFilter.prototype, "eFilterTextField", void 0);
|
27507 | __decorate([
|
27508 | componentAnnotations_1.QuerySelector('#filterConditionText'),
|
27509 | __metadata("design:type", HTMLInputElement)
|
27510 | ], TextFilter.prototype, "eFilterConditionTextField", void 0);
|
27511 | return TextFilter;
|
27512 | }(baseFilter_1.ComparableBaseFilter));
|
27513 | exports.TextFilter = TextFilter;
|
27514 |
|
27515 |
|
27516 | }),
|
27517 |
|
27518 | (function(module, exports, __webpack_require__) {
|
27519 |
|
27520 | "use strict";
|
27521 |
|
27522 |
|
27523 |
|
27524 |
|
27525 |
|
27526 |
|
27527 |
|
27528 | var __extends = (this && this.__extends) || (function () {
|
27529 | var extendStatics = Object.setPrototypeOf ||
|
27530 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
27531 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
27532 | return function (d, b) {
|
27533 | extendStatics(d, b);
|
27534 | function __() { this.constructor = d; }
|
27535 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
27536 | };
|
27537 | })();
|
27538 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
27539 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
27540 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
27541 | 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;
|
27542 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
27543 | };
|
27544 | var __metadata = (this && this.__metadata) || function (k, v) {
|
27545 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
27546 | };
|
27547 | Object.defineProperty(exports, "__esModule", { value: true });
|
27548 | var utils_1 = __webpack_require__(1);
|
27549 | var componentAnnotations_1 = __webpack_require__(11);
|
27550 | var baseFilter_1 = __webpack_require__(51);
|
27551 | var NumberFilter = (function (_super) {
|
27552 | __extends(NumberFilter, _super);
|
27553 | function NumberFilter() {
|
27554 | return _super !== null && _super.apply(this, arguments) || this;
|
27555 | }
|
27556 | NumberFilter.prototype.modelFromFloatingFilter = function (from) {
|
27557 | return {
|
27558 | type: this.filter,
|
27559 | filter: Number(from),
|
27560 | filterTo: this.filterNumberTo,
|
27561 | filterType: 'number'
|
27562 | };
|
27563 | };
|
27564 | NumberFilter.prototype.getApplicableFilterTypes = function () {
|
27565 | return [baseFilter_1.BaseFilter.EQUALS, baseFilter_1.BaseFilter.NOT_EQUAL, baseFilter_1.BaseFilter.LESS_THAN, baseFilter_1.BaseFilter.LESS_THAN_OR_EQUAL,
|
27566 | baseFilter_1.BaseFilter.GREATER_THAN, baseFilter_1.BaseFilter.GREATER_THAN_OR_EQUAL, baseFilter_1.BaseFilter.IN_RANGE];
|
27567 | };
|
27568 | NumberFilter.prototype.bodyTemplate = function (type) {
|
27569 | var translate = this.translate.bind(this);
|
27570 | var fieldId = type == baseFilter_1.FilterConditionType.MAIN ? "filterText" : "filterConditionText";
|
27571 | var filterNumberToPanelId = type == baseFilter_1.FilterConditionType.MAIN ? "filterNumberToPanel" : "filterNumberToPanelCondition";
|
27572 | var fieldToId = type == baseFilter_1.FilterConditionType.MAIN ? "filterToText" : "filterToConditionText";
|
27573 | return "<div class=\"ag-filter-body\">\n <div>\n <input class=\"ag-filter-filter\" id=\"" + fieldId + "\" type=\"text\" placeholder=\"" + translate('filterOoo') + "\"/>\n </div>\n <div class=\"ag-filter-number-to\" id=\"" + filterNumberToPanelId + "\">\n <input class=\"ag-filter-filter\" id=\"" + fieldToId + "\" type=\"text\" placeholder=\"" + translate('filterOoo') + "\"/>\n </div>\n </div>";
|
27574 | };
|
27575 | NumberFilter.prototype.initialiseFilterBodyUi = function (type) {
|
27576 | _super.prototype.initialiseFilterBodyUi.call(this, type);
|
27577 | if (type === baseFilter_1.FilterConditionType.MAIN) {
|
27578 | this.eFilterTextField = this.queryForHtmlInputElement("#filterText");
|
27579 | this.addFilterChangedEventListeners(type, this.eFilterTextField, this.eFilterToTextField);
|
27580 | }
|
27581 | else {
|
27582 | this.eFilterTextConditionField = this.queryForHtmlInputElement("#filterConditionText");
|
27583 | this.addFilterChangedEventListeners(type, this.eFilterTextConditionField, this.eFilterToConditionText);
|
27584 | this.setFilter(this.filterNumberCondition, baseFilter_1.FilterConditionType.CONDITION);
|
27585 | this.setFilterTo(this.filterNumberConditionTo, baseFilter_1.FilterConditionType.CONDITION);
|
27586 | this.setFilterType(this.filterCondition, baseFilter_1.FilterConditionType.CONDITION);
|
27587 | }
|
27588 | };
|
27589 | NumberFilter.prototype.addFilterChangedEventListeners = function (type, filterElement, filterToElement) {
|
27590 | var _this = this;
|
27591 | var debounceMs = this.getDebounceMs(this.filterParams);
|
27592 | var toDebounce = utils_1.Utils.debounce(function () { return _this.onTextFieldsChanged(type, filterElement, filterToElement); }, debounceMs);
|
27593 | this.addDestroyableEventListener(filterElement, "input", toDebounce);
|
27594 | this.addDestroyableEventListener(filterToElement, "input", toDebounce);
|
27595 | };
|
27596 | NumberFilter.prototype.afterGuiAttached = function () {
|
27597 | this.eFilterTextField.focus();
|
27598 | };
|
27599 | NumberFilter.prototype.comparator = function () {
|
27600 | return function (left, right) {
|
27601 | if (left === right) {
|
27602 | return 0;
|
27603 | }
|
27604 | if (left < right) {
|
27605 | return 1;
|
27606 | }
|
27607 | if (left > right) {
|
27608 | return -1;
|
27609 | }
|
27610 | };
|
27611 | };
|
27612 | NumberFilter.prototype.onTextFieldsChanged = function (type, filterElement, filterToElement) {
|
27613 | var newFilter = this.stringToFloat(filterElement.value);
|
27614 | var newFilterTo = this.stringToFloat(filterToElement.value);
|
27615 | if (type === baseFilter_1.FilterConditionType.MAIN) {
|
27616 | if (this.filterNumber !== newFilter || this.filterNumberTo !== newFilterTo) {
|
27617 | this.filterNumber = newFilter;
|
27618 | this.filterNumberTo = newFilterTo;
|
27619 | this.onFilterChanged();
|
27620 | }
|
27621 | }
|
27622 | else {
|
27623 | if (this.filterNumberCondition !== newFilter || this.filterNumberConditionTo !== newFilterTo) {
|
27624 | this.filterNumberCondition = newFilter;
|
27625 | this.filterNumberConditionTo = newFilterTo;
|
27626 | this.onFilterChanged();
|
27627 | }
|
27628 | }
|
27629 | };
|
27630 | NumberFilter.prototype.filterValues = function (type) {
|
27631 | if (type === baseFilter_1.FilterConditionType.MAIN) {
|
27632 | return this.filter !== baseFilter_1.BaseFilter.IN_RANGE ?
|
27633 | this.asNumber(this.filterNumber) :
|
27634 | [this.asNumber(this.filterNumber), this.asNumber(this.filterNumberTo)];
|
27635 | }
|
27636 | return this.filterCondition !== baseFilter_1.BaseFilter.IN_RANGE ?
|
27637 | this.asNumber(this.filterNumberCondition) :
|
27638 | [this.asNumber(this.filterNumberCondition), this.asNumber(this.filterNumberConditionTo)];
|
27639 | };
|
27640 | NumberFilter.prototype.asNumber = function (value) {
|
27641 | return utils_1.Utils.isNumeric(value) ? value : null;
|
27642 | };
|
27643 | NumberFilter.prototype.stringToFloat = function (value) {
|
27644 | var filterText = utils_1.Utils.makeNull(value);
|
27645 | if (filterText && filterText.trim() === '') {
|
27646 | filterText = null;
|
27647 | }
|
27648 | var newFilter;
|
27649 | if (filterText !== null && filterText !== undefined) {
|
27650 | newFilter = parseFloat(filterText);
|
27651 | }
|
27652 | else {
|
27653 | newFilter = null;
|
27654 | }
|
27655 | return newFilter;
|
27656 | };
|
27657 | NumberFilter.prototype.setFilter = function (filter, type) {
|
27658 | filter = utils_1.Utils.makeNull(filter);
|
27659 | if (filter !== null && !(typeof filter === 'number')) {
|
27660 | filter = parseFloat(filter);
|
27661 | }
|
27662 | if (type === baseFilter_1.FilterConditionType.MAIN) {
|
27663 | this.filterNumber = filter;
|
27664 | if (!this.eFilterTextField)
|
27665 | return;
|
27666 | this.eFilterTextField.value = filter;
|
27667 | }
|
27668 | else {
|
27669 | this.filterNumberCondition = filter;
|
27670 | if (!this.eFilterTextConditionField)
|
27671 | return;
|
27672 | this.eFilterTextConditionField.value = filter;
|
27673 | }
|
27674 | };
|
27675 | NumberFilter.prototype.setFilterTo = function (filter, type) {
|
27676 | filter = utils_1.Utils.makeNull(filter);
|
27677 | if (filter !== null && !(typeof filter === 'number')) {
|
27678 | filter = parseFloat(filter);
|
27679 | }
|
27680 | if (type === baseFilter_1.FilterConditionType.MAIN) {
|
27681 | this.filterNumberTo = filter;
|
27682 | if (!this.eFilterToTextField)
|
27683 | return;
|
27684 | this.eFilterToTextField.value = filter;
|
27685 | }
|
27686 | else {
|
27687 | this.filterNumberConditionTo = filter;
|
27688 | if (!this.eFilterToConditionText)
|
27689 | return;
|
27690 | this.eFilterToConditionText.value = filter;
|
27691 | }
|
27692 | };
|
27693 | NumberFilter.prototype.getFilter = function (type) {
|
27694 | return type === baseFilter_1.FilterConditionType.MAIN ? this.filterNumber : this.filterNumberCondition;
|
27695 | };
|
27696 | NumberFilter.prototype.serialize = function (type) {
|
27697 | var filter = type === baseFilter_1.FilterConditionType.MAIN ? this.filter : this.filterCondition;
|
27698 | var filterNumber = type === baseFilter_1.FilterConditionType.MAIN ? this.filterNumber : this.filterNumberCondition;
|
27699 | var filterNumberTo = type === baseFilter_1.FilterConditionType.MAIN ? this.filterNumberTo : this.filterNumberConditionTo;
|
27700 | return {
|
27701 | type: filter ? filter : this.defaultFilter,
|
27702 | filter: filterNumber,
|
27703 | filterTo: filterNumberTo,
|
27704 | filterType: 'number'
|
27705 | };
|
27706 | };
|
27707 | NumberFilter.prototype.parse = function (model, type) {
|
27708 | this.setFilterType(model.type, type);
|
27709 | this.setFilter(model.filter, type);
|
27710 | this.setFilterTo(model.filterTo, type);
|
27711 | };
|
27712 | NumberFilter.prototype.refreshFilterBodyUi = function (type) {
|
27713 | var filterType = type === baseFilter_1.FilterConditionType.MAIN ? this.filter : this.filterCondition;
|
27714 | var panel = type === baseFilter_1.FilterConditionType.MAIN ? this.eNumberToPanel : this.eNumberToConditionPanel;
|
27715 | if (!panel)
|
27716 | return;
|
27717 | var visible = filterType === NumberFilter.IN_RANGE;
|
27718 | utils_1.Utils.setVisible(panel, visible);
|
27719 | };
|
27720 | NumberFilter.prototype.resetState = function () {
|
27721 | this.setFilterType(this.defaultFilter, baseFilter_1.FilterConditionType.MAIN);
|
27722 | this.setFilter(null, baseFilter_1.FilterConditionType.MAIN);
|
27723 | this.setFilterTo(null, baseFilter_1.FilterConditionType.MAIN);
|
27724 | this.setFilterType(this.defaultFilter, baseFilter_1.FilterConditionType.CONDITION);
|
27725 | this.setFilter(null, baseFilter_1.FilterConditionType.CONDITION);
|
27726 | this.setFilterTo(null, baseFilter_1.FilterConditionType.CONDITION);
|
27727 | };
|
27728 | NumberFilter.prototype.setType = function (filterType, type) {
|
27729 | this.setFilterType(filterType, type);
|
27730 | };
|
27731 | NumberFilter.LESS_THAN = 'lessThan';
|
27732 | __decorate([
|
27733 | componentAnnotations_1.QuerySelector('#filterNumberToPanel'),
|
27734 | __metadata("design:type", HTMLElement)
|
27735 | ], NumberFilter.prototype, "eNumberToPanel", void 0);
|
27736 | __decorate([
|
27737 | componentAnnotations_1.QuerySelector('#filterNumberToPanelCondition'),
|
27738 | __metadata("design:type", HTMLElement)
|
27739 | ], NumberFilter.prototype, "eNumberToConditionPanel", void 0);
|
27740 | __decorate([
|
27741 | componentAnnotations_1.QuerySelector('#filterToText'),
|
27742 | __metadata("design:type", HTMLInputElement)
|
27743 | ], NumberFilter.prototype, "eFilterToTextField", void 0);
|
27744 | __decorate([
|
27745 | componentAnnotations_1.QuerySelector('#filterToConditionText'),
|
27746 | __metadata("design:type", HTMLInputElement)
|
27747 | ], NumberFilter.prototype, "eFilterToConditionText", void 0);
|
27748 | return NumberFilter;
|
27749 | }(baseFilter_1.ScalarBaseFilter));
|
27750 | exports.NumberFilter = NumberFilter;
|
27751 |
|
27752 |
|
27753 | }),
|
27754 |
|
27755 | (function(module, exports, __webpack_require__) {
|
27756 |
|
27757 | "use strict";
|
27758 |
|
27759 |
|
27760 |
|
27761 |
|
27762 |
|
27763 |
|
27764 |
|
27765 | Object.defineProperty(exports, "__esModule", { value: true });
|
27766 | var requestAnimationFrame$1 = (function () {
|
27767 | if (typeof requestAnimationFrame === "function") {
|
27768 | return requestAnimationFrame.bind(window);
|
27769 | }
|
27770 | return function (callback) {
|
27771 | return setTimeout(function () {
|
27772 | return callback(Date.now());
|
27773 | }, 1000 / 60);
|
27774 | };
|
27775 | })();
|
27776 | var trailingTimeout = 2;
|
27777 | var throttle = function (callback, delay) {
|
27778 | var leadingCall = false;
|
27779 | var trailingCall = false;
|
27780 | var lastCallTime = 0;
|
27781 | function resolvePending() {
|
27782 | if (leadingCall) {
|
27783 | leadingCall = false;
|
27784 | callback();
|
27785 | }
|
27786 | if (trailingCall) {
|
27787 | proxy();
|
27788 | }
|
27789 | }
|
27790 | function timeoutCallback() {
|
27791 | requestAnimationFrame$1(resolvePending);
|
27792 | }
|
27793 | function proxy() {
|
27794 | var timeStamp = Date.now();
|
27795 | if (leadingCall) {
|
27796 | if (timeStamp - lastCallTime < trailingTimeout) {
|
27797 | return;
|
27798 | }
|
27799 | trailingCall = true;
|
27800 | }
|
27801 | else {
|
27802 | leadingCall = true;
|
27803 | trailingCall = false;
|
27804 | setTimeout(timeoutCallback, delay);
|
27805 | }
|
27806 | lastCallTime = timeStamp;
|
27807 | }
|
27808 | return proxy;
|
27809 | };
|
27810 | var REFRESH_DELAY = 20;
|
27811 | var getWindowOf = function (target) {
|
27812 | var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView;
|
27813 | return ownerGlobal || window;
|
27814 | };
|
27815 | var emptyRect = createRectInit(0, 0, 0, 0);
|
27816 | function toFloat(value) {
|
27817 | return parseFloat(value) || 0;
|
27818 | }
|
27819 | function getBordersSize(styles, start, end) {
|
27820 | var positions = [start, end];
|
27821 | return positions.reduce(function (size, position) {
|
27822 | var value = styles.getPropertyValue("border-" + position + "-width");
|
27823 | return size + toFloat(value);
|
27824 | }, 0);
|
27825 | }
|
27826 | function getPaddings(styles) {
|
27827 | var positions = ["top", "right", "bottom", "left"];
|
27828 | var paddings = {
|
27829 | top: null,
|
27830 | left: null,
|
27831 | right: null,
|
27832 | bottom: null
|
27833 | };
|
27834 | for (var i = 0, list = positions; i < list.length; i += 1) {
|
27835 | var position = list[i];
|
27836 | var value = styles.getPropertyValue("padding-" + position);
|
27837 | paddings[position] = toFloat(value);
|
27838 | }
|
27839 | return paddings;
|
27840 | }
|
27841 | function getHTMLElementContentRect(target) {
|
27842 | var clientWidth = target.clientWidth;
|
27843 | var clientHeight = target.clientHeight;
|
27844 | if (!clientWidth && !clientHeight) {
|
27845 | return emptyRect;
|
27846 | }
|
27847 | var styles = getWindowOf(target).getComputedStyle(target);
|
27848 | var paddings = getPaddings(styles);
|
27849 | var horizPad = paddings.left + paddings.right;
|
27850 | var vertPad = paddings.top + paddings.bottom;
|
27851 | var width = toFloat(styles.width);
|
27852 | var height = toFloat(styles.height);
|
27853 | if (styles.boxSizing === "border-box") {
|
27854 | if (Math.round(width + horizPad) !== clientWidth) {
|
27855 | width -= getBordersSize(styles, "left", "right") + horizPad;
|
27856 | }
|
27857 | if (Math.round(height + vertPad) !== clientHeight) {
|
27858 | height -= getBordersSize(styles, "top", "bottom") + vertPad;
|
27859 | }
|
27860 | }
|
27861 | var vertScrollbar = Math.round(width + horizPad) - clientWidth;
|
27862 | var horizScrollbar = Math.round(height + vertPad) - clientHeight;
|
27863 | if (Math.abs(vertScrollbar) !== 1) {
|
27864 | width -= vertScrollbar;
|
27865 | }
|
27866 | if (Math.abs(horizScrollbar) !== 1) {
|
27867 | height -= horizScrollbar;
|
27868 | }
|
27869 | return createRectInit(paddings.left, paddings.top, width, height);
|
27870 | }
|
27871 | function getContentRect(target) {
|
27872 | return getHTMLElementContentRect(target);
|
27873 | }
|
27874 | function createReadOnlyRect(ref) {
|
27875 | var x = ref.x;
|
27876 | var y = ref.y;
|
27877 | var width = ref.width;
|
27878 | var height = ref.height;
|
27879 | var Constr = window.DOMRectReadOnly ? window.DOMRectReadOnly : Object;
|
27880 | var rect = Object.create(Constr.prototype);
|
27881 | defineConfigurable(rect, {
|
27882 | x: x,
|
27883 | y: y,
|
27884 | width: width,
|
27885 | height: height,
|
27886 | top: y,
|
27887 | right: x + width,
|
27888 | bottom: height + y,
|
27889 | left: x
|
27890 | });
|
27891 | return rect;
|
27892 | }
|
27893 | function createRectInit(x, y, width, height) {
|
27894 | return { x: x, y: y, width: width, height: height };
|
27895 | }
|
27896 | var ResizeObserverController = (function () {
|
27897 | function ResizeObserverController() {
|
27898 | this.connected_ = false;
|
27899 | this.mutationEventsAdded_ = false;
|
27900 | this.mutationsObserver_ = null;
|
27901 | this.observers_ = [];
|
27902 | this.callback_ = null;
|
27903 | this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);
|
27904 | }
|
27905 | ResizeObserverController.prototype.addObserver = function (observer) {
|
27906 | if (this.observers_.indexOf(observer) == -1) {
|
27907 | this.observers_.push(observer);
|
27908 | }
|
27909 |
|
27910 | if (!this.connected_) {
|
27911 | this.connect_();
|
27912 | }
|
27913 | };
|
27914 | ResizeObserverController.prototype.removeObserver = function (observer) {
|
27915 | var observers = this.observers_;
|
27916 | var index = observers.indexOf(observer);
|
27917 | if (index > -1) {
|
27918 | observers.splice(index, 1);
|
27919 | }
|
27920 | if (!observers.length && this.connected_) {
|
27921 | this.disconnect_();
|
27922 | }
|
27923 | };
|
27924 | ResizeObserverController.prototype.refresh = function () {
|
27925 | var changesDetected = this.updateObservers_();
|
27926 | if (changesDetected) {
|
27927 | this.refresh();
|
27928 | }
|
27929 | };
|
27930 | ResizeObserverController.prototype.updateObservers_ = function () {
|
27931 | var activeObservers = this.observers_.filter(function (observer) {
|
27932 | return observer.hasActive();
|
27933 | });
|
27934 | activeObservers.forEach(function (observer) {
|
27935 | return observer.broadcastActive();
|
27936 | });
|
27937 | return activeObservers.length > 0;
|
27938 | };
|
27939 | ResizeObserverController.prototype.connect_ = function () {
|
27940 | if (this.connected_) {
|
27941 | return;
|
27942 | }
|
27943 | window.addEventListener("resize", this.refresh);
|
27944 | document.addEventListener("DOMSubtreeModified", this.refresh);
|
27945 | this.mutationEventsAdded_ = true;
|
27946 | this.connected_ = true;
|
27947 | };
|
27948 | ResizeObserverController.prototype.disconnect_ = function () {
|
27949 | if (!this.connected_) {
|
27950 | return;
|
27951 | }
|
27952 | window.removeEventListener("resize", this.refresh);
|
27953 | if (this.mutationsObserver_) {
|
27954 | this.mutationsObserver_.disconnect();
|
27955 | }
|
27956 | if (this.mutationEventsAdded_) {
|
27957 | document.removeEventListener("DOMSubtreeModified", this.refresh);
|
27958 | }
|
27959 | this.mutationsObserver_ = null;
|
27960 | this.mutationEventsAdded_ = false;
|
27961 | this.connected_ = false;
|
27962 | };
|
27963 | ResizeObserverController.getInstance = function () {
|
27964 | if (!this.instance_) {
|
27965 | this.instance_ = new ResizeObserverController();
|
27966 | }
|
27967 | return this.instance_;
|
27968 | };
|
27969 | ResizeObserverController.instance_ = null;
|
27970 | return ResizeObserverController;
|
27971 | }());
|
27972 | var defineConfigurable = function (target, props) {
|
27973 | for (var i = 0, list = Object.keys(props); i < list.length; i += 1) {
|
27974 | var key = list[i];
|
27975 | Object.defineProperty(target, key, {
|
27976 | value: props[key],
|
27977 | enumerable: false,
|
27978 | writable: false,
|
27979 | configurable: true
|
27980 | });
|
27981 | }
|
27982 | return target;
|
27983 | };
|
27984 | var ResizeObservation = (function () {
|
27985 | function ResizeObservation(target) {
|
27986 | this.target = target;
|
27987 | this.broadcastWidth = 0;
|
27988 | this.broadcastHeight = 0;
|
27989 | this.contentRect_ = null;
|
27990 | this.contentRect_ = createRectInit(0, 0, 0, 0);
|
27991 | }
|
27992 | ResizeObservation.prototype.isActive = function () {
|
27993 | var rect = getContentRect(this.target);
|
27994 | this.contentRect_ = rect;
|
27995 | return rect.width !== this.broadcastWidth || rect.height !== this.broadcastHeight;
|
27996 | };
|
27997 | ResizeObservation.prototype.broadcastRect = function () {
|
27998 | var rect = this.contentRect_;
|
27999 | this.broadcastWidth = rect.width;
|
28000 | this.broadcastHeight = rect.height;
|
28001 | return rect;
|
28002 | };
|
28003 | return ResizeObservation;
|
28004 | }());
|
28005 | var ResizeObserverSPI = (function () {
|
28006 | function ResizeObserverSPI(callback, controller, callbackCtx) {
|
28007 | this.observation = null;
|
28008 | this.callback_ = null;
|
28009 | this.controller_ = null;
|
28010 | this.callbackCtx_ = null;
|
28011 | this.observation = null;
|
28012 | if (typeof callback !== "function") {
|
28013 | throw new TypeError("The callback provided as parameter 1 is not a function.");
|
28014 | }
|
28015 | this.callback_ = callback;
|
28016 | this.controller_ = controller;
|
28017 | this.callbackCtx_ = callbackCtx;
|
28018 | }
|
28019 | ResizeObserverSPI.prototype.observe = function (target) {
|
28020 | this.observation = new ResizeObservation(target);
|
28021 | this.controller_.addObserver(this);
|
28022 |
|
28023 | this.controller_.refresh();
|
28024 | };
|
28025 | ResizeObserverSPI.prototype.disconnect = function () {
|
28026 | this.observation = null;
|
28027 | this.controller_.removeObserver(this);
|
28028 | };
|
28029 | ResizeObserverSPI.prototype.broadcastActive = function () {
|
28030 | if (!this.hasActive()) {
|
28031 | return;
|
28032 | }
|
28033 | var ctx = this.callbackCtx_;
|
28034 | this.callback_.call(ctx, {
|
28035 | target: this.observation.target,
|
28036 | contentRect: createReadOnlyRect(this.observation.broadcastRect())
|
28037 | }, ctx);
|
28038 | };
|
28039 | ResizeObserverSPI.prototype.hasActive = function () {
|
28040 | return this.observation.isActive();
|
28041 | };
|
28042 | return ResizeObserverSPI;
|
28043 | }());
|
28044 | var ResizeObserverFallback = (function () {
|
28045 | function ResizeObserverFallback(callback) {
|
28046 | var controller = ResizeObserverController.getInstance();
|
28047 | var observer = new ResizeObserverSPI(callback, controller, this);
|
28048 | this.observer_ = observer;
|
28049 | }
|
28050 | ResizeObserverFallback.prototype.observe = function (element) {
|
28051 | this.observer_.observe(element);
|
28052 | };
|
28053 | ResizeObserverFallback.prototype.disconnect = function () {
|
28054 | this.observer_.disconnect();
|
28055 | };
|
28056 | return ResizeObserverFallback;
|
28057 | }());
|
28058 | function observeResize(element, callback) {
|
28059 | if (window.ResizeObserver) {
|
28060 | var ro_1 = new window.ResizeObserver(function (entries, observer) {
|
28061 | for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {
|
28062 | var entry = entries_1[_i];
|
28063 | callback(entry);
|
28064 | }
|
28065 | });
|
28066 | ro_1.observe(element);
|
28067 | return function unobserve() {
|
28068 | ro_1.disconnect();
|
28069 | };
|
28070 | }
|
28071 | else {
|
28072 | var ro_2 = new ResizeObserverFallback(function (entry) {
|
28073 | callback(entry);
|
28074 | });
|
28075 | ro_2.observe(element);
|
28076 | return function unobserve() {
|
28077 | ro_2.disconnect();
|
28078 | };
|
28079 | }
|
28080 | }
|
28081 | exports.observeResize = observeResize;
|
28082 |
|
28083 |
|
28084 | }),
|
28085 |
|
28086 | (function(module, exports, __webpack_require__) {
|
28087 |
|
28088 | "use strict";
|
28089 |
|
28090 |
|
28091 |
|
28092 |
|
28093 |
|
28094 |
|
28095 |
|
28096 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
28097 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
28098 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
28099 | 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;
|
28100 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
28101 | };
|
28102 | var __metadata = (this && this.__metadata) || function (k, v) {
|
28103 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
28104 | };
|
28105 | Object.defineProperty(exports, "__esModule", { value: true });
|
28106 | var context_1 = __webpack_require__(0);
|
28107 | var gridCell_1 = __webpack_require__(23);
|
28108 | var constants_1 = __webpack_require__(9);
|
28109 | var mouseEventService_1 = __webpack_require__(44);
|
28110 | var paginationProxy_1 = __webpack_require__(29);
|
28111 | var focusedCellController_1 = __webpack_require__(22);
|
28112 | var utils_1 = __webpack_require__(1);
|
28113 | var animationFrameService_1 = __webpack_require__(37);
|
28114 | var columnController_1 = __webpack_require__(4);
|
28115 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
28116 | var NavigationService = (function () {
|
28117 | function NavigationService() {
|
28118 | this.timeLastPageEventProcessed = 0;
|
28119 | }
|
28120 | NavigationService.prototype.init = function () {
|
28121 | this.scrollWidth = this.gridOptionsWrapper.getScrollbarWidth();
|
28122 | };
|
28123 | NavigationService.prototype.registerGridComp = function (gridPanel) {
|
28124 | this.gridPanel = gridPanel;
|
28125 | };
|
28126 | NavigationService.prototype.handlePageScrollingKey = function (event) {
|
28127 | var key = event.which || event.keyCode;
|
28128 | var alt = event.altKey;
|
28129 | var ctrl = event.ctrlKey;
|
28130 | var currentCell = this.mouseEventService.getGridCellForEvent(event).getGridCellDef();
|
28131 | if (!currentCell) {
|
28132 | return false;
|
28133 | }
|
28134 | var processed = false;
|
28135 | switch (key) {
|
28136 | case constants_1.Constants.KEY_PAGE_HOME:
|
28137 | case constants_1.Constants.KEY_PAGE_END:
|
28138 |
|
28139 | if (!ctrl && !alt) {
|
28140 | this.onHomeOrEndKey(key);
|
28141 | processed = true;
|
28142 | }
|
28143 | break;
|
28144 | case constants_1.Constants.KEY_LEFT:
|
28145 | case constants_1.Constants.KEY_RIGHT:
|
28146 |
|
28147 | if (ctrl && !alt) {
|
28148 | this.onCtrlLeftOrRight(key, currentCell);
|
28149 | processed = true;
|
28150 | }
|
28151 | break;
|
28152 | case constants_1.Constants.KEY_UP:
|
28153 | case constants_1.Constants.KEY_DOWN:
|
28154 |
|
28155 | if (ctrl && !alt) {
|
28156 | this.onCtrlUpOrDown(key, currentCell);
|
28157 | processed = true;
|
28158 | }
|
28159 | break;
|
28160 | case constants_1.Constants.KEY_PAGE_DOWN:
|
28161 |
|
28162 | if (!ctrl && !alt) {
|
28163 | this.onPageDown(currentCell);
|
28164 | processed = true;
|
28165 | }
|
28166 | break;
|
28167 | case constants_1.Constants.KEY_PAGE_UP:
|
28168 |
|
28169 | if (!ctrl && !alt) {
|
28170 | this.onPageUp(currentCell);
|
28171 | processed = true;
|
28172 | }
|
28173 | break;
|
28174 | }
|
28175 | if (processed) {
|
28176 | event.preventDefault();
|
28177 | }
|
28178 | return processed;
|
28179 | };
|
28180 |
|
28181 |
|
28182 |
|
28183 |
|
28184 |
|
28185 |
|
28186 |
|
28187 | NavigationService.prototype.isTimeSinceLastPageEventToRecent = function () {
|
28188 | var now = new Date().getTime();
|
28189 | var diff = now - this.timeLastPageEventProcessed;
|
28190 | return (diff < 100);
|
28191 | };
|
28192 | NavigationService.prototype.setTimeLastPageEventProcessed = function () {
|
28193 | this.timeLastPageEventProcessed = new Date().getTime();
|
28194 | };
|
28195 | NavigationService.prototype.onPageDown = function (gridCell) {
|
28196 | if (this.isTimeSinceLastPageEventToRecent()) {
|
28197 | return;
|
28198 | }
|
28199 | var scrollPosition = this.gridPanel.getVScrollPosition();
|
28200 | var pixelsInOnePage = scrollPosition.bottom - scrollPosition.top;
|
28201 | if (this.gridPanel.isHorizontalScrollShowing()) {
|
28202 | pixelsInOnePage -= this.scrollWidth;
|
28203 | }
|
28204 | var pagingPixelOffset = this.paginationProxy.getPixelOffset();
|
28205 | var currentPageBottomPixel = scrollPosition.top + pixelsInOnePage;
|
28206 | var currentPageBottomRow = this.paginationProxy.getRowIndexAtPixel(currentPageBottomPixel + pagingPixelOffset);
|
28207 | var scrollIndex = currentPageBottomRow;
|
28208 | var currentCellPixel = this.paginationProxy.getRow(gridCell.rowIndex).rowTop;
|
28209 | var nextCellPixel = currentCellPixel + pixelsInOnePage - pagingPixelOffset;
|
28210 | var focusIndex = this.paginationProxy.getRowIndexAtPixel(nextCellPixel + pagingPixelOffset);
|
28211 | var pageLastRow = this.paginationProxy.getPageLastRow();
|
28212 | if (focusIndex > pageLastRow) {
|
28213 | focusIndex = pageLastRow;
|
28214 | }
|
28215 | if (scrollIndex > pageLastRow) {
|
28216 | scrollIndex = pageLastRow;
|
28217 | }
|
28218 | this.navigateTo(scrollIndex, 'top', null, focusIndex, gridCell.column);
|
28219 | this.setTimeLastPageEventProcessed();
|
28220 | };
|
28221 | NavigationService.prototype.onPageUp = function (gridCell) {
|
28222 | if (this.isTimeSinceLastPageEventToRecent()) {
|
28223 | return;
|
28224 | }
|
28225 | var scrollPosition = this.gridPanel.getVScrollPosition();
|
28226 | var pixelsInOnePage = scrollPosition.bottom - scrollPosition.top;
|
28227 | if (this.gridPanel.isHorizontalScrollShowing()) {
|
28228 | pixelsInOnePage -= this.scrollWidth;
|
28229 | }
|
28230 | var pagingPixelOffset = this.paginationProxy.getPixelOffset();
|
28231 | var currentPageTopPixel = scrollPosition.top;
|
28232 | var currentPageTopRow = this.paginationProxy.getRowIndexAtPixel(currentPageTopPixel + pagingPixelOffset);
|
28233 | var scrollIndex = currentPageTopRow;
|
28234 | var currentRowNode = this.paginationProxy.getRow(gridCell.rowIndex);
|
28235 | var nextCellPixel = currentRowNode.rowTop + currentRowNode.rowHeight - pixelsInOnePage - pagingPixelOffset;
|
28236 | var focusIndex = this.paginationProxy.getRowIndexAtPixel(nextCellPixel + pagingPixelOffset);
|
28237 | var firstRow = this.paginationProxy.getPageFirstRow();
|
28238 | if (focusIndex < firstRow) {
|
28239 | focusIndex = firstRow;
|
28240 | }
|
28241 | if (scrollIndex < firstRow) {
|
28242 | scrollIndex = firstRow;
|
28243 | }
|
28244 | this.navigateTo(scrollIndex, 'bottom', null, focusIndex, gridCell.column);
|
28245 | this.setTimeLastPageEventProcessed();
|
28246 | };
|
28247 |
|
28248 |
|
28249 |
|
28250 |
|
28251 |
|
28252 | NavigationService.prototype.navigateTo = function (scrollIndex, scrollType, scrollColumn, focusIndex, focusColumn) {
|
28253 | if (utils_1._.exists(scrollColumn)) {
|
28254 | this.gridPanel.ensureColumnVisible(scrollColumn);
|
28255 | }
|
28256 | if (utils_1._.exists(scrollIndex)) {
|
28257 | this.gridPanel.ensureIndexVisible(scrollIndex, scrollType);
|
28258 | }
|
28259 |
|
28260 | this.animationFrameService.flushAllFrames();
|
28261 |
|
28262 |
|
28263 | this.focusedCellController.setFocusedCell(focusIndex, focusColumn, null, true);
|
28264 | if (this.rangeController) {
|
28265 | var gridCell = new gridCell_1.GridCell({ rowIndex: focusIndex, floating: null, column: focusColumn });
|
28266 | this.rangeController.setRangeToCell(gridCell);
|
28267 | }
|
28268 | };
|
28269 |
|
28270 | NavigationService.prototype.onCtrlUpOrDown = function (key, gridCell) {
|
28271 | var upKey = key === constants_1.Constants.KEY_UP;
|
28272 | var rowIndexToScrollTo = upKey ? 0 : this.paginationProxy.getPageLastRow();
|
28273 | this.navigateTo(rowIndexToScrollTo, null, gridCell.column, rowIndexToScrollTo, gridCell.column);
|
28274 | };
|
28275 |
|
28276 | NavigationService.prototype.onCtrlLeftOrRight = function (key, gridCell) {
|
28277 | var leftKey = key === constants_1.Constants.KEY_LEFT;
|
28278 | var allColumns = this.columnController.getAllDisplayedColumns();
|
28279 | var columnToSelect = leftKey ? allColumns[0] : allColumns[allColumns.length - 1];
|
28280 | this.navigateTo(gridCell.rowIndex, null, columnToSelect, gridCell.rowIndex, columnToSelect);
|
28281 | };
|
28282 |
|
28283 |
|
28284 | NavigationService.prototype.onHomeOrEndKey = function (key) {
|
28285 | var homeKey = key === constants_1.Constants.KEY_PAGE_HOME;
|
28286 | var allColumns = this.columnController.getAllDisplayedColumns();
|
28287 | var columnToSelect = homeKey ? allColumns[0] : allColumns[allColumns.length - 1];
|
28288 | var rowIndexToScrollTo = homeKey ? 0 : this.paginationProxy.getPageLastRow();
|
28289 | this.navigateTo(rowIndexToScrollTo, null, columnToSelect, rowIndexToScrollTo, columnToSelect);
|
28290 | };
|
28291 | __decorate([
|
28292 | context_1.Autowired('mouseEventService'),
|
28293 | __metadata("design:type", mouseEventService_1.MouseEventService)
|
28294 | ], NavigationService.prototype, "mouseEventService", void 0);
|
28295 | __decorate([
|
28296 | context_1.Autowired('paginationProxy'),
|
28297 | __metadata("design:type", paginationProxy_1.PaginationProxy)
|
28298 | ], NavigationService.prototype, "paginationProxy", void 0);
|
28299 | __decorate([
|
28300 | context_1.Autowired('focusedCellController'),
|
28301 | __metadata("design:type", focusedCellController_1.FocusedCellController)
|
28302 | ], NavigationService.prototype, "focusedCellController", void 0);
|
28303 | __decorate([
|
28304 | context_1.Autowired('animationFrameService'),
|
28305 | __metadata("design:type", animationFrameService_1.AnimationFrameService)
|
28306 | ], NavigationService.prototype, "animationFrameService", void 0);
|
28307 | __decorate([
|
28308 | context_1.Optional('rangeController'),
|
28309 | __metadata("design:type", Object)
|
28310 | ], NavigationService.prototype, "rangeController", void 0);
|
28311 | __decorate([
|
28312 | context_1.Autowired('columnController'),
|
28313 | __metadata("design:type", columnController_1.ColumnController)
|
28314 | ], NavigationService.prototype, "columnController", void 0);
|
28315 | __decorate([
|
28316 | context_1.Autowired('gridOptionsWrapper'),
|
28317 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
28318 | ], NavigationService.prototype, "gridOptionsWrapper", void 0);
|
28319 | __decorate([
|
28320 | context_1.PostConstruct,
|
28321 | __metadata("design:type", Function),
|
28322 | __metadata("design:paramtypes", []),
|
28323 | __metadata("design:returntype", void 0)
|
28324 | ], NavigationService.prototype, "init", null);
|
28325 | NavigationService = __decorate([
|
28326 | context_1.Bean('navigationService')
|
28327 | ], NavigationService);
|
28328 | return NavigationService;
|
28329 | }());
|
28330 | exports.NavigationService = NavigationService;
|
28331 |
|
28332 |
|
28333 | }),
|
28334 |
|
28335 | (function(module, exports, __webpack_require__) {
|
28336 |
|
28337 | "use strict";
|
28338 |
|
28339 |
|
28340 |
|
28341 |
|
28342 |
|
28343 |
|
28344 |
|
28345 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
28346 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
28347 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
28348 | 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;
|
28349 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
28350 | };
|
28351 | var __metadata = (this && this.__metadata) || function (k, v) {
|
28352 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
28353 | };
|
28354 | Object.defineProperty(exports, "__esModule", { value: true });
|
28355 | var utils_1 = __webpack_require__(1);
|
28356 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
28357 | var context_1 = __webpack_require__(0);
|
28358 | var dragAndDropService_1 = __webpack_require__(14);
|
28359 | var columnController_1 = __webpack_require__(4);
|
28360 | var eventService_1 = __webpack_require__(3);
|
28361 | var events_1 = __webpack_require__(5);
|
28362 | var headerRowComp_1 = __webpack_require__(99);
|
28363 | var bodyDropTarget_1 = __webpack_require__(101);
|
28364 | var column_1 = __webpack_require__(10);
|
28365 | var scrollVisibleService_1 = __webpack_require__(36);
|
28366 | var HeaderContainer = (function () {
|
28367 | function HeaderContainer(eContainer, eViewport, pinned) {
|
28368 | this.headerRowComps = [];
|
28369 | this.eContainer = eContainer;
|
28370 | this.pinned = pinned;
|
28371 | this.eViewport = eViewport;
|
28372 | }
|
28373 | HeaderContainer.prototype.registerGridComp = function (gridPanel) {
|
28374 | this.setupDragAndDrop(gridPanel);
|
28375 | };
|
28376 | HeaderContainer.prototype.forEachHeaderElement = function (callback) {
|
28377 | this.headerRowComps.forEach(function (headerRowComp) { return headerRowComp.forEachHeaderElement(callback); });
|
28378 | };
|
28379 | HeaderContainer.prototype.init = function () {
|
28380 | this.scrollWidth = this.gridOptionsWrapper.getScrollbarWidth();
|
28381 |
|
28382 |
|
28383 | this.eventService.addEventListener(events_1.Events.EVENT_COLUMN_VALUE_CHANGED, this.onColumnValueChanged.bind(this));
|
28384 | this.eventService.addEventListener(events_1.Events.EVENT_COLUMN_ROW_GROUP_CHANGED, this.onColumnRowGroupChanged.bind(this));
|
28385 | this.eventService.addEventListener(events_1.Events.EVENT_GRID_COLUMNS_CHANGED, this.onGridColumnsChanged.bind(this));
|
28386 | this.eventService.addEventListener(events_1.Events.EVENT_SCROLL_VISIBILITY_CHANGED, this.onScrollVisibilityChanged.bind(this));
|
28387 | this.eventService.addEventListener(events_1.Events.EVENT_COLUMN_RESIZED, this.onColumnResized.bind(this));
|
28388 | this.eventService.addEventListener(events_1.Events.EVENT_DISPLAYED_COLUMNS_CHANGED, this.onDisplayedColumnsChanged.bind(this));
|
28389 | };
|
28390 |
|
28391 |
|
28392 | HeaderContainer.prototype.onColumnRowGroupChanged = function () {
|
28393 | this.onGridColumnsChanged();
|
28394 | };
|
28395 |
|
28396 | HeaderContainer.prototype.onColumnValueChanged = function () {
|
28397 | this.onGridColumnsChanged();
|
28398 | };
|
28399 | HeaderContainer.prototype.onColumnResized = function () {
|
28400 | this.setWidthOfPinnedContainer();
|
28401 | };
|
28402 | HeaderContainer.prototype.onDisplayedColumnsChanged = function () {
|
28403 | this.setWidthOfPinnedContainer();
|
28404 | };
|
28405 | HeaderContainer.prototype.onScrollVisibilityChanged = function () {
|
28406 | this.setWidthOfPinnedContainer();
|
28407 | };
|
28408 | HeaderContainer.prototype.setWidthOfPinnedContainer = function () {
|
28409 | var pinningLeft = this.pinned === column_1.Column.PINNED_LEFT;
|
28410 | var pinningRight = this.pinned === column_1.Column.PINNED_RIGHT;
|
28411 | if (pinningLeft || pinningRight) {
|
28412 |
|
28413 | var width = pinningLeft ?
|
28414 | this.columnController.getPinnedLeftContainerWidth()
|
28415 | : this.columnController.getPinnedRightContainerWidth();
|
28416 |
|
28417 |
|
28418 |
|
28419 | var addPaddingForScrollbar = pinningLeft ?
|
28420 | this.scrollVisibleService.isLeftVerticalScrollShowing()
|
28421 | : this.scrollVisibleService.isRightVerticalScrollShowing();
|
28422 | if (addPaddingForScrollbar) {
|
28423 | width += this.scrollWidth;
|
28424 | }
|
28425 | this.eContainer.style.width = width + 'px';
|
28426 | }
|
28427 | };
|
28428 | HeaderContainer.prototype.destroy = function () {
|
28429 | this.removeHeaderRowComps();
|
28430 | };
|
28431 |
|
28432 |
|
28433 | HeaderContainer.prototype.onGridColumnsChanged = function () {
|
28434 | this.removeHeaderRowComps();
|
28435 | this.createHeaderRowComps();
|
28436 | };
|
28437 |
|
28438 | HeaderContainer.prototype.refresh = function () {
|
28439 | this.onGridColumnsChanged();
|
28440 | };
|
28441 | HeaderContainer.prototype.setupDragAndDrop = function (gridComp) {
|
28442 | var dropContainer = this.eViewport ? this.eViewport : this.eContainer;
|
28443 | var bodyDropTarget = new bodyDropTarget_1.BodyDropTarget(this.pinned, dropContainer);
|
28444 | this.context.wireBean(bodyDropTarget);
|
28445 | bodyDropTarget.registerGridComp(gridComp);
|
28446 | };
|
28447 | HeaderContainer.prototype.removeHeaderRowComps = function () {
|
28448 | this.headerRowComps.forEach(function (headerRowComp) {
|
28449 | headerRowComp.destroy();
|
28450 | });
|
28451 | this.headerRowComps.length = 0;
|
28452 | utils_1.Utils.removeAllChildren(this.eContainer);
|
28453 | };
|
28454 | HeaderContainer.prototype.createHeaderRowComps = function () {
|
28455 |
|
28456 |
|
28457 | var rowCount = this.columnController.getHeaderRowCount();
|
28458 | for (var dept = 0; dept < rowCount; dept++) {
|
28459 | var groupRow = dept !== (rowCount - 1);
|
28460 | var type = groupRow ? headerRowComp_1.HeaderRowType.COLUMN_GROUP : headerRowComp_1.HeaderRowType.COLUMN;
|
28461 | var headerRowComp = new headerRowComp_1.HeaderRowComp(dept, type, this.pinned, this.dropTarget);
|
28462 | this.context.wireBean(headerRowComp);
|
28463 | this.headerRowComps.push(headerRowComp);
|
28464 | this.eContainer.appendChild(headerRowComp.getGui());
|
28465 | }
|
28466 | var includeFloatingFilterRow = this.gridOptionsWrapper.isFloatingFilter() && !this.columnController.isPivotMode();
|
28467 | if (includeFloatingFilterRow) {
|
28468 | var headerRowComp = new headerRowComp_1.HeaderRowComp(rowCount, headerRowComp_1.HeaderRowType.FLOATING_FILTER, this.pinned, this.dropTarget);
|
28469 | this.context.wireBean(headerRowComp);
|
28470 | this.headerRowComps.push(headerRowComp);
|
28471 | this.eContainer.appendChild(headerRowComp.getGui());
|
28472 | }
|
28473 | };
|
28474 | __decorate([
|
28475 | context_1.Autowired('gridOptionsWrapper'),
|
28476 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
28477 | ], HeaderContainer.prototype, "gridOptionsWrapper", void 0);
|
28478 | __decorate([
|
28479 | context_1.Autowired('context'),
|
28480 | __metadata("design:type", context_1.Context)
|
28481 | ], HeaderContainer.prototype, "context", void 0);
|
28482 | __decorate([
|
28483 | context_1.Autowired('$scope'),
|
28484 | __metadata("design:type", Object)
|
28485 | ], HeaderContainer.prototype, "$scope", void 0);
|
28486 | __decorate([
|
28487 | context_1.Autowired('dragAndDropService'),
|
28488 | __metadata("design:type", dragAndDropService_1.DragAndDropService)
|
28489 | ], HeaderContainer.prototype, "dragAndDropService", void 0);
|
28490 | __decorate([
|
28491 | context_1.Autowired('columnController'),
|
28492 | __metadata("design:type", columnController_1.ColumnController)
|
28493 | ], HeaderContainer.prototype, "columnController", void 0);
|
28494 | __decorate([
|
28495 | context_1.Autowired('eventService'),
|
28496 | __metadata("design:type", eventService_1.EventService)
|
28497 | ], HeaderContainer.prototype, "eventService", void 0);
|
28498 | __decorate([
|
28499 | context_1.Autowired('scrollVisibleService'),
|
28500 | __metadata("design:type", scrollVisibleService_1.ScrollVisibleService)
|
28501 | ], HeaderContainer.prototype, "scrollVisibleService", void 0);
|
28502 | __decorate([
|
28503 | context_1.PostConstruct,
|
28504 | __metadata("design:type", Function),
|
28505 | __metadata("design:paramtypes", []),
|
28506 | __metadata("design:returntype", void 0)
|
28507 | ], HeaderContainer.prototype, "init", null);
|
28508 | return HeaderContainer;
|
28509 | }());
|
28510 | exports.HeaderContainer = HeaderContainer;
|
28511 |
|
28512 |
|
28513 | }),
|
28514 |
|
28515 | (function(module, exports, __webpack_require__) {
|
28516 |
|
28517 | "use strict";
|
28518 |
|
28519 |
|
28520 |
|
28521 |
|
28522 |
|
28523 |
|
28524 |
|
28525 | var __extends = (this && this.__extends) || (function () {
|
28526 | var extendStatics = Object.setPrototypeOf ||
|
28527 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
28528 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
28529 | return function (d, b) {
|
28530 | extendStatics(d, b);
|
28531 | function __() { this.constructor = d; }
|
28532 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
28533 | };
|
28534 | })();
|
28535 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
28536 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
28537 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
28538 | 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;
|
28539 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
28540 | };
|
28541 | var __metadata = (this && this.__metadata) || function (k, v) {
|
28542 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
28543 | };
|
28544 | Object.defineProperty(exports, "__esModule", { value: true });
|
28545 | var component_1 = __webpack_require__(8);
|
28546 | var context_1 = __webpack_require__(0);
|
28547 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
28548 | var columnController_1 = __webpack_require__(4);
|
28549 | var column_1 = __webpack_require__(10);
|
28550 | var eventService_1 = __webpack_require__(3);
|
28551 | var events_1 = __webpack_require__(5);
|
28552 | var utils_1 = __webpack_require__(1);
|
28553 | var headerWrapperComp_1 = __webpack_require__(100);
|
28554 | var headerGroupWrapperComp_1 = __webpack_require__(133);
|
28555 | var filterManager_1 = __webpack_require__(18);
|
28556 | var componentRecipes_1 = __webpack_require__(21);
|
28557 | var gridApi_1 = __webpack_require__(6);
|
28558 | var HeaderRowType;
|
28559 | (function (HeaderRowType) {
|
28560 | HeaderRowType[HeaderRowType["COLUMN_GROUP"] = 0] = "COLUMN_GROUP";
|
28561 | HeaderRowType[HeaderRowType["COLUMN"] = 1] = "COLUMN";
|
28562 | HeaderRowType[HeaderRowType["FLOATING_FILTER"] = 2] = "FLOATING_FILTER";
|
28563 | })(HeaderRowType = exports.HeaderRowType || (exports.HeaderRowType = {}));
|
28564 | var HeaderRowComp = (function (_super) {
|
28565 | __extends(HeaderRowComp, _super);
|
28566 | function HeaderRowComp(dept, type, pinned, dropTarget) {
|
28567 | var _this = _super.call(this, "<div class=\"ag-header-row\" role=\"presentation\"/>") || this;
|
28568 | _this.headerComps = {};
|
28569 | _this.dept = dept;
|
28570 | _this.type = type;
|
28571 | _this.pinned = pinned;
|
28572 | _this.dropTarget = dropTarget;
|
28573 | return _this;
|
28574 | }
|
28575 | HeaderRowComp.prototype.forEachHeaderElement = function (callback) {
|
28576 | var _this = this;
|
28577 | Object.keys(this.headerComps).forEach(function (key) {
|
28578 | callback(_this.headerComps[key]);
|
28579 | });
|
28580 | };
|
28581 | HeaderRowComp.prototype.destroy = function () {
|
28582 | var idsOfAllChildren = Object.keys(this.headerComps);
|
28583 | this.removeAndDestroyChildComponents(idsOfAllChildren);
|
28584 | _super.prototype.destroy.call(this);
|
28585 | };
|
28586 | HeaderRowComp.prototype.removeAndDestroyChildComponents = function (idsToDestroy) {
|
28587 | var _this = this;
|
28588 | idsToDestroy.forEach(function (id) {
|
28589 | var childHeaderComp = _this.headerComps[id];
|
28590 | _this.getGui().removeChild(childHeaderComp.getGui());
|
28591 | if (childHeaderComp.destroy) {
|
28592 | childHeaderComp.destroy();
|
28593 | }
|
28594 | delete _this.headerComps[id];
|
28595 | });
|
28596 | };
|
28597 | HeaderRowComp.prototype.onRowHeightChanged = function () {
|
28598 | var headerRowCount = this.columnController.getHeaderRowCount();
|
28599 | var sizes = [];
|
28600 | var numberOfFloating = 0;
|
28601 | var groupHeight;
|
28602 | var headerHeight;
|
28603 | if (!this.columnController.isPivotMode()) {
|
28604 | if (this.gridOptionsWrapper.isFloatingFilter()) {
|
28605 | headerRowCount++;
|
28606 | }
|
28607 | numberOfFloating = (this.gridOptionsWrapper.isFloatingFilter()) ? 1 : 0;
|
28608 | groupHeight = this.gridOptionsWrapper.getGroupHeaderHeight();
|
28609 | headerHeight = this.gridOptionsWrapper.getHeaderHeight();
|
28610 | }
|
28611 | else {
|
28612 | numberOfFloating = 0;
|
28613 | groupHeight = this.gridOptionsWrapper.getPivotGroupHeaderHeight();
|
28614 | headerHeight = this.gridOptionsWrapper.getPivotHeaderHeight();
|
28615 | }
|
28616 | var numberOfNonGroups = 1 + numberOfFloating;
|
28617 | var numberOfGroups = headerRowCount - numberOfNonGroups;
|
28618 | for (var i = 0; i < numberOfGroups; i++) {
|
28619 | sizes.push(groupHeight);
|
28620 | }
|
28621 | sizes.push(headerHeight);
|
28622 | for (var i = 0; i < numberOfFloating; i++) {
|
28623 | sizes.push(this.gridOptionsWrapper.getFloatingFiltersHeight());
|
28624 | }
|
28625 | var rowHeight = 0;
|
28626 | for (var i = 0; i < this.dept; i++) {
|
28627 | rowHeight += sizes[i];
|
28628 | }
|
28629 | this.getGui().style.top = rowHeight + 'px';
|
28630 | this.getGui().style.height = sizes[this.dept] + 'px';
|
28631 | };
|
28632 |
|
28633 | HeaderRowComp.prototype.init = function () {
|
28634 | this.onRowHeightChanged();
|
28635 | this.onVirtualColumnsChanged();
|
28636 | this.setWidth();
|
28637 | this.addDestroyableEventListener(this.gridOptionsWrapper, gridOptionsWrapper_1.GridOptionsWrapper.PROP_HEADER_HEIGHT, this.onRowHeightChanged.bind(this));
|
28638 | this.addDestroyableEventListener(this.gridOptionsWrapper, gridOptionsWrapper_1.GridOptionsWrapper.PROP_PIVOT_HEADER_HEIGHT, this.onRowHeightChanged.bind(this));
|
28639 | this.addDestroyableEventListener(this.gridOptionsWrapper, gridOptionsWrapper_1.GridOptionsWrapper.PROP_GROUP_HEADER_HEIGHT, this.onRowHeightChanged.bind(this));
|
28640 | this.addDestroyableEventListener(this.gridOptionsWrapper, gridOptionsWrapper_1.GridOptionsWrapper.PROP_PIVOT_GROUP_HEADER_HEIGHT, this.onRowHeightChanged.bind(this));
|
28641 | this.addDestroyableEventListener(this.gridOptionsWrapper, gridOptionsWrapper_1.GridOptionsWrapper.PROP_FLOATING_FILTERS_HEIGHT, this.onRowHeightChanged.bind(this));
|
28642 | this.addDestroyableEventListener(this.eventService, events_1.Events.EVENT_VIRTUAL_COLUMNS_CHANGED, this.onVirtualColumnsChanged.bind(this));
|
28643 | this.addDestroyableEventListener(this.eventService, events_1.Events.EVENT_DISPLAYED_COLUMNS_CHANGED, this.onDisplayedColumnsChanged.bind(this));
|
28644 | this.addDestroyableEventListener(this.eventService, events_1.Events.EVENT_COLUMN_RESIZED, this.onColumnResized.bind(this));
|
28645 | this.addDestroyableEventListener(this.eventService, events_1.Events.EVENT_GRID_COLUMNS_CHANGED, this.onGridColumnsChanged.bind(this));
|
28646 | };
|
28647 | HeaderRowComp.prototype.onColumnResized = function () {
|
28648 | this.setWidth();
|
28649 | };
|
28650 | HeaderRowComp.prototype.setWidth = function () {
|
28651 | var mainRowWidth = this.columnController.getContainerWidth(this.pinned) + 'px';
|
28652 | this.getGui().style.width = mainRowWidth;
|
28653 | };
|
28654 | HeaderRowComp.prototype.onGridColumnsChanged = function () {
|
28655 | this.removeAndDestroyAllChildComponents();
|
28656 | };
|
28657 | HeaderRowComp.prototype.removeAndDestroyAllChildComponents = function () {
|
28658 | var idsOfAllChildren = Object.keys(this.headerComps);
|
28659 | this.removeAndDestroyChildComponents(idsOfAllChildren);
|
28660 | };
|
28661 | HeaderRowComp.prototype.onDisplayedColumnsChanged = function () {
|
28662 | this.onVirtualColumnsChanged();
|
28663 | this.setWidth();
|
28664 | };
|
28665 | HeaderRowComp.prototype.onVirtualColumnsChanged = function () {
|
28666 | var _this = this;
|
28667 | var currentChildIds = Object.keys(this.headerComps);
|
28668 | var itemsAtDepth = this.columnController.getVirtualHeaderGroupRow(this.pinned, this.type == HeaderRowType.FLOATING_FILTER ?
|
28669 | this.dept - 1 :
|
28670 | this.dept);
|
28671 | var ensureDomOrder = this.gridOptionsWrapper.isEnsureDomOrder();
|
28672 | var eBefore;
|
28673 | itemsAtDepth.forEach(function (child) {
|
28674 |
|
28675 |
|
28676 |
|
28677 |
|
28678 | if (child.isEmptyGroup()) {
|
28679 | return;
|
28680 | }
|
28681 | var idOfChild = child.getUniqueId();
|
28682 | var eParentContainer = _this.getGui();
|
28683 |
|
28684 | var colAlreadyInDom = currentChildIds.indexOf(idOfChild) >= 0;
|
28685 | var headerComp;
|
28686 | var eHeaderCompGui;
|
28687 | if (colAlreadyInDom) {
|
28688 | utils_1.Utils.removeFromArray(currentChildIds, idOfChild);
|
28689 | headerComp = _this.headerComps[idOfChild];
|
28690 | eHeaderCompGui = headerComp.getGui();
|
28691 | if (ensureDomOrder) {
|
28692 | utils_1.Utils.ensureDomOrder(eParentContainer, eHeaderCompGui, eBefore);
|
28693 | }
|
28694 | eBefore = eHeaderCompGui;
|
28695 | }
|
28696 | else {
|
28697 | headerComp = _this.createHeaderComp(child);
|
28698 | _this.headerComps[idOfChild] = headerComp;
|
28699 | eHeaderCompGui = headerComp.getGui();
|
28700 | if (ensureDomOrder) {
|
28701 | utils_1.Utils.insertWithDomOrder(eParentContainer, eHeaderCompGui, eBefore);
|
28702 | }
|
28703 | else {
|
28704 | eParentContainer.appendChild(eHeaderCompGui);
|
28705 | }
|
28706 | eBefore = eHeaderCompGui;
|
28707 | }
|
28708 | });
|
28709 |
|
28710 | this.removeAndDestroyChildComponents(currentChildIds);
|
28711 | };
|
28712 | HeaderRowComp.prototype.createHeaderComp = function (columnGroupChild) {
|
28713 | var result;
|
28714 | switch (this.type) {
|
28715 | case HeaderRowType.COLUMN:
|
28716 | result = new headerWrapperComp_1.HeaderWrapperComp(columnGroupChild, this.dropTarget, this.pinned);
|
28717 | break;
|
28718 | case HeaderRowType.COLUMN_GROUP:
|
28719 | result = new headerGroupWrapperComp_1.HeaderGroupWrapperComp(columnGroupChild, this.dropTarget, this.pinned);
|
28720 | break;
|
28721 | case HeaderRowType.FLOATING_FILTER:
|
28722 | var column = columnGroupChild;
|
28723 | result = this.createFloatingFilterWrapper(column);
|
28724 | break;
|
28725 | }
|
28726 | this.context.wireBean(result);
|
28727 | return result;
|
28728 | };
|
28729 | HeaderRowComp.prototype.createFloatingFilterWrapper = function (column) {
|
28730 | var _this = this;
|
28731 | var floatingFilterParams = this.createFloatingFilterParams(column);
|
28732 | var floatingFilterWrapper = this.componentRecipes.newFloatingFilterWrapperComponent(column, floatingFilterParams);
|
28733 | this.addDestroyableEventListener(column, column_1.Column.EVENT_FILTER_CHANGED, function () {
|
28734 | var filterComponentPromise = _this.filterManager.getFilterComponent(column);
|
28735 | floatingFilterWrapper.onParentModelChanged(filterComponentPromise.resolveNow(null, function (filter) { return filter.getModel(); }));
|
28736 | });
|
28737 | var cachedFilter = this.filterManager.cachedFilter(column);
|
28738 | if (cachedFilter) {
|
28739 | var filterComponentPromise = this.filterManager.getFilterComponent(column);
|
28740 | floatingFilterWrapper.onParentModelChanged(filterComponentPromise.resolveNow(null, function (filter) { return filter.getModel(); }));
|
28741 | }
|
28742 | return floatingFilterWrapper;
|
28743 | };
|
28744 | HeaderRowComp.prototype.createFloatingFilterParams = function (column) {
|
28745 | var _this = this;
|
28746 |
|
28747 |
|
28748 |
|
28749 |
|
28750 |
|
28751 | var baseParams = {
|
28752 | api: this.gridApi,
|
28753 | column: column,
|
28754 | currentParentModel: function () {
|
28755 | var filterComponentPromise = _this.filterManager.getFilterComponent(column);
|
28756 | var wholeParentFilter = filterComponentPromise.resolveNow(null, function (filter) {
|
28757 | return (filter.getNullableModel) ?
|
28758 | filter.getNullableModel() :
|
28759 | filter.getModel();
|
28760 | });
|
28761 | return wholeParentFilter.operator != null ? wholeParentFilter.condition1 : wholeParentFilter;
|
28762 | },
|
28763 | onFloatingFilterChanged: function (change) {
|
28764 | var captureModelChangedResolveFunc;
|
28765 | var modelChanged = new utils_1.Promise(function (resolve) {
|
28766 | captureModelChangedResolveFunc = resolve;
|
28767 | });
|
28768 | var filterComponentPromise = _this.filterManager.getFilterComponent(column);
|
28769 | filterComponentPromise.then(function (filterComponent) {
|
28770 | if (filterComponent.onFloatingFilterChanged) {
|
28771 |
|
28772 |
|
28773 |
|
28774 | var result = filterComponent.onFloatingFilterChanged(change);
|
28775 | captureModelChangedResolveFunc(result);
|
28776 | }
|
28777 | else {
|
28778 |
|
28779 |
|
28780 |
|
28781 |
|
28782 | filterComponent.setModel(change);
|
28783 | _this.filterManager.onFilterChanged();
|
28784 | captureModelChangedResolveFunc(true);
|
28785 | }
|
28786 | });
|
28787 | return modelChanged.resolveNow(true, function (modelChanged) { return modelChanged; });
|
28788 | },
|
28789 |
|
28790 | suppressFilterButton: false
|
28791 | };
|
28792 | return baseParams;
|
28793 | };
|
28794 | __decorate([
|
28795 | context_1.Autowired('gridOptionsWrapper'),
|
28796 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
28797 | ], HeaderRowComp.prototype, "gridOptionsWrapper", void 0);
|
28798 | __decorate([
|
28799 | context_1.Autowired('gridApi'),
|
28800 | __metadata("design:type", gridApi_1.GridApi)
|
28801 | ], HeaderRowComp.prototype, "gridApi", void 0);
|
28802 | __decorate([
|
28803 | context_1.Autowired('columnController'),
|
28804 | __metadata("design:type", columnController_1.ColumnController)
|
28805 | ], HeaderRowComp.prototype, "columnController", void 0);
|
28806 | __decorate([
|
28807 | context_1.Autowired('context'),
|
28808 | __metadata("design:type", context_1.Context)
|
28809 | ], HeaderRowComp.prototype, "context", void 0);
|
28810 | __decorate([
|
28811 | context_1.Autowired('eventService'),
|
28812 | __metadata("design:type", eventService_1.EventService)
|
28813 | ], HeaderRowComp.prototype, "eventService", void 0);
|
28814 | __decorate([
|
28815 | context_1.Autowired('filterManager'),
|
28816 | __metadata("design:type", filterManager_1.FilterManager)
|
28817 | ], HeaderRowComp.prototype, "filterManager", void 0);
|
28818 | __decorate([
|
28819 | context_1.Autowired('componentRecipes'),
|
28820 | __metadata("design:type", componentRecipes_1.ComponentRecipes)
|
28821 | ], HeaderRowComp.prototype, "componentRecipes", void 0);
|
28822 | __decorate([
|
28823 | context_1.PostConstruct,
|
28824 | __metadata("design:type", Function),
|
28825 | __metadata("design:paramtypes", []),
|
28826 | __metadata("design:returntype", void 0)
|
28827 | ], HeaderRowComp.prototype, "init", null);
|
28828 | return HeaderRowComp;
|
28829 | }(component_1.Component));
|
28830 | exports.HeaderRowComp = HeaderRowComp;
|
28831 |
|
28832 |
|
28833 | }),
|
28834 |
|
28835 | (function(module, exports, __webpack_require__) {
|
28836 |
|
28837 | "use strict";
|
28838 |
|
28839 |
|
28840 |
|
28841 |
|
28842 |
|
28843 |
|
28844 |
|
28845 | var __extends = (this && this.__extends) || (function () {
|
28846 | var extendStatics = Object.setPrototypeOf ||
|
28847 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
28848 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
28849 | return function (d, b) {
|
28850 | extendStatics(d, b);
|
28851 | function __() { this.constructor = d; }
|
28852 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
28853 | };
|
28854 | })();
|
28855 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
28856 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
28857 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
28858 | 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;
|
28859 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
28860 | };
|
28861 | var __metadata = (this && this.__metadata) || function (k, v) {
|
28862 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
28863 | };
|
28864 | Object.defineProperty(exports, "__esModule", { value: true });
|
28865 | var component_1 = __webpack_require__(8);
|
28866 | var context_1 = __webpack_require__(0);
|
28867 | var column_1 = __webpack_require__(10);
|
28868 | var utils_1 = __webpack_require__(1);
|
28869 | var dragAndDropService_1 = __webpack_require__(14);
|
28870 | var columnApi_1 = __webpack_require__(7);
|
28871 | var columnController_1 = __webpack_require__(4);
|
28872 | var horizontalResizeService_1 = __webpack_require__(59);
|
28873 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
28874 | var cssClassApplier_1 = __webpack_require__(81);
|
28875 | var setLeftFeature_1 = __webpack_require__(52);
|
28876 | var gridApi_1 = __webpack_require__(6);
|
28877 | var sortController_1 = __webpack_require__(24);
|
28878 | var eventService_1 = __webpack_require__(3);
|
28879 | var componentRecipes_1 = __webpack_require__(21);
|
28880 | var agCheckbox_1 = __webpack_require__(60);
|
28881 | var componentAnnotations_1 = __webpack_require__(11);
|
28882 | var selectAllFeature_1 = __webpack_require__(132);
|
28883 | var events_1 = __webpack_require__(5);
|
28884 | var columnHoverService_1 = __webpack_require__(45);
|
28885 | var beans_1 = __webpack_require__(28);
|
28886 | var hoverFeature_1 = __webpack_require__(74);
|
28887 | var touchListener_1 = __webpack_require__(46);
|
28888 | var HeaderWrapperComp = (function (_super) {
|
28889 | __extends(HeaderWrapperComp, _super);
|
28890 | function HeaderWrapperComp(column, dragSourceDropTarget, pinned) {
|
28891 | var _this = _super.call(this, HeaderWrapperComp.TEMPLATE) || this;
|
28892 | _this.column = column;
|
28893 | _this.dragSourceDropTarget = dragSourceDropTarget;
|
28894 | _this.pinned = pinned;
|
28895 | return _this;
|
28896 | }
|
28897 | HeaderWrapperComp.prototype.getColumn = function () {
|
28898 | return this.column;
|
28899 | };
|
28900 | HeaderWrapperComp.prototype.init = function () {
|
28901 | this.instantiate(this.context);
|
28902 | var displayName = this.columnController.getDisplayNameForColumn(this.column, 'header', true);
|
28903 | var enableSorting = this.gridOptionsWrapper.isEnableSorting() && !this.column.getColDef().suppressSorting;
|
28904 | var enableMenu = this.menuFactory.isMenuEnabled(this.column) && !this.column.getColDef().suppressMenu;
|
28905 | this.appendHeaderComp(displayName, enableSorting, enableMenu);
|
28906 | this.setupWidth();
|
28907 | this.setupMovingCss();
|
28908 | this.setupTooltip();
|
28909 | this.setupResize();
|
28910 | this.setupMenuClass();
|
28911 | this.setupSortableClass(enableSorting);
|
28912 | this.addColumnHoverListener();
|
28913 | this.addFeature(this.context, new hoverFeature_1.HoverFeature([this.column], this.getGui()));
|
28914 | this.addDestroyableEventListener(this.column, column_1.Column.EVENT_FILTER_ACTIVE_CHANGED, this.onFilterChanged.bind(this));
|
28915 | this.onFilterChanged();
|
28916 | this.addFeature(this.context, new selectAllFeature_1.SelectAllFeature(this.cbSelectAll, this.column));
|
28917 | var setLeftFeature = new setLeftFeature_1.SetLeftFeature(this.column, this.getGui(), this.beans);
|
28918 | setLeftFeature.init();
|
28919 | this.addDestroyFunc(setLeftFeature.destroy.bind(setLeftFeature));
|
28920 | this.addAttributes();
|
28921 | cssClassApplier_1.CssClassApplier.addHeaderClassesFromColDef(this.column.getColDef(), this.getGui(), this.gridOptionsWrapper, this.column, null);
|
28922 | };
|
28923 | HeaderWrapperComp.prototype.addColumnHoverListener = function () {
|
28924 | this.addDestroyableEventListener(this.eventService, events_1.Events.EVENT_COLUMN_HOVER_CHANGED, this.onColumnHover.bind(this));
|
28925 | this.onColumnHover();
|
28926 | };
|
28927 | HeaderWrapperComp.prototype.onColumnHover = function () {
|
28928 | var isHovered = this.columnHoverService.isHovered(this.column);
|
28929 | utils_1.Utils.addOrRemoveCssClass(this.getGui(), 'ag-column-hover', isHovered);
|
28930 | };
|
28931 | HeaderWrapperComp.prototype.setupSortableClass = function (enableSorting) {
|
28932 | if (enableSorting) {
|
28933 | var element = this.getGui();
|
28934 | utils_1.Utils.addCssClass(element, 'ag-header-cell-sortable');
|
28935 | }
|
28936 | };
|
28937 | HeaderWrapperComp.prototype.onFilterChanged = function () {
|
28938 | var filterPresent = this.column.isFilterActive();
|
28939 | utils_1.Utils.addOrRemoveCssClass(this.getGui(), 'ag-header-cell-filtered', filterPresent);
|
28940 | };
|
28941 | HeaderWrapperComp.prototype.appendHeaderComp = function (displayName, enableSorting, enableMenu) {
|
28942 | var _this = this;
|
28943 | var params = {
|
28944 | column: this.column,
|
28945 | displayName: displayName,
|
28946 | enableSorting: enableSorting,
|
28947 | enableMenu: enableMenu,
|
28948 | showColumnMenu: function (source) {
|
28949 | _this.gridApi.showColumnMenuAfterButtonClick(_this.column, source);
|
28950 | },
|
28951 | progressSort: function (multiSort) {
|
28952 | _this.sortController.progressSort(_this.column, !!multiSort, "uiColumnSorted");
|
28953 | },
|
28954 | setSort: function (sort, multiSort) {
|
28955 | _this.sortController.setSortForColumn(_this.column, sort, !!multiSort, "uiColumnSorted");
|
28956 | },
|
28957 | api: this.gridApi,
|
28958 | columnApi: this.columnApi,
|
28959 | context: this.gridOptionsWrapper.getContext()
|
28960 | };
|
28961 | var callback = this.afterHeaderCompCreated.bind(this, displayName);
|
28962 | this.componentRecipes.newHeaderComponent(params).then(callback);
|
28963 | };
|
28964 | HeaderWrapperComp.prototype.afterHeaderCompCreated = function (displayName, headerComp) {
|
28965 | this.appendChild(headerComp);
|
28966 | this.setupMove(headerComp.getGui(), displayName);
|
28967 | if (headerComp.destroy) {
|
28968 | this.addDestroyFunc(headerComp.destroy.bind(headerComp));
|
28969 | }
|
28970 | };
|
28971 | HeaderWrapperComp.prototype.onColumnMovingChanged = function () {
|
28972 |
|
28973 |
|
28974 |
|
28975 | if (this.column.isMoving()) {
|
28976 | utils_1.Utils.addCssClass(this.getGui(), 'ag-header-cell-moving');
|
28977 | }
|
28978 | else {
|
28979 | utils_1.Utils.removeCssClass(this.getGui(), 'ag-header-cell-moving');
|
28980 | }
|
28981 | };
|
28982 | HeaderWrapperComp.prototype.setupMove = function (eHeaderCellLabel, displayName) {
|
28983 | var _this = this;
|
28984 | var suppressMove = this.gridOptionsWrapper.isSuppressMovableColumns()
|
28985 | || this.column.getColDef().suppressMovable
|
28986 | || this.column.isLockPosition();
|
28987 | if (suppressMove) {
|
28988 | return;
|
28989 | }
|
28990 | if (eHeaderCellLabel) {
|
28991 | var dragSource_1 = {
|
28992 | type: dragAndDropService_1.DragSourceType.HeaderCell,
|
28993 | eElement: eHeaderCellLabel,
|
28994 | dragItemCallback: function () { return _this.createDragItem(); },
|
28995 | dragItemName: displayName,
|
28996 | dragSourceDropTarget: this.dragSourceDropTarget,
|
28997 | dragStarted: function () { return _this.column.setMoving(true, "uiColumnMoved"); },
|
28998 | dragStopped: function () { return _this.column.setMoving(false, "uiColumnMoved"); }
|
28999 | };
|
29000 | this.dragAndDropService.addDragSource(dragSource_1, true);
|
29001 | this.addDestroyFunc(function () { return _this.dragAndDropService.removeDragSource(dragSource_1); });
|
29002 | }
|
29003 | };
|
29004 | HeaderWrapperComp.prototype.createDragItem = function () {
|
29005 | var visibleState = {};
|
29006 | visibleState[this.column.getId()] = this.column.isVisible();
|
29007 | return {
|
29008 | columns: [this.column],
|
29009 | visibleState: visibleState
|
29010 | };
|
29011 | };
|
29012 | HeaderWrapperComp.prototype.setupResize = function () {
|
29013 | var _this = this;
|
29014 | var colDef = this.column.getColDef();
|
29015 |
|
29016 | if (!this.eResize) {
|
29017 | return;
|
29018 | }
|
29019 | if (!this.column.isResizable()) {
|
29020 | utils_1.Utils.removeFromParent(this.eResize);
|
29021 | return;
|
29022 | }
|
29023 | var finishedWithResizeFunc = this.horizontalResizeService.addResizeBar({
|
29024 | eResizeBar: this.eResize,
|
29025 | onResizeStart: this.onResizeStart.bind(this),
|
29026 | onResizing: this.onResizing.bind(this, false),
|
29027 | onResizeEnd: this.onResizing.bind(this, true)
|
29028 | });
|
29029 | this.addDestroyFunc(finishedWithResizeFunc);
|
29030 | var weWantAutoSize = !this.gridOptionsWrapper.isSuppressAutoSize() && !colDef.suppressAutoSize;
|
29031 | if (weWantAutoSize) {
|
29032 | this.addDestroyableEventListener(this.eResize, 'dblclick', function () {
|
29033 | _this.columnController.autoSizeColumn(_this.column, "uiColumnResized");
|
29034 | });
|
29035 | var touchListener = new touchListener_1.TouchListener(this.eResize);
|
29036 | this.addDestroyableEventListener(touchListener, touchListener_1.TouchListener.EVENT_DOUBLE_TAP, function () {
|
29037 | _this.columnController.autoSizeColumn(_this.column, "uiColumnResized");
|
29038 | });
|
29039 | this.addDestroyFunc(touchListener.destroy.bind(touchListener));
|
29040 | }
|
29041 | };
|
29042 | HeaderWrapperComp.prototype.onResizing = function (finished, resizeAmount) {
|
29043 | var resizeAmountNormalised = this.normaliseResizeAmount(resizeAmount);
|
29044 | var newWidth = this.resizeStartWidth + resizeAmountNormalised;
|
29045 | this.columnController.setColumnWidth(this.column, newWidth, this.resizeWithShiftKey, finished, "uiColumnDragged");
|
29046 | };
|
29047 | HeaderWrapperComp.prototype.onResizeStart = function (shiftKey) {
|
29048 | this.resizeStartWidth = this.column.getActualWidth();
|
29049 | this.resizeWithShiftKey = shiftKey;
|
29050 | };
|
29051 | HeaderWrapperComp.prototype.setupTooltip = function () {
|
29052 | var colDef = this.column.getColDef();
|
29053 |
|
29054 | if (colDef.headerTooltip) {
|
29055 | this.getGui().title = colDef.headerTooltip;
|
29056 | }
|
29057 | };
|
29058 | HeaderWrapperComp.prototype.setupMovingCss = function () {
|
29059 | this.addDestroyableEventListener(this.column, column_1.Column.EVENT_MOVING_CHANGED, this.onColumnMovingChanged.bind(this));
|
29060 | this.onColumnMovingChanged();
|
29061 | };
|
29062 | HeaderWrapperComp.prototype.addAttributes = function () {
|
29063 | this.getGui().setAttribute("col-id", this.column.getColId());
|
29064 | };
|
29065 | HeaderWrapperComp.prototype.setupWidth = function () {
|
29066 | this.addDestroyableEventListener(this.column, column_1.Column.EVENT_WIDTH_CHANGED, this.onColumnWidthChanged.bind(this));
|
29067 | this.onColumnWidthChanged();
|
29068 | };
|
29069 | HeaderWrapperComp.prototype.setupMenuClass = function () {
|
29070 | this.addDestroyableEventListener(this.column, column_1.Column.EVENT_MENU_VISIBLE_CHANGED, this.onMenuVisible.bind(this));
|
29071 | this.onColumnWidthChanged();
|
29072 | };
|
29073 | HeaderWrapperComp.prototype.onMenuVisible = function () {
|
29074 | this.addOrRemoveCssClass('ag-column-menu-visible', this.column.isMenuVisible());
|
29075 | };
|
29076 | HeaderWrapperComp.prototype.onColumnWidthChanged = function () {
|
29077 | this.getGui().style.width = this.column.getActualWidth() + 'px';
|
29078 | };
|
29079 |
|
29080 |
|
29081 | HeaderWrapperComp.prototype.normaliseResizeAmount = function (dragChange) {
|
29082 | var result = dragChange;
|
29083 | if (this.gridOptionsWrapper.isEnableRtl()) {
|
29084 |
|
29085 | if (this.pinned !== column_1.Column.PINNED_LEFT) {
|
29086 | result *= -1;
|
29087 | }
|
29088 | }
|
29089 | else {
|
29090 |
|
29091 | if (this.pinned === column_1.Column.PINNED_RIGHT) {
|
29092 | result *= -1;
|
29093 | }
|
29094 | }
|
29095 | return result;
|
29096 | };
|
29097 | HeaderWrapperComp.TEMPLATE = '<div class="ag-header-cell" role="presentation" >' +
|
29098 | '<div ref="eResize" class="ag-header-cell-resize" role="presentation"></div>' +
|
29099 | '<ag-checkbox ref="cbSelectAll" class="ag-header-select-all" role="presentation"></ag-checkbox>' +
|
29100 |
|
29101 | '</div>';
|
29102 | __decorate([
|
29103 | context_1.Autowired('gridOptionsWrapper'),
|
29104 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
29105 | ], HeaderWrapperComp.prototype, "gridOptionsWrapper", void 0);
|
29106 | __decorate([
|
29107 | context_1.Autowired('dragAndDropService'),
|
29108 | __metadata("design:type", dragAndDropService_1.DragAndDropService)
|
29109 | ], HeaderWrapperComp.prototype, "dragAndDropService", void 0);
|
29110 | __decorate([
|
29111 | context_1.Autowired('columnController'),
|
29112 | __metadata("design:type", columnController_1.ColumnController)
|
29113 | ], HeaderWrapperComp.prototype, "columnController", void 0);
|
29114 | __decorate([
|
29115 | context_1.Autowired('horizontalResizeService'),
|
29116 | __metadata("design:type", horizontalResizeService_1.HorizontalResizeService)
|
29117 | ], HeaderWrapperComp.prototype, "horizontalResizeService", void 0);
|
29118 | __decorate([
|
29119 | context_1.Autowired('context'),
|
29120 | __metadata("design:type", context_1.Context)
|
29121 | ], HeaderWrapperComp.prototype, "context", void 0);
|
29122 | __decorate([
|
29123 | context_1.Autowired('menuFactory'),
|
29124 | __metadata("design:type", Object)
|
29125 | ], HeaderWrapperComp.prototype, "menuFactory", void 0);
|
29126 | __decorate([
|
29127 | context_1.Autowired('gridApi'),
|
29128 | __metadata("design:type", gridApi_1.GridApi)
|
29129 | ], HeaderWrapperComp.prototype, "gridApi", void 0);
|
29130 | __decorate([
|
29131 | context_1.Autowired('columnApi'),
|
29132 | __metadata("design:type", columnApi_1.ColumnApi)
|
29133 | ], HeaderWrapperComp.prototype, "columnApi", void 0);
|
29134 | __decorate([
|
29135 | context_1.Autowired('sortController'),
|
29136 | __metadata("design:type", sortController_1.SortController)
|
29137 | ], HeaderWrapperComp.prototype, "sortController", void 0);
|
29138 | __decorate([
|
29139 | context_1.Autowired('eventService'),
|
29140 | __metadata("design:type", eventService_1.EventService)
|
29141 | ], HeaderWrapperComp.prototype, "eventService", void 0);
|
29142 | __decorate([
|
29143 | context_1.Autowired('componentRecipes'),
|
29144 | __metadata("design:type", componentRecipes_1.ComponentRecipes)
|
29145 | ], HeaderWrapperComp.prototype, "componentRecipes", void 0);
|
29146 | __decorate([
|
29147 | context_1.Autowired('columnHoverService'),
|
29148 | __metadata("design:type", columnHoverService_1.ColumnHoverService)
|
29149 | ], HeaderWrapperComp.prototype, "columnHoverService", void 0);
|
29150 | __decorate([
|
29151 | context_1.Autowired('beans'),
|
29152 | __metadata("design:type", beans_1.Beans)
|
29153 | ], HeaderWrapperComp.prototype, "beans", void 0);
|
29154 | __decorate([
|
29155 | componentAnnotations_1.RefSelector('eResize'),
|
29156 | __metadata("design:type", HTMLElement)
|
29157 | ], HeaderWrapperComp.prototype, "eResize", void 0);
|
29158 | __decorate([
|
29159 | componentAnnotations_1.RefSelector('cbSelectAll'),
|
29160 | __metadata("design:type", agCheckbox_1.AgCheckbox)
|
29161 | ], HeaderWrapperComp.prototype, "cbSelectAll", void 0);
|
29162 | __decorate([
|
29163 | context_1.PostConstruct,
|
29164 | __metadata("design:type", Function),
|
29165 | __metadata("design:paramtypes", []),
|
29166 | __metadata("design:returntype", void 0)
|
29167 | ], HeaderWrapperComp.prototype, "init", null);
|
29168 | return HeaderWrapperComp;
|
29169 | }(component_1.Component));
|
29170 | exports.HeaderWrapperComp = HeaderWrapperComp;
|
29171 |
|
29172 |
|
29173 | }),
|
29174 |
|
29175 | (function(module, exports, __webpack_require__) {
|
29176 |
|
29177 | "use strict";
|
29178 |
|
29179 |
|
29180 |
|
29181 |
|
29182 |
|
29183 |
|
29184 |
|
29185 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
29186 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
29187 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
29188 | 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;
|
29189 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
29190 | };
|
29191 | var __metadata = (this && this.__metadata) || function (k, v) {
|
29192 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
29193 | };
|
29194 | Object.defineProperty(exports, "__esModule", { value: true });
|
29195 | var dragAndDropService_1 = __webpack_require__(14);
|
29196 | var context_1 = __webpack_require__(0);
|
29197 | var moveColumnController_1 = __webpack_require__(102);
|
29198 | var column_1 = __webpack_require__(10);
|
29199 | var bodyDropPivotTarget_1 = __webpack_require__(103);
|
29200 | var columnController_1 = __webpack_require__(4);
|
29201 | var DropType;
|
29202 | (function (DropType) {
|
29203 | DropType[DropType["ColumnMove"] = 0] = "ColumnMove";
|
29204 | DropType[DropType["Pivot"] = 1] = "Pivot";
|
29205 | })(DropType || (DropType = {}));
|
29206 | var BodyDropTarget = (function () {
|
29207 | function BodyDropTarget(pinned, eContainer) {
|
29208 | this.dropListeners = {};
|
29209 | this.pinned = pinned;
|
29210 | this.eContainer = eContainer;
|
29211 | }
|
29212 | BodyDropTarget.prototype.registerGridComp = function (gridPanel) {
|
29213 | this.gridPanel = gridPanel;
|
29214 | this.moveColumnController.registerGridComp(gridPanel);
|
29215 | switch (this.pinned) {
|
29216 | case column_1.Column.PINNED_LEFT:
|
29217 | this.eSecondaryContainers = this.gridPanel.getDropTargetLeftContainers();
|
29218 | break;
|
29219 | case column_1.Column.PINNED_RIGHT:
|
29220 | this.eSecondaryContainers = this.gridPanel.getDropTargetRightContainers();
|
29221 | break;
|
29222 | default:
|
29223 | this.eSecondaryContainers = this.gridPanel.getDropTargetBodyContainers();
|
29224 | break;
|
29225 | }
|
29226 | };
|
29227 | BodyDropTarget.prototype.isInterestedIn = function (type) {
|
29228 |
|
29229 | return type === dragAndDropService_1.DragSourceType.HeaderCell || type === dragAndDropService_1.DragSourceType.ToolPanel;
|
29230 | };
|
29231 | BodyDropTarget.prototype.getSecondaryContainers = function () {
|
29232 | return this.eSecondaryContainers;
|
29233 | };
|
29234 | BodyDropTarget.prototype.getContainer = function () {
|
29235 | return this.eContainer;
|
29236 | };
|
29237 | BodyDropTarget.prototype.init = function () {
|
29238 | this.moveColumnController = new moveColumnController_1.MoveColumnController(this.pinned, this.eContainer);
|
29239 | this.context.wireBean(this.moveColumnController);
|
29240 | var bodyDropPivotTarget = new bodyDropPivotTarget_1.BodyDropPivotTarget(this.pinned);
|
29241 | this.context.wireBean(bodyDropPivotTarget);
|
29242 | this.dropListeners[DropType.ColumnMove] = this.moveColumnController;
|
29243 | this.dropListeners[DropType.Pivot] = bodyDropPivotTarget;
|
29244 | this.dragAndDropService.addDropTarget(this);
|
29245 | };
|
29246 | BodyDropTarget.prototype.getIconName = function () {
|
29247 | return this.currentDropListener.getIconName();
|
29248 | };
|
29249 |
|
29250 |
|
29251 |
|
29252 | BodyDropTarget.prototype.getDropType = function (draggingEvent) {
|
29253 | if (this.columnController.isPivotMode()) {
|
29254 |
|
29255 |
|
29256 |
|
29257 | if (draggingEvent.dragSource.type === dragAndDropService_1.DragSourceType.ToolPanel) {
|
29258 | return DropType.Pivot;
|
29259 | }
|
29260 | else {
|
29261 | return DropType.ColumnMove;
|
29262 | }
|
29263 | }
|
29264 | else {
|
29265 |
|
29266 | return DropType.ColumnMove;
|
29267 | }
|
29268 | };
|
29269 | BodyDropTarget.prototype.onDragEnter = function (draggingEvent) {
|
29270 |
|
29271 |
|
29272 |
|
29273 |
|
29274 | var dropType = this.getDropType(draggingEvent);
|
29275 | this.currentDropListener = this.dropListeners[dropType];
|
29276 | this.currentDropListener.onDragEnter(draggingEvent);
|
29277 | };
|
29278 | BodyDropTarget.prototype.onDragLeave = function (params) {
|
29279 | this.currentDropListener.onDragLeave(params);
|
29280 | };
|
29281 | BodyDropTarget.prototype.onDragging = function (params) {
|
29282 | this.currentDropListener.onDragging(params);
|
29283 | };
|
29284 | BodyDropTarget.prototype.onDragStop = function (params) {
|
29285 | this.currentDropListener.onDragStop(params);
|
29286 | };
|
29287 | __decorate([
|
29288 | context_1.Autowired('context'),
|
29289 | __metadata("design:type", context_1.Context)
|
29290 | ], BodyDropTarget.prototype, "context", void 0);
|
29291 | __decorate([
|
29292 | context_1.Autowired('dragAndDropService'),
|
29293 | __metadata("design:type", dragAndDropService_1.DragAndDropService)
|
29294 | ], BodyDropTarget.prototype, "dragAndDropService", void 0);
|
29295 | __decorate([
|
29296 | context_1.Autowired('columnController'),
|
29297 | __metadata("design:type", columnController_1.ColumnController)
|
29298 | ], BodyDropTarget.prototype, "columnController", void 0);
|
29299 | __decorate([
|
29300 | context_1.PostConstruct,
|
29301 | __metadata("design:type", Function),
|
29302 | __metadata("design:paramtypes", []),
|
29303 | __metadata("design:returntype", void 0)
|
29304 | ], BodyDropTarget.prototype, "init", null);
|
29305 | return BodyDropTarget;
|
29306 | }());
|
29307 | exports.BodyDropTarget = BodyDropTarget;
|
29308 |
|
29309 |
|
29310 | }),
|
29311 |
|
29312 | (function(module, exports, __webpack_require__) {
|
29313 |
|
29314 | "use strict";
|
29315 |
|
29316 |
|
29317 |
|
29318 |
|
29319 |
|
29320 |
|
29321 |
|
29322 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
29323 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
29324 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
29325 | 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;
|
29326 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
29327 | };
|
29328 | var __metadata = (this && this.__metadata) || function (k, v) {
|
29329 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
29330 | };
|
29331 | Object.defineProperty(exports, "__esModule", { value: true });
|
29332 | var context_1 = __webpack_require__(0);
|
29333 | var logger_1 = __webpack_require__(12);
|
29334 | var columnController_1 = __webpack_require__(4);
|
29335 | var column_1 = __webpack_require__(10);
|
29336 | var utils_1 = __webpack_require__(1);
|
29337 | var dragAndDropService_1 = __webpack_require__(14);
|
29338 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
29339 | var MoveColumnController = (function () {
|
29340 | function MoveColumnController(pinned, eContainer) {
|
29341 | this.needToMoveLeft = false;
|
29342 | this.needToMoveRight = false;
|
29343 | this.pinned = pinned;
|
29344 | this.eContainer = eContainer;
|
29345 | this.centerContainer = !utils_1.Utils.exists(pinned);
|
29346 | }
|
29347 | MoveColumnController.prototype.registerGridComp = function (gridPanel) {
|
29348 | this.gridPanel = gridPanel;
|
29349 | };
|
29350 | MoveColumnController.prototype.init = function () {
|
29351 | this.logger = this.loggerFactory.create('MoveColumnController');
|
29352 | };
|
29353 | MoveColumnController.prototype.getIconName = function () {
|
29354 | return this.pinned ? dragAndDropService_1.DragAndDropService.ICON_PINNED : dragAndDropService_1.DragAndDropService.ICON_MOVE;
|
29355 | };
|
29356 | MoveColumnController.prototype.onDragEnter = function (draggingEvent) {
|
29357 |
|
29358 | var columns = draggingEvent.dragItem.columns;
|
29359 | var dragCameFromToolPanel = draggingEvent.dragSource.type === dragAndDropService_1.DragSourceType.ToolPanel;
|
29360 | if (dragCameFromToolPanel) {
|
29361 |
|
29362 | this.setColumnsVisible(columns, true, "uiColumnDragged");
|
29363 | }
|
29364 | else {
|
29365 |
|
29366 |
|
29367 |
|
29368 |
|
29369 | var visibleState_1 = draggingEvent.dragItem.visibleState;
|
29370 | var visibleColumns = columns.filter(function (column) { return visibleState_1[column.getId()]; });
|
29371 | this.setColumnsVisible(visibleColumns, true, "uiColumnDragged");
|
29372 | }
|
29373 | this.setColumnsPinned(columns, this.pinned, "uiColumnDragged");
|
29374 | this.onDragging(draggingEvent, true);
|
29375 | };
|
29376 | MoveColumnController.prototype.onDragLeave = function (draggingEvent) {
|
29377 | var hideColumnOnExit = !this.gridOptionsWrapper.isSuppressDragLeaveHidesColumns() && !draggingEvent.fromNudge;
|
29378 | if (hideColumnOnExit) {
|
29379 | var dragItem = draggingEvent.dragSource.dragItemCallback();
|
29380 | var columns = dragItem.columns;
|
29381 | this.setColumnsVisible(columns, false, "uiColumnDragged");
|
29382 | }
|
29383 | this.ensureIntervalCleared();
|
29384 | };
|
29385 | MoveColumnController.prototype.setColumnsVisible = function (columns, visible, source) {
|
29386 | if (source === void 0) { source = "api"; }
|
29387 | if (columns) {
|
29388 | var allowedCols = columns.filter(function (c) { return !c.isLockVisible(); });
|
29389 | this.columnController.setColumnsVisible(allowedCols, visible, source);
|
29390 | }
|
29391 | };
|
29392 | MoveColumnController.prototype.setColumnsPinned = function (columns, pinned, source) {
|
29393 | if (source === void 0) { source = "api"; }
|
29394 | if (columns) {
|
29395 | var allowedCols = columns.filter(function (c) { return !c.isLockPinned(); });
|
29396 | this.columnController.setColumnsPinned(allowedCols, pinned, source);
|
29397 | }
|
29398 | };
|
29399 | MoveColumnController.prototype.onDragStop = function () {
|
29400 | this.ensureIntervalCleared();
|
29401 | };
|
29402 | MoveColumnController.prototype.normaliseX = function (x) {
|
29403 |
|
29404 | var flipHorizontallyForRtl = this.gridOptionsWrapper.isEnableRtl();
|
29405 | if (flipHorizontallyForRtl) {
|
29406 | var clientWidth = this.eContainer.clientWidth;
|
29407 | x = clientWidth - x;
|
29408 | }
|
29409 |
|
29410 | var adjustForScroll = this.centerContainer;
|
29411 | if (adjustForScroll) {
|
29412 | x += this.gridPanel.getBodyViewportScrollLeft();
|
29413 | }
|
29414 | return x;
|
29415 | };
|
29416 | MoveColumnController.prototype.checkCenterForScrolling = function (xAdjustedForScroll) {
|
29417 | if (this.centerContainer) {
|
29418 |
|
29419 |
|
29420 | var firstVisiblePixel = this.gridPanel.getBodyViewportScrollLeft();
|
29421 | var lastVisiblePixel = firstVisiblePixel + this.gridPanel.getCenterWidth();
|
29422 | if (this.gridOptionsWrapper.isEnableRtl()) {
|
29423 | this.needToMoveRight = xAdjustedForScroll < (firstVisiblePixel + 50);
|
29424 | this.needToMoveLeft = xAdjustedForScroll > (lastVisiblePixel - 50);
|
29425 | }
|
29426 | else {
|
29427 | this.needToMoveLeft = xAdjustedForScroll < (firstVisiblePixel + 50);
|
29428 | this.needToMoveRight = xAdjustedForScroll > (lastVisiblePixel - 50);
|
29429 | }
|
29430 | if (this.needToMoveLeft || this.needToMoveRight) {
|
29431 | this.ensureIntervalStarted();
|
29432 | }
|
29433 | else {
|
29434 | this.ensureIntervalCleared();
|
29435 | }
|
29436 | }
|
29437 | };
|
29438 | MoveColumnController.prototype.onDragging = function (draggingEvent, fromEnter) {
|
29439 | var _this = this;
|
29440 | if (fromEnter === void 0) { fromEnter = false; }
|
29441 | this.lastDraggingEvent = draggingEvent;
|
29442 |
|
29443 | if (utils_1.Utils.missing(draggingEvent.hDirection)) {
|
29444 | return;
|
29445 | }
|
29446 | var xNormalised = this.normaliseX(draggingEvent.x);
|
29447 |
|
29448 |
|
29449 |
|
29450 | if (!fromEnter) {
|
29451 | this.checkCenterForScrolling(xNormalised);
|
29452 | }
|
29453 | var hDirectionNormalised = this.normaliseDirection(draggingEvent.hDirection);
|
29454 | var dragSourceType = draggingEvent.dragSource.type;
|
29455 | var columnsToMove = draggingEvent.dragSource.dragItemCallback().columns;
|
29456 | columnsToMove = columnsToMove.filter(function (col) {
|
29457 | if (col.isLockPinned()) {
|
29458 |
|
29459 |
|
29460 | return col.getPinned() == _this.pinned;
|
29461 | }
|
29462 | else {
|
29463 |
|
29464 | return true;
|
29465 | }
|
29466 | });
|
29467 | this.attemptMoveColumns(dragSourceType, columnsToMove, hDirectionNormalised, xNormalised, fromEnter);
|
29468 | };
|
29469 | MoveColumnController.prototype.normaliseDirection = function (hDirection) {
|
29470 | if (this.gridOptionsWrapper.isEnableRtl()) {
|
29471 | switch (hDirection) {
|
29472 | case dragAndDropService_1.HDirection.Left: return dragAndDropService_1.HDirection.Right;
|
29473 | case dragAndDropService_1.HDirection.Right: return dragAndDropService_1.HDirection.Left;
|
29474 | default: console.error("ag-Grid: Unknown direction " + hDirection);
|
29475 | }
|
29476 | }
|
29477 | else {
|
29478 | return hDirection;
|
29479 | }
|
29480 | };
|
29481 |
|
29482 |
|
29483 | MoveColumnController.prototype.calculateOldIndex = function (movingCols) {
|
29484 | var gridCols = this.columnController.getAllGridColumns();
|
29485 | var indexes = [];
|
29486 | movingCols.forEach(function (col) { return indexes.push(gridCols.indexOf(col)); });
|
29487 | utils_1.Utils.sortNumberArray(indexes);
|
29488 | var firstIndex = indexes[0];
|
29489 | var lastIndex = indexes[indexes.length - 1];
|
29490 | var spread = lastIndex - firstIndex;
|
29491 | var gapsExist = spread !== indexes.length - 1;
|
29492 | return gapsExist ? null : firstIndex;
|
29493 | };
|
29494 | MoveColumnController.prototype.attemptMoveColumns = function (dragSourceType, allMovingColumns, hDirection, xAdjusted, fromEnter) {
|
29495 | var draggingLeft = hDirection === dragAndDropService_1.HDirection.Left;
|
29496 | var draggingRight = hDirection === dragAndDropService_1.HDirection.Right;
|
29497 | var validMoves = this.calculateValidMoves(allMovingColumns, draggingRight, xAdjusted);
|
29498 |
|
29499 |
|
29500 | var oldIndex = this.calculateOldIndex(allMovingColumns);
|
29501 |
|
29502 | for (var i = 0; i < validMoves.length; i++) {
|
29503 | var newIndex = validMoves[i];
|
29504 |
|
29505 |
|
29506 |
|
29507 |
|
29508 |
|
29509 |
|
29510 |
|
29511 |
|
29512 | var constrainDirection = oldIndex !== null && !fromEnter;
|
29513 |
|
29514 | if (dragSourceType == dragAndDropService_1.DragSourceType.HeaderCell) {
|
29515 | constrainDirection = oldIndex !== null;
|
29516 | }
|
29517 | if (constrainDirection) {
|
29518 |
|
29519 | if (draggingLeft && newIndex >= oldIndex) {
|
29520 | continue;
|
29521 | }
|
29522 |
|
29523 | if (draggingRight && newIndex <= oldIndex) {
|
29524 | continue;
|
29525 | }
|
29526 | }
|
29527 | if (!this.columnController.doesMovePassRules(allMovingColumns, newIndex)) {
|
29528 | continue;
|
29529 | }
|
29530 | this.columnController.moveColumns(allMovingColumns, newIndex, "uiColumnDragged");
|
29531 |
|
29532 | return;
|
29533 | }
|
29534 | };
|
29535 | MoveColumnController.prototype.calculateValidMoves = function (movingCols, draggingRight, x) {
|
29536 |
|
29537 | var allDisplayedCols = this.columnController.getDisplayedColumns(this.pinned);
|
29538 |
|
29539 |
|
29540 | var allGridCols = this.columnController.getAllGridColumns();
|
29541 | var colIsMovingFunc = function (col) { return movingCols.indexOf(col) >= 0; };
|
29542 | var colIsNotMovingFunc = function (col) { return movingCols.indexOf(col) < 0; };
|
29543 | var movingDisplayedCols = allDisplayedCols.filter(colIsMovingFunc);
|
29544 | var otherDisplayedCols = allDisplayedCols.filter(colIsNotMovingFunc);
|
29545 | var otherGridCols = allGridCols.filter(colIsNotMovingFunc);
|
29546 |
|
29547 |
|
29548 |
|
29549 | var displayIndex = 0;
|
29550 | var availableWidth = x;
|
29551 |
|
29552 |
|
29553 | if (draggingRight) {
|
29554 | var widthOfMovingDisplayedCols_1 = 0;
|
29555 | movingDisplayedCols.forEach(function (col) { return widthOfMovingDisplayedCols_1 += col.getActualWidth(); });
|
29556 | availableWidth -= widthOfMovingDisplayedCols_1;
|
29557 | }
|
29558 |
|
29559 | for (var i = 0; i < otherDisplayedCols.length; i++) {
|
29560 | var col = otherDisplayedCols[i];
|
29561 | availableWidth -= col.getActualWidth();
|
29562 | if (availableWidth < 0) {
|
29563 | break;
|
29564 | }
|
29565 | displayIndex++;
|
29566 | }
|
29567 |
|
29568 | if (draggingRight) {
|
29569 | displayIndex++;
|
29570 | }
|
29571 |
|
29572 |
|
29573 | var gridColIndex;
|
29574 | if (displayIndex > 0) {
|
29575 | var leftColumn = otherDisplayedCols[displayIndex - 1];
|
29576 | gridColIndex = otherGridCols.indexOf(leftColumn) + 1;
|
29577 | }
|
29578 | else {
|
29579 | gridColIndex = 0;
|
29580 | }
|
29581 | var validMoves = [gridColIndex];
|
29582 |
|
29583 |
|
29584 |
|
29585 |
|
29586 | var nextCol = allGridCols[gridColIndex];
|
29587 | while (utils_1.Utils.exists(nextCol) && this.isColumnHidden(allDisplayedCols, nextCol)) {
|
29588 | gridColIndex++;
|
29589 | validMoves.push(gridColIndex);
|
29590 | nextCol = allGridCols[gridColIndex];
|
29591 | }
|
29592 | return validMoves;
|
29593 | };
|
29594 |
|
29595 | MoveColumnController.prototype.isColumnHidden = function (displayedColumns, col) {
|
29596 | return displayedColumns.indexOf(col) < 0;
|
29597 | };
|
29598 | MoveColumnController.prototype.ensureIntervalStarted = function () {
|
29599 | if (!this.movingIntervalId) {
|
29600 | this.intervalCount = 0;
|
29601 | this.failedMoveAttempts = 0;
|
29602 | this.movingIntervalId = setInterval(this.moveInterval.bind(this), 100);
|
29603 | if (this.needToMoveLeft) {
|
29604 | this.dragAndDropService.setGhostIcon(dragAndDropService_1.DragAndDropService.ICON_LEFT, true);
|
29605 | }
|
29606 | else {
|
29607 | this.dragAndDropService.setGhostIcon(dragAndDropService_1.DragAndDropService.ICON_RIGHT, true);
|
29608 | }
|
29609 | }
|
29610 | };
|
29611 | MoveColumnController.prototype.ensureIntervalCleared = function () {
|
29612 | if (this.moveInterval) {
|
29613 | clearInterval(this.movingIntervalId);
|
29614 | this.movingIntervalId = null;
|
29615 | this.dragAndDropService.setGhostIcon(dragAndDropService_1.DragAndDropService.ICON_MOVE);
|
29616 | }
|
29617 | };
|
29618 | MoveColumnController.prototype.moveInterval = function () {
|
29619 |
|
29620 |
|
29621 | var pixelsToMove;
|
29622 | this.intervalCount++;
|
29623 | pixelsToMove = 10 + (this.intervalCount * 5);
|
29624 | if (pixelsToMove > 100) {
|
29625 | pixelsToMove = 100;
|
29626 | }
|
29627 | var pixelsMoved;
|
29628 | if (this.needToMoveLeft) {
|
29629 | pixelsMoved = this.gridPanel.scrollHorizontally(-pixelsToMove);
|
29630 | }
|
29631 | else if (this.needToMoveRight) {
|
29632 | pixelsMoved = this.gridPanel.scrollHorizontally(pixelsToMove);
|
29633 | }
|
29634 | if (pixelsMoved !== 0) {
|
29635 | this.onDragging(this.lastDraggingEvent);
|
29636 | this.failedMoveAttempts = 0;
|
29637 | }
|
29638 | else {
|
29639 |
|
29640 |
|
29641 | this.failedMoveAttempts++;
|
29642 | var columns = this.lastDraggingEvent.dragItem.columns;
|
29643 | var columnsThatCanPin = columns.filter(function (c) { return !c.isLockPinned(); });
|
29644 | if (columnsThatCanPin.length > 0) {
|
29645 | this.dragAndDropService.setGhostIcon(dragAndDropService_1.DragAndDropService.ICON_PINNED);
|
29646 | if (this.failedMoveAttempts > 7) {
|
29647 | var pinType = this.needToMoveLeft ? column_1.Column.PINNED_LEFT : column_1.Column.PINNED_RIGHT;
|
29648 | this.setColumnsPinned(columnsThatCanPin, pinType, "uiColumnDragged");
|
29649 | this.dragAndDropService.nudge();
|
29650 | }
|
29651 | }
|
29652 | }
|
29653 | };
|
29654 | __decorate([
|
29655 | context_1.Autowired('loggerFactory'),
|
29656 | __metadata("design:type", logger_1.LoggerFactory)
|
29657 | ], MoveColumnController.prototype, "loggerFactory", void 0);
|
29658 | __decorate([
|
29659 | context_1.Autowired('columnController'),
|
29660 | __metadata("design:type", columnController_1.ColumnController)
|
29661 | ], MoveColumnController.prototype, "columnController", void 0);
|
29662 | __decorate([
|
29663 | context_1.Autowired('dragAndDropService'),
|
29664 | __metadata("design:type", dragAndDropService_1.DragAndDropService)
|
29665 | ], MoveColumnController.prototype, "dragAndDropService", void 0);
|
29666 | __decorate([
|
29667 | context_1.Autowired('gridOptionsWrapper'),
|
29668 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
29669 | ], MoveColumnController.prototype, "gridOptionsWrapper", void 0);
|
29670 | __decorate([
|
29671 | context_1.PostConstruct,
|
29672 | __metadata("design:type", Function),
|
29673 | __metadata("design:paramtypes", []),
|
29674 | __metadata("design:returntype", void 0)
|
29675 | ], MoveColumnController.prototype, "init", null);
|
29676 | return MoveColumnController;
|
29677 | }());
|
29678 | exports.MoveColumnController = MoveColumnController;
|
29679 |
|
29680 |
|
29681 | }),
|
29682 |
|
29683 | (function(module, exports, __webpack_require__) {
|
29684 |
|
29685 | "use strict";
|
29686 |
|
29687 |
|
29688 |
|
29689 |
|
29690 |
|
29691 |
|
29692 |
|
29693 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
29694 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
29695 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
29696 | 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;
|
29697 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
29698 | };
|
29699 | var __metadata = (this && this.__metadata) || function (k, v) {
|
29700 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
29701 | };
|
29702 | Object.defineProperty(exports, "__esModule", { value: true });
|
29703 | var dragAndDropService_1 = __webpack_require__(14);
|
29704 | var columnController_1 = __webpack_require__(4);
|
29705 | var context_1 = __webpack_require__(0);
|
29706 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
29707 | var BodyDropPivotTarget = (function () {
|
29708 | function BodyDropPivotTarget(pinned) {
|
29709 | this.columnsToAggregate = [];
|
29710 | this.columnsToGroup = [];
|
29711 | this.columnsToPivot = [];
|
29712 | this.pinned = pinned;
|
29713 | }
|
29714 |
|
29715 | BodyDropPivotTarget.prototype.onDragEnter = function (draggingEvent) {
|
29716 | var _this = this;
|
29717 | this.clearColumnsList();
|
29718 |
|
29719 | if (this.gridOptionsWrapper.isFunctionsReadOnly()) {
|
29720 | return;
|
29721 | }
|
29722 | var dragColumns = draggingEvent.dragItem.columns;
|
29723 | dragColumns.forEach(function (column) {
|
29724 |
|
29725 | if (!column.isPrimary()) {
|
29726 | return;
|
29727 | }
|
29728 | if (column.isAnyFunctionActive()) {
|
29729 | return;
|
29730 | }
|
29731 | if (column.isAllowValue()) {
|
29732 | _this.columnsToAggregate.push(column);
|
29733 | }
|
29734 | else if (column.isAllowRowGroup()) {
|
29735 | _this.columnsToGroup.push(column);
|
29736 | }
|
29737 | else if (column.isAllowRowGroup()) {
|
29738 | _this.columnsToPivot.push(column);
|
29739 | }
|
29740 | });
|
29741 | };
|
29742 | BodyDropPivotTarget.prototype.getIconName = function () {
|
29743 | var totalColumns = this.columnsToAggregate.length + this.columnsToGroup.length + this.columnsToPivot.length;
|
29744 | if (totalColumns > 0) {
|
29745 | return this.pinned ? dragAndDropService_1.DragAndDropService.ICON_PINNED : dragAndDropService_1.DragAndDropService.ICON_MOVE;
|
29746 | }
|
29747 | else {
|
29748 | return null;
|
29749 | }
|
29750 | };
|
29751 |
|
29752 | BodyDropPivotTarget.prototype.onDragLeave = function (draggingEvent) {
|
29753 |
|
29754 | this.clearColumnsList();
|
29755 | };
|
29756 | BodyDropPivotTarget.prototype.clearColumnsList = function () {
|
29757 | this.columnsToAggregate.length = 0;
|
29758 | this.columnsToGroup.length = 0;
|
29759 | this.columnsToPivot.length = 0;
|
29760 | };
|
29761 |
|
29762 | BodyDropPivotTarget.prototype.onDragging = function (draggingEvent) {
|
29763 | };
|
29764 |
|
29765 | BodyDropPivotTarget.prototype.onDragStop = function (draggingEvent) {
|
29766 | if (this.columnsToAggregate.length > 0) {
|
29767 | this.columnController.addValueColumns(this.columnsToAggregate, "toolPanelDragAndDrop");
|
29768 | }
|
29769 | if (this.columnsToGroup.length > 0) {
|
29770 | this.columnController.addRowGroupColumns(this.columnsToGroup, "toolPanelDragAndDrop");
|
29771 | }
|
29772 | if (this.columnsToPivot.length > 0) {
|
29773 | this.columnController.addPivotColumns(this.columnsToPivot, "toolPanelDragAndDrop");
|
29774 | }
|
29775 | };
|
29776 | __decorate([
|
29777 | context_1.Autowired('columnController'),
|
29778 | __metadata("design:type", columnController_1.ColumnController)
|
29779 | ], BodyDropPivotTarget.prototype, "columnController", void 0);
|
29780 | __decorate([
|
29781 | context_1.Autowired('gridOptionsWrapper'),
|
29782 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
29783 | ], BodyDropPivotTarget.prototype, "gridOptionsWrapper", void 0);
|
29784 | return BodyDropPivotTarget;
|
29785 | }());
|
29786 | exports.BodyDropPivotTarget = BodyDropPivotTarget;
|
29787 |
|
29788 |
|
29789 | }),
|
29790 |
|
29791 | (function(module, exports, __webpack_require__) {
|
29792 |
|
29793 | "use strict";
|
29794 |
|
29795 |
|
29796 |
|
29797 |
|
29798 |
|
29799 |
|
29800 |
|
29801 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
29802 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
29803 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
29804 | 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;
|
29805 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
29806 | };
|
29807 | var __metadata = (this && this.__metadata) || function (k, v) {
|
29808 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
29809 | };
|
29810 | Object.defineProperty(exports, "__esModule", { value: true });
|
29811 | var context_1 = __webpack_require__(0);
|
29812 | var column_1 = __webpack_require__(10);
|
29813 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
29814 | var utils_1 = __webpack_require__(1);
|
29815 | var columnController_1 = __webpack_require__(4);
|
29816 | var balancedColumnTreeBuilder_1 = __webpack_require__(38);
|
29817 | var AutoGroupColService = (function () {
|
29818 | function AutoGroupColService() {
|
29819 | }
|
29820 | AutoGroupColService_1 = AutoGroupColService;
|
29821 | AutoGroupColService.prototype.createAutoGroupColumns = function (rowGroupColumns) {
|
29822 | var _this = this;
|
29823 | var groupAutoColumns = [];
|
29824 | var doingTreeData = this.gridOptionsWrapper.isTreeData();
|
29825 | var doingMultiAutoColumn = this.gridOptionsWrapper.isGroupMultiAutoColumn();
|
29826 | if (doingTreeData && doingMultiAutoColumn) {
|
29827 | console.log('ag-Grid: you cannot mix groupMultiAutoColumn with treeData, only one column can be used to display groups when doing tree data');
|
29828 | doingMultiAutoColumn = false;
|
29829 | }
|
29830 |
|
29831 |
|
29832 | if (doingMultiAutoColumn) {
|
29833 | rowGroupColumns.forEach(function (rowGroupCol, index) {
|
29834 | groupAutoColumns.push(_this.createOneAutoGroupColumn(rowGroupCol, index));
|
29835 | });
|
29836 | }
|
29837 | else {
|
29838 | groupAutoColumns.push(this.createOneAutoGroupColumn(null));
|
29839 | }
|
29840 | return groupAutoColumns;
|
29841 | };
|
29842 |
|
29843 | AutoGroupColService.prototype.createOneAutoGroupColumn = function (rowGroupCol, index) {
|
29844 |
|
29845 | var defaultAutoColDef = this.generateDefaultColDef(rowGroupCol);
|
29846 |
|
29847 | var colId;
|
29848 | if (rowGroupCol) {
|
29849 | colId = AutoGroupColService_1.GROUP_AUTO_COLUMN_ID + "-" + rowGroupCol.getId();
|
29850 | }
|
29851 | else {
|
29852 | colId = AutoGroupColService_1.GROUP_AUTO_COLUMN_BUNDLE_ID;
|
29853 | }
|
29854 | var userAutoColDef = this.gridOptionsWrapper.getAutoGroupColumnDef();
|
29855 | utils_1._.mergeDeep(defaultAutoColDef, userAutoColDef);
|
29856 | defaultAutoColDef = this.balancedColumnTreeBuilder.mergeColDefs(defaultAutoColDef);
|
29857 | defaultAutoColDef.colId = colId;
|
29858 |
|
29859 | if (!this.gridOptionsWrapper.isTreeData()) {
|
29860 |
|
29861 |
|
29862 | var noFieldOrValueGetter = utils_1._.missing(defaultAutoColDef.field) && utils_1._.missing(defaultAutoColDef.valueGetter) && utils_1._.missing(defaultAutoColDef.filterValueGetter);
|
29863 | if (noFieldOrValueGetter) {
|
29864 | defaultAutoColDef.suppressFilter = true;
|
29865 | }
|
29866 | }
|
29867 |
|
29868 | if (index > 0) {
|
29869 | defaultAutoColDef.headerCheckboxSelection = false;
|
29870 | }
|
29871 | var newCol = new column_1.Column(defaultAutoColDef, colId, true);
|
29872 | this.context.wireBean(newCol);
|
29873 | return newCol;
|
29874 | };
|
29875 | AutoGroupColService.prototype.generateDefaultColDef = function (rowGroupCol) {
|
29876 | var localeTextFunc = this.gridOptionsWrapper.getLocaleTextFunc();
|
29877 | var defaultAutoColDef = {
|
29878 | headerName: localeTextFunc('group', 'Group'),
|
29879 | cellRenderer: 'agGroupCellRenderer'
|
29880 | };
|
29881 |
|
29882 |
|
29883 | if (rowGroupCol) {
|
29884 | var rowGroupColDef = rowGroupCol.getColDef();
|
29885 | utils_1._.assign(defaultAutoColDef, {
|
29886 |
|
29887 | headerName: this.columnController.getDisplayNameForColumn(rowGroupCol, 'header'),
|
29888 | headerValueGetter: rowGroupColDef.headerValueGetter
|
29889 | });
|
29890 | if (rowGroupColDef.cellRenderer) {
|
29891 | utils_1._.assign(defaultAutoColDef, {
|
29892 | cellRendererParams: {
|
29893 | innerRenderer: rowGroupColDef.cellRenderer,
|
29894 | innerRendererParams: rowGroupColDef.cellRendererParams
|
29895 | }
|
29896 | });
|
29897 | }
|
29898 | defaultAutoColDef.showRowGroup = rowGroupCol.getColId();
|
29899 | }
|
29900 | else {
|
29901 | defaultAutoColDef.showRowGroup = true;
|
29902 | }
|
29903 | return defaultAutoColDef;
|
29904 | };
|
29905 | AutoGroupColService.GROUP_AUTO_COLUMN_ID = 'ag-Grid-AutoColumn';
|
29906 | AutoGroupColService.GROUP_AUTO_COLUMN_BUNDLE_ID = AutoGroupColService_1.GROUP_AUTO_COLUMN_ID;
|
29907 | __decorate([
|
29908 | context_1.Autowired('gridOptionsWrapper'),
|
29909 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
29910 | ], AutoGroupColService.prototype, "gridOptionsWrapper", void 0);
|
29911 | __decorate([
|
29912 | context_1.Autowired('context'),
|
29913 | __metadata("design:type", context_1.Context)
|
29914 | ], AutoGroupColService.prototype, "context", void 0);
|
29915 | __decorate([
|
29916 | context_1.Autowired('columnController'),
|
29917 | __metadata("design:type", columnController_1.ColumnController)
|
29918 | ], AutoGroupColService.prototype, "columnController", void 0);
|
29919 | __decorate([
|
29920 | context_1.Autowired('balancedColumnTreeBuilder'),
|
29921 | __metadata("design:type", balancedColumnTreeBuilder_1.BalancedColumnTreeBuilder)
|
29922 | ], AutoGroupColService.prototype, "balancedColumnTreeBuilder", void 0);
|
29923 | AutoGroupColService = AutoGroupColService_1 = __decorate([
|
29924 | context_1.Bean('autoGroupColService')
|
29925 | ], AutoGroupColService);
|
29926 | return AutoGroupColService;
|
29927 | var AutoGroupColService_1;
|
29928 | }());
|
29929 | exports.AutoGroupColService = AutoGroupColService;
|
29930 |
|
29931 |
|
29932 | }),
|
29933 |
|
29934 | (function(module, exports, __webpack_require__) {
|
29935 |
|
29936 | "use strict";
|
29937 |
|
29938 |
|
29939 |
|
29940 |
|
29941 |
|
29942 |
|
29943 |
|
29944 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
29945 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
29946 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
29947 | 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;
|
29948 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
29949 | };
|
29950 | var __metadata = (this && this.__metadata) || function (k, v) {
|
29951 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
29952 | };
|
29953 | Object.defineProperty(exports, "__esModule", { value: true });
|
29954 | var context_1 = __webpack_require__(0);
|
29955 | var constants_1 = __webpack_require__(9);
|
29956 | var utils_1 = __webpack_require__(1);
|
29957 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
29958 | var ImmutableService = (function () {
|
29959 | function ImmutableService() {
|
29960 | }
|
29961 | ImmutableService.prototype.postConstruct = function () {
|
29962 | if (this.rowModel.getType() === constants_1.Constants.ROW_MODEL_TYPE_CLIENT_SIDE) {
|
29963 | this.clientSideRowModel = this.rowModel;
|
29964 | }
|
29965 | };
|
29966 |
|
29967 | ImmutableService.prototype.createTransactionForRowData = function (data) {
|
29968 | if (utils_1._.missing(this.clientSideRowModel)) {
|
29969 | console.error('ag-Grid: ImmutableService only works with ClientSideRowModel');
|
29970 | return;
|
29971 | }
|
29972 | var getRowNodeIdFunc = this.gridOptionsWrapper.getRowNodeIdFunc();
|
29973 | if (utils_1._.missing(getRowNodeIdFunc)) {
|
29974 | console.error('ag-Grid: ImmutableService requires getRowNodeId() callback to be implemented, your row data need IDs!');
|
29975 | return;
|
29976 | }
|
29977 |
|
29978 | var transaction = {
|
29979 | remove: [],
|
29980 | update: [],
|
29981 | add: []
|
29982 | };
|
29983 | var existingNodesMap = this.clientSideRowModel.getCopyOfNodesMap();
|
29984 | var orderMap = {};
|
29985 | if (utils_1._.exists(data)) {
|
29986 |
|
29987 |
|
29988 |
|
29989 |
|
29990 | data.forEach(function (dataItem, index) {
|
29991 | var id = getRowNodeIdFunc(dataItem);
|
29992 | var existingNode = existingNodesMap[id];
|
29993 | orderMap[id] = index;
|
29994 | if (existingNode) {
|
29995 | var dataHasChanged = existingNode.data !== dataItem;
|
29996 | if (dataHasChanged) {
|
29997 | transaction.update.push(dataItem);
|
29998 | }
|
29999 |
|
30000 |
|
30001 | existingNodesMap[id] = undefined;
|
30002 | }
|
30003 | else {
|
30004 | transaction.add.push(dataItem);
|
30005 | }
|
30006 | });
|
30007 | }
|
30008 |
|
30009 | utils_1._.iterateObject(existingNodesMap, function (id, rowNode) {
|
30010 | if (rowNode) {
|
30011 | transaction.remove.push(rowNode.data);
|
30012 | }
|
30013 | });
|
30014 | return [transaction, orderMap];
|
30015 | };
|
30016 | __decorate([
|
30017 | context_1.Autowired('rowModel'),
|
30018 | __metadata("design:type", Object)
|
30019 | ], ImmutableService.prototype, "rowModel", void 0);
|
30020 | __decorate([
|
30021 | context_1.Autowired('gridOptionsWrapper'),
|
30022 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
30023 | ], ImmutableService.prototype, "gridOptionsWrapper", void 0);
|
30024 | __decorate([
|
30025 | context_1.PostConstruct,
|
30026 | __metadata("design:type", Function),
|
30027 | __metadata("design:paramtypes", []),
|
30028 | __metadata("design:returntype", void 0)
|
30029 | ], ImmutableService.prototype, "postConstruct", null);
|
30030 | ImmutableService = __decorate([
|
30031 | context_1.Bean('immutableService')
|
30032 | ], ImmutableService);
|
30033 | return ImmutableService;
|
30034 | }());
|
30035 | exports.ImmutableService = ImmutableService;
|
30036 |
|
30037 |
|
30038 | }),
|
30039 |
|
30040 | (function(module, exports, __webpack_require__) {
|
30041 |
|
30042 | "use strict";
|
30043 |
|
30044 |
|
30045 |
|
30046 |
|
30047 |
|
30048 |
|
30049 |
|
30050 | Object.defineProperty(exports, "__esModule", { value: true });
|
30051 | var ColDefUtil = (function () {
|
30052 | function ColDefUtil() {
|
30053 | }
|
30054 | ColDefUtil.STRING_PROPERTIES = [
|
30055 | 'headerName',
|
30056 | 'columnGroupShow',
|
30057 | 'headerClass',
|
30058 | 'toolPanelClass',
|
30059 | 'headerValueGetter',
|
30060 | 'pivotKeys',
|
30061 | 'groupId',
|
30062 | 'colId',
|
30063 | 'sort',
|
30064 | 'field',
|
30065 | 'type',
|
30066 | 'tooltipField',
|
30067 | 'headerTooltip',
|
30068 | 'cellClass',
|
30069 | 'showRowGroup',
|
30070 | 'template',
|
30071 | 'templateUrl',
|
30072 | 'filter',
|
30073 | 'aggFunc',
|
30074 | 'cellRenderer',
|
30075 | 'cellEditor',
|
30076 | 'pinned'
|
30077 | ];
|
30078 | ColDefUtil.OBJECT_PROPERTIES = [
|
30079 | 'headerGroupComponent',
|
30080 | 'headerGroupComponentFramework',
|
30081 | 'headerGroupComponentParams',
|
30082 | 'cellStyle',
|
30083 | 'cellRendererParams',
|
30084 | 'cellEditorFramework',
|
30085 | 'cellEditorParams',
|
30086 | 'pinnedRowCellRendererFramework',
|
30087 | 'pinnedRowCellRendererParams',
|
30088 | 'filterFramework',
|
30089 | 'filterParams',
|
30090 | 'pivotValueColumn',
|
30091 | 'headerComponent',
|
30092 | 'headerComponentFramework',
|
30093 | 'headerComponentParams',
|
30094 | 'floatingFilterComponent',
|
30095 | 'floatingFilterComponentParams',
|
30096 | 'floatingFilterComponentFramework',
|
30097 | 'refData'
|
30098 | ];
|
30099 | ColDefUtil.ARRAY_PROPERTIES = [
|
30100 | 'children',
|
30101 | 'sortingOrder',
|
30102 | 'allowedAggFuncs',
|
30103 | 'menuTabs',
|
30104 | 'pivotTotalColumnIds',
|
30105 | 'cellClassRules',
|
30106 | 'icons'
|
30107 | ];
|
30108 | ColDefUtil.NUMBER_PROPERTIES = [
|
30109 | 'sortedAt',
|
30110 | 'width',
|
30111 | 'minWidth',
|
30112 | 'maxWidth',
|
30113 | 'rowGroupIndex',
|
30114 | 'pivotIndex'
|
30115 | ];
|
30116 | ColDefUtil.BOOLEAN_PROPERTIES = [
|
30117 | 'suppressCellFlash',
|
30118 | 'suppressToolPanel',
|
30119 | 'openByDefault',
|
30120 | 'marryChildren',
|
30121 | 'hide',
|
30122 | 'rowGroup',
|
30123 | 'pivot',
|
30124 | 'checkboxSelection',
|
30125 | 'headerCheckboxSelection',
|
30126 | 'headerCheckboxSelectionFilteredOnly',
|
30127 | 'suppressMenu',
|
30128 | 'suppressSorting',
|
30129 | 'suppressMovable',
|
30130 | 'suppressFilter',
|
30131 | 'lockPosition',
|
30132 | 'lockVisible',
|
30133 | 'lockPinned',
|
30134 | 'unSortIcon',
|
30135 | 'suppressSizeToFit',
|
30136 | 'suppressResize',
|
30137 | 'suppressAutoSize',
|
30138 | 'enableRowGroup',
|
30139 | 'enablePivot',
|
30140 | 'enableValue',
|
30141 | 'editable',
|
30142 | 'suppressPaste',
|
30143 | 'suppressNavigable',
|
30144 | 'enableCellChangeFlash',
|
30145 | 'rowDrag',
|
30146 | 'autoHeight'
|
30147 | ];
|
30148 | ColDefUtil.FUNCTION_PROPERTIES = [
|
30149 | 'valueGetter',
|
30150 | 'valueSetter',
|
30151 | 'filterValueGetter',
|
30152 | 'keyCreator',
|
30153 | 'cellRenderer',
|
30154 | 'cellRendererFramework',
|
30155 | 'pinnedRowCellRenderer',
|
30156 | 'valueFormatter',
|
30157 | 'pinnedRowValueFormatter',
|
30158 | 'valueParser',
|
30159 | 'comparator',
|
30160 | 'equals',
|
30161 | 'pivotComparator',
|
30162 | 'suppressKeyboardEvent',
|
30163 | 'colSpan',
|
30164 | 'rowSpan',
|
30165 | 'getQuickFilterText',
|
30166 | 'newValueHandler',
|
30167 | 'onCellValueChanged',
|
30168 | 'onCellClicked',
|
30169 | 'onCellDoubleClicked',
|
30170 | 'onCellContextMenu',
|
30171 | 'tooltip',
|
30172 | 'cellRendererSelector',
|
30173 | 'cellEditorSelector'
|
30174 | ];
|
30175 | ColDefUtil.ALL_PROPERTIES = ColDefUtil.ARRAY_PROPERTIES
|
30176 | .concat(ColDefUtil.OBJECT_PROPERTIES)
|
30177 | .concat(ColDefUtil.STRING_PROPERTIES)
|
30178 | .concat(ColDefUtil.NUMBER_PROPERTIES)
|
30179 | .concat(ColDefUtil.FUNCTION_PROPERTIES)
|
30180 | .concat(ColDefUtil.BOOLEAN_PROPERTIES);
|
30181 |
|
30182 |
|
30183 | ColDefUtil.FRAMEWORK_PROPERTIES = ['__ob__', '__metadata__', 'mappedColumnProperties', 'hasChildColumns',
|
30184 | 'toColDef', 'createColDefFromGridColumn'];
|
30185 | return ColDefUtil;
|
30186 | }());
|
30187 | exports.ColDefUtil = ColDefUtil;
|
30188 |
|
30189 |
|
30190 | }),
|
30191 |
|
30192 | (function(module, exports, __webpack_require__) {
|
30193 |
|
30194 | "use strict";
|
30195 |
|
30196 |
|
30197 |
|
30198 |
|
30199 |
|
30200 |
|
30201 |
|
30202 | Object.defineProperty(exports, "__esModule", { value: true });
|
30203 |
|
30204 |
|
30205 |
|
30206 |
|
30207 | var utils_1 = __webpack_require__(1);
|
30208 | var ColumnKeyCreator = (function () {
|
30209 | function ColumnKeyCreator() {
|
30210 | this.existingKeys = [];
|
30211 | }
|
30212 | ColumnKeyCreator.prototype.getUniqueKey = function (colId, colField) {
|
30213 |
|
30214 | colId = utils_1.Utils.toStringOrNull(colId);
|
30215 | var count = 0;
|
30216 | while (true) {
|
30217 | var idToTry = void 0;
|
30218 | if (colId) {
|
30219 | idToTry = colId;
|
30220 | if (count !== 0) {
|
30221 | idToTry += '_' + count;
|
30222 | }
|
30223 | }
|
30224 | else if (colField) {
|
30225 | idToTry = colField;
|
30226 | if (count !== 0) {
|
30227 | idToTry += '_' + count;
|
30228 | }
|
30229 | }
|
30230 | else {
|
30231 | idToTry = '' + count;
|
30232 | }
|
30233 | if (this.existingKeys.indexOf(idToTry) < 0) {
|
30234 | this.existingKeys.push(idToTry);
|
30235 | return idToTry;
|
30236 | }
|
30237 | count++;
|
30238 | }
|
30239 | };
|
30240 | return ColumnKeyCreator;
|
30241 | }());
|
30242 | exports.ColumnKeyCreator = ColumnKeyCreator;
|
30243 |
|
30244 |
|
30245 | }),
|
30246 |
|
30247 | (function(module, exports, __webpack_require__) {
|
30248 |
|
30249 | "use strict";
|
30250 |
|
30251 |
|
30252 |
|
30253 |
|
30254 |
|
30255 |
|
30256 |
|
30257 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
30258 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
30259 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
30260 | 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;
|
30261 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
30262 | };
|
30263 | var __metadata = (this && this.__metadata) || function (k, v) {
|
30264 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
30265 | };
|
30266 | Object.defineProperty(exports, "__esModule", { value: true });
|
30267 | var context_1 = __webpack_require__(0);
|
30268 | var filterManager_1 = __webpack_require__(18);
|
30269 | var utils_1 = __webpack_require__(1);
|
30270 | var popupService_1 = __webpack_require__(35);
|
30271 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
30272 | var eventService_1 = __webpack_require__(3);
|
30273 | var StandardMenuFactory = (function () {
|
30274 | function StandardMenuFactory() {
|
30275 | }
|
30276 | StandardMenuFactory.prototype.hideActiveMenu = function () {
|
30277 | if (this.hidePopup) {
|
30278 | this.hidePopup();
|
30279 | }
|
30280 | };
|
30281 | StandardMenuFactory.prototype.showMenuAfterMouseEvent = function (column, mouseEvent) {
|
30282 | var _this = this;
|
30283 | this.showPopup(column, function (eMenu) {
|
30284 | _this.popupService.positionPopupUnderMouseEvent({
|
30285 | column: column,
|
30286 | type: 'columnMenu',
|
30287 | mouseEvent: mouseEvent,
|
30288 | ePopup: eMenu
|
30289 | });
|
30290 | });
|
30291 | };
|
30292 | StandardMenuFactory.prototype.showMenuAfterButtonClick = function (column, eventSource) {
|
30293 | var _this = this;
|
30294 | this.showPopup(column, function (eMenu) {
|
30295 | _this.popupService.positionPopupUnderComponent({ type: 'columnMenu', eventSource: eventSource,
|
30296 | ePopup: eMenu, keepWithinBounds: true, column: column });
|
30297 | });
|
30298 | };
|
30299 | StandardMenuFactory.prototype.showPopup = function (column, positionCallback) {
|
30300 | var _this = this;
|
30301 | var filterWrapper = this.filterManager.getOrCreateFilterWrapper(column);
|
30302 | var eMenu = document.createElement('div');
|
30303 | utils_1.Utils.addCssClass(eMenu, 'ag-menu');
|
30304 | filterWrapper.guiPromise.promise.then(function (gui) {
|
30305 | eMenu.appendChild(gui);
|
30306 | });
|
30307 | var hidePopup;
|
30308 | var bodyScrollListener = function (event) {
|
30309 |
|
30310 | if (event.direction === 'horizontal') {
|
30311 | hidePopup();
|
30312 | }
|
30313 | };
|
30314 | this.eventService.addEventListener('bodyScroll', bodyScrollListener);
|
30315 | var closedCallback = function () {
|
30316 | _this.eventService.removeEventListener('bodyScroll', bodyScrollListener);
|
30317 | column.setMenuVisible(false, "contextMenu");
|
30318 | };
|
30319 |
|
30320 |
|
30321 | hidePopup = this.popupService.addAsModalPopup(eMenu, true, closedCallback);
|
30322 | positionCallback(eMenu);
|
30323 | filterWrapper.filterPromise.then(function (filter) {
|
30324 | if (filter.afterGuiAttached) {
|
30325 | var params = {
|
30326 | hidePopup: hidePopup
|
30327 | };
|
30328 | filter.afterGuiAttached(params);
|
30329 | }
|
30330 | });
|
30331 | this.hidePopup = hidePopup;
|
30332 | column.setMenuVisible(true, "contextMenu");
|
30333 | };
|
30334 | StandardMenuFactory.prototype.isMenuEnabled = function (column) {
|
30335 |
|
30336 | return this.gridOptionsWrapper.isEnableFilter() && column.isFilterAllowed();
|
30337 | };
|
30338 | __decorate([
|
30339 | context_1.Autowired('eventService'),
|
30340 | __metadata("design:type", eventService_1.EventService)
|
30341 | ], StandardMenuFactory.prototype, "eventService", void 0);
|
30342 | __decorate([
|
30343 | context_1.Autowired('filterManager'),
|
30344 | __metadata("design:type", filterManager_1.FilterManager)
|
30345 | ], StandardMenuFactory.prototype, "filterManager", void 0);
|
30346 | __decorate([
|
30347 | context_1.Autowired('popupService'),
|
30348 | __metadata("design:type", popupService_1.PopupService)
|
30349 | ], StandardMenuFactory.prototype, "popupService", void 0);
|
30350 | __decorate([
|
30351 | context_1.Autowired('gridOptionsWrapper'),
|
30352 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
30353 | ], StandardMenuFactory.prototype, "gridOptionsWrapper", void 0);
|
30354 | StandardMenuFactory = __decorate([
|
30355 | context_1.Bean('menuFactory')
|
30356 | ], StandardMenuFactory);
|
30357 | return StandardMenuFactory;
|
30358 | }());
|
30359 | exports.StandardMenuFactory = StandardMenuFactory;
|
30360 |
|
30361 |
|
30362 | }),
|
30363 |
|
30364 | (function(module, exports, __webpack_require__) {
|
30365 |
|
30366 | "use strict";
|
30367 |
|
30368 |
|
30369 |
|
30370 |
|
30371 |
|
30372 |
|
30373 |
|
30374 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
30375 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
30376 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
30377 | 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;
|
30378 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
30379 | };
|
30380 | var __metadata = (this && this.__metadata) || function (k, v) {
|
30381 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
30382 | };
|
30383 | Object.defineProperty(exports, "__esModule", { value: true });
|
30384 | var context_1 = __webpack_require__(0);
|
30385 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
30386 | var filterService_1 = __webpack_require__(110);
|
30387 | var selectableService_1 = __webpack_require__(86);
|
30388 | var FilterStage = (function () {
|
30389 | function FilterStage() {
|
30390 | }
|
30391 | FilterStage.prototype.execute = function (params) {
|
30392 | var rowNode = params.rowNode;
|
30393 | if (this.gridOptionsWrapper.isEnableServerSideFilter()) {
|
30394 | this.filterService.filter(rowNode, false);
|
30395 | }
|
30396 | else {
|
30397 | this.filterService.filterAccordingToColumnState(rowNode);
|
30398 | }
|
30399 | this.selectableService.updateSelectableAfterFiltering(rowNode);
|
30400 | };
|
30401 | __decorate([
|
30402 | context_1.Autowired('gridOptionsWrapper'),
|
30403 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
30404 | ], FilterStage.prototype, "gridOptionsWrapper", void 0);
|
30405 | __decorate([
|
30406 | context_1.Autowired('selectableService'),
|
30407 | __metadata("design:type", selectableService_1.SelectableService)
|
30408 | ], FilterStage.prototype, "selectableService", void 0);
|
30409 | __decorate([
|
30410 | context_1.Autowired('filterService'),
|
30411 | __metadata("design:type", filterService_1.FilterService)
|
30412 | ], FilterStage.prototype, "filterService", void 0);
|
30413 | FilterStage = __decorate([
|
30414 | context_1.Bean('filterStage')
|
30415 | ], FilterStage);
|
30416 | return FilterStage;
|
30417 | }());
|
30418 | exports.FilterStage = FilterStage;
|
30419 |
|
30420 |
|
30421 | }),
|
30422 |
|
30423 | (function(module, exports, __webpack_require__) {
|
30424 |
|
30425 | "use strict";
|
30426 |
|
30427 |
|
30428 |
|
30429 |
|
30430 |
|
30431 |
|
30432 |
|
30433 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
30434 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
30435 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
30436 | 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;
|
30437 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
30438 | };
|
30439 | var __metadata = (this && this.__metadata) || function (k, v) {
|
30440 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
30441 | };
|
30442 | Object.defineProperty(exports, "__esModule", { value: true });
|
30443 | var context_1 = __webpack_require__(0);
|
30444 | var filterManager_1 = __webpack_require__(18);
|
30445 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
30446 | var FilterService = (function () {
|
30447 | function FilterService() {
|
30448 | }
|
30449 | FilterService.prototype.postConstruct = function () {
|
30450 | this.doingTreeData = this.gridOptionsWrapper.isTreeData();
|
30451 | };
|
30452 | FilterService.prototype.filterAccordingToColumnState = function (rowNode) {
|
30453 | var filterActive = this.filterManager.isAnyFilterPresent();
|
30454 | this.filter(rowNode, filterActive);
|
30455 | };
|
30456 | FilterService.prototype.filter = function (rowNode, filterActive) {
|
30457 | var _this = this;
|
30458 |
|
30459 | if (rowNode.hasChildren()) {
|
30460 | rowNode.childrenAfterGroup.forEach(function (node) { return _this.filter(node, filterActive); });
|
30461 |
|
30462 | if (filterActive) {
|
30463 | rowNode.childrenAfterFilter = rowNode.childrenAfterGroup.filter(function (childNode) {
|
30464 |
|
30465 |
|
30466 | var passBecauseChildren = childNode.childrenAfterFilter && childNode.childrenAfterFilter.length > 0;
|
30467 |
|
30468 |
|
30469 | var passBecauseDataPasses = childNode.data && _this.filterManager.doesRowPassFilter(childNode);
|
30470 |
|
30471 | return passBecauseChildren || passBecauseDataPasses;
|
30472 | });
|
30473 | }
|
30474 | else {
|
30475 |
|
30476 | rowNode.childrenAfterFilter = rowNode.childrenAfterGroup;
|
30477 | }
|
30478 | this.setAllChildrenCount(rowNode);
|
30479 | }
|
30480 | else {
|
30481 | rowNode.childrenAfterFilter = rowNode.childrenAfterGroup;
|
30482 | rowNode.setAllChildrenCount(null);
|
30483 | }
|
30484 | };
|
30485 | FilterService.prototype.setAllChildrenCountTreeData = function (rowNode) {
|
30486 |
|
30487 | var allChildrenCount = 0;
|
30488 | rowNode.childrenAfterFilter.forEach(function (child) {
|
30489 |
|
30490 | allChildrenCount++;
|
30491 |
|
30492 | allChildrenCount += child.allChildrenCount;
|
30493 | });
|
30494 | rowNode.setAllChildrenCount(allChildrenCount);
|
30495 | };
|
30496 | FilterService.prototype.setAllChildrenCountGridGrouping = function (rowNode) {
|
30497 |
|
30498 | var allChildrenCount = 0;
|
30499 | rowNode.childrenAfterFilter.forEach(function (child) {
|
30500 | if (child.group) {
|
30501 | allChildrenCount += child.allChildrenCount;
|
30502 | }
|
30503 | else {
|
30504 | allChildrenCount++;
|
30505 | }
|
30506 | });
|
30507 | rowNode.setAllChildrenCount(allChildrenCount);
|
30508 | };
|
30509 | FilterService.prototype.setAllChildrenCount = function (rowNode) {
|
30510 | if (this.doingTreeData) {
|
30511 | this.setAllChildrenCountTreeData(rowNode);
|
30512 | }
|
30513 | else {
|
30514 | this.setAllChildrenCountGridGrouping(rowNode);
|
30515 | }
|
30516 | };
|
30517 | __decorate([
|
30518 | context_1.Autowired('filterManager'),
|
30519 | __metadata("design:type", filterManager_1.FilterManager)
|
30520 | ], FilterService.prototype, "filterManager", void 0);
|
30521 | __decorate([
|
30522 | context_1.Autowired('gridOptionsWrapper'),
|
30523 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
30524 | ], FilterService.prototype, "gridOptionsWrapper", void 0);
|
30525 | __decorate([
|
30526 | context_1.PostConstruct,
|
30527 | __metadata("design:type", Function),
|
30528 | __metadata("design:paramtypes", []),
|
30529 | __metadata("design:returntype", void 0)
|
30530 | ], FilterService.prototype, "postConstruct", null);
|
30531 | FilterService = __decorate([
|
30532 | context_1.Bean("filterService")
|
30533 | ], FilterService);
|
30534 | return FilterService;
|
30535 | }());
|
30536 | exports.FilterService = FilterService;
|
30537 |
|
30538 |
|
30539 | }),
|
30540 |
|
30541 | (function(module, exports, __webpack_require__) {
|
30542 |
|
30543 | "use strict";
|
30544 |
|
30545 |
|
30546 |
|
30547 |
|
30548 |
|
30549 |
|
30550 |
|
30551 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
30552 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
30553 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
30554 | 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;
|
30555 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
30556 | };
|
30557 | var __metadata = (this && this.__metadata) || function (k, v) {
|
30558 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
30559 | };
|
30560 | Object.defineProperty(exports, "__esModule", { value: true });
|
30561 | var context_1 = __webpack_require__(0);
|
30562 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
30563 | var sortService_1 = __webpack_require__(112);
|
30564 | var SortStage = (function () {
|
30565 | function SortStage() {
|
30566 | }
|
30567 | SortStage.prototype.execute = function (params) {
|
30568 |
|
30569 | if (this.gridOptionsWrapper.isEnableServerSideSorting()) {
|
30570 | this.sortService.sort(params.rowNode, null);
|
30571 | }
|
30572 | else {
|
30573 | this.sortService.sortAccordingToColumnsState(params.rowNode);
|
30574 | }
|
30575 | };
|
30576 | __decorate([
|
30577 | context_1.Autowired('gridOptionsWrapper'),
|
30578 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
30579 | ], SortStage.prototype, "gridOptionsWrapper", void 0);
|
30580 | __decorate([
|
30581 | context_1.Autowired('sortService'),
|
30582 | __metadata("design:type", sortService_1.SortService)
|
30583 | ], SortStage.prototype, "sortService", void 0);
|
30584 | SortStage = __decorate([
|
30585 | context_1.Bean('sortStage')
|
30586 | ], SortStage);
|
30587 | return SortStage;
|
30588 | }());
|
30589 | exports.SortStage = SortStage;
|
30590 |
|
30591 |
|
30592 | }),
|
30593 |
|
30594 | (function(module, exports, __webpack_require__) {
|
30595 |
|
30596 | "use strict";
|
30597 |
|
30598 |
|
30599 |
|
30600 |
|
30601 |
|
30602 |
|
30603 |
|
30604 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
30605 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
30606 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
30607 | 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;
|
30608 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
30609 | };
|
30610 | var __metadata = (this && this.__metadata) || function (k, v) {
|
30611 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
30612 | };
|
30613 | Object.defineProperty(exports, "__esModule", { value: true });
|
30614 | var context_1 = __webpack_require__(0);
|
30615 | var sortController_1 = __webpack_require__(24);
|
30616 | var utils_1 = __webpack_require__(1);
|
30617 | var valueService_1 = __webpack_require__(15);
|
30618 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
30619 | var columnController_1 = __webpack_require__(4);
|
30620 | var SortService = (function () {
|
30621 | function SortService() {
|
30622 | }
|
30623 | SortService.prototype.init = function () {
|
30624 | this.postSortFunc = this.gridOptionsWrapper.getPostSortFunc();
|
30625 | };
|
30626 | SortService.prototype.sortAccordingToColumnsState = function (rowNode) {
|
30627 | var sortOptions = this.sortController.getSortForRowController();
|
30628 | this.sort(rowNode, sortOptions);
|
30629 | };
|
30630 | SortService.prototype.sort = function (rowNode, sortOptions) {
|
30631 | var _this = this;
|
30632 | rowNode.childrenAfterSort = rowNode.childrenAfterFilter.slice(0);
|
30633 |
|
30634 | this.pullDownDataForHideOpenParents(rowNode, true);
|
30635 | var sortActive = utils_1._.exists(sortOptions) && sortOptions.length > 0;
|
30636 | if (sortActive) {
|
30637 |
|
30638 |
|
30639 |
|
30640 |
|
30641 |
|
30642 | var sortedRowNodes = rowNode.childrenAfterSort.map(function (it, pos) {
|
30643 | return { currentPos: pos, rowNode: it };
|
30644 | });
|
30645 | sortedRowNodes.sort(this.compareRowNodes.bind(this, sortOptions));
|
30646 | rowNode.childrenAfterSort = sortedRowNodes.map(function (sorted) { return sorted.rowNode; });
|
30647 | }
|
30648 | this.updateChildIndexes(rowNode);
|
30649 | this.pullDownDataForHideOpenParents(rowNode, false);
|
30650 |
|
30651 | rowNode.childrenAfterFilter.forEach(function (child) {
|
30652 | if (child.hasChildren()) {
|
30653 | _this.sort(child, sortOptions);
|
30654 | }
|
30655 | });
|
30656 | if (this.postSortFunc) {
|
30657 | this.postSortFunc(rowNode.childrenAfterSort);
|
30658 | }
|
30659 | };
|
30660 | SortService.prototype.compareRowNodes = function (sortOptions, sortedNodeA, sortedNodeB) {
|
30661 | var nodeA = sortedNodeA.rowNode;
|
30662 | var nodeB = sortedNodeB.rowNode;
|
30663 |
|
30664 | for (var i = 0, len = sortOptions.length; i < len; i++) {
|
30665 | var sortOption = sortOptions[i];
|
30666 |
|
30667 | var isInverted = sortOption.inverter === -1;
|
30668 | var valueA = this.getValue(nodeA, sortOption.column);
|
30669 | var valueB = this.getValue(nodeB, sortOption.column);
|
30670 | var comparatorResult = void 0;
|
30671 | if (sortOption.column.getColDef().comparator) {
|
30672 |
|
30673 | comparatorResult = sortOption.column.getColDef().comparator(valueA, valueB, nodeA, nodeB, isInverted);
|
30674 | }
|
30675 | else {
|
30676 |
|
30677 | comparatorResult = utils_1._.defaultComparator(valueA, valueB, this.gridOptionsWrapper.isAccentedSort());
|
30678 | }
|
30679 | if (comparatorResult !== 0) {
|
30680 | return comparatorResult * sortOption.inverter;
|
30681 | }
|
30682 | }
|
30683 |
|
30684 | return sortedNodeA.currentPos - sortedNodeB.currentPos;
|
30685 | };
|
30686 | SortService.prototype.getValue = function (nodeA, column) {
|
30687 | return this.valueService.getValue(column, nodeA);
|
30688 | };
|
30689 | SortService.prototype.updateChildIndexes = function (rowNode) {
|
30690 | if (utils_1._.missing(rowNode.childrenAfterSort)) {
|
30691 | return;
|
30692 | }
|
30693 | rowNode.childrenAfterSort.forEach(function (child, index) {
|
30694 | var firstChild = index === 0;
|
30695 | var lastChild = index === rowNode.childrenAfterSort.length - 1;
|
30696 | child.setFirstChild(firstChild);
|
30697 | child.setLastChild(lastChild);
|
30698 | child.setChildIndex(index);
|
30699 | });
|
30700 | };
|
30701 | SortService.prototype.pullDownDataForHideOpenParents = function (rowNode, clearOperation) {
|
30702 | var _this = this;
|
30703 | if (utils_1._.missing(rowNode.childrenAfterSort)) {
|
30704 | return;
|
30705 | }
|
30706 | if (!this.gridOptionsWrapper.isGroupHideOpenParents()) {
|
30707 | return;
|
30708 | }
|
30709 | rowNode.childrenAfterSort.forEach(function (childRowNode) {
|
30710 | var groupDisplayCols = _this.columnController.getGroupDisplayColumns();
|
30711 | groupDisplayCols.forEach(function (groupDisplayCol) {
|
30712 | var showRowGroup = groupDisplayCol.getColDef().showRowGroup;
|
30713 | if (typeof showRowGroup !== 'string') {
|
30714 | console.error('ag-Grid: groupHideOpenParents only works when specifying specific columns for colDef.showRowGroup');
|
30715 | return;
|
30716 | }
|
30717 | var displayingGroupKey = showRowGroup;
|
30718 | var rowGroupColumn = _this.columnController.getPrimaryColumn(displayingGroupKey);
|
30719 | var thisRowNodeMatches = rowGroupColumn === childRowNode.rowGroupColumn;
|
30720 | if (thisRowNodeMatches) {
|
30721 | return;
|
30722 | }
|
30723 | if (clearOperation) {
|
30724 |
|
30725 | childRowNode.setGroupValue(groupDisplayCol.getId(), null);
|
30726 | }
|
30727 | else {
|
30728 |
|
30729 | var parentToStealFrom = childRowNode.getFirstChildOfFirstChild(rowGroupColumn);
|
30730 | if (parentToStealFrom) {
|
30731 | childRowNode.setGroupValue(groupDisplayCol.getId(), parentToStealFrom.key);
|
30732 | }
|
30733 | }
|
30734 | });
|
30735 | });
|
30736 | };
|
30737 | __decorate([
|
30738 | context_1.Autowired('sortController'),
|
30739 | __metadata("design:type", sortController_1.SortController)
|
30740 | ], SortService.prototype, "sortController", void 0);
|
30741 | __decorate([
|
30742 | context_1.Autowired('columnController'),
|
30743 | __metadata("design:type", columnController_1.ColumnController)
|
30744 | ], SortService.prototype, "columnController", void 0);
|
30745 | __decorate([
|
30746 | context_1.Autowired('valueService'),
|
30747 | __metadata("design:type", valueService_1.ValueService)
|
30748 | ], SortService.prototype, "valueService", void 0);
|
30749 | __decorate([
|
30750 | context_1.Autowired('gridOptionsWrapper'),
|
30751 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
30752 | ], SortService.prototype, "gridOptionsWrapper", void 0);
|
30753 | __decorate([
|
30754 | context_1.PostConstruct,
|
30755 | __metadata("design:type", Function),
|
30756 | __metadata("design:paramtypes", []),
|
30757 | __metadata("design:returntype", void 0)
|
30758 | ], SortService.prototype, "init", null);
|
30759 | SortService = __decorate([
|
30760 | context_1.Bean('sortService')
|
30761 | ], SortService);
|
30762 | return SortService;
|
30763 | }());
|
30764 | exports.SortService = SortService;
|
30765 |
|
30766 |
|
30767 | }),
|
30768 |
|
30769 | (function(module, exports, __webpack_require__) {
|
30770 |
|
30771 | "use strict";
|
30772 |
|
30773 |
|
30774 |
|
30775 |
|
30776 |
|
30777 |
|
30778 |
|
30779 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
30780 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
30781 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
30782 | 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;
|
30783 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
30784 | };
|
30785 | var __metadata = (this && this.__metadata) || function (k, v) {
|
30786 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
30787 | };
|
30788 | Object.defineProperty(exports, "__esModule", { value: true });
|
30789 | var context_1 = __webpack_require__(0);
|
30790 | var rowNode_1 = __webpack_require__(16);
|
30791 | var utils_1 = __webpack_require__(1);
|
30792 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
30793 | var selectionController_1 = __webpack_require__(17);
|
30794 | var eventService_1 = __webpack_require__(3);
|
30795 | var columnController_1 = __webpack_require__(4);
|
30796 | var FlattenStage = (function () {
|
30797 | function FlattenStage() {
|
30798 | }
|
30799 | FlattenStage.prototype.execute = function (params) {
|
30800 | var rootNode = params.rowNode;
|
30801 |
|
30802 |
|
30803 | var result = [];
|
30804 |
|
30805 | var nextRowTop = { value: 0 };
|
30806 | var skipLeafNodes = this.columnController.isPivotMode();
|
30807 |
|
30808 |
|
30809 | var showRootNode = skipLeafNodes && rootNode.leafGroup;
|
30810 | var topList = showRootNode ? [rootNode] : rootNode.childrenAfterSort;
|
30811 |
|
30812 |
|
30813 |
|
30814 | this.resetRowTops(rootNode);
|
30815 | this.recursivelyAddToRowsToDisplay(topList, result, nextRowTop, skipLeafNodes, 0);
|
30816 |
|
30817 | var includeGroupTotalFooter = !showRootNode && this.gridOptionsWrapper.isGroupIncludeTotalFooter();
|
30818 | if (includeGroupTotalFooter) {
|
30819 | this.ensureFooterNodeExists(rootNode);
|
30820 | this.addRowNodeToRowsToDisplay(rootNode.sibling, result, nextRowTop, 0);
|
30821 | }
|
30822 | return result;
|
30823 | };
|
30824 | FlattenStage.prototype.resetRowTops = function (rowNode) {
|
30825 | rowNode.clearRowTop();
|
30826 | if (rowNode.hasChildren()) {
|
30827 | if (rowNode.childrenAfterGroup) {
|
30828 | for (var i = 0; i < rowNode.childrenAfterGroup.length; i++) {
|
30829 | this.resetRowTops(rowNode.childrenAfterGroup[i]);
|
30830 | }
|
30831 | }
|
30832 | if (rowNode.sibling) {
|
30833 | rowNode.sibling.clearRowTop();
|
30834 | }
|
30835 | }
|
30836 | };
|
30837 | FlattenStage.prototype.recursivelyAddToRowsToDisplay = function (rowsToFlatten, result, nextRowTop, skipLeafNodes, uiLevel) {
|
30838 | if (utils_1.Utils.missingOrEmpty(rowsToFlatten)) {
|
30839 | return;
|
30840 | }
|
30841 | var groupSuppressRow = this.gridOptionsWrapper.isGroupSuppressRow();
|
30842 | var hideOpenParents = this.gridOptionsWrapper.isGroupHideOpenParents();
|
30843 |
|
30844 | var groupRemoveSingleChildren = this.gridOptionsWrapper.isGroupRemoveSingleChildren();
|
30845 | var groupRemoveLowestSingleChildren = !groupRemoveSingleChildren && this.gridOptionsWrapper.isGroupRemoveLowestSingleChildren();
|
30846 | for (var i = 0; i < rowsToFlatten.length; i++) {
|
30847 | var rowNode = rowsToFlatten[i];
|
30848 |
|
30849 | var isParent = rowNode.hasChildren();
|
30850 | var isGroupSuppressedNode = groupSuppressRow && isParent;
|
30851 | var isSkippedLeafNode = skipLeafNodes && !isParent;
|
30852 | var isRemovedSingleChildrenGroup = groupRemoveSingleChildren && isParent && rowNode.childrenAfterGroup.length === 1;
|
30853 | var isRemovedLowestSingleChildrenGroup = groupRemoveLowestSingleChildren && isParent && rowNode.leafGroup && rowNode.childrenAfterGroup.length === 1;
|
30854 |
|
30855 |
|
30856 |
|
30857 | var neverAllowToExpand = skipLeafNodes && rowNode.leafGroup;
|
30858 | var isHiddenOpenParent = hideOpenParents && rowNode.expanded && (!neverAllowToExpand);
|
30859 | var thisRowShouldBeRendered = !isSkippedLeafNode && !isGroupSuppressedNode && !isHiddenOpenParent && !isRemovedSingleChildrenGroup && !isRemovedLowestSingleChildrenGroup;
|
30860 | if (thisRowShouldBeRendered) {
|
30861 | this.addRowNodeToRowsToDisplay(rowNode, result, nextRowTop, uiLevel);
|
30862 | }
|
30863 |
|
30864 | if (skipLeafNodes && rowNode.leafGroup) {
|
30865 | continue;
|
30866 | }
|
30867 | if (isParent) {
|
30868 | var excludedParent = isRemovedSingleChildrenGroup || isRemovedLowestSingleChildrenGroup;
|
30869 |
|
30870 |
|
30871 | if (rowNode.expanded || excludedParent) {
|
30872 |
|
30873 | var uiLevelForChildren = excludedParent ? uiLevel : uiLevel + 1;
|
30874 | this.recursivelyAddToRowsToDisplay(rowNode.childrenAfterSort, result, nextRowTop, skipLeafNodes, uiLevelForChildren);
|
30875 |
|
30876 | if (this.gridOptionsWrapper.isGroupIncludeFooter()) {
|
30877 | this.ensureFooterNodeExists(rowNode);
|
30878 | this.addRowNodeToRowsToDisplay(rowNode.sibling, result, nextRowTop, uiLevel);
|
30879 | }
|
30880 | }
|
30881 | else {
|
30882 | }
|
30883 | }
|
30884 | else if (rowNode.master && rowNode.expanded) {
|
30885 | var detailNode = this.createDetailNode(rowNode);
|
30886 | this.addRowNodeToRowsToDisplay(detailNode, result, nextRowTop, uiLevel);
|
30887 | }
|
30888 | }
|
30889 | };
|
30890 |
|
30891 | FlattenStage.prototype.addRowNodeToRowsToDisplay = function (rowNode, result, nextRowTop, uiLevel) {
|
30892 | result.push(rowNode);
|
30893 | if (utils_1.Utils.missing(rowNode.rowHeight)) {
|
30894 | var rowHeight = this.gridOptionsWrapper.getRowHeightForNode(rowNode);
|
30895 | rowNode.setRowHeight(rowHeight);
|
30896 | }
|
30897 | rowNode.setUiLevel(uiLevel);
|
30898 | rowNode.setRowTop(nextRowTop.value);
|
30899 | rowNode.setRowIndex(result.length - 1);
|
30900 | nextRowTop.value += rowNode.rowHeight;
|
30901 | };
|
30902 | FlattenStage.prototype.ensureFooterNodeExists = function (groupNode) {
|
30903 |
|
30904 |
|
30905 | if (utils_1.Utils.exists(groupNode.sibling)) {
|
30906 | return;
|
30907 | }
|
30908 | var footerNode = new rowNode_1.RowNode();
|
30909 | this.context.wireBean(footerNode);
|
30910 | Object.keys(groupNode).forEach(function (key) {
|
30911 | footerNode[key] = groupNode[key];
|
30912 | });
|
30913 | footerNode.footer = true;
|
30914 | footerNode.rowTop = null;
|
30915 | footerNode.oldRowTop = null;
|
30916 | if (utils_1.Utils.exists(footerNode.id)) {
|
30917 | footerNode.id = 'rowGroupFooter_' + footerNode.id;
|
30918 | }
|
30919 |
|
30920 |
|
30921 |
|
30922 | footerNode.sibling = groupNode;
|
30923 | groupNode.sibling = footerNode;
|
30924 | };
|
30925 | FlattenStage.prototype.createDetailNode = function (masterNode) {
|
30926 | if (utils_1.Utils.exists(masterNode.detailNode)) {
|
30927 | return masterNode.detailNode;
|
30928 | }
|
30929 | else {
|
30930 | var detailNode = new rowNode_1.RowNode();
|
30931 | this.context.wireBean(detailNode);
|
30932 | detailNode.detail = true;
|
30933 |
|
30934 | detailNode.flower = detailNode.detail;
|
30935 | detailNode.parent = masterNode;
|
30936 | if (utils_1.Utils.exists(masterNode.id)) {
|
30937 | detailNode.id = 'detail_' + masterNode.id;
|
30938 | }
|
30939 | detailNode.data = masterNode.data;
|
30940 | detailNode.level = masterNode.level + 1;
|
30941 | masterNode.detailNode = detailNode;
|
30942 | masterNode.childFlower = masterNode.detailNode;
|
30943 | return detailNode;
|
30944 | }
|
30945 | };
|
30946 | __decorate([
|
30947 | context_1.Autowired('gridOptionsWrapper'),
|
30948 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
30949 | ], FlattenStage.prototype, "gridOptionsWrapper", void 0);
|
30950 | __decorate([
|
30951 | context_1.Autowired('selectionController'),
|
30952 | __metadata("design:type", selectionController_1.SelectionController)
|
30953 | ], FlattenStage.prototype, "selectionController", void 0);
|
30954 | __decorate([
|
30955 | context_1.Autowired('eventService'),
|
30956 | __metadata("design:type", eventService_1.EventService)
|
30957 | ], FlattenStage.prototype, "eventService", void 0);
|
30958 | __decorate([
|
30959 | context_1.Autowired('context'),
|
30960 | __metadata("design:type", context_1.Context)
|
30961 | ], FlattenStage.prototype, "context", void 0);
|
30962 | __decorate([
|
30963 | context_1.Autowired('columnController'),
|
30964 | __metadata("design:type", columnController_1.ColumnController)
|
30965 | ], FlattenStage.prototype, "columnController", void 0);
|
30966 | FlattenStage = __decorate([
|
30967 | context_1.Bean('flattenStage')
|
30968 | ], FlattenStage);
|
30969 | return FlattenStage;
|
30970 | }());
|
30971 | exports.FlattenStage = FlattenStage;
|
30972 |
|
30973 |
|
30974 | }),
|
30975 |
|
30976 | (function(module, exports, __webpack_require__) {
|
30977 |
|
30978 | "use strict";
|
30979 |
|
30980 |
|
30981 |
|
30982 |
|
30983 |
|
30984 |
|
30985 |
|
30986 | var __extends = (this && this.__extends) || (function () {
|
30987 | var extendStatics = Object.setPrototypeOf ||
|
30988 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
30989 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
30990 | return function (d, b) {
|
30991 | extendStatics(d, b);
|
30992 | function __() { this.constructor = d; }
|
30993 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
30994 | };
|
30995 | })();
|
30996 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
30997 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
30998 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
30999 | 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;
|
31000 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
31001 | };
|
31002 | var __metadata = (this && this.__metadata) || function (k, v) {
|
31003 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
31004 | };
|
31005 | Object.defineProperty(exports, "__esModule", { value: true });
|
31006 | var utils_1 = __webpack_require__(1);
|
31007 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
31008 | var context_1 = __webpack_require__(0);
|
31009 | var eventService_1 = __webpack_require__(3);
|
31010 | var selectionController_1 = __webpack_require__(17);
|
31011 | var events_1 = __webpack_require__(5);
|
31012 | var sortController_1 = __webpack_require__(24);
|
31013 | var filterManager_1 = __webpack_require__(18);
|
31014 | var constants_1 = __webpack_require__(9);
|
31015 | var infiniteCache_1 = __webpack_require__(136);
|
31016 | var beanStub_1 = __webpack_require__(13);
|
31017 | var rowNodeCache_1 = __webpack_require__(87);
|
31018 | var rowNodeBlockLoader_1 = __webpack_require__(115);
|
31019 | var gridApi_1 = __webpack_require__(6);
|
31020 | var columnApi_1 = __webpack_require__(7);
|
31021 | var InfiniteRowModel = (function (_super) {
|
31022 | __extends(InfiniteRowModel, _super);
|
31023 | function InfiniteRowModel() {
|
31024 | return _super !== null && _super.apply(this, arguments) || this;
|
31025 | }
|
31026 | InfiniteRowModel.prototype.getRowBounds = function (index) {
|
31027 | return {
|
31028 | rowHeight: this.rowHeight,
|
31029 | rowTop: this.rowHeight * index
|
31030 | };
|
31031 | };
|
31032 | InfiniteRowModel.prototype.init = function () {
|
31033 | var _this = this;
|
31034 | if (!this.gridOptionsWrapper.isRowModelInfinite()) {
|
31035 | return;
|
31036 | }
|
31037 | this.rowHeight = this.gridOptionsWrapper.getRowHeightAsNumber();
|
31038 | this.addEventListeners();
|
31039 | this.setDatasource(this.gridOptionsWrapper.getDatasource());
|
31040 | this.addDestroyFunc(function () { return _this.destroyCache(); });
|
31041 | };
|
31042 | InfiniteRowModel.prototype.destroyDatasource = function () {
|
31043 | if (this.datasource && this.datasource.destroy) {
|
31044 | this.datasource.destroy();
|
31045 | }
|
31046 | this.datasource = null;
|
31047 | };
|
31048 | InfiniteRowModel.prototype.isLastRowFound = function () {
|
31049 | return this.infiniteCache ? this.infiniteCache.isMaxRowFound() : false;
|
31050 | };
|
31051 | InfiniteRowModel.prototype.addEventListeners = function () {
|
31052 | this.addDestroyableEventListener(this.eventService, events_1.Events.EVENT_FILTER_CHANGED, this.onFilterChanged.bind(this));
|
31053 | this.addDestroyableEventListener(this.eventService, events_1.Events.EVENT_SORT_CHANGED, this.onSortChanged.bind(this));
|
31054 | this.addDestroyableEventListener(this.eventService, events_1.Events.EVENT_COLUMN_EVERYTHING_CHANGED, this.onColumnEverything.bind(this));
|
31055 | };
|
31056 | InfiniteRowModel.prototype.onFilterChanged = function () {
|
31057 | if (this.gridOptionsWrapper.isEnableServerSideFilter()) {
|
31058 | this.reset();
|
31059 | }
|
31060 | };
|
31061 | InfiniteRowModel.prototype.onSortChanged = function () {
|
31062 | if (this.gridOptionsWrapper.isEnableServerSideSorting()) {
|
31063 | this.reset();
|
31064 | }
|
31065 | };
|
31066 | InfiniteRowModel.prototype.onColumnEverything = function () {
|
31067 |
|
31068 | if (this.gridOptionsWrapper.isEnableServerSideSorting()) {
|
31069 | this.reset();
|
31070 | }
|
31071 | };
|
31072 | InfiniteRowModel.prototype.destroy = function () {
|
31073 | _super.prototype.destroy.call(this);
|
31074 | };
|
31075 | InfiniteRowModel.prototype.getType = function () {
|
31076 | return constants_1.Constants.ROW_MODEL_TYPE_INFINITE;
|
31077 | };
|
31078 | InfiniteRowModel.prototype.setDatasource = function (datasource) {
|
31079 | this.destroyDatasource();
|
31080 | this.datasource = datasource;
|
31081 |
|
31082 | if (datasource) {
|
31083 | this.checkForDeprecated();
|
31084 | this.reset();
|
31085 | }
|
31086 | };
|
31087 | InfiniteRowModel.prototype.checkForDeprecated = function () {
|
31088 | var ds = this.datasource;
|
31089 |
|
31090 | if (utils_1.Utils.exists(ds.maxConcurrentRequests)) {
|
31091 | console.error('ag-Grid: since version 5.1.x, maxConcurrentRequests is replaced with grid property maxConcurrentDatasourceRequests');
|
31092 | }
|
31093 | if (utils_1.Utils.exists(ds.maxPagesInCache)) {
|
31094 | console.error('ag-Grid: since version 5.1.x, maxPagesInCache is replaced with grid property maxPagesInPaginationCache');
|
31095 | }
|
31096 | if (utils_1.Utils.exists(ds.overflowSize)) {
|
31097 | console.error('ag-Grid: since version 5.1.x, overflowSize is replaced with grid property paginationOverflowSize');
|
31098 | }
|
31099 | if (utils_1.Utils.exists(ds.blockSize)) {
|
31100 | console.error('ag-Grid: since version 5.1.x, pageSize/blockSize is replaced with grid property infinitePageSize');
|
31101 | }
|
31102 | };
|
31103 | InfiniteRowModel.prototype.isEmpty = function () {
|
31104 | return utils_1.Utils.missing(this.infiniteCache);
|
31105 | };
|
31106 | InfiniteRowModel.prototype.isRowsToRender = function () {
|
31107 | return utils_1.Utils.exists(this.infiniteCache);
|
31108 | };
|
31109 | InfiniteRowModel.prototype.getNodesInRangeForSelection = function (firstInRange, lastInRange) {
|
31110 | return this.infiniteCache.getRowNodesInRange(firstInRange, lastInRange);
|
31111 | };
|
31112 | InfiniteRowModel.prototype.reset = function () {
|
31113 |
|
31114 |
|
31115 | if (utils_1.Utils.missing(this.datasource)) {
|
31116 | return;
|
31117 | }
|
31118 |
|
31119 |
|
31120 |
|
31121 | var userGeneratingIds = utils_1.Utils.exists(this.gridOptionsWrapper.getRowNodeIdFunc());
|
31122 | if (!userGeneratingIds) {
|
31123 | this.selectionController.reset();
|
31124 | }
|
31125 | this.resetCache();
|
31126 | var event = this.createModelUpdatedEvent();
|
31127 | this.eventService.dispatchEvent(event);
|
31128 | };
|
31129 | InfiniteRowModel.prototype.createModelUpdatedEvent = function () {
|
31130 | return {
|
31131 | type: events_1.Events.EVENT_MODEL_UPDATED,
|
31132 | api: this.gridApi,
|
31133 | columnApi: this.columnApi,
|
31134 |
|
31135 |
|
31136 | newPage: false,
|
31137 | newData: false,
|
31138 | keepRenderedRows: false,
|
31139 | animate: false
|
31140 | };
|
31141 | };
|
31142 | InfiniteRowModel.prototype.resetCache = function () {
|
31143 |
|
31144 | this.destroyCache();
|
31145 | var maxConcurrentRequests = this.gridOptionsWrapper.getMaxConcurrentDatasourceRequests();
|
31146 |
|
31147 |
|
31148 | this.rowNodeBlockLoader = new rowNodeBlockLoader_1.RowNodeBlockLoader(maxConcurrentRequests);
|
31149 | this.context.wireBean(this.rowNodeBlockLoader);
|
31150 | var cacheSettings = {
|
31151 |
|
31152 | datasource: this.datasource,
|
31153 |
|
31154 | filterModel: this.filterManager.getFilterModel(),
|
31155 | sortModel: this.sortController.getSortModel(),
|
31156 | rowNodeBlockLoader: this.rowNodeBlockLoader,
|
31157 |
|
31158 |
|
31159 |
|
31160 | maxConcurrentRequests: maxConcurrentRequests,
|
31161 | overflowSize: this.gridOptionsWrapper.getCacheOverflowSize(),
|
31162 | initialRowCount: this.gridOptionsWrapper.getInfiniteInitialRowCount(),
|
31163 | maxBlocksInCache: this.gridOptionsWrapper.getMaxBlocksInCache(),
|
31164 | blockSize: this.gridOptionsWrapper.getCacheBlockSize(),
|
31165 | rowHeight: this.gridOptionsWrapper.getRowHeightAsNumber(),
|
31166 |
|
31167 |
|
31168 | lastAccessedSequence: new utils_1.NumberSequence()
|
31169 | };
|
31170 |
|
31171 | if (!(cacheSettings.maxConcurrentRequests >= 1)) {
|
31172 | cacheSettings.maxConcurrentRequests = 2;
|
31173 | }
|
31174 |
|
31175 |
|
31176 | if (!(cacheSettings.blockSize >= 1)) {
|
31177 | cacheSettings.blockSize = 100;
|
31178 | }
|
31179 |
|
31180 | if (!(cacheSettings.initialRowCount >= 1)) {
|
31181 | cacheSettings.initialRowCount = 0;
|
31182 | }
|
31183 |
|
31184 |
|
31185 | if (!(cacheSettings.overflowSize >= 1)) {
|
31186 | cacheSettings.overflowSize = 1;
|
31187 | }
|
31188 | this.infiniteCache = new infiniteCache_1.InfiniteCache(cacheSettings);
|
31189 | this.context.wireBean(this.infiniteCache);
|
31190 | this.infiniteCache.addEventListener(rowNodeCache_1.RowNodeCache.EVENT_CACHE_UPDATED, this.onCacheUpdated.bind(this));
|
31191 | };
|
31192 | InfiniteRowModel.prototype.destroyCache = function () {
|
31193 | if (this.infiniteCache) {
|
31194 | this.infiniteCache.destroy();
|
31195 | this.infiniteCache = null;
|
31196 | }
|
31197 | if (this.rowNodeBlockLoader) {
|
31198 | this.rowNodeBlockLoader.destroy();
|
31199 | this.rowNodeBlockLoader = null;
|
31200 | }
|
31201 | };
|
31202 | InfiniteRowModel.prototype.onCacheUpdated = function () {
|
31203 | var event = this.createModelUpdatedEvent();
|
31204 | this.eventService.dispatchEvent(event);
|
31205 | };
|
31206 | InfiniteRowModel.prototype.getRow = function (rowIndex) {
|
31207 | return this.infiniteCache ? this.infiniteCache.getRow(rowIndex) : null;
|
31208 | };
|
31209 | InfiniteRowModel.prototype.getRowNode = function (id) {
|
31210 | var result = null;
|
31211 | this.forEachNode(function (rowNode) {
|
31212 | if (rowNode.id === id) {
|
31213 | result = rowNode;
|
31214 | }
|
31215 | });
|
31216 | return result;
|
31217 | };
|
31218 | InfiniteRowModel.prototype.forEachNode = function (callback) {
|
31219 | if (this.infiniteCache) {
|
31220 | this.infiniteCache.forEachNodeDeep(callback, new utils_1.NumberSequence());
|
31221 | }
|
31222 | };
|
31223 | InfiniteRowModel.prototype.getCurrentPageHeight = function () {
|
31224 | return this.getRowCount() * this.rowHeight;
|
31225 | };
|
31226 | InfiniteRowModel.prototype.getRowIndexAtPixel = function (pixel) {
|
31227 | if (this.rowHeight !== 0) {
|
31228 | var rowIndexForPixel = Math.floor(pixel / this.rowHeight);
|
31229 | if (rowIndexForPixel > this.getPageLastRow()) {
|
31230 | return this.getPageLastRow();
|
31231 | }
|
31232 | else {
|
31233 | return rowIndexForPixel;
|
31234 | }
|
31235 | }
|
31236 | else {
|
31237 | return 0;
|
31238 | }
|
31239 | };
|
31240 | InfiniteRowModel.prototype.getPageFirstRow = function () {
|
31241 | return 0;
|
31242 | };
|
31243 | InfiniteRowModel.prototype.getPageLastRow = function () {
|
31244 | return this.infiniteCache ? this.infiniteCache.getVirtualRowCount() - 1 : 0;
|
31245 | };
|
31246 | InfiniteRowModel.prototype.getRowCount = function () {
|
31247 | return this.infiniteCache ? this.infiniteCache.getVirtualRowCount() : 0;
|
31248 | };
|
31249 | InfiniteRowModel.prototype.updateRowData = function (transaction) {
|
31250 | if (utils_1.Utils.exists(transaction.remove) || utils_1.Utils.exists(transaction.update)) {
|
31251 | console.warn('ag-Grid: updateRowData for InfiniteRowModel does not support remove or update, only add');
|
31252 | return;
|
31253 | }
|
31254 | if (utils_1.Utils.missing(transaction.addIndex)) {
|
31255 | console.warn('ag-Grid: updateRowData for InfiniteRowModel requires add and addIndex to be set');
|
31256 | return;
|
31257 | }
|
31258 | if (this.infiniteCache) {
|
31259 | this.infiniteCache.insertItemsAtIndex(transaction.addIndex, transaction.add);
|
31260 | }
|
31261 | };
|
31262 | InfiniteRowModel.prototype.isRowPresent = function (rowNode) {
|
31263 | return false;
|
31264 | };
|
31265 | InfiniteRowModel.prototype.refreshCache = function () {
|
31266 | if (this.infiniteCache) {
|
31267 | this.infiniteCache.refreshCache();
|
31268 | }
|
31269 | };
|
31270 | InfiniteRowModel.prototype.purgeCache = function () {
|
31271 | if (this.infiniteCache) {
|
31272 | this.infiniteCache.purgeCache();
|
31273 | }
|
31274 | };
|
31275 | InfiniteRowModel.prototype.getVirtualRowCount = function () {
|
31276 | if (this.infiniteCache) {
|
31277 | return this.infiniteCache.getVirtualRowCount();
|
31278 | }
|
31279 | else {
|
31280 | return null;
|
31281 | }
|
31282 | };
|
31283 | InfiniteRowModel.prototype.isMaxRowFound = function () {
|
31284 | if (this.infiniteCache) {
|
31285 | return this.infiniteCache.isMaxRowFound();
|
31286 | }
|
31287 | };
|
31288 | InfiniteRowModel.prototype.setVirtualRowCount = function (rowCount, maxRowFound) {
|
31289 | if (this.infiniteCache) {
|
31290 | this.infiniteCache.setVirtualRowCount(rowCount, maxRowFound);
|
31291 | }
|
31292 | };
|
31293 | InfiniteRowModel.prototype.getBlockState = function () {
|
31294 | if (this.rowNodeBlockLoader) {
|
31295 | return this.rowNodeBlockLoader.getBlockState();
|
31296 | }
|
31297 | else {
|
31298 | return null;
|
31299 | }
|
31300 | };
|
31301 | __decorate([
|
31302 | context_1.Autowired('gridOptionsWrapper'),
|
31303 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
31304 | ], InfiniteRowModel.prototype, "gridOptionsWrapper", void 0);
|
31305 | __decorate([
|
31306 | context_1.Autowired('filterManager'),
|
31307 | __metadata("design:type", filterManager_1.FilterManager)
|
31308 | ], InfiniteRowModel.prototype, "filterManager", void 0);
|
31309 | __decorate([
|
31310 | context_1.Autowired('sortController'),
|
31311 | __metadata("design:type", sortController_1.SortController)
|
31312 | ], InfiniteRowModel.prototype, "sortController", void 0);
|
31313 | __decorate([
|
31314 | context_1.Autowired('selectionController'),
|
31315 | __metadata("design:type", selectionController_1.SelectionController)
|
31316 | ], InfiniteRowModel.prototype, "selectionController", void 0);
|
31317 | __decorate([
|
31318 | context_1.Autowired('eventService'),
|
31319 | __metadata("design:type", eventService_1.EventService)
|
31320 | ], InfiniteRowModel.prototype, "eventService", void 0);
|
31321 | __decorate([
|
31322 | context_1.Autowired('context'),
|
31323 | __metadata("design:type", context_1.Context)
|
31324 | ], InfiniteRowModel.prototype, "context", void 0);
|
31325 | __decorate([
|
31326 | context_1.Autowired('gridApi'),
|
31327 | __metadata("design:type", gridApi_1.GridApi)
|
31328 | ], InfiniteRowModel.prototype, "gridApi", void 0);
|
31329 | __decorate([
|
31330 | context_1.Autowired('columnApi'),
|
31331 | __metadata("design:type", columnApi_1.ColumnApi)
|
31332 | ], InfiniteRowModel.prototype, "columnApi", void 0);
|
31333 | __decorate([
|
31334 | context_1.PostConstruct,
|
31335 | __metadata("design:type", Function),
|
31336 | __metadata("design:paramtypes", []),
|
31337 | __metadata("design:returntype", void 0)
|
31338 | ], InfiniteRowModel.prototype, "init", null);
|
31339 | __decorate([
|
31340 | context_1.PreDestroy,
|
31341 | __metadata("design:type", Function),
|
31342 | __metadata("design:paramtypes", []),
|
31343 | __metadata("design:returntype", void 0)
|
31344 | ], InfiniteRowModel.prototype, "destroyDatasource", null);
|
31345 | __decorate([
|
31346 | context_1.PreDestroy,
|
31347 | __metadata("design:type", Function),
|
31348 | __metadata("design:paramtypes", []),
|
31349 | __metadata("design:returntype", void 0)
|
31350 | ], InfiniteRowModel.prototype, "destroy", null);
|
31351 | InfiniteRowModel = __decorate([
|
31352 | context_1.Bean('rowModel')
|
31353 | ], InfiniteRowModel);
|
31354 | return InfiniteRowModel;
|
31355 | }(beanStub_1.BeanStub));
|
31356 | exports.InfiniteRowModel = InfiniteRowModel;
|
31357 |
|
31358 |
|
31359 | }),
|
31360 |
|
31361 | (function(module, exports, __webpack_require__) {
|
31362 |
|
31363 | "use strict";
|
31364 |
|
31365 |
|
31366 |
|
31367 |
|
31368 |
|
31369 |
|
31370 |
|
31371 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
31372 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
31373 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
31374 | 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;
|
31375 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
31376 | };
|
31377 | var __metadata = (this && this.__metadata) || function (k, v) {
|
31378 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
31379 | };
|
31380 | var __param = (this && this.__param) || function (paramIndex, decorator) {
|
31381 | return function (target, key) { decorator(target, key, paramIndex); }
|
31382 | };
|
31383 | Object.defineProperty(exports, "__esModule", { value: true });
|
31384 | var rowNodeBlock_1 = __webpack_require__(61);
|
31385 | var logger_1 = __webpack_require__(12);
|
31386 | var context_1 = __webpack_require__(0);
|
31387 | var utils_1 = __webpack_require__(1);
|
31388 | var RowNodeBlockLoader = (function () {
|
31389 | function RowNodeBlockLoader(maxConcurrentRequests) {
|
31390 | this.activeBlockLoadsCount = 0;
|
31391 | this.blocks = [];
|
31392 | this.active = true;
|
31393 | this.maxConcurrentRequests = maxConcurrentRequests;
|
31394 | }
|
31395 | RowNodeBlockLoader.prototype.setBeans = function (loggerFactory) {
|
31396 | this.logger = loggerFactory.create('RowNodeBlockLoader');
|
31397 | };
|
31398 | RowNodeBlockLoader.prototype.addBlock = function (block) {
|
31399 | this.blocks.push(block);
|
31400 | };
|
31401 | RowNodeBlockLoader.prototype.removeBlock = function (block) {
|
31402 | utils_1._.removeFromArray(this.blocks, block);
|
31403 | };
|
31404 | RowNodeBlockLoader.prototype.destroy = function () {
|
31405 | this.active = false;
|
31406 | };
|
31407 | RowNodeBlockLoader.prototype.loadComplete = function () {
|
31408 | this.activeBlockLoadsCount--;
|
31409 | };
|
31410 | RowNodeBlockLoader.prototype.checkBlockToLoad = function () {
|
31411 | if (!this.active) {
|
31412 | return;
|
31413 | }
|
31414 | this.printCacheStatus();
|
31415 | if (this.activeBlockLoadsCount >= this.maxConcurrentRequests) {
|
31416 | this.logger.log("checkBlockToLoad: max loads exceeded");
|
31417 | return;
|
31418 | }
|
31419 | var blockToLoad = null;
|
31420 | this.blocks.forEach(function (block) {
|
31421 | if (block.getState() === rowNodeBlock_1.RowNodeBlock.STATE_DIRTY) {
|
31422 | blockToLoad = block;
|
31423 | }
|
31424 | });
|
31425 | if (blockToLoad) {
|
31426 | blockToLoad.load();
|
31427 | this.activeBlockLoadsCount++;
|
31428 | this.logger.log("checkBlockToLoad: loading page " + blockToLoad.getBlockNumber());
|
31429 | this.printCacheStatus();
|
31430 | }
|
31431 | else {
|
31432 | this.logger.log("checkBlockToLoad: no pages to load");
|
31433 | }
|
31434 | };
|
31435 | RowNodeBlockLoader.prototype.getBlockState = function () {
|
31436 | var result = {};
|
31437 | this.blocks.forEach(function (block) {
|
31438 | var nodeIdPrefix = block.getNodeIdPrefix();
|
31439 | var stateItem = {
|
31440 | blockNumber: block.getBlockNumber(),
|
31441 | startRow: block.getStartRow(),
|
31442 | endRow: block.getEndRow(),
|
31443 | pageStatus: block.getState()
|
31444 | };
|
31445 | if (utils_1._.exists(nodeIdPrefix)) {
|
31446 | result[nodeIdPrefix + block.getBlockNumber()] = stateItem;
|
31447 | }
|
31448 | else {
|
31449 | result[block.getBlockNumber()] = stateItem;
|
31450 | }
|
31451 | });
|
31452 | return result;
|
31453 | };
|
31454 | RowNodeBlockLoader.prototype.printCacheStatus = function () {
|
31455 | if (this.logger.isLogging()) {
|
31456 | this.logger.log("printCacheStatus: activePageLoadsCount = " + this.activeBlockLoadsCount + ","
|
31457 | + (" blocks = " + JSON.stringify(this.getBlockState())));
|
31458 | }
|
31459 | };
|
31460 | __decorate([
|
31461 | __param(0, context_1.Qualifier('loggerFactory')),
|
31462 | __metadata("design:type", Function),
|
31463 | __metadata("design:paramtypes", [logger_1.LoggerFactory]),
|
31464 | __metadata("design:returntype", void 0)
|
31465 | ], RowNodeBlockLoader.prototype, "setBeans", null);
|
31466 | return RowNodeBlockLoader;
|
31467 | }());
|
31468 | exports.RowNodeBlockLoader = RowNodeBlockLoader;
|
31469 |
|
31470 |
|
31471 | }),
|
31472 |
|
31473 | (function(module, exports, __webpack_require__) {
|
31474 |
|
31475 | "use strict";
|
31476 |
|
31477 |
|
31478 |
|
31479 |
|
31480 |
|
31481 |
|
31482 |
|
31483 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
31484 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
31485 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
31486 | 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;
|
31487 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
31488 | };
|
31489 | var __metadata = (this && this.__metadata) || function (k, v) {
|
31490 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
31491 | };
|
31492 | Object.defineProperty(exports, "__esModule", { value: true });
|
31493 | var utils_1 = __webpack_require__(1);
|
31494 | var constants_1 = __webpack_require__(9);
|
31495 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
31496 | var columnApi_1 = __webpack_require__(7);
|
31497 | var columnController_1 = __webpack_require__(4);
|
31498 | var filterManager_1 = __webpack_require__(18);
|
31499 | var rowNode_1 = __webpack_require__(16);
|
31500 | var eventService_1 = __webpack_require__(3);
|
31501 | var events_1 = __webpack_require__(5);
|
31502 | var context_1 = __webpack_require__(0);
|
31503 | var selectionController_1 = __webpack_require__(17);
|
31504 | var clientSideNodeManager_1 = __webpack_require__(117);
|
31505 | var changedPath_1 = __webpack_require__(88);
|
31506 | var valueService_1 = __webpack_require__(15);
|
31507 | var valueCache_1 = __webpack_require__(33);
|
31508 | var gridApi_1 = __webpack_require__(6);
|
31509 | var RecursionType;
|
31510 | (function (RecursionType) {
|
31511 | RecursionType[RecursionType["Normal"] = 0] = "Normal";
|
31512 | RecursionType[RecursionType["AfterFilter"] = 1] = "AfterFilter";
|
31513 | RecursionType[RecursionType["AfterFilterAndSort"] = 2] = "AfterFilterAndSort";
|
31514 | RecursionType[RecursionType["PivotNodes"] = 3] = "PivotNodes";
|
31515 | })(RecursionType || (RecursionType = {}));
|
31516 | ;
|
31517 | var ClientSideRowModel = (function () {
|
31518 | function ClientSideRowModel() {
|
31519 | }
|
31520 | ClientSideRowModel.prototype.init = function () {
|
31521 | var refreshEverythingFunc = this.refreshModel.bind(this, { step: constants_1.Constants.STEP_EVERYTHING });
|
31522 | this.eventService.addModalPriorityEventListener(events_1.Events.EVENT_COLUMN_EVERYTHING_CHANGED, refreshEverythingFunc);
|
31523 | this.eventService.addModalPriorityEventListener(events_1.Events.EVENT_COLUMN_ROW_GROUP_CHANGED, refreshEverythingFunc);
|
31524 | this.eventService.addModalPriorityEventListener(events_1.Events.EVENT_COLUMN_VALUE_CHANGED, this.onValueChanged.bind(this));
|
31525 | this.eventService.addModalPriorityEventListener(events_1.Events.EVENT_COLUMN_PIVOT_CHANGED, this.refreshModel.bind(this, { step: constants_1.Constants.STEP_PIVOT }));
|
31526 | this.eventService.addModalPriorityEventListener(events_1.Events.EVENT_ROW_GROUP_OPENED, this.onRowGroupOpened.bind(this));
|
31527 | this.eventService.addModalPriorityEventListener(events_1.Events.EVENT_FILTER_CHANGED, this.onFilterChanged.bind(this));
|
31528 | this.eventService.addModalPriorityEventListener(events_1.Events.EVENT_SORT_CHANGED, this.onSortChanged.bind(this));
|
31529 | this.eventService.addModalPriorityEventListener(events_1.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED, refreshEverythingFunc);
|
31530 | var refreshMapFunc = this.refreshModel.bind(this, { step: constants_1.Constants.STEP_MAP, keepRenderedRows: true, animate: true });
|
31531 | this.gridOptionsWrapper.addEventListener(gridOptionsWrapper_1.GridOptionsWrapper.PROP_GROUP_REMOVE_SINGLE_CHILDREN, refreshMapFunc);
|
31532 | this.gridOptionsWrapper.addEventListener(gridOptionsWrapper_1.GridOptionsWrapper.PROP_GROUP_REMOVE_LOWEST_SINGLE_CHILDREN, refreshMapFunc);
|
31533 | this.rootNode = new rowNode_1.RowNode();
|
31534 | this.nodeManager = new clientSideNodeManager_1.ClientSideNodeManager(this.rootNode, this.gridOptionsWrapper, this.context, this.eventService, this.columnController, this.gridApi, this.columnApi, this.selectionController);
|
31535 | this.context.wireBean(this.rootNode);
|
31536 | };
|
31537 |
|
31538 | ClientSideRowModel.prototype.ensureRowAtPixel = function (rowNode, pixel) {
|
31539 | var indexAtPixelNow = this.getRowIndexAtPixel(pixel);
|
31540 | var rowNodeAtPixelNow = this.getRow(indexAtPixelNow);
|
31541 | if (rowNodeAtPixelNow === rowNode) {
|
31542 | return false;
|
31543 | }
|
31544 | utils_1.Utils.removeFromArray(this.rootNode.allLeafChildren, rowNode);
|
31545 | utils_1.Utils.insertIntoArray(this.rootNode.allLeafChildren, rowNode, indexAtPixelNow);
|
31546 | this.refreshModel({ step: constants_1.Constants.STEP_EVERYTHING, keepRenderedRows: true, animate: true, keepEditingRows: true });
|
31547 | return true;
|
31548 | };
|
31549 | ClientSideRowModel.prototype.isLastRowFound = function () {
|
31550 | return true;
|
31551 | };
|
31552 | ClientSideRowModel.prototype.getRowCount = function () {
|
31553 | if (this.rowsToDisplay) {
|
31554 | return this.rowsToDisplay.length;
|
31555 | }
|
31556 | else {
|
31557 | return 0;
|
31558 | }
|
31559 | };
|
31560 | ClientSideRowModel.prototype.getRowBounds = function (index) {
|
31561 | if (utils_1.Utils.missing(this.rowsToDisplay)) {
|
31562 | return null;
|
31563 | }
|
31564 | var rowNode = this.rowsToDisplay[index];
|
31565 | if (rowNode) {
|
31566 | return {
|
31567 | rowTop: rowNode.rowTop,
|
31568 | rowHeight: rowNode.rowHeight
|
31569 | };
|
31570 | }
|
31571 | else {
|
31572 | return null;
|
31573 | }
|
31574 | };
|
31575 | ClientSideRowModel.prototype.onRowGroupOpened = function () {
|
31576 | var animate = this.gridOptionsWrapper.isAnimateRows();
|
31577 | this.refreshModel({ step: constants_1.Constants.STEP_MAP, keepRenderedRows: true, animate: animate });
|
31578 | };
|
31579 | ClientSideRowModel.prototype.onFilterChanged = function () {
|
31580 | var animate = this.gridOptionsWrapper.isAnimateRows();
|
31581 | this.refreshModel({ step: constants_1.Constants.STEP_FILTER, keepRenderedRows: true, animate: animate });
|
31582 | };
|
31583 | ClientSideRowModel.prototype.onSortChanged = function () {
|
31584 |
|
31585 |
|
31586 | if (this.gridOptionsWrapper.isEnableServerSideSorting()) {
|
31587 | return;
|
31588 | }
|
31589 | var animate = this.gridOptionsWrapper.isAnimateRows();
|
31590 | this.refreshModel({ step: constants_1.Constants.STEP_SORT, keepRenderedRows: true, animate: animate, keepEditingRows: true });
|
31591 | };
|
31592 | ClientSideRowModel.prototype.getType = function () {
|
31593 | return constants_1.Constants.ROW_MODEL_TYPE_CLIENT_SIDE;
|
31594 | };
|
31595 | ClientSideRowModel.prototype.onValueChanged = function () {
|
31596 | if (this.columnController.isPivotActive()) {
|
31597 | this.refreshModel({ step: constants_1.Constants.STEP_PIVOT });
|
31598 | }
|
31599 | else {
|
31600 | this.refreshModel({ step: constants_1.Constants.STEP_AGGREGATE });
|
31601 | }
|
31602 | };
|
31603 | ClientSideRowModel.prototype.createChangePath = function (rowNodeTransactions) {
|
31604 |
|
31605 |
|
31606 |
|
31607 |
|
31608 |
|
31609 |
|
31610 |
|
31611 | var valueColumns = this.columnController.getValueColumns();
|
31612 | var noValueColumns = utils_1.Utils.missingOrEmpty(valueColumns);
|
31613 | var noTransactions = utils_1.Utils.missingOrEmpty(rowNodeTransactions);
|
31614 | var changedPath = new changedPath_1.ChangedPath(false);
|
31615 | if (noValueColumns || noTransactions) {
|
31616 | changedPath.setInactive();
|
31617 | }
|
31618 | return changedPath;
|
31619 | };
|
31620 | ClientSideRowModel.prototype.refreshModel = function (params) {
|
31621 |
|
31622 |
|
31623 |
|
31624 |
|
31625 |
|
31626 | var _this = this;
|
31627 |
|
31628 |
|
31629 |
|
31630 |
|
31631 |
|
31632 | var changedPath = this.createChangePath(params.rowNodeTransactions);
|
31633 | switch (params.step) {
|
31634 | case constants_1.Constants.STEP_EVERYTHING:
|
31635 |
|
31636 | this.doRowGrouping(params.groupState, params.rowNodeTransactions, params.rowNodeOrder, changedPath);
|
31637 |
|
31638 | case constants_1.Constants.STEP_FILTER:
|
31639 |
|
31640 | this.doFilter();
|
31641 |
|
31642 | case constants_1.Constants.STEP_PIVOT:
|
31643 | this.doPivot(changedPath);
|
31644 | case constants_1.Constants.STEP_AGGREGATE:
|
31645 |
|
31646 | this.doAggregate(changedPath);
|
31647 |
|
31648 | case constants_1.Constants.STEP_SORT:
|
31649 |
|
31650 | this.doSort();
|
31651 |
|
31652 | case constants_1.Constants.STEP_MAP:
|
31653 |
|
31654 | this.doRowsToDisplay();
|
31655 | }
|
31656 | var event = {
|
31657 | type: events_1.Events.EVENT_MODEL_UPDATED,
|
31658 | api: this.gridApi,
|
31659 | columnApi: this.columnApi,
|
31660 | animate: params.animate,
|
31661 | keepRenderedRows: params.keepRenderedRows,
|
31662 | newData: params.newData,
|
31663 | newPage: false
|
31664 | };
|
31665 | this.eventService.dispatchEvent(event);
|
31666 | if (this.$scope) {
|
31667 | setTimeout(function () {
|
31668 | _this.$scope.$apply();
|
31669 | }, 0);
|
31670 | }
|
31671 | };
|
31672 | ClientSideRowModel.prototype.isEmpty = function () {
|
31673 | var rowsMissing;
|
31674 | var doingLegacyTreeData = utils_1.Utils.exists(this.gridOptionsWrapper.getNodeChildDetailsFunc());
|
31675 | if (doingLegacyTreeData) {
|
31676 | rowsMissing = utils_1.Utils.missing(this.rootNode.childrenAfterGroup) || this.rootNode.childrenAfterGroup.length === 0;
|
31677 | }
|
31678 | else {
|
31679 | rowsMissing = utils_1.Utils.missing(this.rootNode.allLeafChildren) || this.rootNode.allLeafChildren.length === 0;
|
31680 | }
|
31681 | var empty = utils_1.Utils.missing(this.rootNode) || rowsMissing || !this.columnController.isReady();
|
31682 | return empty;
|
31683 | };
|
31684 | ClientSideRowModel.prototype.isRowsToRender = function () {
|
31685 | return utils_1.Utils.exists(this.rowsToDisplay) && this.rowsToDisplay.length > 0;
|
31686 | };
|
31687 | ClientSideRowModel.prototype.getNodesInRangeForSelection = function (firstInRange, lastInRange) {
|
31688 |
|
31689 | var firstRowHit = !lastInRange;
|
31690 | var lastRowHit = false;
|
31691 | var lastRow;
|
31692 | var result = [];
|
31693 | var groupsSelectChildren = this.gridOptionsWrapper.isGroupSelectsChildren();
|
31694 | this.forEachNodeAfterFilterAndSort(function (rowNode) {
|
31695 | var lookingForLastRow = firstRowHit && !lastRowHit;
|
31696 |
|
31697 | if (!firstRowHit) {
|
31698 | if (rowNode === lastInRange || rowNode === firstInRange) {
|
31699 | firstRowHit = true;
|
31700 | }
|
31701 | }
|
31702 | var skipThisGroupNode = rowNode.group && groupsSelectChildren;
|
31703 | if (!skipThisGroupNode) {
|
31704 | var inRange = firstRowHit && !lastRowHit;
|
31705 | var childOfLastRow = rowNode.isParentOfNode(lastRow);
|
31706 | if (inRange || childOfLastRow) {
|
31707 | result.push(rowNode);
|
31708 | }
|
31709 | }
|
31710 | if (lookingForLastRow) {
|
31711 | if (rowNode === lastInRange || rowNode === firstInRange) {
|
31712 | lastRowHit = true;
|
31713 | if (rowNode === lastInRange) {
|
31714 | lastRow = lastInRange;
|
31715 | }
|
31716 | else {
|
31717 | lastRow = firstInRange;
|
31718 | }
|
31719 | }
|
31720 | }
|
31721 | });
|
31722 | return result;
|
31723 | };
|
31724 | ClientSideRowModel.prototype.setDatasource = function (datasource) {
|
31725 | console.error('ag-Grid: should never call setDatasource on clientSideRowController');
|
31726 | };
|
31727 | ClientSideRowModel.prototype.getTopLevelNodes = function () {
|
31728 | return this.rootNode ? this.rootNode.childrenAfterGroup : null;
|
31729 | };
|
31730 | ClientSideRowModel.prototype.getRootNode = function () {
|
31731 | return this.rootNode;
|
31732 | };
|
31733 | ClientSideRowModel.prototype.getRow = function (index) {
|
31734 | return this.rowsToDisplay[index];
|
31735 | };
|
31736 | ClientSideRowModel.prototype.isRowPresent = function (rowNode) {
|
31737 | return this.rowsToDisplay.indexOf(rowNode) >= 0;
|
31738 | };
|
31739 | ClientSideRowModel.prototype.getVirtualRowCount = function () {
|
31740 | console.warn('ag-Grid: rowModel.getVirtualRowCount() is not longer a function, use rowModel.getRowCount() instead');
|
31741 | return this.getPageLastRow();
|
31742 | };
|
31743 | ClientSideRowModel.prototype.getPageFirstRow = function () {
|
31744 | return 0;
|
31745 | };
|
31746 | ClientSideRowModel.prototype.getPageLastRow = function () {
|
31747 | if (this.rowsToDisplay) {
|
31748 | return this.rowsToDisplay.length - 1;
|
31749 | }
|
31750 | else {
|
31751 | return 0;
|
31752 | }
|
31753 | };
|
31754 | ClientSideRowModel.prototype.getRowIndexAtPixel = function (pixelToMatch) {
|
31755 | if (this.isEmpty()) {
|
31756 | return -1;
|
31757 | }
|
31758 |
|
31759 |
|
31760 | var bottomPointer = 0;
|
31761 | var topPointer = this.rowsToDisplay.length - 1;
|
31762 |
|
31763 | if (pixelToMatch <= 0) {
|
31764 |
|
31765 | return 0;
|
31766 | }
|
31767 | var lastNode = this.rowsToDisplay[this.rowsToDisplay.length - 1];
|
31768 | if (lastNode.rowTop <= pixelToMatch) {
|
31769 | return this.rowsToDisplay.length - 1;
|
31770 | }
|
31771 | while (true) {
|
31772 | var midPointer = Math.floor((bottomPointer + topPointer) / 2);
|
31773 | var currentRowNode = this.rowsToDisplay[midPointer];
|
31774 | if (this.isRowInPixel(currentRowNode, pixelToMatch)) {
|
31775 | return midPointer;
|
31776 | }
|
31777 | else if (currentRowNode.rowTop < pixelToMatch) {
|
31778 | bottomPointer = midPointer + 1;
|
31779 | }
|
31780 | else if (currentRowNode.rowTop > pixelToMatch) {
|
31781 | topPointer = midPointer - 1;
|
31782 | }
|
31783 | }
|
31784 | };
|
31785 | ClientSideRowModel.prototype.isRowInPixel = function (rowNode, pixelToMatch) {
|
31786 | var topPixel = rowNode.rowTop;
|
31787 | var bottomPixel = rowNode.rowTop + rowNode.rowHeight;
|
31788 | var pixelInRow = topPixel <= pixelToMatch && bottomPixel > pixelToMatch;
|
31789 | return pixelInRow;
|
31790 | };
|
31791 | ClientSideRowModel.prototype.getCurrentPageHeight = function () {
|
31792 | if (this.rowsToDisplay && this.rowsToDisplay.length > 0) {
|
31793 | var lastRow = this.rowsToDisplay[this.rowsToDisplay.length - 1];
|
31794 | var lastPixel = lastRow.rowTop + lastRow.rowHeight;
|
31795 | return lastPixel;
|
31796 | }
|
31797 | else {
|
31798 | return 0;
|
31799 | }
|
31800 | };
|
31801 | ClientSideRowModel.prototype.forEachLeafNode = function (callback) {
|
31802 | if (this.rootNode.allLeafChildren) {
|
31803 | this.rootNode.allLeafChildren.forEach(function (rowNode, index) { return callback(rowNode, index); });
|
31804 | }
|
31805 | };
|
31806 | ClientSideRowModel.prototype.forEachNode = function (callback) {
|
31807 | this.recursivelyWalkNodesAndCallback(this.rootNode.childrenAfterGroup, callback, RecursionType.Normal, 0);
|
31808 | };
|
31809 | ClientSideRowModel.prototype.forEachNodeAfterFilter = function (callback) {
|
31810 | this.recursivelyWalkNodesAndCallback(this.rootNode.childrenAfterFilter, callback, RecursionType.AfterFilter, 0);
|
31811 | };
|
31812 | ClientSideRowModel.prototype.forEachNodeAfterFilterAndSort = function (callback) {
|
31813 | this.recursivelyWalkNodesAndCallback(this.rootNode.childrenAfterSort, callback, RecursionType.AfterFilterAndSort, 0);
|
31814 | };
|
31815 | ClientSideRowModel.prototype.forEachPivotNode = function (callback) {
|
31816 | this.recursivelyWalkNodesAndCallback([this.rootNode], callback, RecursionType.PivotNodes, 0);
|
31817 | };
|
31818 |
|
31819 |
|
31820 |
|
31821 |
|
31822 |
|
31823 | ClientSideRowModel.prototype.recursivelyWalkNodesAndCallback = function (nodes, callback, recursionType, index) {
|
31824 | if (nodes) {
|
31825 | for (var i = 0; i < nodes.length; i++) {
|
31826 | var node = nodes[i];
|
31827 | callback(node, index++);
|
31828 |
|
31829 | if (node.hasChildren()) {
|
31830 |
|
31831 | var nodeChildren = void 0;
|
31832 | switch (recursionType) {
|
31833 | case RecursionType.Normal:
|
31834 | nodeChildren = node.childrenAfterGroup;
|
31835 | break;
|
31836 | case RecursionType.AfterFilter:
|
31837 | nodeChildren = node.childrenAfterFilter;
|
31838 | break;
|
31839 | case RecursionType.AfterFilterAndSort:
|
31840 | nodeChildren = node.childrenAfterSort;
|
31841 | break;
|
31842 | case RecursionType.PivotNodes:
|
31843 |
|
31844 | nodeChildren = !node.leafGroup ? node.childrenAfterSort : null;
|
31845 | break;
|
31846 | }
|
31847 | if (nodeChildren) {
|
31848 | index = this.recursivelyWalkNodesAndCallback(nodeChildren, callback, recursionType, index);
|
31849 | }
|
31850 | }
|
31851 | }
|
31852 | }
|
31853 | return index;
|
31854 | };
|
31855 |
|
31856 |
|
31857 | ClientSideRowModel.prototype.doAggregate = function (changedPath) {
|
31858 | if (this.aggregationStage) {
|
31859 | this.aggregationStage.execute({ rowNode: this.rootNode, changedPath: changedPath });
|
31860 | }
|
31861 | };
|
31862 |
|
31863 |
|
31864 | ClientSideRowModel.prototype.expandOrCollapseAll = function (expand) {
|
31865 | var usingTreeData = this.gridOptionsWrapper.isTreeData();
|
31866 | if (this.rootNode) {
|
31867 | recursiveExpandOrCollapse(this.rootNode.childrenAfterGroup);
|
31868 | }
|
31869 | function recursiveExpandOrCollapse(rowNodes) {
|
31870 | if (!rowNodes) {
|
31871 | return;
|
31872 | }
|
31873 | rowNodes.forEach(function (rowNode) {
|
31874 | var shouldExpandOrCollapse = usingTreeData ? utils_1.Utils.exists(rowNode.childrenAfterGroup) : rowNode.group;
|
31875 | if (shouldExpandOrCollapse) {
|
31876 | rowNode.expanded = expand;
|
31877 | recursiveExpandOrCollapse(rowNode.childrenAfterGroup);
|
31878 | }
|
31879 | });
|
31880 | }
|
31881 | this.refreshModel({ step: constants_1.Constants.STEP_MAP });
|
31882 | };
|
31883 | ClientSideRowModel.prototype.doSort = function () {
|
31884 | this.sortStage.execute({ rowNode: this.rootNode });
|
31885 | };
|
31886 | ClientSideRowModel.prototype.doRowGrouping = function (groupState, rowNodeTransactions, rowNodeOrder, changedPath) {
|
31887 | var _this = this;
|
31888 |
|
31889 | var doingLegacyTreeData = utils_1.Utils.exists(this.gridOptionsWrapper.getNodeChildDetailsFunc());
|
31890 | if (doingLegacyTreeData) {
|
31891 | return;
|
31892 | }
|
31893 | if (this.groupStage) {
|
31894 | if (utils_1.Utils.exists(rowNodeTransactions)) {
|
31895 | rowNodeTransactions.forEach(function (tran) {
|
31896 | _this.groupStage.execute({ rowNode: _this.rootNode,
|
31897 | rowNodeTransaction: tran,
|
31898 | rowNodeOrder: rowNodeOrder,
|
31899 | changedPath: changedPath });
|
31900 | });
|
31901 | }
|
31902 | else {
|
31903 |
|
31904 | this.selectionController.removeGroupsFromSelection();
|
31905 | this.groupStage.execute({ rowNode: this.rootNode, changedPath: changedPath });
|
31906 |
|
31907 | this.restoreGroupState(groupState);
|
31908 | }
|
31909 | if (this.gridOptionsWrapper.isGroupSelectsChildren()) {
|
31910 | this.selectionController.updateGroupsFromChildrenSelections();
|
31911 | }
|
31912 | }
|
31913 | else {
|
31914 | this.rootNode.childrenAfterGroup = this.rootNode.allLeafChildren;
|
31915 | }
|
31916 | };
|
31917 | ClientSideRowModel.prototype.restoreGroupState = function (groupState) {
|
31918 | if (!groupState) {
|
31919 | return;
|
31920 | }
|
31921 | utils_1.Utils.traverseNodesWithKey(this.rootNode.childrenAfterGroup, function (node, key) {
|
31922 |
|
31923 |
|
31924 |
|
31925 | if (typeof groupState[key] === 'boolean') {
|
31926 | node.expanded = groupState[key];
|
31927 | }
|
31928 | });
|
31929 | };
|
31930 | ClientSideRowModel.prototype.doFilter = function () {
|
31931 | this.filterStage.execute({ rowNode: this.rootNode });
|
31932 | };
|
31933 | ClientSideRowModel.prototype.doPivot = function (changedPath) {
|
31934 | if (this.pivotStage) {
|
31935 | this.pivotStage.execute({ rowNode: this.rootNode, changedPath: changedPath });
|
31936 | }
|
31937 | };
|
31938 | ClientSideRowModel.prototype.getGroupState = function () {
|
31939 | if (!this.rootNode.childrenAfterGroup || !this.gridOptionsWrapper.isRememberGroupStateWhenNewData()) {
|
31940 | return null;
|
31941 | }
|
31942 | var result = {};
|
31943 | utils_1.Utils.traverseNodesWithKey(this.rootNode.childrenAfterGroup, function (node, key) { return result[key] = node.expanded; });
|
31944 | return result;
|
31945 | };
|
31946 | ClientSideRowModel.prototype.getCopyOfNodesMap = function () {
|
31947 | return this.nodeManager.getCopyOfNodesMap();
|
31948 | };
|
31949 | ClientSideRowModel.prototype.getRowNode = function (id) {
|
31950 | return this.nodeManager.getRowNode(id);
|
31951 | };
|
31952 |
|
31953 | ClientSideRowModel.prototype.setRowData = function (rowData) {
|
31954 |
|
31955 |
|
31956 |
|
31957 | var groupState = this.getGroupState();
|
31958 | this.nodeManager.setRowData(rowData);
|
31959 |
|
31960 |
|
31961 |
|
31962 |
|
31963 | var rowDataChangedEvent = {
|
31964 | type: events_1.Events.EVENT_ROW_DATA_CHANGED,
|
31965 | api: this.gridApi,
|
31966 | columnApi: this.columnApi
|
31967 | };
|
31968 | this.eventService.dispatchEvent(rowDataChangedEvent);
|
31969 | this.refreshModel({
|
31970 | step: constants_1.Constants.STEP_EVERYTHING,
|
31971 | groupState: groupState,
|
31972 | newData: true
|
31973 | });
|
31974 | };
|
31975 | ClientSideRowModel.prototype.batchUpdateRowData = function (rowDataTransaction, callback) {
|
31976 | var _this = this;
|
31977 | if (!this.rowDataTransactionBatch) {
|
31978 | this.rowDataTransactionBatch = [];
|
31979 | var waitMillis = this.gridOptionsWrapper.getBatchUpdateWaitMillis();
|
31980 | setTimeout(function () {
|
31981 | _this.executeBatchUpdateRowData();
|
31982 | _this.rowDataTransactionBatch = null;
|
31983 | }, waitMillis);
|
31984 | }
|
31985 | this.rowDataTransactionBatch.push({ rowDataTransaction: rowDataTransaction, callback: callback });
|
31986 | };
|
31987 | ClientSideRowModel.prototype.executeBatchUpdateRowData = function () {
|
31988 | var _this = this;
|
31989 | this.valueCache.onDataChanged();
|
31990 | var callbackFuncsBound = [];
|
31991 | var rowNodeTrans = [];
|
31992 | this.rowDataTransactionBatch.forEach(function (tranItem) {
|
31993 | var rowNodeTran = _this.nodeManager.updateRowData(tranItem.rowDataTransaction, null);
|
31994 | rowNodeTrans.push(rowNodeTran);
|
31995 | if (tranItem.callback) {
|
31996 | callbackFuncsBound.push(tranItem.callback.bind(rowNodeTran));
|
31997 | }
|
31998 | });
|
31999 | this.commonUpdateRowData(rowNodeTrans);
|
32000 |
|
32001 | if (callbackFuncsBound.length > 0) {
|
32002 | setTimeout(function () {
|
32003 | callbackFuncsBound.forEach(function (func) { return func(); });
|
32004 | }, 0);
|
32005 | }
|
32006 | };
|
32007 | ClientSideRowModel.prototype.updateRowData = function (rowDataTran, rowNodeOrder) {
|
32008 | this.valueCache.onDataChanged();
|
32009 | var rowNodeTran = this.nodeManager.updateRowData(rowDataTran, rowNodeOrder);
|
32010 | this.commonUpdateRowData([rowNodeTran], rowNodeOrder);
|
32011 | return rowNodeTran;
|
32012 | };
|
32013 |
|
32014 | ClientSideRowModel.prototype.commonUpdateRowData = function (rowNodeTrans, rowNodeOrder) {
|
32015 | this.refreshModel({
|
32016 | step: constants_1.Constants.STEP_EVERYTHING,
|
32017 | rowNodeTransactions: rowNodeTrans,
|
32018 | rowNodeOrder: rowNodeOrder,
|
32019 | keepRenderedRows: true,
|
32020 | animate: true,
|
32021 | keepEditingRows: true
|
32022 | });
|
32023 | var event = {
|
32024 | type: events_1.Events.EVENT_ROW_DATA_UPDATED,
|
32025 | api: this.gridApi,
|
32026 | columnApi: this.columnApi
|
32027 | };
|
32028 | this.eventService.dispatchEvent(event);
|
32029 | };
|
32030 | ClientSideRowModel.prototype.doRowsToDisplay = function () {
|
32031 | this.rowsToDisplay = this.flattenStage.execute({ rowNode: this.rootNode });
|
32032 | };
|
32033 | ClientSideRowModel.prototype.onRowHeightChanged = function () {
|
32034 | this.refreshModel({ step: constants_1.Constants.STEP_MAP, keepRenderedRows: true, keepEditingRows: true });
|
32035 | };
|
32036 | ClientSideRowModel.prototype.resetRowHeights = function () {
|
32037 | this.forEachNode(function (rowNode) { return rowNode.setRowHeight(null); });
|
32038 | this.onRowHeightChanged();
|
32039 | };
|
32040 | __decorate([
|
32041 | context_1.Autowired('gridOptionsWrapper'),
|
32042 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
32043 | ], ClientSideRowModel.prototype, "gridOptionsWrapper", void 0);
|
32044 | __decorate([
|
32045 | context_1.Autowired('columnController'),
|
32046 | __metadata("design:type", columnController_1.ColumnController)
|
32047 | ], ClientSideRowModel.prototype, "columnController", void 0);
|
32048 | __decorate([
|
32049 | context_1.Autowired('filterManager'),
|
32050 | __metadata("design:type", filterManager_1.FilterManager)
|
32051 | ], ClientSideRowModel.prototype, "filterManager", void 0);
|
32052 | __decorate([
|
32053 | context_1.Autowired('$scope'),
|
32054 | __metadata("design:type", Object)
|
32055 | ], ClientSideRowModel.prototype, "$scope", void 0);
|
32056 | __decorate([
|
32057 | context_1.Autowired('selectionController'),
|
32058 | __metadata("design:type", selectionController_1.SelectionController)
|
32059 | ], ClientSideRowModel.prototype, "selectionController", void 0);
|
32060 | __decorate([
|
32061 | context_1.Autowired('eventService'),
|
32062 | __metadata("design:type", eventService_1.EventService)
|
32063 | ], ClientSideRowModel.prototype, "eventService", void 0);
|
32064 | __decorate([
|
32065 | context_1.Autowired('context'),
|
32066 | __metadata("design:type", context_1.Context)
|
32067 | ], ClientSideRowModel.prototype, "context", void 0);
|
32068 | __decorate([
|
32069 | context_1.Autowired('valueService'),
|
32070 | __metadata("design:type", valueService_1.ValueService)
|
32071 | ], ClientSideRowModel.prototype, "valueService", void 0);
|
32072 | __decorate([
|
32073 | context_1.Autowired('valueCache'),
|
32074 | __metadata("design:type", valueCache_1.ValueCache)
|
32075 | ], ClientSideRowModel.prototype, "valueCache", void 0);
|
32076 | __decorate([
|
32077 | context_1.Autowired('columnApi'),
|
32078 | __metadata("design:type", columnApi_1.ColumnApi)
|
32079 | ], ClientSideRowModel.prototype, "columnApi", void 0);
|
32080 | __decorate([
|
32081 | context_1.Autowired('gridApi'),
|
32082 | __metadata("design:type", gridApi_1.GridApi)
|
32083 | ], ClientSideRowModel.prototype, "gridApi", void 0);
|
32084 | __decorate([
|
32085 | context_1.Autowired('filterStage'),
|
32086 | __metadata("design:type", Object)
|
32087 | ], ClientSideRowModel.prototype, "filterStage", void 0);
|
32088 | __decorate([
|
32089 | context_1.Autowired('sortStage'),
|
32090 | __metadata("design:type", Object)
|
32091 | ], ClientSideRowModel.prototype, "sortStage", void 0);
|
32092 | __decorate([
|
32093 | context_1.Autowired('flattenStage'),
|
32094 | __metadata("design:type", Object)
|
32095 | ], ClientSideRowModel.prototype, "flattenStage", void 0);
|
32096 | __decorate([
|
32097 | context_1.Optional('groupStage'),
|
32098 | __metadata("design:type", Object)
|
32099 | ], ClientSideRowModel.prototype, "groupStage", void 0);
|
32100 | __decorate([
|
32101 | context_1.Optional('aggregationStage'),
|
32102 | __metadata("design:type", Object)
|
32103 | ], ClientSideRowModel.prototype, "aggregationStage", void 0);
|
32104 | __decorate([
|
32105 | context_1.Optional('pivotStage'),
|
32106 | __metadata("design:type", Object)
|
32107 | ], ClientSideRowModel.prototype, "pivotStage", void 0);
|
32108 | __decorate([
|
32109 | context_1.PostConstruct,
|
32110 | __metadata("design:type", Function),
|
32111 | __metadata("design:paramtypes", []),
|
32112 | __metadata("design:returntype", void 0)
|
32113 | ], ClientSideRowModel.prototype, "init", null);
|
32114 | ClientSideRowModel = __decorate([
|
32115 | context_1.Bean('rowModel')
|
32116 | ], ClientSideRowModel);
|
32117 | return ClientSideRowModel;
|
32118 | }());
|
32119 | exports.ClientSideRowModel = ClientSideRowModel;
|
32120 |
|
32121 |
|
32122 | }),
|
32123 |
|
32124 | (function(module, exports, __webpack_require__) {
|
32125 |
|
32126 | "use strict";
|
32127 |
|
32128 |
|
32129 |
|
32130 |
|
32131 |
|
32132 |
|
32133 |
|
32134 | Object.defineProperty(exports, "__esModule", { value: true });
|
32135 | var rowNode_1 = __webpack_require__(16);
|
32136 | var utils_1 = __webpack_require__(1);
|
32137 | var events_1 = __webpack_require__(5);
|
32138 | var ClientSideNodeManager = (function () {
|
32139 | function ClientSideNodeManager(rootNode, gridOptionsWrapper, context, eventService, columnController, gridApi, columnApi, selectionController) {
|
32140 | this.nextId = 0;
|
32141 |
|
32142 | this.allNodesMap = {};
|
32143 | this.rootNode = rootNode;
|
32144 | this.gridOptionsWrapper = gridOptionsWrapper;
|
32145 | this.context = context;
|
32146 | this.eventService = eventService;
|
32147 | this.columnController = columnController;
|
32148 | this.gridApi = gridApi;
|
32149 | this.columnApi = columnApi;
|
32150 | this.selectionController = selectionController;
|
32151 | this.rootNode.group = true;
|
32152 | this.rootNode.level = -1;
|
32153 | this.rootNode.id = ClientSideNodeManager.ROOT_NODE_ID;
|
32154 | this.rootNode.allLeafChildren = [];
|
32155 | this.rootNode.childrenAfterGroup = [];
|
32156 | this.rootNode.childrenAfterSort = [];
|
32157 | this.rootNode.childrenAfterFilter = [];
|
32158 |
|
32159 | this.postConstruct();
|
32160 | }
|
32161 |
|
32162 | ClientSideNodeManager.prototype.postConstruct = function () {
|
32163 |
|
32164 | this.getNodeChildDetails = this.gridOptionsWrapper.getNodeChildDetailsFunc();
|
32165 | this.suppressParentsInRowNodes = this.gridOptionsWrapper.isSuppressParentsInRowNodes();
|
32166 | this.doesDataFlower = this.gridOptionsWrapper.getDoesDataFlowerFunc();
|
32167 | this.isRowMasterFunc = this.gridOptionsWrapper.getIsRowMasterFunc();
|
32168 | this.doingLegacyTreeData = utils_1.Utils.exists(this.getNodeChildDetails);
|
32169 | this.doingMasterDetail = this.gridOptionsWrapper.isMasterDetail();
|
32170 | };
|
32171 | ClientSideNodeManager.prototype.getCopyOfNodesMap = function () {
|
32172 | var result = utils_1.Utils.cloneObject(this.allNodesMap);
|
32173 | return result;
|
32174 | };
|
32175 | ClientSideNodeManager.prototype.getRowNode = function (id) {
|
32176 | return this.allNodesMap[id];
|
32177 | };
|
32178 | ClientSideNodeManager.prototype.setRowData = function (rowData) {
|
32179 | this.rootNode.childrenAfterFilter = null;
|
32180 | this.rootNode.childrenAfterGroup = null;
|
32181 | this.rootNode.childrenAfterSort = null;
|
32182 | this.rootNode.childrenMapped = null;
|
32183 | this.nextId = 0;
|
32184 | this.allNodesMap = {};
|
32185 | if (!rowData) {
|
32186 | this.rootNode.allLeafChildren = [];
|
32187 | this.rootNode.childrenAfterGroup = [];
|
32188 | return;
|
32189 | }
|
32190 |
|
32191 | var result = this.recursiveFunction(rowData, null, ClientSideNodeManager.TOP_LEVEL);
|
32192 | if (this.doingLegacyTreeData) {
|
32193 | this.rootNode.childrenAfterGroup = result;
|
32194 | this.setLeafChildren(this.rootNode);
|
32195 | }
|
32196 | else {
|
32197 | this.rootNode.allLeafChildren = result;
|
32198 | }
|
32199 | };
|
32200 | ClientSideNodeManager.prototype.updateRowData = function (rowDataTran, rowNodeOrder) {
|
32201 | var _this = this;
|
32202 | if (this.isLegacyTreeData()) {
|
32203 | return null;
|
32204 | }
|
32205 | var add = rowDataTran.add, addIndex = rowDataTran.addIndex, remove = rowDataTran.remove, update = rowDataTran.update;
|
32206 | var rowNodeTransaction = {
|
32207 | remove: [],
|
32208 | update: [],
|
32209 | add: []
|
32210 | };
|
32211 | if (utils_1.Utils.exists(add)) {
|
32212 | var useIndex = typeof addIndex === 'number' && addIndex >= 0;
|
32213 | if (useIndex) {
|
32214 |
|
32215 | add.reverse().forEach(function (item) {
|
32216 | var newRowNode = _this.addRowNode(item, addIndex);
|
32217 | rowNodeTransaction.add.push(newRowNode);
|
32218 | });
|
32219 | }
|
32220 | else {
|
32221 | add.forEach(function (item) {
|
32222 | var newRowNode = _this.addRowNode(item);
|
32223 | rowNodeTransaction.add.push(newRowNode);
|
32224 | });
|
32225 | }
|
32226 | }
|
32227 | if (utils_1.Utils.exists(remove)) {
|
32228 | var anyNodesSelected_1 = false;
|
32229 | remove.forEach(function (item) {
|
32230 | var rowNode = _this.lookupRowNode(item);
|
32231 | if (!rowNode) {
|
32232 | return;
|
32233 | }
|
32234 | if (rowNode.isSelected()) {
|
32235 | anyNodesSelected_1 = true;
|
32236 | }
|
32237 | _this.updatedRowNode(rowNode, item, false);
|
32238 | rowNodeTransaction.remove.push(rowNode);
|
32239 | });
|
32240 | if (anyNodesSelected_1) {
|
32241 | this.selectionController.updateGroupsFromChildrenSelections();
|
32242 | var event_1 = {
|
32243 | type: events_1.Events.EVENT_SELECTION_CHANGED,
|
32244 | api: this.gridApi,
|
32245 | columnApi: this.columnApi
|
32246 | };
|
32247 | this.eventService.dispatchEvent(event_1);
|
32248 | }
|
32249 | }
|
32250 | if (utils_1.Utils.exists(update)) {
|
32251 | update.forEach(function (item) {
|
32252 | var rowNode = _this.lookupRowNode(item);
|
32253 | if (!rowNode) {
|
32254 | return;
|
32255 | }
|
32256 | _this.updatedRowNode(rowNode, item, true);
|
32257 | rowNodeTransaction.update.push(rowNode);
|
32258 | });
|
32259 | }
|
32260 | if (rowNodeOrder) {
|
32261 | utils_1.Utils.sortRowNodesByOrder(this.rootNode.allLeafChildren, rowNodeOrder);
|
32262 | }
|
32263 | return rowNodeTransaction;
|
32264 | };
|
32265 | ClientSideNodeManager.prototype.addRowNode = function (data, index) {
|
32266 | var newNode = this.createNode(data, null, ClientSideNodeManager.TOP_LEVEL);
|
32267 | if (utils_1.Utils.exists(index)) {
|
32268 | utils_1.Utils.insertIntoArray(this.rootNode.allLeafChildren, newNode, index);
|
32269 | }
|
32270 | else {
|
32271 | this.rootNode.allLeafChildren.push(newNode);
|
32272 | }
|
32273 | return newNode;
|
32274 | };
|
32275 | ClientSideNodeManager.prototype.lookupRowNode = function (data) {
|
32276 | var rowNodeIdFunc = this.gridOptionsWrapper.getRowNodeIdFunc();
|
32277 | var rowNode;
|
32278 | if (utils_1.Utils.exists(rowNodeIdFunc)) {
|
32279 |
|
32280 | var id = rowNodeIdFunc(data);
|
32281 | rowNode = this.allNodesMap[id];
|
32282 | if (!rowNode) {
|
32283 | console.error("ag-Grid: could not find row id=" + id + ", data item was not found for this id");
|
32284 | return null;
|
32285 | }
|
32286 | }
|
32287 | else {
|
32288 |
|
32289 | rowNode = utils_1.Utils.find(this.rootNode.allLeafChildren, function (rowNode) { return rowNode.data === data; });
|
32290 | if (!rowNode) {
|
32291 | console.error("ag-Grid: could not find data item as object was not found", data);
|
32292 | return null;
|
32293 | }
|
32294 | }
|
32295 | return rowNode;
|
32296 | };
|
32297 | ClientSideNodeManager.prototype.updatedRowNode = function (rowNode, data, update) {
|
32298 | if (update) {
|
32299 |
|
32300 | rowNode.updateData(data);
|
32301 | }
|
32302 | else {
|
32303 |
|
32304 |
|
32305 | rowNode.setSelected(false, false, true);
|
32306 |
|
32307 | rowNode.clearRowTop();
|
32308 | utils_1.Utils.removeFromArray(this.rootNode.allLeafChildren, rowNode);
|
32309 | this.allNodesMap[rowNode.id] = undefined;
|
32310 | }
|
32311 | };
|
32312 | ClientSideNodeManager.prototype.recursiveFunction = function (rowData, parent, level) {
|
32313 | var _this = this;
|
32314 |
|
32315 | if (typeof rowData === 'string') {
|
32316 | console.warn('ag-Grid: rowData must be an array, however you passed in a string. If you are loading JSON, make sure you convert the JSON string to JavaScript objects first');
|
32317 | return;
|
32318 | }
|
32319 | var rowNodes = [];
|
32320 | rowData.forEach(function (dataItem) {
|
32321 | var node = _this.createNode(dataItem, parent, level);
|
32322 | rowNodes.push(node);
|
32323 | });
|
32324 | return rowNodes;
|
32325 | };
|
32326 | ClientSideNodeManager.prototype.createNode = function (dataItem, parent, level) {
|
32327 | var node = new rowNode_1.RowNode();
|
32328 | this.context.wireBean(node);
|
32329 | var doingTreeData = this.gridOptionsWrapper.isTreeData();
|
32330 | var doingLegacyTreeData = !doingTreeData && utils_1.Utils.exists(this.getNodeChildDetails);
|
32331 | var nodeChildDetails = doingLegacyTreeData ? this.getNodeChildDetails(dataItem) : null;
|
32332 | if (nodeChildDetails && nodeChildDetails.group) {
|
32333 | node.group = true;
|
32334 | node.childrenAfterGroup = this.recursiveFunction(nodeChildDetails.children, node, level + 1);
|
32335 | node.expanded = nodeChildDetails.expanded === true;
|
32336 | node.field = nodeChildDetails.field;
|
32337 | node.key = nodeChildDetails.key;
|
32338 | node.canFlower = node.master;
|
32339 |
|
32340 | this.setLeafChildren(node);
|
32341 | }
|
32342 | else {
|
32343 | node.group = false;
|
32344 | if (doingTreeData) {
|
32345 | node.master = false;
|
32346 | node.expanded = false;
|
32347 | }
|
32348 | else {
|
32349 |
|
32350 | if (this.doesDataFlower) {
|
32351 | node.master = this.doesDataFlower(dataItem);
|
32352 | }
|
32353 | else if (this.doingMasterDetail) {
|
32354 |
|
32355 |
|
32356 | if (this.isRowMasterFunc) {
|
32357 | node.master = this.isRowMasterFunc(dataItem);
|
32358 | }
|
32359 | else {
|
32360 | node.master = true;
|
32361 | }
|
32362 | }
|
32363 | else {
|
32364 | node.master = false;
|
32365 | }
|
32366 | var rowGroupColumns = this.columnController.getRowGroupColumns();
|
32367 | var numRowGroupColumns = rowGroupColumns ? rowGroupColumns.length : 0;
|
32368 |
|
32369 | var masterRowLevel = level + numRowGroupColumns;
|
32370 | node.expanded = node.master ? this.isExpanded(masterRowLevel) : false;
|
32371 | }
|
32372 | }
|
32373 |
|
32374 | node.canFlower = node.master;
|
32375 | if (parent && !this.suppressParentsInRowNodes) {
|
32376 | node.parent = parent;
|
32377 | }
|
32378 | node.level = level;
|
32379 | node.setDataAndId(dataItem, this.nextId.toString());
|
32380 | this.allNodesMap[node.id] = node;
|
32381 | this.nextId++;
|
32382 | return node;
|
32383 | };
|
32384 | ClientSideNodeManager.prototype.isExpanded = function (level) {
|
32385 | var expandByDefault = this.gridOptionsWrapper.getGroupDefaultExpanded();
|
32386 | if (expandByDefault === -1) {
|
32387 | return true;
|
32388 | }
|
32389 | else {
|
32390 | return level < expandByDefault;
|
32391 | }
|
32392 | };
|
32393 |
|
32394 | ClientSideNodeManager.prototype.setLeafChildren = function (node) {
|
32395 | node.allLeafChildren = [];
|
32396 | if (node.childrenAfterGroup) {
|
32397 | node.childrenAfterGroup.forEach(function (childAfterGroup) {
|
32398 | if (childAfterGroup.group) {
|
32399 | if (childAfterGroup.allLeafChildren) {
|
32400 | childAfterGroup.allLeafChildren.forEach(function (leafChild) { return node.allLeafChildren.push(leafChild); });
|
32401 | }
|
32402 | }
|
32403 | else {
|
32404 | node.allLeafChildren.push(childAfterGroup);
|
32405 | }
|
32406 | });
|
32407 | }
|
32408 | };
|
32409 | ClientSideNodeManager.prototype.insertItemsAtIndex = function (index, rowData) {
|
32410 | if (this.isLegacyTreeData()) {
|
32411 | return null;
|
32412 | }
|
32413 | var nodeList = this.rootNode.allLeafChildren;
|
32414 | if (index > nodeList.length) {
|
32415 | console.warn("ag-Grid: invalid index " + index + ", max index is " + nodeList.length);
|
32416 | return;
|
32417 | }
|
32418 | var newNodes = [];
|
32419 |
|
32420 | for (var i = rowData.length - 1; i >= 0; i--) {
|
32421 | var data = rowData[i];
|
32422 | var newNode = this.createNode(data, null, ClientSideNodeManager.TOP_LEVEL);
|
32423 | utils_1.Utils.insertIntoArray(nodeList, newNode, index);
|
32424 | newNodes.push(newNode);
|
32425 | }
|
32426 | return newNodes.length > 0 ? newNodes : null;
|
32427 | };
|
32428 | ClientSideNodeManager.prototype.addItems = function (items) {
|
32429 | var nodeList = this.rootNode.allLeafChildren;
|
32430 | return this.insertItemsAtIndex(nodeList.length, items);
|
32431 | };
|
32432 | ClientSideNodeManager.prototype.isLegacyTreeData = function () {
|
32433 | var rowsAlreadyGrouped = utils_1.Utils.exists(this.gridOptionsWrapper.getNodeChildDetailsFunc());
|
32434 | if (rowsAlreadyGrouped) {
|
32435 | console.warn('ag-Grid: adding and removing rows is not supported when using nodeChildDetailsFunc, ie it is not ' +
|
32436 | 'supported for legacy tree data. Please see the docs on the new preferred way of providing tree data that works with delta updates.');
|
32437 | return true;
|
32438 | }
|
32439 | else {
|
32440 | return false;
|
32441 | }
|
32442 | };
|
32443 | ClientSideNodeManager.TOP_LEVEL = 0;
|
32444 | ClientSideNodeManager.ROOT_NODE_ID = 'ROOT_NODE_ID';
|
32445 | return ClientSideNodeManager;
|
32446 | }());
|
32447 | exports.ClientSideNodeManager = ClientSideNodeManager;
|
32448 |
|
32449 |
|
32450 | }),
|
32451 |
|
32452 | (function(module, exports, __webpack_require__) {
|
32453 |
|
32454 | "use strict";
|
32455 |
|
32456 |
|
32457 |
|
32458 |
|
32459 |
|
32460 |
|
32461 |
|
32462 | Object.defineProperty(exports, "__esModule", { value: true });
|
32463 |
|
32464 | var BaseFrameworkFactory = (function () {
|
32465 | function BaseFrameworkFactory() {
|
32466 | }
|
32467 | BaseFrameworkFactory.prototype.dateComponent = function (gridOptions) {
|
32468 | return gridOptions.dateComponent;
|
32469 | };
|
32470 | BaseFrameworkFactory.prototype.colDefFloatingCellRenderer = function (colDef) {
|
32471 | return colDef.pinnedRowCellRenderer;
|
32472 | };
|
32473 | BaseFrameworkFactory.prototype.colDefCellRenderer = function (colDef) {
|
32474 | return colDef.cellRenderer;
|
32475 | };
|
32476 | BaseFrameworkFactory.prototype.colDefCellEditor = function (colDef) {
|
32477 | return colDef.cellEditor;
|
32478 | };
|
32479 | BaseFrameworkFactory.prototype.colDefFilter = function (colDef) {
|
32480 | return colDef.filter;
|
32481 | };
|
32482 | BaseFrameworkFactory.prototype.gridOptionsFullWidthCellRenderer = function (gridOptions) {
|
32483 | return gridOptions.fullWidthCellRenderer;
|
32484 | };
|
32485 | BaseFrameworkFactory.prototype.gridOptionsGroupRowRenderer = function (gridOptions) {
|
32486 | return gridOptions.groupRowRenderer;
|
32487 | };
|
32488 | BaseFrameworkFactory.prototype.gridOptionsGroupRowInnerRenderer = function (gridOptions) {
|
32489 | return gridOptions.groupRowInnerRenderer;
|
32490 | };
|
32491 | BaseFrameworkFactory.prototype.setTimeout = function (action, timeout) {
|
32492 | setTimeout(action, timeout);
|
32493 | };
|
32494 | return BaseFrameworkFactory;
|
32495 | }());
|
32496 | exports.BaseFrameworkFactory = BaseFrameworkFactory;
|
32497 |
|
32498 |
|
32499 | }),
|
32500 |
|
32501 | (function(module, exports, __webpack_require__) {
|
32502 |
|
32503 | "use strict";
|
32504 |
|
32505 |
|
32506 |
|
32507 |
|
32508 |
|
32509 |
|
32510 |
|
32511 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
32512 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
32513 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
32514 | 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;
|
32515 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
32516 | };
|
32517 | Object.defineProperty(exports, "__esModule", { value: true });
|
32518 | var context_1 = __webpack_require__(0);
|
32519 | var LINE_SEPARATOR = '\r\n';
|
32520 | var XmlFactory = (function () {
|
32521 | function XmlFactory() {
|
32522 | }
|
32523 | XmlFactory.prototype.createXml = function (xmlElement, booleanTransformer) {
|
32524 | var _this = this;
|
32525 | var props = "";
|
32526 | if (xmlElement.properties) {
|
32527 | if (xmlElement.properties.prefixedAttributes) {
|
32528 | xmlElement.properties.prefixedAttributes.forEach(function (prefixedSet) {
|
32529 | Object.keys(prefixedSet.map).forEach(function (key) {
|
32530 | props += _this.returnAttributeIfPopulated(prefixedSet.prefix + key, prefixedSet.map[key], booleanTransformer);
|
32531 | });
|
32532 | });
|
32533 | }
|
32534 | if (xmlElement.properties.rawMap) {
|
32535 | Object.keys(xmlElement.properties.rawMap).forEach(function (key) {
|
32536 | props += _this.returnAttributeIfPopulated(key, xmlElement.properties.rawMap[key], booleanTransformer);
|
32537 | });
|
32538 | }
|
32539 | }
|
32540 | var result = "<" + xmlElement.name + props;
|
32541 | if (!xmlElement.children && xmlElement.textNode == null) {
|
32542 | return result + "/>" + LINE_SEPARATOR;
|
32543 | }
|
32544 | if (xmlElement.textNode != null) {
|
32545 | return result + ">" + xmlElement.textNode + "</" + xmlElement.name + ">" + LINE_SEPARATOR;
|
32546 | }
|
32547 | result += ">" + LINE_SEPARATOR;
|
32548 | xmlElement.children.forEach(function (it) {
|
32549 | result += _this.createXml(it, booleanTransformer);
|
32550 | });
|
32551 | return result + "</" + xmlElement.name + ">" + LINE_SEPARATOR;
|
32552 | };
|
32553 | XmlFactory.prototype.returnAttributeIfPopulated = function (key, value, booleanTransformer) {
|
32554 | if (!value) {
|
32555 | return "";
|
32556 | }
|
32557 | var xmlValue = value;
|
32558 | if ((typeof (value) === 'boolean')) {
|
32559 | if (booleanTransformer) {
|
32560 | xmlValue = booleanTransformer(value);
|
32561 | }
|
32562 | }
|
32563 | xmlValue = '"' + xmlValue + '"';
|
32564 | return " " + key + "=" + xmlValue;
|
32565 | };
|
32566 | XmlFactory = __decorate([
|
32567 | context_1.Bean('xmlFactory')
|
32568 | ], XmlFactory);
|
32569 | return XmlFactory;
|
32570 | }());
|
32571 | exports.XmlFactory = XmlFactory;
|
32572 |
|
32573 |
|
32574 | }),
|
32575 |
|
32576 | (function(module, exports, __webpack_require__) {
|
32577 |
|
32578 | "use strict";
|
32579 | (function(global) { |
32580 |
|
32581 |
|
32582 |
|
32583 |
|
32584 |
|
32585 |
|
32586 |
|
32587 | Object.defineProperty(exports, "__esModule", { value: true });
|
32588 | var globalObj = typeof global === 'undefined' ? {} : global;
|
32589 | globalObj.HTMLElement = typeof HTMLElement === 'undefined' ? {} : HTMLElement;
|
32590 | globalObj.HTMLButtonElement = typeof HTMLButtonElement === 'undefined' ? {} : HTMLButtonElement;
|
32591 | globalObj.HTMLSelectElement = typeof HTMLSelectElement === 'undefined' ? {} : HTMLSelectElement;
|
32592 | globalObj.HTMLInputElement = typeof HTMLInputElement === 'undefined' ? {} : HTMLInputElement;
|
32593 | globalObj.Node = typeof Node === 'undefined' ? {} : Node;
|
32594 | globalObj.MouseEvent = typeof MouseEvent === 'undefined' ? {} : MouseEvent;
|
32595 |
|
32596 | var balancedColumnTreeBuilder_1 = __webpack_require__(38);
|
32597 | exports.BalancedColumnTreeBuilder = balancedColumnTreeBuilder_1.BalancedColumnTreeBuilder;
|
32598 | var columnController_1 = __webpack_require__(4);
|
32599 | exports.ColumnController = columnController_1.ColumnController;
|
32600 | var columnKeyCreator_1 = __webpack_require__(107);
|
32601 | exports.ColumnKeyCreator = columnKeyCreator_1.ColumnKeyCreator;
|
32602 | var columnUtils_1 = __webpack_require__(31);
|
32603 | exports.ColumnUtils = columnUtils_1.ColumnUtils;
|
32604 | var displayedGroupCreator_1 = __webpack_require__(48);
|
32605 | exports.DisplayedGroupCreator = displayedGroupCreator_1.DisplayedGroupCreator;
|
32606 | var groupInstanceIdCreator_1 = __webpack_require__(83);
|
32607 | exports.GroupInstanceIdCreator = groupInstanceIdCreator_1.GroupInstanceIdCreator;
|
32608 |
|
32609 | var componentUtil_1 = __webpack_require__(62);
|
32610 | exports.ComponentUtil = componentUtil_1.ComponentUtil;
|
32611 | var colDefUtil_1 = __webpack_require__(106);
|
32612 | exports.ColDefUtil = colDefUtil_1.ColDefUtil;
|
32613 | var componentProvider_1 = __webpack_require__(66);
|
32614 | exports.ComponentProvider = componentProvider_1.ComponentProvider;
|
32615 | var agGridNg1_1 = __webpack_require__(135);
|
32616 | exports.initialiseAgGridWithAngular1 = agGridNg1_1.initialiseAgGridWithAngular1;
|
32617 | var agGridWebComponent_1 = __webpack_require__(140);
|
32618 | exports.initialiseAgGridWithWebComponents = agGridWebComponent_1.initialiseAgGridWithWebComponents;
|
32619 |
|
32620 | var beanStub_1 = __webpack_require__(13);
|
32621 | exports.BeanStub = beanStub_1.BeanStub;
|
32622 | var context_1 = __webpack_require__(0);
|
32623 | exports.Context = context_1.Context;
|
32624 | exports.Autowired = context_1.Autowired;
|
32625 | exports.PostConstruct = context_1.PostConstruct;
|
32626 | exports.PreConstruct = context_1.PreConstruct;
|
32627 | exports.Optional = context_1.Optional;
|
32628 | exports.Bean = context_1.Bean;
|
32629 | exports.Qualifier = context_1.Qualifier;
|
32630 | exports.PreDestroy = context_1.PreDestroy;
|
32631 | var componentAnnotations_1 = __webpack_require__(11);
|
32632 | exports.QuerySelector = componentAnnotations_1.QuerySelector;
|
32633 | exports.Listener = componentAnnotations_1.Listener;
|
32634 | exports.RefSelector = componentAnnotations_1.RefSelector;
|
32635 |
|
32636 | var dragAndDropService_1 = __webpack_require__(14);
|
32637 | exports.DragAndDropService = dragAndDropService_1.DragAndDropService;
|
32638 | exports.DragSourceType = dragAndDropService_1.DragSourceType;
|
32639 | exports.HDirection = dragAndDropService_1.HDirection;
|
32640 | exports.VDirection = dragAndDropService_1.VDirection;
|
32641 | var dragService_1 = __webpack_require__(40);
|
32642 | exports.DragService = dragService_1.DragService;
|
32643 |
|
32644 | var column_1 = __webpack_require__(10);
|
32645 | exports.Column = column_1.Column;
|
32646 | var columnGroup_1 = __webpack_require__(26);
|
32647 | exports.ColumnGroup = columnGroup_1.ColumnGroup;
|
32648 | var gridCell_1 = __webpack_require__(23);
|
32649 | exports.GridCell = gridCell_1.GridCell;
|
32650 | var gridRow_1 = __webpack_require__(64);
|
32651 | exports.GridRow = gridRow_1.GridRow;
|
32652 | var originalColumnGroup_1 = __webpack_require__(32);
|
32653 | exports.OriginalColumnGroup = originalColumnGroup_1.OriginalColumnGroup;
|
32654 | var rowNode_1 = __webpack_require__(16);
|
32655 | exports.RowNode = rowNode_1.RowNode;
|
32656 |
|
32657 | var baseFilter_1 = __webpack_require__(51);
|
32658 | exports.BaseFilter = baseFilter_1.BaseFilter;
|
32659 | var dateFilter_1 = __webpack_require__(68);
|
32660 | exports.DateFilter = dateFilter_1.DateFilter;
|
32661 | var filterManager_1 = __webpack_require__(18);
|
32662 | exports.FilterManager = filterManager_1.FilterManager;
|
32663 | var numberFilter_1 = __webpack_require__(95);
|
32664 | exports.NumberFilter = numberFilter_1.NumberFilter;
|
32665 | var textFilter_1 = __webpack_require__(94);
|
32666 | exports.TextFilter = textFilter_1.TextFilter;
|
32667 |
|
32668 | var gridPanel_1 = __webpack_require__(78);
|
32669 | exports.GridPanel = gridPanel_1.GridPanel;
|
32670 | var scrollVisibleService_1 = __webpack_require__(36);
|
32671 | exports.ScrollVisibleService = scrollVisibleService_1.ScrollVisibleService;
|
32672 | var mouseEventService_1 = __webpack_require__(44);
|
32673 | exports.MouseEventService = mouseEventService_1.MouseEventService;
|
32674 |
|
32675 | var bodyDropPivotTarget_1 = __webpack_require__(103);
|
32676 | exports.BodyDropPivotTarget = bodyDropPivotTarget_1.BodyDropPivotTarget;
|
32677 | var bodyDropTarget_1 = __webpack_require__(101);
|
32678 | exports.BodyDropTarget = bodyDropTarget_1.BodyDropTarget;
|
32679 | var cssClassApplier_1 = __webpack_require__(81);
|
32680 | exports.CssClassApplier = cssClassApplier_1.CssClassApplier;
|
32681 | var headerContainer_1 = __webpack_require__(98);
|
32682 | exports.HeaderContainer = headerContainer_1.HeaderContainer;
|
32683 | var headerRootComp_1 = __webpack_require__(80);
|
32684 | exports.HeaderRootComp = headerRootComp_1.HeaderRootComp;
|
32685 | var headerRowComp_1 = __webpack_require__(99);
|
32686 | exports.HeaderRowComp = headerRowComp_1.HeaderRowComp;
|
32687 | var horizontalResizeService_1 = __webpack_require__(59);
|
32688 | exports.HorizontalResizeService = horizontalResizeService_1.HorizontalResizeService;
|
32689 | var moveColumnController_1 = __webpack_require__(102);
|
32690 | exports.MoveColumnController = moveColumnController_1.MoveColumnController;
|
32691 | var standardMenu_1 = __webpack_require__(108);
|
32692 | exports.StandardMenuFactory = standardMenu_1.StandardMenuFactory;
|
32693 |
|
32694 | var tabbedLayout_1 = __webpack_require__(141);
|
32695 | exports.TabbedLayout = tabbedLayout_1.TabbedLayout;
|
32696 | var verticalStack_1 = __webpack_require__(142);
|
32697 | exports.VerticalStack = verticalStack_1.VerticalStack;
|
32698 |
|
32699 | var simpleHttpRequest_1 = __webpack_require__(143);
|
32700 | exports.simpleHttpRequest = simpleHttpRequest_1.simpleHttpRequest;
|
32701 | var largeTextCellEditor_1 = __webpack_require__(93);
|
32702 | exports.LargeTextCellEditor = largeTextCellEditor_1.LargeTextCellEditor;
|
32703 | var popupEditorWrapper_1 = __webpack_require__(69);
|
32704 | exports.PopupEditorWrapper = popupEditorWrapper_1.PopupEditorWrapper;
|
32705 | var popupSelectCellEditor_1 = __webpack_require__(92);
|
32706 | exports.PopupSelectCellEditor = popupSelectCellEditor_1.PopupSelectCellEditor;
|
32707 | var popupTextCellEditor_1 = __webpack_require__(91);
|
32708 | exports.PopupTextCellEditor = popupTextCellEditor_1.PopupTextCellEditor;
|
32709 | var selectCellEditor_1 = __webpack_require__(75);
|
32710 | exports.SelectCellEditor = selectCellEditor_1.SelectCellEditor;
|
32711 | var textCellEditor_1 = __webpack_require__(67);
|
32712 | exports.TextCellEditor = textCellEditor_1.TextCellEditor;
|
32713 | var animateShowChangeCellRenderer_1 = __webpack_require__(71);
|
32714 | exports.AnimateShowChangeCellRenderer = animateShowChangeCellRenderer_1.AnimateShowChangeCellRenderer;
|
32715 | var animateSlideCellRenderer_1 = __webpack_require__(70);
|
32716 | exports.AnimateSlideCellRenderer = animateSlideCellRenderer_1.AnimateSlideCellRenderer;
|
32717 | var groupCellRenderer_1 = __webpack_require__(72);
|
32718 | exports.GroupCellRenderer = groupCellRenderer_1.GroupCellRenderer;
|
32719 |
|
32720 | var setLeftFeature_1 = __webpack_require__(52);
|
32721 | exports.SetLeftFeature = setLeftFeature_1.SetLeftFeature;
|
32722 |
|
32723 | var autoWidthCalculator_1 = __webpack_require__(39);
|
32724 | exports.AutoWidthCalculator = autoWidthCalculator_1.AutoWidthCalculator;
|
32725 | var cellEditorFactory_1 = __webpack_require__(54);
|
32726 | exports.CellEditorFactory = cellEditorFactory_1.CellEditorFactory;
|
32727 | var cellRendererFactory_1 = __webpack_require__(55);
|
32728 | exports.CellRendererFactory = cellRendererFactory_1.CellRendererFactory;
|
32729 | var cellRendererService_1 = __webpack_require__(56);
|
32730 | exports.CellRendererService = cellRendererService_1.CellRendererService;
|
32731 | var checkboxSelectionComponent_1 = __webpack_require__(65);
|
32732 | exports.CheckboxSelectionComponent = checkboxSelectionComponent_1.CheckboxSelectionComponent;
|
32733 | var cellComp_1 = __webpack_require__(34);
|
32734 | exports.CellComp = cellComp_1.CellComp;
|
32735 | var rowComp_1 = __webpack_require__(50);
|
32736 | exports.RowComp = rowComp_1.RowComp;
|
32737 | var rowRenderer_1 = __webpack_require__(20);
|
32738 | exports.RowRenderer = rowRenderer_1.RowRenderer;
|
32739 | var valueFormatterService_1 = __webpack_require__(43);
|
32740 | exports.ValueFormatterService = valueFormatterService_1.ValueFormatterService;
|
32741 |
|
32742 | var filterStage_1 = __webpack_require__(109);
|
32743 | exports.FilterStage = filterStage_1.FilterStage;
|
32744 | var flattenStage_1 = __webpack_require__(113);
|
32745 | exports.FlattenStage = flattenStage_1.FlattenStage;
|
32746 | var sortStage_1 = __webpack_require__(111);
|
32747 | exports.SortStage = sortStage_1.SortStage;
|
32748 |
|
32749 | var pinnedRowModel_1 = __webpack_require__(30);
|
32750 | exports.PinnedRowModel = pinnedRowModel_1.PinnedRowModel;
|
32751 | var clientSideRowModel_1 = __webpack_require__(116);
|
32752 | exports.ClientSideRowModel = clientSideRowModel_1.ClientSideRowModel;
|
32753 | var changedPath_1 = __webpack_require__(88);
|
32754 | exports.ChangedPath = changedPath_1.ChangedPath;
|
32755 | var clientSideNodeManager_1 = __webpack_require__(117);
|
32756 | exports.ClientSideNodeManager = clientSideNodeManager_1.ClientSideNodeManager;
|
32757 | var infiniteRowModel_1 = __webpack_require__(114);
|
32758 | exports.InfiniteRowModel = infiniteRowModel_1.InfiniteRowModel;
|
32759 | var rowNodeBlock_1 = __webpack_require__(61);
|
32760 | exports.RowNodeBlock = rowNodeBlock_1.RowNodeBlock;
|
32761 | var rowNodeBlockLoader_1 = __webpack_require__(115);
|
32762 | exports.RowNodeBlockLoader = rowNodeBlockLoader_1.RowNodeBlockLoader;
|
32763 | var rowNodeCache_1 = __webpack_require__(87);
|
32764 | exports.RowNodeCache = rowNodeCache_1.RowNodeCache;
|
32765 |
|
32766 | var stylingService_1 = __webpack_require__(73);
|
32767 | exports.StylingService = stylingService_1.StylingService;
|
32768 |
|
32769 | var agCheckbox_1 = __webpack_require__(60);
|
32770 | exports.AgCheckbox = agCheckbox_1.AgCheckbox;
|
32771 | var component_1 = __webpack_require__(8);
|
32772 | exports.Component = component_1.Component;
|
32773 | var popupService_1 = __webpack_require__(35);
|
32774 | exports.PopupService = popupService_1.PopupService;
|
32775 | var touchListener_1 = __webpack_require__(46);
|
32776 | exports.TouchListener = touchListener_1.TouchListener;
|
32777 |
|
32778 | var baseFrameworkFactory_1 = __webpack_require__(118);
|
32779 | exports.BaseFrameworkFactory = baseFrameworkFactory_1.BaseFrameworkFactory;
|
32780 | var cellNavigationService_1 = __webpack_require__(82);
|
32781 | exports.CellNavigationService = cellNavigationService_1.CellNavigationService;
|
32782 | var alignedGridsService_1 = __webpack_require__(58);
|
32783 | exports.AlignedGridsService = alignedGridsService_1.AlignedGridsService;
|
32784 | var constants_1 = __webpack_require__(9);
|
32785 | exports.Constants = constants_1.Constants;
|
32786 | var csvCreator_1 = __webpack_require__(47);
|
32787 | exports.CsvCreator = csvCreator_1.CsvCreator;
|
32788 | exports.BaseCreator = csvCreator_1.BaseCreator;
|
32789 | var downloader_1 = __webpack_require__(84);
|
32790 | exports.Downloader = downloader_1.Downloader;
|
32791 | var grid_1 = __webpack_require__(85);
|
32792 | exports.Grid = grid_1.Grid;
|
32793 | var gridApi_1 = __webpack_require__(6);
|
32794 | exports.GridApi = gridApi_1.GridApi;
|
32795 | var eventKeys_1 = __webpack_require__(25);
|
32796 | exports.Events = eventKeys_1.Events;
|
32797 | var focusedCellController_1 = __webpack_require__(22);
|
32798 | exports.FocusedCellController = focusedCellController_1.FocusedCellController;
|
32799 | var functions_1 = __webpack_require__(144);
|
32800 | exports.defaultGroupComparator = functions_1.defaultGroupComparator;
|
32801 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
32802 | exports.GridOptionsWrapper = gridOptionsWrapper_1.GridOptionsWrapper;
|
32803 | var eventService_1 = __webpack_require__(3);
|
32804 | exports.EventService = eventService_1.EventService;
|
32805 | var selectableService_1 = __webpack_require__(86);
|
32806 | exports.SelectableService = selectableService_1.SelectableService;
|
32807 | var gridCore_1 = __webpack_require__(42);
|
32808 | exports.GridCore = gridCore_1.GridCore;
|
32809 | var logger_1 = __webpack_require__(12);
|
32810 | exports.Logger = logger_1.Logger;
|
32811 | var selectionController_1 = __webpack_require__(17);
|
32812 | exports.SelectionController = selectionController_1.SelectionController;
|
32813 | var sortController_1 = __webpack_require__(24);
|
32814 | exports.SortController = sortController_1.SortController;
|
32815 | var templateService_1 = __webpack_require__(49);
|
32816 | exports.TemplateService = templateService_1.TemplateService;
|
32817 | var utils_1 = __webpack_require__(1);
|
32818 | exports.Utils = utils_1.Utils;
|
32819 | exports.NumberSequence = utils_1.NumberSequence;
|
32820 | exports._ = utils_1._;
|
32821 | exports.Promise = utils_1.Promise;
|
32822 | var valueService_1 = __webpack_require__(15);
|
32823 | exports.ValueService = valueService_1.ValueService;
|
32824 | var expressionService_1 = __webpack_require__(19);
|
32825 | exports.ExpressionService = expressionService_1.ExpressionService;
|
32826 | var xmlFactory_1 = __webpack_require__(119);
|
32827 | exports.XmlFactory = xmlFactory_1.XmlFactory;
|
32828 | var gridSerializer_1 = __webpack_require__(63);
|
32829 | exports.GridSerializer = gridSerializer_1.GridSerializer;
|
32830 | exports.BaseGridSerializingSession = gridSerializer_1.BaseGridSerializingSession;
|
32831 | exports.RowType = gridSerializer_1.RowType;
|
32832 | var logger_2 = __webpack_require__(12);
|
32833 | exports.LoggerFactory = logger_2.LoggerFactory;
|
32834 | var columnApi_1 = __webpack_require__(7);
|
32835 | exports.ColumnApi = columnApi_1.ColumnApi;
|
32836 | var frameworkComponentWrapper_1 = __webpack_require__(145);
|
32837 | exports.BaseComponentWrapper = frameworkComponentWrapper_1.BaseComponentWrapper;
|
32838 | var environment_1 = __webpack_require__(41);
|
32839 | exports.Environment = environment_1.Environment;
|
32840 |
|
32841 | }.call(exports, __webpack_require__(121)))
|
32842 |
|
32843 | }),
|
32844 |
|
32845 | (function(module, exports) {
|
32846 |
|
32847 | var g;
|
32848 |
|
32849 |
|
32850 | g = (function() {
|
32851 | return this;
|
32852 | })();
|
32853 |
|
32854 | try {
|
32855 |
|
32856 | g = g || Function("return this")() || (1,eval)("this");
|
32857 | } catch(e) {
|
32858 |
|
32859 | if(typeof window === "object")
|
32860 | g = window;
|
32861 | }
|
32862 |
|
32863 |
|
32864 |
|
32865 |
|
32866 |
|
32867 | module.exports = g;
|
32868 |
|
32869 |
|
32870 | }),
|
32871 |
|
32872 | (function(module, exports, __webpack_require__) {
|
32873 |
|
32874 | "use strict";
|
32875 |
|
32876 |
|
32877 |
|
32878 |
|
32879 |
|
32880 |
|
32881 |
|
32882 | var __extends = (this && this.__extends) || (function () {
|
32883 | var extendStatics = Object.setPrototypeOf ||
|
32884 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
32885 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
32886 | return function (d, b) {
|
32887 | extendStatics(d, b);
|
32888 | function __() { this.constructor = d; }
|
32889 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
32890 | };
|
32891 | })();
|
32892 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
32893 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
32894 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
32895 | 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;
|
32896 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
32897 | };
|
32898 | var __metadata = (this && this.__metadata) || function (k, v) {
|
32899 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
32900 | };
|
32901 | Object.defineProperty(exports, "__esModule", { value: true });
|
32902 | var component_1 = __webpack_require__(8);
|
32903 | var context_1 = __webpack_require__(0);
|
32904 | var rowNode_1 = __webpack_require__(16);
|
32905 | var dragAndDropService_1 = __webpack_require__(14);
|
32906 | var eventKeys_1 = __webpack_require__(25);
|
32907 | var utils_1 = __webpack_require__(1);
|
32908 | var beanStub_1 = __webpack_require__(13);
|
32909 | var RowDragComp = (function (_super) {
|
32910 | __extends(RowDragComp, _super);
|
32911 | function RowDragComp(rowNode, column, cellValue, beans) {
|
32912 | var _this = _super.call(this, "<span class=\"ag-row-drag\"></span>") || this;
|
32913 | _this.rowNode = rowNode;
|
32914 | _this.column = column;
|
32915 | _this.cellValue = cellValue;
|
32916 | _this.beans = beans;
|
32917 | return _this;
|
32918 | }
|
32919 | RowDragComp.prototype.postConstruct = function () {
|
32920 | this.addDragSource();
|
32921 | this.checkCompatibility();
|
32922 | if (this.beans.gridOptionsWrapper.isRowDragManaged()) {
|
32923 | this.addFeature(this.beans.context, new ManagedVisibilityStrategy(this, this.beans, this.rowNode, this.column));
|
32924 | }
|
32925 | else {
|
32926 | this.addFeature(this.beans.context, new NonManagedVisibilityStrategy(this, this.beans, this.rowNode, this.column));
|
32927 | }
|
32928 | };
|
32929 |
|
32930 | RowDragComp.prototype.checkCompatibility = function () {
|
32931 | var managed = this.beans.gridOptionsWrapper.isRowDragManaged();
|
32932 | var treeData = this.beans.gridOptionsWrapper.isTreeData();
|
32933 | if (treeData && managed) {
|
32934 | utils_1._.doOnce(function () {
|
32935 | return console.warn('ag-Grid: If using row drag with tree data, you cannot have rowDragManaged=true');
|
32936 | }, 'RowDragComp.managedAndTreeData');
|
32937 | }
|
32938 | };
|
32939 | RowDragComp.prototype.addDragSource = function () {
|
32940 | var _this = this;
|
32941 | var dragItem = {
|
32942 | rowNode: this.rowNode
|
32943 | };
|
32944 | var dragSource = {
|
32945 | type: dragAndDropService_1.DragSourceType.RowDrag,
|
32946 | eElement: this.getGui(),
|
32947 | dragItemName: this.cellValue,
|
32948 | dragItemCallback: function () { return dragItem; },
|
32949 | dragStartPixels: 0
|
32950 | };
|
32951 | this.beans.dragAndDropService.addDragSource(dragSource, true);
|
32952 | this.addDestroyFunc(function () { return _this.beans.dragAndDropService.removeDragSource(dragSource); });
|
32953 | };
|
32954 | __decorate([
|
32955 | context_1.PostConstruct,
|
32956 | __metadata("design:type", Function),
|
32957 | __metadata("design:paramtypes", []),
|
32958 | __metadata("design:returntype", void 0)
|
32959 | ], RowDragComp.prototype, "postConstruct", null);
|
32960 | return RowDragComp;
|
32961 | }(component_1.Component));
|
32962 | exports.RowDragComp = RowDragComp;
|
32963 |
|
32964 | var NonManagedVisibilityStrategy = (function (_super) {
|
32965 | __extends(NonManagedVisibilityStrategy, _super);
|
32966 | function NonManagedVisibilityStrategy(parent, beans, rowNode, column) {
|
32967 | var _this = _super.call(this) || this;
|
32968 | _this.parent = parent;
|
32969 | _this.beans = beans;
|
32970 | _this.column = column;
|
32971 | _this.rowNode = rowNode;
|
32972 | return _this;
|
32973 | }
|
32974 | NonManagedVisibilityStrategy.prototype.postConstruct = function () {
|
32975 | this.addDestroyableEventListener(this.beans.gridOptionsWrapper, 'suppressRowDrag', this.onSuppressRowDrag.bind(this));
|
32976 |
|
32977 | this.addDestroyableEventListener(this.rowNode, rowNode_1.RowNode.EVENT_DATA_CHANGED, this.workOutVisibility.bind(this));
|
32978 | this.addDestroyableEventListener(this.rowNode, rowNode_1.RowNode.EVENT_CELL_CHANGED, this.workOutVisibility.bind(this));
|
32979 | this.workOutVisibility();
|
32980 | };
|
32981 | NonManagedVisibilityStrategy.prototype.onSuppressRowDrag = function () {
|
32982 | this.workOutVisibility();
|
32983 | };
|
32984 | NonManagedVisibilityStrategy.prototype.workOutVisibility = function () {
|
32985 |
|
32986 | var suppressRowDrag = this.beans.gridOptionsWrapper.isSuppressRowDrag();
|
32987 | if (suppressRowDrag) {
|
32988 | this.parent.setVisible(false);
|
32989 | }
|
32990 | else {
|
32991 | var visible = this.column.isRowDrag(this.rowNode);
|
32992 | this.parent.setVisible(visible);
|
32993 | }
|
32994 | };
|
32995 | __decorate([
|
32996 | context_1.PostConstruct,
|
32997 | __metadata("design:type", Function),
|
32998 | __metadata("design:paramtypes", []),
|
32999 | __metadata("design:returntype", void 0)
|
33000 | ], NonManagedVisibilityStrategy.prototype, "postConstruct", null);
|
33001 | return NonManagedVisibilityStrategy;
|
33002 | }(beanStub_1.BeanStub));
|
33003 |
|
33004 | var ManagedVisibilityStrategy = (function (_super) {
|
33005 | __extends(ManagedVisibilityStrategy, _super);
|
33006 | function ManagedVisibilityStrategy(parent, beans, rowNode, column) {
|
33007 | var _this = _super.call(this) || this;
|
33008 | _this.parent = parent;
|
33009 | _this.beans = beans;
|
33010 | _this.column = column;
|
33011 | _this.rowNode = rowNode;
|
33012 | return _this;
|
33013 | }
|
33014 | ManagedVisibilityStrategy.prototype.postConstruct = function () {
|
33015 |
|
33016 | this.addDestroyableEventListener(this.beans.eventService, eventKeys_1.Events.EVENT_SORT_CHANGED, this.onSortChanged.bind(this));
|
33017 | this.addDestroyableEventListener(this.beans.eventService, eventKeys_1.Events.EVENT_FILTER_CHANGED, this.onFilterChanged.bind(this));
|
33018 | this.addDestroyableEventListener(this.beans.eventService, eventKeys_1.Events.EVENT_COLUMN_ROW_GROUP_CHANGED, this.onRowGroupChanged.bind(this));
|
33019 |
|
33020 | this.addDestroyableEventListener(this.rowNode, rowNode_1.RowNode.EVENT_DATA_CHANGED, this.workOutVisibility.bind(this));
|
33021 | this.addDestroyableEventListener(this.rowNode, rowNode_1.RowNode.EVENT_CELL_CHANGED, this.workOutVisibility.bind(this));
|
33022 | this.addDestroyableEventListener(this.beans.gridOptionsWrapper, 'suppressRowDrag', this.onSuppressRowDrag.bind(this));
|
33023 | this.updateSortActive();
|
33024 | this.updateFilterActive();
|
33025 | this.updateRowGroupActive();
|
33026 | this.workOutVisibility();
|
33027 | };
|
33028 | ManagedVisibilityStrategy.prototype.updateRowGroupActive = function () {
|
33029 | var rowGroups = this.beans.columnController.getRowGroupColumns();
|
33030 | this.rowGroupActive = !utils_1._.missingOrEmpty(rowGroups);
|
33031 | };
|
33032 | ManagedVisibilityStrategy.prototype.onRowGroupChanged = function () {
|
33033 | this.updateRowGroupActive();
|
33034 | this.workOutVisibility();
|
33035 | };
|
33036 | ManagedVisibilityStrategy.prototype.updateSortActive = function () {
|
33037 | var sortModel = this.beans.sortController.getSortModel();
|
33038 | this.sortActive = !utils_1._.missingOrEmpty(sortModel);
|
33039 | };
|
33040 | ManagedVisibilityStrategy.prototype.onSortChanged = function () {
|
33041 | this.updateSortActive();
|
33042 | this.workOutVisibility();
|
33043 | };
|
33044 | ManagedVisibilityStrategy.prototype.updateFilterActive = function () {
|
33045 | this.filterActive = this.beans.filterManager.isAnyFilterPresent();
|
33046 | };
|
33047 | ManagedVisibilityStrategy.prototype.onFilterChanged = function () {
|
33048 | this.updateFilterActive();
|
33049 | this.workOutVisibility();
|
33050 | };
|
33051 | ManagedVisibilityStrategy.prototype.onSuppressRowDrag = function () {
|
33052 | this.workOutVisibility();
|
33053 | };
|
33054 | ManagedVisibilityStrategy.prototype.workOutVisibility = function () {
|
33055 |
|
33056 | var sortOrFilterOrGroupActive = this.sortActive || this.filterActive || this.rowGroupActive;
|
33057 | var suppressRowDrag = this.beans.gridOptionsWrapper.isSuppressRowDrag();
|
33058 | var alwaysHide = sortOrFilterOrGroupActive || suppressRowDrag;
|
33059 | if (alwaysHide) {
|
33060 | this.parent.setVisible(false);
|
33061 | }
|
33062 | else {
|
33063 | var visible = this.column.isRowDrag(this.rowNode);
|
33064 | this.parent.setVisible(visible);
|
33065 | }
|
33066 | };
|
33067 | __decorate([
|
33068 | context_1.PostConstruct,
|
33069 | __metadata("design:type", Function),
|
33070 | __metadata("design:paramtypes", []),
|
33071 | __metadata("design:returntype", void 0)
|
33072 | ], ManagedVisibilityStrategy.prototype, "postConstruct", null);
|
33073 | return ManagedVisibilityStrategy;
|
33074 | }(beanStub_1.BeanStub));
|
33075 |
|
33076 |
|
33077 | }),
|
33078 |
|
33079 | (function(module, exports, __webpack_require__) {
|
33080 |
|
33081 | "use strict";
|
33082 |
|
33083 |
|
33084 |
|
33085 |
|
33086 |
|
33087 |
|
33088 |
|
33089 | var __extends = (this && this.__extends) || (function () {
|
33090 | var extendStatics = Object.setPrototypeOf ||
|
33091 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
33092 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
33093 | return function (d, b) {
|
33094 | extendStatics(d, b);
|
33095 | function __() { this.constructor = d; }
|
33096 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
33097 | };
|
33098 | })();
|
33099 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
33100 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
33101 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
33102 | 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;
|
33103 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
33104 | };
|
33105 | var __metadata = (this && this.__metadata) || function (k, v) {
|
33106 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
33107 | };
|
33108 | Object.defineProperty(exports, "__esModule", { value: true });
|
33109 | var context_1 = __webpack_require__(0);
|
33110 | var column_1 = __webpack_require__(10);
|
33111 | var utils_1 = __webpack_require__(1);
|
33112 | var setLeftFeature_1 = __webpack_require__(52);
|
33113 | var component_1 = __webpack_require__(8);
|
33114 | var componentAnnotations_1 = __webpack_require__(11);
|
33115 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
33116 | var beans_1 = __webpack_require__(28);
|
33117 | var hoverFeature_1 = __webpack_require__(74);
|
33118 | var events_1 = __webpack_require__(5);
|
33119 | var eventService_1 = __webpack_require__(3);
|
33120 | var columnHoverService_1 = __webpack_require__(45);
|
33121 | var BaseFilterWrapperComp = (function (_super) {
|
33122 | __extends(BaseFilterWrapperComp, _super);
|
33123 | function BaseFilterWrapperComp() {
|
33124 | return _super !== null && _super.apply(this, arguments) || this;
|
33125 | }
|
33126 | BaseFilterWrapperComp.prototype.init = function (params) {
|
33127 | this.column = params.column;
|
33128 | var base = utils_1._.loadTemplate("<div class=\"ag-header-cell\" aria-hidden=\"true\"><div class=\"ag-floating-filter-body\" aria-hidden=\"true\"></div></div>");
|
33129 | this.enrichBody(base);
|
33130 | this.setTemplateFromElement(base);
|
33131 | this.setupWidth();
|
33132 | this.addColumnHoverListener();
|
33133 | this.addFeature(this.context, new hoverFeature_1.HoverFeature([this.column], this.getGui()));
|
33134 | var setLeftFeature = new setLeftFeature_1.SetLeftFeature(this.column, this.getGui(), this.beans);
|
33135 | setLeftFeature.init();
|
33136 | this.addDestroyFunc(setLeftFeature.destroy.bind(setLeftFeature));
|
33137 | };
|
33138 | BaseFilterWrapperComp.prototype.addColumnHoverListener = function () {
|
33139 | this.addDestroyableEventListener(this.eventService, events_1.Events.EVENT_COLUMN_HOVER_CHANGED, this.onColumnHover.bind(this));
|
33140 | this.onColumnHover();
|
33141 | };
|
33142 | BaseFilterWrapperComp.prototype.onColumnHover = function () {
|
33143 | var isHovered = this.columnHoverService.isHovered(this.column);
|
33144 | utils_1._.addOrRemoveCssClass(this.getGui(), 'ag-column-hover', isHovered);
|
33145 | };
|
33146 | BaseFilterWrapperComp.prototype.setupWidth = function () {
|
33147 | this.addDestroyableEventListener(this.column, column_1.Column.EVENT_WIDTH_CHANGED, this.onColumnWidthChanged.bind(this));
|
33148 | this.onColumnWidthChanged();
|
33149 | };
|
33150 | BaseFilterWrapperComp.prototype.onColumnWidthChanged = function () {
|
33151 | this.getGui().style.width = this.column.getActualWidth() + 'px';
|
33152 | };
|
33153 | __decorate([
|
33154 | context_1.Autowired('context'),
|
33155 | __metadata("design:type", context_1.Context)
|
33156 | ], BaseFilterWrapperComp.prototype, "context", void 0);
|
33157 | __decorate([
|
33158 | context_1.Autowired('columnHoverService'),
|
33159 | __metadata("design:type", columnHoverService_1.ColumnHoverService)
|
33160 | ], BaseFilterWrapperComp.prototype, "columnHoverService", void 0);
|
33161 | __decorate([
|
33162 | context_1.Autowired('eventService'),
|
33163 | __metadata("design:type", eventService_1.EventService)
|
33164 | ], BaseFilterWrapperComp.prototype, "eventService", void 0);
|
33165 | __decorate([
|
33166 | context_1.Autowired('beans'),
|
33167 | __metadata("design:type", beans_1.Beans)
|
33168 | ], BaseFilterWrapperComp.prototype, "beans", void 0);
|
33169 | return BaseFilterWrapperComp;
|
33170 | }(component_1.Component));
|
33171 | exports.BaseFilterWrapperComp = BaseFilterWrapperComp;
|
33172 | var FloatingFilterWrapperComp = (function (_super) {
|
33173 | __extends(FloatingFilterWrapperComp, _super);
|
33174 | function FloatingFilterWrapperComp() {
|
33175 | return _super !== null && _super.apply(this, arguments) || this;
|
33176 | }
|
33177 | FloatingFilterWrapperComp.prototype.init = function (params) {
|
33178 | this.floatingFilterCompPromise = params.floatingFilterComp;
|
33179 | this.suppressFilterButton = params.suppressFilterButton;
|
33180 | _super.prototype.init.call(this, params);
|
33181 | this.addEventListeners();
|
33182 | };
|
33183 | FloatingFilterWrapperComp.prototype.addEventListeners = function () {
|
33184 | if (!this.suppressFilterButton && this.eButtonShowMainFilter) {
|
33185 | this.addDestroyableEventListener(this.eButtonShowMainFilter, 'click', this.showParentFilter.bind(this));
|
33186 | }
|
33187 | };
|
33188 | FloatingFilterWrapperComp.prototype.enrichBody = function (body) {
|
33189 | var _this = this;
|
33190 | this.floatingFilterCompPromise.then(function (floatingFilterComp) {
|
33191 | var floatingFilterBody = body.querySelector('.ag-floating-filter-body');
|
33192 | var floatingFilterCompUi = floatingFilterComp.getGui();
|
33193 | if (_this.suppressFilterButton) {
|
33194 | floatingFilterBody.appendChild(floatingFilterCompUi);
|
33195 | utils_1._.removeCssClass(floatingFilterBody, 'ag-floating-filter-body');
|
33196 | utils_1._.addCssClass(floatingFilterBody, 'ag-floating-filter-full-body');
|
33197 | }
|
33198 | else {
|
33199 | floatingFilterBody.appendChild(floatingFilterCompUi);
|
33200 | body.appendChild(utils_1._.loadTemplate("<div class=\"ag-floating-filter-button\" aria-hidden=\"true\">\n <button type=\"button\" ref=\"eButtonShowMainFilter\"></button>\n </div>"));
|
33201 | var eIcon = utils_1._.createIconNoSpan('filter', _this.gridOptionsWrapper, _this.column);
|
33202 | body.querySelector('button').appendChild(eIcon);
|
33203 | }
|
33204 | if (floatingFilterComp.afterGuiAttached) {
|
33205 | floatingFilterComp.afterGuiAttached();
|
33206 | }
|
33207 | _this.wireQuerySelectors();
|
33208 | _this.addEventListeners();
|
33209 | });
|
33210 | };
|
33211 | FloatingFilterWrapperComp.prototype.onParentModelChanged = function (parentModel) {
|
33212 | var combinedFilter = undefined;
|
33213 | var mainModel = null;
|
33214 | if (parentModel && parentModel.operator) {
|
33215 | combinedFilter = parentModel;
|
33216 | mainModel = combinedFilter.condition1;
|
33217 | }
|
33218 | else {
|
33219 | mainModel = parentModel;
|
33220 | }
|
33221 | this.floatingFilterCompPromise.then(function (floatingFilterComp) {
|
33222 | floatingFilterComp.onParentModelChanged(mainModel, combinedFilter);
|
33223 | });
|
33224 | };
|
33225 | FloatingFilterWrapperComp.prototype.showParentFilter = function () {
|
33226 | this.menuFactory.showMenuAfterButtonClick(this.column, this.eButtonShowMainFilter, 'filterMenuTab', ['filterMenuTab']);
|
33227 | };
|
33228 | __decorate([
|
33229 | componentAnnotations_1.RefSelector('eButtonShowMainFilter'),
|
33230 | __metadata("design:type", HTMLInputElement)
|
33231 | ], FloatingFilterWrapperComp.prototype, "eButtonShowMainFilter", void 0);
|
33232 | __decorate([
|
33233 | context_1.Autowired('menuFactory'),
|
33234 | __metadata("design:type", Object)
|
33235 | ], FloatingFilterWrapperComp.prototype, "menuFactory", void 0);
|
33236 | __decorate([
|
33237 | context_1.Autowired('gridOptionsWrapper'),
|
33238 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
33239 | ], FloatingFilterWrapperComp.prototype, "gridOptionsWrapper", void 0);
|
33240 | return FloatingFilterWrapperComp;
|
33241 | }(BaseFilterWrapperComp));
|
33242 | exports.FloatingFilterWrapperComp = FloatingFilterWrapperComp;
|
33243 | var EmptyFloatingFilterWrapperComp = (function (_super) {
|
33244 | __extends(EmptyFloatingFilterWrapperComp, _super);
|
33245 | function EmptyFloatingFilterWrapperComp() {
|
33246 | return _super !== null && _super.apply(this, arguments) || this;
|
33247 | }
|
33248 | EmptyFloatingFilterWrapperComp.prototype.enrichBody = function (body) {
|
33249 | };
|
33250 | EmptyFloatingFilterWrapperComp.prototype.onParentModelChanged = function (parentModel) {
|
33251 | };
|
33252 | return EmptyFloatingFilterWrapperComp;
|
33253 | }(BaseFilterWrapperComp));
|
33254 | exports.EmptyFloatingFilterWrapperComp = EmptyFloatingFilterWrapperComp;
|
33255 |
|
33256 |
|
33257 | }),
|
33258 |
|
33259 | (function(module, exports, __webpack_require__) {
|
33260 |
|
33261 | "use strict";
|
33262 |
|
33263 |
|
33264 |
|
33265 |
|
33266 |
|
33267 |
|
33268 |
|
33269 | Object.defineProperty(exports, "__esModule", { value: true });
|
33270 | var LinkedList = (function () {
|
33271 | function LinkedList() {
|
33272 | this.first = null;
|
33273 | this.last = null;
|
33274 | }
|
33275 | LinkedList.prototype.add = function (item) {
|
33276 | var entry = {
|
33277 | item: item,
|
33278 | next: null
|
33279 | };
|
33280 | if (this.last) {
|
33281 | this.last.next = entry;
|
33282 | }
|
33283 | else {
|
33284 | this.first = entry;
|
33285 | }
|
33286 | this.last = entry;
|
33287 | };
|
33288 | LinkedList.prototype.remove = function () {
|
33289 | var result = this.first;
|
33290 | if (result) {
|
33291 | this.first = result.next;
|
33292 | if (!this.first) {
|
33293 | this.last = null;
|
33294 | }
|
33295 | }
|
33296 | return result.item;
|
33297 | };
|
33298 | LinkedList.prototype.isEmpty = function () {
|
33299 | return !this.first;
|
33300 | };
|
33301 | return LinkedList;
|
33302 | }());
|
33303 | exports.LinkedList = LinkedList;
|
33304 | var LinkedListItem = (function () {
|
33305 | function LinkedListItem() {
|
33306 | }
|
33307 | return LinkedListItem;
|
33308 | }());
|
33309 |
|
33310 |
|
33311 | }),
|
33312 |
|
33313 | (function(module, exports, __webpack_require__) {
|
33314 |
|
33315 | "use strict";
|
33316 |
|
33317 |
|
33318 |
|
33319 |
|
33320 |
|
33321 |
|
33322 |
|
33323 | var __extends = (this && this.__extends) || (function () {
|
33324 | var extendStatics = Object.setPrototypeOf ||
|
33325 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
33326 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
33327 | return function (d, b) {
|
33328 | extendStatics(d, b);
|
33329 | function __() { this.constructor = d; }
|
33330 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
33331 | };
|
33332 | })();
|
33333 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
33334 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
33335 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
33336 | 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;
|
33337 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
33338 | };
|
33339 | var __metadata = (this && this.__metadata) || function (k, v) {
|
33340 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
33341 | };
|
33342 | Object.defineProperty(exports, "__esModule", { value: true });
|
33343 | var utils_1 = __webpack_require__(1);
|
33344 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
33345 | var context_1 = __webpack_require__(0);
|
33346 | var component_1 = __webpack_require__(8);
|
33347 | var componentRecipes_1 = __webpack_require__(21);
|
33348 | var OverlayWrapperComponent = (function (_super) {
|
33349 | __extends(OverlayWrapperComponent, _super);
|
33350 | function OverlayWrapperComponent() {
|
33351 | return _super.call(this) || this;
|
33352 | }
|
33353 | OverlayWrapperComponent.prototype.init = function () { };
|
33354 | OverlayWrapperComponent.prototype.showLoadingOverlay = function (eOverlayWrapper) {
|
33355 | var _this = this;
|
33356 | this.setTemplate(OverlayWrapperComponent.LOADING_WRAPPER_OVERLAY_TEMPLATE);
|
33357 | this.componentRecipes.newLoadingOverlayComponent().then(function (renderer) {
|
33358 | var loadingOverlayWrapper = _this.getRefElement("loadingOverlayWrapper");
|
33359 | utils_1.Utils.removeAllChildren(loadingOverlayWrapper);
|
33360 | loadingOverlayWrapper.appendChild(renderer.getGui());
|
33361 | });
|
33362 | this.showOverlay(eOverlayWrapper, this.getGui());
|
33363 | };
|
33364 | OverlayWrapperComponent.prototype.showNoRowsOverlay = function (eOverlayWrapper) {
|
33365 | var _this = this;
|
33366 | this.setTemplate(OverlayWrapperComponent.NO_ROWS_WRAPPER_OVERLAY_TEMPLATE);
|
33367 |
|
33368 |
|
33369 | var eNoRowsOverlayWrapper = this.getRefElement('noRowsOverlayWrapper');
|
33370 | var autoHeight = this.gridOptionsWrapper.isGridAutoHeight();
|
33371 | utils_1.Utils.addOrRemoveCssClass(eNoRowsOverlayWrapper, 'ag-layout-auto-height', autoHeight);
|
33372 | utils_1.Utils.addOrRemoveCssClass(eNoRowsOverlayWrapper, 'ag-layout-normal', !autoHeight);
|
33373 | this.componentRecipes.newNoRowsOverlayComponent().then(function (renderer) {
|
33374 | var noRowsOverlayWrapper = _this.getRefElement("noRowsOverlayWrapper");
|
33375 | utils_1.Utils.removeAllChildren(noRowsOverlayWrapper);
|
33376 | noRowsOverlayWrapper.appendChild(renderer.getGui());
|
33377 | });
|
33378 | this.showOverlay(eOverlayWrapper, this.getGui());
|
33379 | };
|
33380 | OverlayWrapperComponent.prototype.hideOverlay = function (eOverlayWrapper) {
|
33381 | utils_1.Utils.removeAllChildren(eOverlayWrapper);
|
33382 | utils_1.Utils.setVisible(eOverlayWrapper, false);
|
33383 | };
|
33384 | OverlayWrapperComponent.prototype.showOverlay = function (eOverlayWrapper, overlay) {
|
33385 | if (overlay) {
|
33386 | utils_1.Utils.removeAllChildren(eOverlayWrapper);
|
33387 | utils_1.Utils.setVisible(eOverlayWrapper, true);
|
33388 | eOverlayWrapper.appendChild(overlay);
|
33389 | }
|
33390 | else {
|
33391 | console.warn('ag-Grid: unknown overlay');
|
33392 | this.hideOverlay(eOverlayWrapper);
|
33393 | }
|
33394 | };
|
33395 |
|
33396 |
|
33397 | OverlayWrapperComponent.LOADING_WRAPPER_OVERLAY_TEMPLATE = '<div class="ag-overlay-panel" role="presentation">' +
|
33398 | '<div class="ag-overlay-wrapper ag-overlay-loading-wrapper" ref="loadingOverlayWrapper">[OVERLAY_TEMPLATE]</div>' +
|
33399 | '</div>';
|
33400 | OverlayWrapperComponent.NO_ROWS_WRAPPER_OVERLAY_TEMPLATE = '<div class="ag-overlay-panel" role="presentation">' +
|
33401 | '<div class="ag-overlay-wrapper ag-overlay-no-rows-wrapper" ref="noRowsOverlayWrapper">[OVERLAY_TEMPLATE]</div>' +
|
33402 | '</div>';
|
33403 | __decorate([
|
33404 | context_1.Autowired('gridOptionsWrapper'),
|
33405 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
33406 | ], OverlayWrapperComponent.prototype, "gridOptionsWrapper", void 0);
|
33407 | __decorate([
|
33408 | context_1.Autowired('componentRecipes'),
|
33409 | __metadata("design:type", componentRecipes_1.ComponentRecipes)
|
33410 | ], OverlayWrapperComponent.prototype, "componentRecipes", void 0);
|
33411 | return OverlayWrapperComponent;
|
33412 | }(component_1.Component));
|
33413 | exports.OverlayWrapperComponent = OverlayWrapperComponent;
|
33414 |
|
33415 |
|
33416 | }),
|
33417 |
|
33418 | (function(module, exports, __webpack_require__) {
|
33419 |
|
33420 | "use strict";
|
33421 |
|
33422 |
|
33423 |
|
33424 |
|
33425 |
|
33426 |
|
33427 |
|
33428 | var __extends = (this && this.__extends) || (function () {
|
33429 | var extendStatics = Object.setPrototypeOf ||
|
33430 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
33431 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
33432 | return function (d, b) {
|
33433 | extendStatics(d, b);
|
33434 | function __() { this.constructor = d; }
|
33435 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
33436 | };
|
33437 | })();
|
33438 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
33439 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
33440 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
33441 | 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;
|
33442 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
33443 | };
|
33444 | var __metadata = (this && this.__metadata) || function (k, v) {
|
33445 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
33446 | };
|
33447 | Object.defineProperty(exports, "__esModule", { value: true });
|
33448 | var component_1 = __webpack_require__(8);
|
33449 | var column_1 = __webpack_require__(10);
|
33450 | var utils_1 = __webpack_require__(1);
|
33451 | var context_1 = __webpack_require__(0);
|
33452 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
33453 | var sortController_1 = __webpack_require__(24);
|
33454 | var touchListener_1 = __webpack_require__(46);
|
33455 | var eventService_1 = __webpack_require__(3);
|
33456 | var componentAnnotations_1 = __webpack_require__(11);
|
33457 | var events_1 = __webpack_require__(5);
|
33458 | var HeaderComp = (function (_super) {
|
33459 | __extends(HeaderComp, _super);
|
33460 | function HeaderComp() {
|
33461 | var _this = _super !== null && _super.apply(this, arguments) || this;
|
33462 | _this.lastMovingChanged = 0;
|
33463 | return _this;
|
33464 | }
|
33465 | HeaderComp.prototype.init = function (params) {
|
33466 | var template = utils_1.Utils.firstExistingValue(params.template, HeaderComp.TEMPLATE);
|
33467 | this.setTemplate(template);
|
33468 | this.params = params;
|
33469 | this.setupTap();
|
33470 | this.setupIcons(params.column);
|
33471 | this.setupMenu();
|
33472 | this.setupSort();
|
33473 | this.setupFilterIcon();
|
33474 | this.setupText(params.displayName);
|
33475 | };
|
33476 | HeaderComp.prototype.setupText = function (displayName) {
|
33477 | if (this.eText) {
|
33478 | this.eText.innerHTML = displayName;
|
33479 | }
|
33480 | };
|
33481 | HeaderComp.prototype.setupIcons = function (column) {
|
33482 | this.addInIcon('sortAscending', this.eSortAsc, column);
|
33483 | this.addInIcon('sortDescending', this.eSortDesc, column);
|
33484 | this.addInIcon('sortUnSort', this.eSortNone, column);
|
33485 | this.addInIcon('menu', this.eMenu, column);
|
33486 | this.addInIcon('filter', this.eFilter, column);
|
33487 | };
|
33488 | HeaderComp.prototype.addInIcon = function (iconName, eParent, column) {
|
33489 | if (eParent == null)
|
33490 | return;
|
33491 | var eIcon = utils_1.Utils.createIconNoSpan(iconName, this.gridOptionsWrapper, column);
|
33492 | eParent.appendChild(eIcon);
|
33493 | };
|
33494 | HeaderComp.prototype.setupTap = function () {
|
33495 | var _this = this;
|
33496 | if (this.gridOptionsWrapper.isSuppressTouch()) {
|
33497 | return;
|
33498 | }
|
33499 | var touchListener = new touchListener_1.TouchListener(this.getGui());
|
33500 | if (this.params.enableMenu) {
|
33501 | var longTapListener = function (event) {
|
33502 | _this.gridOptionsWrapper.getApi().showColumnMenuAfterMouseClick(_this.params.column, event.touchStart);
|
33503 | };
|
33504 | this.addDestroyableEventListener(touchListener, touchListener_1.TouchListener.EVENT_LONG_TAP, longTapListener);
|
33505 | }
|
33506 | if (this.params.enableSorting) {
|
33507 | var tapListener = function () {
|
33508 | _this.sortController.progressSort(_this.params.column, false, "uiColumnSorted");
|
33509 | };
|
33510 | this.addDestroyableEventListener(touchListener, touchListener_1.TouchListener.EVENT_TAP, tapListener);
|
33511 | }
|
33512 | this.addDestroyFunc(function () { return touchListener.destroy(); });
|
33513 | };
|
33514 | HeaderComp.prototype.setupMenu = function () {
|
33515 | var _this = this;
|
33516 |
|
33517 | if (!this.eMenu) {
|
33518 | return;
|
33519 | }
|
33520 |
|
33521 |
|
33522 | var dontShowMenu = !this.params.enableMenu || utils_1.Utils.isUserAgentIPad();
|
33523 | if (dontShowMenu) {
|
33524 | utils_1.Utils.removeFromParent(this.eMenu);
|
33525 | return;
|
33526 | }
|
33527 | this.eMenu.addEventListener('click', function () { return _this.showMenu(_this.eMenu); });
|
33528 | if (!this.gridOptionsWrapper.isSuppressMenuHide()) {
|
33529 | this.eMenu.style.opacity = '0';
|
33530 | this.addGuiEventListener('mouseover', function () {
|
33531 | _this.eMenu.style.opacity = '1';
|
33532 | });
|
33533 | this.addGuiEventListener('mouseout', function () {
|
33534 | _this.eMenu.style.opacity = '0';
|
33535 | });
|
33536 | }
|
33537 | var style = this.eMenu.style;
|
33538 | style['transition'] = 'opacity 0.2s, border 0.2s';
|
33539 | style['-webkit-transition'] = 'opacity 0.2s, border 0.2s';
|
33540 | };
|
33541 | HeaderComp.prototype.showMenu = function (eventSource) {
|
33542 | this.menuFactory.showMenuAfterButtonClick(this.params.column, eventSource);
|
33543 | };
|
33544 | HeaderComp.prototype.removeSortIcons = function () {
|
33545 | utils_1.Utils.removeFromParent(this.eSortAsc);
|
33546 | utils_1.Utils.removeFromParent(this.eSortDesc);
|
33547 | utils_1.Utils.removeFromParent(this.eSortNone);
|
33548 | utils_1.Utils.removeFromParent(this.eSortOrder);
|
33549 | };
|
33550 | HeaderComp.prototype.setupSort = function () {
|
33551 | var _this = this;
|
33552 | var enableSorting = this.params.enableSorting;
|
33553 | if (!enableSorting) {
|
33554 | this.removeSortIcons();
|
33555 | return;
|
33556 | }
|
33557 | var sortUsingCtrl = this.gridOptionsWrapper.isMultiSortKeyCtrl();
|
33558 |
|
33559 | this.addDestroyableEventListener(this.params.column, column_1.Column.EVENT_MOVING_CHANGED, function () {
|
33560 | _this.lastMovingChanged = new Date().getTime();
|
33561 | });
|
33562 |
|
33563 | if (this.eLabel) {
|
33564 | this.addDestroyableEventListener(this.eLabel, 'click', function (event) {
|
33565 |
|
33566 |
|
33567 |
|
33568 | var moving = _this.params.column.isMoving();
|
33569 | var nowTime = new Date().getTime();
|
33570 |
|
33571 | var movedRecently = (nowTime - _this.lastMovingChanged) < 50;
|
33572 | var columnMoving = moving || movedRecently;
|
33573 | if (!columnMoving) {
|
33574 | var multiSort = sortUsingCtrl ? (event.ctrlKey || event.metaKey) : event.shiftKey;
|
33575 | _this.params.progressSort(multiSort);
|
33576 | }
|
33577 | else {
|
33578 | console.log("kipping sort cos of moving " + _this.lastMovingChanged);
|
33579 | }
|
33580 | });
|
33581 | }
|
33582 | this.addDestroyableEventListener(this.params.column, column_1.Column.EVENT_SORT_CHANGED, this.onSortChanged.bind(this));
|
33583 | this.onSortChanged();
|
33584 | this.addDestroyableEventListener(this.eventService, events_1.Events.EVENT_SORT_CHANGED, this.setMultiSortOrder.bind(this));
|
33585 | this.setMultiSortOrder();
|
33586 | };
|
33587 | HeaderComp.prototype.onSortChanged = function () {
|
33588 | utils_1.Utils.addOrRemoveCssClass(this.getGui(), 'ag-header-cell-sorted-asc', this.params.column.isSortAscending());
|
33589 | utils_1.Utils.addOrRemoveCssClass(this.getGui(), 'ag-header-cell-sorted-desc', this.params.column.isSortDescending());
|
33590 | utils_1.Utils.addOrRemoveCssClass(this.getGui(), 'ag-header-cell-sorted-none', this.params.column.isSortNone());
|
33591 | if (this.eSortAsc) {
|
33592 | utils_1.Utils.addOrRemoveCssClass(this.eSortAsc, 'ag-hidden', !this.params.column.isSortAscending());
|
33593 | }
|
33594 | if (this.eSortDesc) {
|
33595 | utils_1.Utils.addOrRemoveCssClass(this.eSortDesc, 'ag-hidden', !this.params.column.isSortDescending());
|
33596 | }
|
33597 | if (this.eSortNone) {
|
33598 | var alwaysHideNoSort = !this.params.column.getColDef().unSortIcon && !this.gridOptionsWrapper.isUnSortIcon();
|
33599 | utils_1.Utils.addOrRemoveCssClass(this.eSortNone, 'ag-hidden', alwaysHideNoSort || !this.params.column.isSortNone());
|
33600 | }
|
33601 | };
|
33602 |
|
33603 |
|
33604 |
|
33605 | HeaderComp.prototype.setMultiSortOrder = function () {
|
33606 | if (!this.eSortOrder) {
|
33607 | return;
|
33608 | }
|
33609 | var col = this.params.column;
|
33610 | var allColumnsWithSorting = this.sortController.getColumnsWithSortingOrdered();
|
33611 | var indexThisCol = allColumnsWithSorting.indexOf(col);
|
33612 | var moreThanOneColSorting = allColumnsWithSorting.length > 1;
|
33613 | var showIndex = col.isSorting() && moreThanOneColSorting;
|
33614 | utils_1.Utils.setVisible(this.eSortOrder, showIndex);
|
33615 | if (indexThisCol >= 0) {
|
33616 | this.eSortOrder.innerHTML = (indexThisCol + 1).toString();
|
33617 | }
|
33618 | else {
|
33619 | this.eSortOrder.innerHTML = '';
|
33620 | }
|
33621 | };
|
33622 | HeaderComp.prototype.setupFilterIcon = function () {
|
33623 | if (!this.eFilter) {
|
33624 | return;
|
33625 | }
|
33626 | this.addDestroyableEventListener(this.params.column, column_1.Column.EVENT_FILTER_CHANGED, this.onFilterChanged.bind(this));
|
33627 | this.onFilterChanged();
|
33628 | };
|
33629 | HeaderComp.prototype.onFilterChanged = function () {
|
33630 | var filterPresent = this.params.column.isFilterActive();
|
33631 | utils_1.Utils.addOrRemoveCssClass(this.eFilter, 'ag-hidden', !filterPresent);
|
33632 | };
|
33633 | HeaderComp.TEMPLATE = '<div class="ag-cell-label-container" role="presentation">' +
|
33634 | ' <span ref="eMenu" class="ag-header-icon ag-header-cell-menu-button" aria-hidden="true"></span>' +
|
33635 | ' <div ref="eLabel" class="ag-header-cell-label" role="presentation">' +
|
33636 | ' <span ref="eText" class="ag-header-cell-text" role="columnheader"></span>' +
|
33637 | ' <span ref="eFilter" class="ag-header-icon ag-filter-icon" aria-hidden="true"></span>' +
|
33638 | ' <span ref="eSortOrder" class="ag-header-icon ag-sort-order" aria-hidden="true"></span>' +
|
33639 | ' <span ref="eSortAsc" class="ag-header-icon ag-sort-ascending-icon" aria-hidden="true"></span>' +
|
33640 | ' <span ref="eSortDesc" class="ag-header-icon ag-sort-descending-icon" aria-hidden="true"></span>' +
|
33641 | ' <span ref="eSortNone" class="ag-header-icon ag-sort-none-icon" aria-hidden="true"></span>' +
|
33642 | ' </div>' +
|
33643 | '</div>';
|
33644 | __decorate([
|
33645 | context_1.Autowired('gridOptionsWrapper'),
|
33646 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
33647 | ], HeaderComp.prototype, "gridOptionsWrapper", void 0);
|
33648 | __decorate([
|
33649 | context_1.Autowired('sortController'),
|
33650 | __metadata("design:type", sortController_1.SortController)
|
33651 | ], HeaderComp.prototype, "sortController", void 0);
|
33652 | __decorate([
|
33653 | context_1.Autowired('menuFactory'),
|
33654 | __metadata("design:type", Object)
|
33655 | ], HeaderComp.prototype, "menuFactory", void 0);
|
33656 | __decorate([
|
33657 | context_1.Autowired('eventService'),
|
33658 | __metadata("design:type", eventService_1.EventService)
|
33659 | ], HeaderComp.prototype, "eventService", void 0);
|
33660 | __decorate([
|
33661 | componentAnnotations_1.RefSelector('eFilter'),
|
33662 | __metadata("design:type", HTMLElement)
|
33663 | ], HeaderComp.prototype, "eFilter", void 0);
|
33664 | __decorate([
|
33665 | componentAnnotations_1.RefSelector('eSortAsc'),
|
33666 | __metadata("design:type", HTMLElement)
|
33667 | ], HeaderComp.prototype, "eSortAsc", void 0);
|
33668 | __decorate([
|
33669 | componentAnnotations_1.RefSelector('eSortDesc'),
|
33670 | __metadata("design:type", HTMLElement)
|
33671 | ], HeaderComp.prototype, "eSortDesc", void 0);
|
33672 | __decorate([
|
33673 | componentAnnotations_1.RefSelector('eSortNone'),
|
33674 | __metadata("design:type", HTMLElement)
|
33675 | ], HeaderComp.prototype, "eSortNone", void 0);
|
33676 | __decorate([
|
33677 | componentAnnotations_1.RefSelector('eSortOrder'),
|
33678 | __metadata("design:type", HTMLElement)
|
33679 | ], HeaderComp.prototype, "eSortOrder", void 0);
|
33680 | __decorate([
|
33681 | componentAnnotations_1.RefSelector('eMenu'),
|
33682 | __metadata("design:type", HTMLElement)
|
33683 | ], HeaderComp.prototype, "eMenu", void 0);
|
33684 | __decorate([
|
33685 | componentAnnotations_1.RefSelector('eLabel'),
|
33686 | __metadata("design:type", HTMLElement)
|
33687 | ], HeaderComp.prototype, "eLabel", void 0);
|
33688 | __decorate([
|
33689 | componentAnnotations_1.RefSelector('eText'),
|
33690 | __metadata("design:type", HTMLElement)
|
33691 | ], HeaderComp.prototype, "eText", void 0);
|
33692 | return HeaderComp;
|
33693 | }(component_1.Component));
|
33694 | exports.HeaderComp = HeaderComp;
|
33695 |
|
33696 |
|
33697 | }),
|
33698 |
|
33699 | (function(module, exports, __webpack_require__) {
|
33700 |
|
33701 | "use strict";
|
33702 |
|
33703 |
|
33704 |
|
33705 |
|
33706 |
|
33707 |
|
33708 |
|
33709 | var __extends = (this && this.__extends) || (function () {
|
33710 | var extendStatics = Object.setPrototypeOf ||
|
33711 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
33712 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
33713 | return function (d, b) {
|
33714 | extendStatics(d, b);
|
33715 | function __() { this.constructor = d; }
|
33716 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
33717 | };
|
33718 | })();
|
33719 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
33720 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
33721 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
33722 | 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;
|
33723 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
33724 | };
|
33725 | var __metadata = (this && this.__metadata) || function (k, v) {
|
33726 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
33727 | };
|
33728 | Object.defineProperty(exports, "__esModule", { value: true });
|
33729 | var component_1 = __webpack_require__(8);
|
33730 | var utils_1 = __webpack_require__(1);
|
33731 | var columnController_1 = __webpack_require__(4);
|
33732 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
33733 | var context_1 = __webpack_require__(0);
|
33734 | var touchListener_1 = __webpack_require__(46);
|
33735 | var componentAnnotations_1 = __webpack_require__(11);
|
33736 | var originalColumnGroup_1 = __webpack_require__(32);
|
33737 | var HeaderGroupComp = (function (_super) {
|
33738 | __extends(HeaderGroupComp, _super);
|
33739 | function HeaderGroupComp() {
|
33740 | return _super.call(this, HeaderGroupComp.TEMPLATE) || this;
|
33741 | }
|
33742 | HeaderGroupComp.prototype.init = function (params) {
|
33743 | this.params = params;
|
33744 | this.setupLabel();
|
33745 | this.addGroupExpandIcon();
|
33746 | this.setupExpandIcons();
|
33747 | };
|
33748 | HeaderGroupComp.prototype.setupExpandIcons = function () {
|
33749 | var _this = this;
|
33750 | this.addInIcon("columnGroupOpened", "agOpened");
|
33751 | this.addInIcon("columnGroupClosed", "agClosed");
|
33752 | var expandAction = function (event) {
|
33753 | if (utils_1.Utils.isStopPropagationForAgGrid(event)) {
|
33754 | return;
|
33755 | }
|
33756 | var newExpandedValue = !_this.params.columnGroup.isExpanded();
|
33757 | _this.columnController.setColumnGroupOpened(_this.params.columnGroup.getOriginalColumnGroup(), newExpandedValue, "uiColumnExpanded");
|
33758 | };
|
33759 | this.addTouchAndClickListeners(this.eCloseIcon, expandAction);
|
33760 | this.addTouchAndClickListeners(this.eOpenIcon, expandAction);
|
33761 | var stopPropagationAction = function (event) {
|
33762 | utils_1.Utils.stopPropagationForAgGrid(event);
|
33763 | };
|
33764 |
|
33765 |
|
33766 |
|
33767 |
|
33768 |
|
33769 | this.addDestroyableEventListener(this.eCloseIcon, "dblclick", stopPropagationAction);
|
33770 | this.addDestroyableEventListener(this.eOpenIcon, "dblclick", stopPropagationAction);
|
33771 | this.addDestroyableEventListener(this.getGui(), "dblclick", expandAction);
|
33772 | this.updateIconVisibility();
|
33773 | var originalColumnGroup = this.params.columnGroup.getOriginalColumnGroup();
|
33774 | this.addDestroyableEventListener(originalColumnGroup, originalColumnGroup_1.OriginalColumnGroup.EVENT_EXPANDED_CHANGED, this.updateIconVisibility.bind(this));
|
33775 | this.addDestroyableEventListener(originalColumnGroup, originalColumnGroup_1.OriginalColumnGroup.EVENT_EXPANDABLE_CHANGED, this.updateIconVisibility.bind(this));
|
33776 | };
|
33777 | HeaderGroupComp.prototype.addTouchAndClickListeners = function (eElement, action) {
|
33778 | var touchListener = new touchListener_1.TouchListener(this.eCloseIcon);
|
33779 | this.addDestroyableEventListener(touchListener, touchListener_1.TouchListener.EVENT_TAP, action);
|
33780 | this.addDestroyFunc(function () { return touchListener.destroy(); });
|
33781 | this.addDestroyableEventListener(eElement, "click", action);
|
33782 | };
|
33783 | HeaderGroupComp.prototype.updateIconVisibility = function () {
|
33784 | var columnGroup = this.params.columnGroup;
|
33785 | if (columnGroup.isExpandable()) {
|
33786 | var expanded = this.params.columnGroup.isExpanded();
|
33787 | utils_1.Utils.setVisible(this.eOpenIcon, !expanded);
|
33788 | utils_1.Utils.setVisible(this.eCloseIcon, expanded);
|
33789 | }
|
33790 | else {
|
33791 | utils_1.Utils.setVisible(this.eOpenIcon, false);
|
33792 | utils_1.Utils.setVisible(this.eCloseIcon, false);
|
33793 | }
|
33794 | };
|
33795 | HeaderGroupComp.prototype.addInIcon = function (iconName, refName) {
|
33796 | var eIcon = utils_1.Utils.createIconNoSpan(iconName, this.gridOptionsWrapper, null);
|
33797 | this.getRefElement(refName).appendChild(eIcon);
|
33798 | };
|
33799 | HeaderGroupComp.prototype.addGroupExpandIcon = function () {
|
33800 | if (!this.params.columnGroup.isExpandable()) {
|
33801 | utils_1.Utils.setVisible(this.eOpenIcon, false);
|
33802 | utils_1.Utils.setVisible(this.eCloseIcon, false);
|
33803 | return;
|
33804 | }
|
33805 | };
|
33806 | HeaderGroupComp.prototype.setupLabel = function () {
|
33807 |
|
33808 | if (this.params.displayName && this.params.displayName !== "") {
|
33809 | var eInnerText = this.getRefElement("agLabel");
|
33810 | eInnerText.innerHTML = this.params.displayName;
|
33811 | }
|
33812 | };
|
33813 | HeaderGroupComp.TEMPLATE = "<div class=\"ag-header-group-cell-label\" ref=\"agContainer\">" +
|
33814 | "<span ref=\"agLabel\" class=\"ag-header-group-text\"></span>" +
|
33815 | "<span ref=\"agOpened\" class=\"ag-header-icon ag-header-expand-icon ag-header-expand-icon-expanded\"></span>" +
|
33816 | "<span ref=\"agClosed\" class=\"ag-header-icon ag-header-expand-icon ag-header-expand-icon-collapsed\"></span>" +
|
33817 | "</div>";
|
33818 | __decorate([
|
33819 | context_1.Autowired("columnController"),
|
33820 | __metadata("design:type", columnController_1.ColumnController)
|
33821 | ], HeaderGroupComp.prototype, "columnController", void 0);
|
33822 | __decorate([
|
33823 | context_1.Autowired("gridOptionsWrapper"),
|
33824 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
33825 | ], HeaderGroupComp.prototype, "gridOptionsWrapper", void 0);
|
33826 | __decorate([
|
33827 | componentAnnotations_1.RefSelector("agOpened"),
|
33828 | __metadata("design:type", HTMLElement)
|
33829 | ], HeaderGroupComp.prototype, "eOpenIcon", void 0);
|
33830 | __decorate([
|
33831 | componentAnnotations_1.RefSelector("agClosed"),
|
33832 | __metadata("design:type", HTMLElement)
|
33833 | ], HeaderGroupComp.prototype, "eCloseIcon", void 0);
|
33834 | return HeaderGroupComp;
|
33835 | }(component_1.Component));
|
33836 | exports.HeaderGroupComp = HeaderGroupComp;
|
33837 |
|
33838 |
|
33839 | }),
|
33840 |
|
33841 | (function(module, exports, __webpack_require__) {
|
33842 |
|
33843 | "use strict";
|
33844 |
|
33845 |
|
33846 |
|
33847 |
|
33848 |
|
33849 |
|
33850 |
|
33851 | var __extends = (this && this.__extends) || (function () {
|
33852 | var extendStatics = Object.setPrototypeOf ||
|
33853 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
33854 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
33855 | return function (d, b) {
|
33856 | extendStatics(d, b);
|
33857 | function __() { this.constructor = d; }
|
33858 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
33859 | };
|
33860 | })();
|
33861 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
33862 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
33863 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
33864 | 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;
|
33865 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
33866 | };
|
33867 | var __metadata = (this && this.__metadata) || function (k, v) {
|
33868 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
33869 | };
|
33870 | Object.defineProperty(exports, "__esModule", { value: true });
|
33871 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
33872 | var context_1 = __webpack_require__(0);
|
33873 | var component_1 = __webpack_require__(8);
|
33874 | var LoadingOverlayComponent = (function (_super) {
|
33875 | __extends(LoadingOverlayComponent, _super);
|
33876 | function LoadingOverlayComponent() {
|
33877 | return _super.call(this) || this;
|
33878 | }
|
33879 | LoadingOverlayComponent.prototype.init = function (params) {
|
33880 | var template = this.gridOptionsWrapper.getOverlayLoadingTemplate() ?
|
33881 | this.gridOptionsWrapper.getOverlayLoadingTemplate() : LoadingOverlayComponent.DEFAULT_LOADING_OVERLAY_TEMPLATE;
|
33882 | var localeTextFunc = this.gridOptionsWrapper.getLocaleTextFunc();
|
33883 | var localisedTemplate = template.replace('[LOADING...]', localeTextFunc('loadingOoo', 'Loading...'));
|
33884 | this.setTemplate(localisedTemplate);
|
33885 | };
|
33886 | LoadingOverlayComponent.DEFAULT_LOADING_OVERLAY_TEMPLATE = '<span class="ag-overlay-loading-center">[LOADING...]</span>';
|
33887 | __decorate([
|
33888 | context_1.Autowired('gridOptionsWrapper'),
|
33889 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
33890 | ], LoadingOverlayComponent.prototype, "gridOptionsWrapper", void 0);
|
33891 | return LoadingOverlayComponent;
|
33892 | }(component_1.Component));
|
33893 | exports.LoadingOverlayComponent = LoadingOverlayComponent;
|
33894 |
|
33895 |
|
33896 | }),
|
33897 |
|
33898 | (function(module, exports, __webpack_require__) {
|
33899 |
|
33900 | "use strict";
|
33901 |
|
33902 |
|
33903 |
|
33904 |
|
33905 |
|
33906 |
|
33907 |
|
33908 | var __extends = (this && this.__extends) || (function () {
|
33909 | var extendStatics = Object.setPrototypeOf ||
|
33910 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
33911 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
33912 | return function (d, b) {
|
33913 | extendStatics(d, b);
|
33914 | function __() { this.constructor = d; }
|
33915 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
33916 | };
|
33917 | })();
|
33918 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
33919 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
33920 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
33921 | 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;
|
33922 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
33923 | };
|
33924 | var __metadata = (this && this.__metadata) || function (k, v) {
|
33925 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
33926 | };
|
33927 | Object.defineProperty(exports, "__esModule", { value: true });
|
33928 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
33929 | var context_1 = __webpack_require__(0);
|
33930 | var component_1 = __webpack_require__(8);
|
33931 | var NoRowsOverlayComponent = (function (_super) {
|
33932 | __extends(NoRowsOverlayComponent, _super);
|
33933 | function NoRowsOverlayComponent() {
|
33934 | return _super.call(this) || this;
|
33935 | }
|
33936 | NoRowsOverlayComponent.prototype.init = function (params) {
|
33937 | var template = this.gridOptionsWrapper.getOverlayNoRowsTemplate() ?
|
33938 | this.gridOptionsWrapper.getOverlayNoRowsTemplate() : NoRowsOverlayComponent.DEFAULT_NO_ROWS_TEMPLATE;
|
33939 | var localeTextFunc = this.gridOptionsWrapper.getLocaleTextFunc();
|
33940 | var localisedTemplate = template.replace('[NO_ROWS_TO_SHOW]', localeTextFunc('noRowsToShow', 'No Rows To Show'));
|
33941 | this.setTemplate(localisedTemplate);
|
33942 | };
|
33943 | NoRowsOverlayComponent.DEFAULT_NO_ROWS_TEMPLATE = '<span class="ag-overlay-no-rows-center">[NO_ROWS_TO_SHOW]</span>';
|
33944 | __decorate([
|
33945 | context_1.Autowired('gridOptionsWrapper'),
|
33946 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
33947 | ], NoRowsOverlayComponent.prototype, "gridOptionsWrapper", void 0);
|
33948 | return NoRowsOverlayComponent;
|
33949 | }(component_1.Component));
|
33950 | exports.NoRowsOverlayComponent = NoRowsOverlayComponent;
|
33951 |
|
33952 |
|
33953 | }),
|
33954 |
|
33955 | (function(module, exports, __webpack_require__) {
|
33956 |
|
33957 | "use strict";
|
33958 |
|
33959 |
|
33960 |
|
33961 |
|
33962 |
|
33963 |
|
33964 |
|
33965 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
33966 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
33967 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
33968 | 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;
|
33969 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
33970 | };
|
33971 | var __metadata = (this && this.__metadata) || function (k, v) {
|
33972 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
33973 | };
|
33974 | Object.defineProperty(exports, "__esModule", { value: true });
|
33975 | var utils_1 = __webpack_require__(1);
|
33976 | var context_1 = __webpack_require__(0);
|
33977 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
33978 |
|
33979 |
|
33980 |
|
33981 |
|
33982 |
|
33983 | var RowContainerComponent = (function () {
|
33984 | function RowContainerComponent(params) {
|
33985 | this.childCount = 0;
|
33986 | this.rowTemplatesToAdd = [];
|
33987 | this.afterGuiAttachedCallbacks = [];
|
33988 | this.eContainer = params.eContainer;
|
33989 | this.eViewport = params.eViewport;
|
33990 | this.hideWhenNoChildren = params.hideWhenNoChildren;
|
33991 | }
|
33992 | RowContainerComponent.prototype.setVerticalScrollPosition = function (verticalScrollPosition) {
|
33993 | this.scrollTop = verticalScrollPosition;
|
33994 | };
|
33995 | RowContainerComponent.prototype.postConstruct = function () {
|
33996 | this.domOrder = this.gridOptionsWrapper.isEnsureDomOrder();
|
33997 | this.checkVisibility();
|
33998 | };
|
33999 | RowContainerComponent.prototype.getRowElement = function (compId) {
|
34000 | return this.eContainer.querySelector("[comp-id=\"" + compId + "\"]");
|
34001 | };
|
34002 | RowContainerComponent.prototype.setHeight = function (height) {
|
34003 | this.eContainer.style.height = height + "px";
|
34004 | };
|
34005 | RowContainerComponent.prototype.flushRowTemplates = function () {
|
34006 |
|
34007 |
|
34008 | if (this.rowTemplatesToAdd.length !== 0) {
|
34009 | var htmlToAdd = this.rowTemplatesToAdd.join('');
|
34010 | utils_1.Utils.appendHtml(this.eContainer, htmlToAdd);
|
34011 | this.rowTemplatesToAdd.length = 0;
|
34012 | }
|
34013 |
|
34014 |
|
34015 | this.afterGuiAttachedCallbacks.forEach(function (func) { return func(); });
|
34016 | this.afterGuiAttachedCallbacks.length = 0;
|
34017 | this.lastPlacedElement = null;
|
34018 | };
|
34019 | RowContainerComponent.prototype.appendRowTemplate = function (rowTemplate, callback) {
|
34020 | if (this.domOrder) {
|
34021 | this.lastPlacedElement = utils_1.Utils.insertTemplateWithDomOrder(this.eContainer, rowTemplate, this.lastPlacedElement);
|
34022 | }
|
34023 | else {
|
34024 | this.rowTemplatesToAdd.push(rowTemplate);
|
34025 | }
|
34026 | this.afterGuiAttachedCallbacks.push(callback);
|
34027 |
|
34028 |
|
34029 |
|
34030 |
|
34031 |
|
34032 | this.childCount++;
|
34033 | this.checkVisibility();
|
34034 | };
|
34035 | RowContainerComponent.prototype.ensureDomOrder = function (eRow) {
|
34036 | if (this.domOrder) {
|
34037 | utils_1.Utils.ensureDomOrder(this.eContainer, eRow, this.lastPlacedElement);
|
34038 | this.lastPlacedElement = eRow;
|
34039 | }
|
34040 | };
|
34041 | RowContainerComponent.prototype.removeRowElement = function (eRow) {
|
34042 | this.eContainer.removeChild(eRow);
|
34043 | this.childCount--;
|
34044 | this.checkVisibility();
|
34045 | };
|
34046 | RowContainerComponent.prototype.checkVisibility = function () {
|
34047 | if (!this.hideWhenNoChildren) {
|
34048 | return;
|
34049 | }
|
34050 | var eGui = this.eViewport ? this.eViewport : this.eContainer;
|
34051 | var visible = this.childCount > 0;
|
34052 | if (this.visible !== visible) {
|
34053 | this.visible = visible;
|
34054 | utils_1.Utils.setVisible(eGui, visible);
|
34055 |
|
34056 |
|
34057 |
|
34058 |
|
34059 |
|
34060 |
|
34061 |
|
34062 | if (visible && this.eViewport) {
|
34063 | this.eViewport.scrollTop = this.scrollTop;
|
34064 | }
|
34065 | }
|
34066 | };
|
34067 | __decorate([
|
34068 | context_1.Autowired('gridOptionsWrapper'),
|
34069 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
34070 | ], RowContainerComponent.prototype, "gridOptionsWrapper", void 0);
|
34071 | __decorate([
|
34072 | context_1.PostConstruct,
|
34073 | __metadata("design:type", Function),
|
34074 | __metadata("design:paramtypes", []),
|
34075 | __metadata("design:returntype", void 0)
|
34076 | ], RowContainerComponent.prototype, "postConstruct", null);
|
34077 | return RowContainerComponent;
|
34078 | }());
|
34079 | exports.RowContainerComponent = RowContainerComponent;
|
34080 |
|
34081 |
|
34082 | }),
|
34083 |
|
34084 | (function(module, exports, __webpack_require__) {
|
34085 |
|
34086 | "use strict";
|
34087 |
|
34088 |
|
34089 |
|
34090 |
|
34091 |
|
34092 |
|
34093 |
|
34094 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
34095 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
34096 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
34097 | 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;
|
34098 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
34099 | };
|
34100 | var __metadata = (this && this.__metadata) || function (k, v) {
|
34101 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
34102 | };
|
34103 | Object.defineProperty(exports, "__esModule", { value: true });
|
34104 | var dragAndDropService_1 = __webpack_require__(14);
|
34105 | var context_1 = __webpack_require__(0);
|
34106 | var focusedCellController_1 = __webpack_require__(22);
|
34107 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
34108 | var eventService_1 = __webpack_require__(3);
|
34109 | var eventKeys_1 = __webpack_require__(25);
|
34110 | var RowDragFeature = (function () {
|
34111 | function RowDragFeature(eContainer, gridPanel) {
|
34112 | this.eContainer = eContainer;
|
34113 | this.gridPanel = gridPanel;
|
34114 | }
|
34115 | RowDragFeature.prototype.postConstruct = function () {
|
34116 | if (this.gridOptionsWrapper.isRowModelDefault()) {
|
34117 | this.clientSideRowModel = this.rowModel;
|
34118 | }
|
34119 | };
|
34120 | RowDragFeature.prototype.getContainer = function () {
|
34121 | return this.eContainer;
|
34122 | };
|
34123 | RowDragFeature.prototype.isInterestedIn = function (type) {
|
34124 | return type === dragAndDropService_1.DragSourceType.RowDrag;
|
34125 | };
|
34126 | RowDragFeature.prototype.getIconName = function () {
|
34127 | return dragAndDropService_1.DragAndDropService.ICON_MOVE;
|
34128 | };
|
34129 | RowDragFeature.prototype.onDragEnter = function (draggingEvent) {
|
34130 |
|
34131 |
|
34132 | this.dispatchEvent(eventKeys_1.Events.EVENT_ROW_DRAG_ENTER, draggingEvent);
|
34133 | this.dragAndDropService.setGhostIcon(dragAndDropService_1.DragAndDropService.ICON_MOVE);
|
34134 | draggingEvent.dragItem.rowNode.setDragging(true);
|
34135 | this.onEnterOrDragging(draggingEvent);
|
34136 | };
|
34137 | RowDragFeature.prototype.onDragging = function (draggingEvent) {
|
34138 | this.onEnterOrDragging(draggingEvent);
|
34139 | };
|
34140 | RowDragFeature.prototype.onEnterOrDragging = function (draggingEvent) {
|
34141 |
|
34142 | this.dispatchEvent(eventKeys_1.Events.EVENT_ROW_DRAG_MOVE, draggingEvent);
|
34143 | this.lastDraggingEvent = draggingEvent;
|
34144 | var pixel = this.normaliseForScroll(draggingEvent.y);
|
34145 | var managedDrag = this.gridOptionsWrapper.isRowDragManaged();
|
34146 | if (managedDrag) {
|
34147 | this.doManagedDrag(draggingEvent, pixel);
|
34148 | }
|
34149 | this.checkCenterForScrolling(pixel);
|
34150 | };
|
34151 | RowDragFeature.prototype.doManagedDrag = function (draggingEvent, pixel) {
|
34152 | var rowNode = draggingEvent.dragItem.rowNode;
|
34153 | var rowWasMoved = this.clientSideRowModel.ensureRowAtPixel(rowNode, pixel);
|
34154 | if (rowWasMoved) {
|
34155 | this.focusedCellController.clearFocusedCell();
|
34156 | if (this.rangeController) {
|
34157 | this.rangeController.clearSelection();
|
34158 | }
|
34159 | }
|
34160 | };
|
34161 | RowDragFeature.prototype.normaliseForScroll = function (pixel) {
|
34162 | var gridPanelHasScrolls = !this.gridOptionsWrapper.isGridAutoHeight();
|
34163 | if (gridPanelHasScrolls) {
|
34164 | var pixelRange = this.gridPanel.getVScrollPosition();
|
34165 | return pixel + pixelRange.top;
|
34166 | }
|
34167 | else {
|
34168 | return pixel;
|
34169 | }
|
34170 | };
|
34171 | RowDragFeature.prototype.checkCenterForScrolling = function (pixel) {
|
34172 |
|
34173 | var pixelRange = this.gridPanel.getVScrollPosition();
|
34174 |
|
34175 | this.needToMoveUp = pixel < (pixelRange.top + 50);
|
34176 | this.needToMoveDown = pixel > (pixelRange.bottom - 50);
|
34177 |
|
34178 |
|
34179 | if (this.needToMoveUp || this.needToMoveDown) {
|
34180 | this.ensureIntervalStarted();
|
34181 | }
|
34182 | else {
|
34183 | this.ensureIntervalCleared();
|
34184 | }
|
34185 | };
|
34186 | RowDragFeature.prototype.ensureIntervalStarted = function () {
|
34187 | if (!this.movingIntervalId) {
|
34188 | this.intervalCount = 0;
|
34189 | this.movingIntervalId = setInterval(this.moveInterval.bind(this), 100);
|
34190 | }
|
34191 | };
|
34192 | RowDragFeature.prototype.ensureIntervalCleared = function () {
|
34193 | if (this.moveInterval) {
|
34194 | clearInterval(this.movingIntervalId);
|
34195 | this.movingIntervalId = null;
|
34196 | }
|
34197 | };
|
34198 | RowDragFeature.prototype.moveInterval = function () {
|
34199 |
|
34200 |
|
34201 | var pixelsToMove;
|
34202 | this.intervalCount++;
|
34203 | pixelsToMove = 10 + (this.intervalCount * 5);
|
34204 | if (pixelsToMove > 100) {
|
34205 | pixelsToMove = 100;
|
34206 | }
|
34207 | var pixelsMoved;
|
34208 | if (this.needToMoveDown) {
|
34209 | pixelsMoved = this.gridPanel.scrollVertically(pixelsToMove);
|
34210 | }
|
34211 | else if (this.needToMoveUp) {
|
34212 | pixelsMoved = this.gridPanel.scrollVertically(-pixelsToMove);
|
34213 | }
|
34214 | if (pixelsMoved !== 0) {
|
34215 | this.onDragging(this.lastDraggingEvent);
|
34216 | }
|
34217 | };
|
34218 |
|
34219 |
|
34220 |
|
34221 | RowDragFeature.prototype.dispatchEvent = function (type, draggingEvent) {
|
34222 | var yNormalised = this.normaliseForScroll(draggingEvent.y);
|
34223 | var overIndex = -1;
|
34224 | var overNode = null;
|
34225 | var mouseIsPastLastRow = yNormalised > this.rowModel.getCurrentPageHeight();
|
34226 | if (!mouseIsPastLastRow) {
|
34227 | overIndex = this.rowModel.getRowIndexAtPixel(yNormalised);
|
34228 | overNode = this.rowModel.getRow(overIndex);
|
34229 | }
|
34230 | var vDirectionString;
|
34231 | switch (draggingEvent.vDirection) {
|
34232 | case dragAndDropService_1.VDirection.Down:
|
34233 | vDirectionString = 'down';
|
34234 | break;
|
34235 | case dragAndDropService_1.VDirection.Up:
|
34236 | vDirectionString = 'up';
|
34237 | break;
|
34238 | default:
|
34239 | vDirectionString = null;
|
34240 | break;
|
34241 | }
|
34242 | var event = {
|
34243 | type: type,
|
34244 | api: this.gridOptionsWrapper.getApi(),
|
34245 | columnApi: this.gridOptionsWrapper.getColumnApi(),
|
34246 | event: draggingEvent.event,
|
34247 | node: draggingEvent.dragItem.rowNode,
|
34248 | overIndex: overIndex,
|
34249 | overNode: overNode,
|
34250 | y: yNormalised,
|
34251 | vDirection: vDirectionString
|
34252 | };
|
34253 | this.eventService.dispatchEvent(event);
|
34254 | };
|
34255 | RowDragFeature.prototype.onDragLeave = function (draggingEvent) {
|
34256 | this.dispatchEvent(eventKeys_1.Events.EVENT_ROW_DRAG_LEAVE, draggingEvent);
|
34257 | this.stopDragging(draggingEvent);
|
34258 | };
|
34259 | RowDragFeature.prototype.onDragStop = function (draggingEvent) {
|
34260 | this.dispatchEvent(eventKeys_1.Events.EVENT_ROW_DRAG_END, draggingEvent);
|
34261 | this.stopDragging(draggingEvent);
|
34262 | };
|
34263 | RowDragFeature.prototype.stopDragging = function (draggingEvent) {
|
34264 | this.ensureIntervalCleared();
|
34265 | draggingEvent.dragItem.rowNode.setDragging(false);
|
34266 | };
|
34267 | __decorate([
|
34268 | context_1.Autowired('dragAndDropService'),
|
34269 | __metadata("design:type", dragAndDropService_1.DragAndDropService)
|
34270 | ], RowDragFeature.prototype, "dragAndDropService", void 0);
|
34271 | __decorate([
|
34272 | context_1.Autowired('rowModel'),
|
34273 | __metadata("design:type", Object)
|
34274 | ], RowDragFeature.prototype, "rowModel", void 0);
|
34275 | __decorate([
|
34276 | context_1.Autowired('focusedCellController'),
|
34277 | __metadata("design:type", focusedCellController_1.FocusedCellController)
|
34278 | ], RowDragFeature.prototype, "focusedCellController", void 0);
|
34279 | __decorate([
|
34280 | context_1.Autowired('gridOptionsWrapper'),
|
34281 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
34282 | ], RowDragFeature.prototype, "gridOptionsWrapper", void 0);
|
34283 | __decorate([
|
34284 | context_1.Optional('rangeController'),
|
34285 | __metadata("design:type", Object)
|
34286 | ], RowDragFeature.prototype, "rangeController", void 0);
|
34287 | __decorate([
|
34288 | context_1.Autowired('eventService'),
|
34289 | __metadata("design:type", eventService_1.EventService)
|
34290 | ], RowDragFeature.prototype, "eventService", void 0);
|
34291 | __decorate([
|
34292 | context_1.PostConstruct,
|
34293 | __metadata("design:type", Function),
|
34294 | __metadata("design:paramtypes", []),
|
34295 | __metadata("design:returntype", void 0)
|
34296 | ], RowDragFeature.prototype, "postConstruct", null);
|
34297 | return RowDragFeature;
|
34298 | }());
|
34299 | exports.RowDragFeature = RowDragFeature;
|
34300 |
|
34301 |
|
34302 | }),
|
34303 |
|
34304 | (function(module, exports, __webpack_require__) {
|
34305 |
|
34306 | "use strict";
|
34307 |
|
34308 |
|
34309 |
|
34310 |
|
34311 |
|
34312 |
|
34313 |
|
34314 | var __extends = (this && this.__extends) || (function () {
|
34315 | var extendStatics = Object.setPrototypeOf ||
|
34316 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
34317 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
34318 | return function (d, b) {
|
34319 | extendStatics(d, b);
|
34320 | function __() { this.constructor = d; }
|
34321 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
34322 | };
|
34323 | })();
|
34324 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
34325 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
34326 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
34327 | 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;
|
34328 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
34329 | };
|
34330 | var __metadata = (this && this.__metadata) || function (k, v) {
|
34331 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
34332 | };
|
34333 | Object.defineProperty(exports, "__esModule", { value: true });
|
34334 | var agCheckbox_1 = __webpack_require__(60);
|
34335 | var beanStub_1 = __webpack_require__(13);
|
34336 | var context_1 = __webpack_require__(0);
|
34337 | var columnApi_1 = __webpack_require__(7);
|
34338 | var gridApi_1 = __webpack_require__(6);
|
34339 | var events_1 = __webpack_require__(5);
|
34340 | var eventService_1 = __webpack_require__(3);
|
34341 | var constants_1 = __webpack_require__(9);
|
34342 | var selectionController_1 = __webpack_require__(17);
|
34343 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
34344 | var SelectAllFeature = (function (_super) {
|
34345 | __extends(SelectAllFeature, _super);
|
34346 | function SelectAllFeature(cbSelectAll, column) {
|
34347 | var _this = _super.call(this) || this;
|
34348 | _this.cbSelectAllVisible = false;
|
34349 | _this.processingEventFromCheckbox = false;
|
34350 | _this.cbSelectAll = cbSelectAll;
|
34351 | _this.column = column;
|
34352 | var colDef = column.getColDef();
|
34353 | _this.filteredOnly = colDef ? !!colDef.headerCheckboxSelectionFilteredOnly : false;
|
34354 | return _this;
|
34355 | }
|
34356 | SelectAllFeature.prototype.postConstruct = function () {
|
34357 | this.showOrHideSelectAll();
|
34358 | this.addDestroyableEventListener(this.eventService, events_1.Events.EVENT_DISPLAYED_COLUMNS_CHANGED, this.showOrHideSelectAll.bind(this));
|
34359 | this.addDestroyableEventListener(this.eventService, events_1.Events.EVENT_SELECTION_CHANGED, this.onSelectionChanged.bind(this));
|
34360 | this.addDestroyableEventListener(this.eventService, events_1.Events.EVENT_MODEL_UPDATED, this.onModelChanged.bind(this));
|
34361 | this.addDestroyableEventListener(this.cbSelectAll, agCheckbox_1.AgCheckbox.EVENT_CHANGED, this.onCbSelectAll.bind(this));
|
34362 | };
|
34363 | SelectAllFeature.prototype.showOrHideSelectAll = function () {
|
34364 | this.cbSelectAllVisible = this.isCheckboxSelection();
|
34365 | this.cbSelectAll.setVisible(this.cbSelectAllVisible);
|
34366 | if (this.cbSelectAllVisible) {
|
34367 |
|
34368 | this.checkRightRowModelType();
|
34369 |
|
34370 | this.updateStateOfCheckbox();
|
34371 | }
|
34372 | };
|
34373 | SelectAllFeature.prototype.onModelChanged = function () {
|
34374 | if (!this.cbSelectAllVisible) {
|
34375 | return;
|
34376 | }
|
34377 | this.updateStateOfCheckbox();
|
34378 | };
|
34379 | SelectAllFeature.prototype.onSelectionChanged = function () {
|
34380 | if (!this.cbSelectAllVisible) {
|
34381 | return;
|
34382 | }
|
34383 | this.updateStateOfCheckbox();
|
34384 | };
|
34385 | SelectAllFeature.prototype.getNextCheckboxState = function (selectionCount) {
|
34386 | if (selectionCount.selected === 0 && selectionCount.notSelected === 0) {
|
34387 |
|
34388 | return false;
|
34389 | }
|
34390 | else if (selectionCount.selected > 0 && selectionCount.notSelected > 0) {
|
34391 |
|
34392 | return null;
|
34393 | }
|
34394 | else if (selectionCount.selected > 0) {
|
34395 |
|
34396 | return true;
|
34397 | }
|
34398 | else {
|
34399 |
|
34400 | return false;
|
34401 | }
|
34402 | };
|
34403 | SelectAllFeature.prototype.updateStateOfCheckbox = function () {
|
34404 | if (this.processingEventFromCheckbox) {
|
34405 | return;
|
34406 | }
|
34407 | this.processingEventFromCheckbox = true;
|
34408 | var selectionCount = this.getSelectionCount();
|
34409 | var allSelected = this.getNextCheckboxState(selectionCount);
|
34410 | this.cbSelectAll.setSelected(allSelected);
|
34411 | this.processingEventFromCheckbox = false;
|
34412 | };
|
34413 | SelectAllFeature.prototype.getSelectionCount = function () {
|
34414 | var selectedCount = 0;
|
34415 | var notSelectedCount = 0;
|
34416 | var callback = function (node) {
|
34417 | if (node.isSelected()) {
|
34418 | selectedCount++;
|
34419 | }
|
34420 | else if (!node.selectable) {
|
34421 |
|
34422 | }
|
34423 | else {
|
34424 | notSelectedCount++;
|
34425 | }
|
34426 | };
|
34427 | if (this.filteredOnly) {
|
34428 | this.gridApi.forEachNodeAfterFilter(callback);
|
34429 | }
|
34430 | else {
|
34431 | this.gridApi.forEachNode(callback);
|
34432 | }
|
34433 | return {
|
34434 | notSelected: notSelectedCount,
|
34435 | selected: selectedCount
|
34436 | };
|
34437 | };
|
34438 | SelectAllFeature.prototype.checkRightRowModelType = function () {
|
34439 | var rowModelType = this.rowModel.getType();
|
34440 | var rowModelMatches = rowModelType === constants_1.Constants.ROW_MODEL_TYPE_CLIENT_SIDE;
|
34441 | if (!rowModelMatches) {
|
34442 | console.log("ag-Grid: selectAllCheckbox is only available if using normal row model, you are using " + rowModelType);
|
34443 | }
|
34444 | };
|
34445 | SelectAllFeature.prototype.onCbSelectAll = function () {
|
34446 | if (this.processingEventFromCheckbox) {
|
34447 | return;
|
34448 | }
|
34449 | if (!this.cbSelectAllVisible) {
|
34450 | return;
|
34451 | }
|
34452 | var value = this.cbSelectAll.isSelected();
|
34453 | if (value) {
|
34454 | this.selectionController.selectAllRowNodes(this.filteredOnly);
|
34455 | }
|
34456 | else {
|
34457 | this.selectionController.deselectAllRowNodes(this.filteredOnly);
|
34458 | }
|
34459 | };
|
34460 | SelectAllFeature.prototype.isCheckboxSelection = function () {
|
34461 | var result = this.column.getColDef().headerCheckboxSelection;
|
34462 | if (typeof result === 'function') {
|
34463 | var func = result;
|
34464 | result = func({
|
34465 | column: this.column,
|
34466 | colDef: this.column.getColDef(),
|
34467 | columnApi: this.columnApi,
|
34468 | api: this.gridApi
|
34469 | });
|
34470 | }
|
34471 | if (result) {
|
34472 | if (this.gridOptionsWrapper.isRowModelServerSide()) {
|
34473 | console.warn('headerCheckboxSelection is not supported for Server Side Row Model');
|
34474 | return false;
|
34475 | }
|
34476 | if (this.gridOptionsWrapper.isRowModelInfinite()) {
|
34477 | console.warn('headerCheckboxSelection is not supported for Infinite Row Model');
|
34478 | return false;
|
34479 | }
|
34480 | if (this.gridOptionsWrapper.isRowModelViewport()) {
|
34481 | console.warn('headerCheckboxSelection is not supported for Viewport Row Model');
|
34482 | return false;
|
34483 | }
|
34484 |
|
34485 | return true;
|
34486 | }
|
34487 | else {
|
34488 | return false;
|
34489 | }
|
34490 | };
|
34491 | __decorate([
|
34492 | context_1.Autowired('gridApi'),
|
34493 | __metadata("design:type", gridApi_1.GridApi)
|
34494 | ], SelectAllFeature.prototype, "gridApi", void 0);
|
34495 | __decorate([
|
34496 | context_1.Autowired('columnApi'),
|
34497 | __metadata("design:type", columnApi_1.ColumnApi)
|
34498 | ], SelectAllFeature.prototype, "columnApi", void 0);
|
34499 | __decorate([
|
34500 | context_1.Autowired('eventService'),
|
34501 | __metadata("design:type", eventService_1.EventService)
|
34502 | ], SelectAllFeature.prototype, "eventService", void 0);
|
34503 | __decorate([
|
34504 | context_1.Autowired('rowModel'),
|
34505 | __metadata("design:type", Object)
|
34506 | ], SelectAllFeature.prototype, "rowModel", void 0);
|
34507 | __decorate([
|
34508 | context_1.Autowired('selectionController'),
|
34509 | __metadata("design:type", selectionController_1.SelectionController)
|
34510 | ], SelectAllFeature.prototype, "selectionController", void 0);
|
34511 | __decorate([
|
34512 | context_1.Autowired('gridOptionsWrapper'),
|
34513 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
34514 | ], SelectAllFeature.prototype, "gridOptionsWrapper", void 0);
|
34515 | __decorate([
|
34516 | context_1.PostConstruct,
|
34517 | __metadata("design:type", Function),
|
34518 | __metadata("design:paramtypes", []),
|
34519 | __metadata("design:returntype", void 0)
|
34520 | ], SelectAllFeature.prototype, "postConstruct", null);
|
34521 | return SelectAllFeature;
|
34522 | }(beanStub_1.BeanStub));
|
34523 | exports.SelectAllFeature = SelectAllFeature;
|
34524 |
|
34525 |
|
34526 | }),
|
34527 |
|
34528 | (function(module, exports, __webpack_require__) {
|
34529 |
|
34530 | "use strict";
|
34531 |
|
34532 |
|
34533 |
|
34534 |
|
34535 |
|
34536 |
|
34537 |
|
34538 | var __extends = (this && this.__extends) || (function () {
|
34539 | var extendStatics = Object.setPrototypeOf ||
|
34540 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
34541 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
34542 | return function (d, b) {
|
34543 | extendStatics(d, b);
|
34544 | function __() { this.constructor = d; }
|
34545 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
34546 | };
|
34547 | })();
|
34548 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
34549 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
34550 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
34551 | 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;
|
34552 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
34553 | };
|
34554 | var __metadata = (this && this.__metadata) || function (k, v) {
|
34555 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
34556 | };
|
34557 | Object.defineProperty(exports, "__esModule", { value: true });
|
34558 | var component_1 = __webpack_require__(8);
|
34559 | var column_1 = __webpack_require__(10);
|
34560 | var utils_1 = __webpack_require__(1);
|
34561 | var columnGroup_1 = __webpack_require__(26);
|
34562 | var columnApi_1 = __webpack_require__(7);
|
34563 | var columnController_1 = __webpack_require__(4);
|
34564 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
34565 | var horizontalResizeService_1 = __webpack_require__(59);
|
34566 | var context_1 = __webpack_require__(0);
|
34567 | var cssClassApplier_1 = __webpack_require__(81);
|
34568 | var dragAndDropService_1 = __webpack_require__(14);
|
34569 | var setLeftFeature_1 = __webpack_require__(52);
|
34570 | var gridApi_1 = __webpack_require__(6);
|
34571 | var componentRecipes_1 = __webpack_require__(21);
|
34572 | var beans_1 = __webpack_require__(28);
|
34573 | var hoverFeature_1 = __webpack_require__(74);
|
34574 | var HeaderGroupWrapperComp = (function (_super) {
|
34575 | __extends(HeaderGroupWrapperComp, _super);
|
34576 | function HeaderGroupWrapperComp(columnGroup, dragSourceDropTarget, pinned) {
|
34577 | var _this = _super.call(this, HeaderGroupWrapperComp.TEMPLATE) || this;
|
34578 |
|
34579 | _this.childColumnsDestroyFuncs = [];
|
34580 | _this.columnGroup = columnGroup;
|
34581 | _this.dragSourceDropTarget = dragSourceDropTarget;
|
34582 | _this.pinned = pinned;
|
34583 | return _this;
|
34584 | }
|
34585 | HeaderGroupWrapperComp.prototype.postConstruct = function () {
|
34586 | cssClassApplier_1.CssClassApplier.addHeaderClassesFromColDef(this.columnGroup.getColGroupDef(), this.getGui(), this.gridOptionsWrapper, null, this.columnGroup);
|
34587 | var displayName = this.columnController.getDisplayNameForColumnGroup(this.columnGroup, 'header');
|
34588 | this.appendHeaderGroupComp(displayName);
|
34589 | this.setupResize();
|
34590 | this.addClasses();
|
34591 | this.setupWidth();
|
34592 | this.addAttributes();
|
34593 | this.setupMovingCss();
|
34594 | this.setupTooltip();
|
34595 | this.addFeature(this.context, new hoverFeature_1.HoverFeature(this.columnGroup.getOriginalColumnGroup().getLeafColumns(), this.getGui()));
|
34596 | var setLeftFeature = new setLeftFeature_1.SetLeftFeature(this.columnGroup, this.getGui(), this.beans);
|
34597 | setLeftFeature.init();
|
34598 | this.addDestroyFunc(setLeftFeature.destroy.bind(setLeftFeature));
|
34599 | };
|
34600 | HeaderGroupWrapperComp.prototype.setupMovingCss = function () {
|
34601 | var _this = this;
|
34602 | var originalColumnGroup = this.columnGroup.getOriginalColumnGroup();
|
34603 | var leafColumns = originalColumnGroup.getLeafColumns();
|
34604 | leafColumns.forEach(function (col) {
|
34605 | _this.addDestroyableEventListener(col, column_1.Column.EVENT_MOVING_CHANGED, _this.onColumnMovingChanged.bind(_this));
|
34606 | });
|
34607 | this.onColumnMovingChanged();
|
34608 | };
|
34609 | HeaderGroupWrapperComp.prototype.setupTooltip = function () {
|
34610 | var colGroupDef = this.columnGroup.getColGroupDef();
|
34611 |
|
34612 | if (colGroupDef && colGroupDef.headerTooltip) {
|
34613 | this.getGui().title = colGroupDef.headerTooltip;
|
34614 | }
|
34615 | };
|
34616 | HeaderGroupWrapperComp.prototype.onColumnMovingChanged = function () {
|
34617 |
|
34618 |
|
34619 |
|
34620 | if (this.columnGroup.isMoving()) {
|
34621 | utils_1.Utils.addCssClass(this.getGui(), 'ag-header-cell-moving');
|
34622 | }
|
34623 | else {
|
34624 | utils_1.Utils.removeCssClass(this.getGui(), 'ag-header-cell-moving');
|
34625 | }
|
34626 | };
|
34627 | HeaderGroupWrapperComp.prototype.addAttributes = function () {
|
34628 | this.getGui().setAttribute("col-id", this.columnGroup.getUniqueId());
|
34629 | };
|
34630 | HeaderGroupWrapperComp.prototype.appendHeaderGroupComp = function (displayName) {
|
34631 | var _this = this;
|
34632 | var params = {
|
34633 | displayName: displayName,
|
34634 | columnGroup: this.columnGroup,
|
34635 | setExpanded: function (expanded) {
|
34636 | _this.columnController.setColumnGroupOpened(_this.columnGroup.getOriginalColumnGroup(), expanded, "gridInitializing");
|
34637 | },
|
34638 | api: this.gridApi,
|
34639 | columnApi: this.columnApi,
|
34640 | context: this.gridOptionsWrapper.getContext()
|
34641 | };
|
34642 | if (!displayName) {
|
34643 | var leafCols = this.columnGroup.getLeafColumns();
|
34644 | displayName = leafCols ? leafCols[0].getColDef().headerName : '';
|
34645 | }
|
34646 | var callback = this.afterHeaderCompCreated.bind(this, displayName);
|
34647 | this.componentRecipes.newHeaderGroupComponent(params).then(callback);
|
34648 | };
|
34649 | HeaderGroupWrapperComp.prototype.afterHeaderCompCreated = function (displayName, headerGroupComp) {
|
34650 | this.appendChild(headerGroupComp);
|
34651 | this.setupMove(headerGroupComp.getGui(), displayName);
|
34652 | if (headerGroupComp.destroy) {
|
34653 | this.addDestroyFunc(headerGroupComp.destroy.bind(headerGroupComp));
|
34654 | }
|
34655 | };
|
34656 | HeaderGroupWrapperComp.prototype.addClasses = function () {
|
34657 |
|
34658 |
|
34659 |
|
34660 | if (this.columnGroup.isPadding()) {
|
34661 | this.addCssClass('ag-header-group-cell-no-group');
|
34662 | }
|
34663 | else {
|
34664 | this.addCssClass('ag-header-group-cell-with-group');
|
34665 | }
|
34666 | };
|
34667 | HeaderGroupWrapperComp.prototype.setupMove = function (eHeaderGroup, displayName) {
|
34668 | var _this = this;
|
34669 | if (!eHeaderGroup) {
|
34670 | return;
|
34671 | }
|
34672 | if (this.isSuppressMoving()) {
|
34673 | return;
|
34674 | }
|
34675 | var allLeafColumns = this.columnGroup.getOriginalColumnGroup().getLeafColumns();
|
34676 | if (eHeaderGroup) {
|
34677 | var dragSource_1 = {
|
34678 | type: dragAndDropService_1.DragSourceType.HeaderCell,
|
34679 | eElement: eHeaderGroup,
|
34680 | dragItemName: displayName,
|
34681 |
|
34682 | dragItemCallback: this.getDragItemForGroup.bind(this),
|
34683 | dragSourceDropTarget: this.dragSourceDropTarget,
|
34684 | dragStarted: function () { return allLeafColumns.forEach(function (col) { return col.setMoving(true, "uiColumnDragged"); }); },
|
34685 | dragStopped: function () { return allLeafColumns.forEach(function (col) { return col.setMoving(false, "uiColumnDragged"); }); }
|
34686 | };
|
34687 | this.dragAndDropService.addDragSource(dragSource_1, true);
|
34688 | this.addDestroyFunc(function () { return _this.dragAndDropService.removeDragSource(dragSource_1); });
|
34689 | }
|
34690 | };
|
34691 |
|
34692 |
|
34693 | HeaderGroupWrapperComp.prototype.getDragItemForGroup = function () {
|
34694 | var allColumnsOriginalOrder = this.columnGroup.getOriginalColumnGroup().getLeafColumns();
|
34695 |
|
34696 | var visibleState = {};
|
34697 | allColumnsOriginalOrder.forEach(function (column) { return visibleState[column.getId()] = column.isVisible(); });
|
34698 | var allColumnsCurrentOrder = [];
|
34699 | this.columnController.getAllDisplayedColumns().forEach(function (column) {
|
34700 | if (allColumnsOriginalOrder.indexOf(column) >= 0) {
|
34701 | allColumnsCurrentOrder.push(column);
|
34702 | utils_1.Utils.removeFromArray(allColumnsOriginalOrder, column);
|
34703 | }
|
34704 | });
|
34705 |
|
34706 | allColumnsOriginalOrder.forEach(function (column) { return allColumnsCurrentOrder.push(column); });
|
34707 |
|
34708 | return {
|
34709 | columns: allColumnsCurrentOrder,
|
34710 | visibleState: visibleState
|
34711 | };
|
34712 | };
|
34713 | HeaderGroupWrapperComp.prototype.isSuppressMoving = function () {
|
34714 |
|
34715 | var childSuppressesMoving = false;
|
34716 | this.columnGroup.getLeafColumns().forEach(function (column) {
|
34717 | if (column.getColDef().suppressMovable || column.isLockPosition()) {
|
34718 | childSuppressesMoving = true;
|
34719 | }
|
34720 | });
|
34721 | var result = childSuppressesMoving || this.gridOptionsWrapper.isSuppressMovableColumns();
|
34722 | return result;
|
34723 | };
|
34724 | HeaderGroupWrapperComp.prototype.setupWidth = function () {
|
34725 |
|
34726 | this.addListenersToChildrenColumns();
|
34727 |
|
34728 | this.addDestroyableEventListener(this.columnGroup, columnGroup_1.ColumnGroup.EVENT_DISPLAYED_CHILDREN_CHANGED, this.onDisplayedChildrenChanged.bind(this));
|
34729 | this.onWidthChanged();
|
34730 |
|
34731 |
|
34732 |
|
34733 | this.addDestroyFunc(this.destroyListenersOnChildrenColumns.bind(this));
|
34734 | };
|
34735 | HeaderGroupWrapperComp.prototype.onDisplayedChildrenChanged = function () {
|
34736 | this.addListenersToChildrenColumns();
|
34737 | this.onWidthChanged();
|
34738 | };
|
34739 | HeaderGroupWrapperComp.prototype.addListenersToChildrenColumns = function () {
|
34740 | var _this = this;
|
34741 |
|
34742 | this.destroyListenersOnChildrenColumns();
|
34743 |
|
34744 | var widthChangedListener = this.onWidthChanged.bind(this);
|
34745 | this.columnGroup.getLeafColumns().forEach(function (column) {
|
34746 | column.addEventListener(column_1.Column.EVENT_WIDTH_CHANGED, widthChangedListener);
|
34747 | column.addEventListener(column_1.Column.EVENT_VISIBLE_CHANGED, widthChangedListener);
|
34748 | _this.childColumnsDestroyFuncs.push(function () {
|
34749 | column.removeEventListener(column_1.Column.EVENT_WIDTH_CHANGED, widthChangedListener);
|
34750 | column.removeEventListener(column_1.Column.EVENT_VISIBLE_CHANGED, widthChangedListener);
|
34751 | });
|
34752 | });
|
34753 | };
|
34754 | HeaderGroupWrapperComp.prototype.destroyListenersOnChildrenColumns = function () {
|
34755 | this.childColumnsDestroyFuncs.forEach(function (func) { return func(); });
|
34756 | this.childColumnsDestroyFuncs = [];
|
34757 | };
|
34758 | HeaderGroupWrapperComp.prototype.onWidthChanged = function () {
|
34759 | this.getGui().style.width = this.columnGroup.getActualWidth() + 'px';
|
34760 | };
|
34761 | HeaderGroupWrapperComp.prototype.setupResize = function () {
|
34762 | var _this = this;
|
34763 | this.eHeaderCellResize = this.getRefElement('agResize');
|
34764 | if (!this.columnGroup.isResizable()) {
|
34765 | utils_1.Utils.removeFromParent(this.eHeaderCellResize);
|
34766 | return;
|
34767 | }
|
34768 | var finishedWithResizeFunc = this.horizontalResizeService.addResizeBar({
|
34769 | eResizeBar: this.eHeaderCellResize,
|
34770 | onResizeStart: this.onResizeStart.bind(this),
|
34771 | onResizing: this.onResizing.bind(this, false),
|
34772 | onResizeEnd: this.onResizing.bind(this, true)
|
34773 | });
|
34774 | this.addDestroyFunc(finishedWithResizeFunc);
|
34775 | if (!this.gridOptionsWrapper.isSuppressAutoSize()) {
|
34776 | this.eHeaderCellResize.addEventListener('dblclick', function (event) {
|
34777 |
|
34778 | var keys = [];
|
34779 | _this.columnGroup.getDisplayedLeafColumns().forEach(function (column) {
|
34780 |
|
34781 | if (!column.getColDef().suppressAutoSize) {
|
34782 | keys.push(column.getColId());
|
34783 | }
|
34784 | });
|
34785 | if (keys.length > 0) {
|
34786 | _this.columnController.autoSizeColumns(keys, "uiColumnResized");
|
34787 | }
|
34788 | });
|
34789 | }
|
34790 | };
|
34791 | HeaderGroupWrapperComp.prototype.onResizeStart = function (shiftKey) {
|
34792 | var _this = this;
|
34793 | var leafCols = this.columnGroup.getDisplayedLeafColumns();
|
34794 | this.resizeCols = utils_1.Utils.filter(leafCols, function (col) { return col.isResizable(); });
|
34795 | this.resizeStartWidth = 0;
|
34796 | this.resizeCols.forEach(function (col) { return _this.resizeStartWidth += col.getActualWidth(); });
|
34797 | this.resizeRatios = [];
|
34798 | this.resizeCols.forEach(function (col) { return _this.resizeRatios.push(col.getActualWidth() / _this.resizeStartWidth); });
|
34799 | var takeFromGroup = null;
|
34800 | if (shiftKey) {
|
34801 | takeFromGroup = this.columnController.getDisplayedGroupAfter(this.columnGroup);
|
34802 | }
|
34803 | if (takeFromGroup) {
|
34804 | var takeFromLeafCols = takeFromGroup.getDisplayedLeafColumns();
|
34805 | this.resizeTakeFromCols = utils_1.Utils.filter(takeFromLeafCols, function (col) { return col.isResizable(); });
|
34806 | this.resizeTakeFromStartWidth = 0;
|
34807 | this.resizeTakeFromCols.forEach(function (col) { return _this.resizeTakeFromStartWidth += col.getActualWidth(); });
|
34808 | this.resizeTakeFromRatios = [];
|
34809 | this.resizeTakeFromCols.forEach(function (col) { return _this.resizeTakeFromRatios.push(col.getActualWidth() / _this.resizeTakeFromStartWidth); });
|
34810 | }
|
34811 | else {
|
34812 | this.resizeTakeFromCols = null;
|
34813 | this.resizeTakeFromStartWidth = null;
|
34814 | this.resizeTakeFromRatios = null;
|
34815 | }
|
34816 | };
|
34817 | HeaderGroupWrapperComp.prototype.onResizing = function (finished, resizeAmount) {
|
34818 | var resizeSets = [];
|
34819 | var resizeAmountNormalised = this.normaliseDragChange(resizeAmount);
|
34820 | resizeSets.push({
|
34821 | columns: this.resizeCols,
|
34822 | ratios: this.resizeRatios,
|
34823 | width: this.resizeStartWidth + resizeAmountNormalised
|
34824 | });
|
34825 | if (this.resizeTakeFromCols) {
|
34826 | resizeSets.push({
|
34827 | columns: this.resizeTakeFromCols,
|
34828 | ratios: this.resizeTakeFromRatios,
|
34829 | width: this.resizeTakeFromStartWidth - resizeAmountNormalised
|
34830 | });
|
34831 | }
|
34832 | this.columnController.resizeColumnSets(resizeSets, finished, 'uiColumnDragged');
|
34833 | };
|
34834 |
|
34835 |
|
34836 | HeaderGroupWrapperComp.prototype.normaliseDragChange = function (dragChange) {
|
34837 | var result = dragChange;
|
34838 | if (this.gridOptionsWrapper.isEnableRtl()) {
|
34839 |
|
34840 | if (this.pinned !== column_1.Column.PINNED_LEFT) {
|
34841 | result *= -1;
|
34842 | }
|
34843 | }
|
34844 | else {
|
34845 |
|
34846 | if (this.pinned === column_1.Column.PINNED_RIGHT) {
|
34847 | result *= -1;
|
34848 | }
|
34849 | }
|
34850 | return result;
|
34851 | };
|
34852 | HeaderGroupWrapperComp.TEMPLATE = '<div class="ag-header-group-cell">' +
|
34853 | '<div ref="agResize" class="ag-header-cell-resize"></div>' +
|
34854 | '</div>';
|
34855 | __decorate([
|
34856 | context_1.Autowired('gridOptionsWrapper'),
|
34857 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
34858 | ], HeaderGroupWrapperComp.prototype, "gridOptionsWrapper", void 0);
|
34859 | __decorate([
|
34860 | context_1.Autowired('columnController'),
|
34861 | __metadata("design:type", columnController_1.ColumnController)
|
34862 | ], HeaderGroupWrapperComp.prototype, "columnController", void 0);
|
34863 | __decorate([
|
34864 | context_1.Autowired('horizontalResizeService'),
|
34865 | __metadata("design:type", horizontalResizeService_1.HorizontalResizeService)
|
34866 | ], HeaderGroupWrapperComp.prototype, "horizontalResizeService", void 0);
|
34867 | __decorate([
|
34868 | context_1.Autowired('dragAndDropService'),
|
34869 | __metadata("design:type", dragAndDropService_1.DragAndDropService)
|
34870 | ], HeaderGroupWrapperComp.prototype, "dragAndDropService", void 0);
|
34871 | __decorate([
|
34872 | context_1.Autowired('context'),
|
34873 | __metadata("design:type", context_1.Context)
|
34874 | ], HeaderGroupWrapperComp.prototype, "context", void 0);
|
34875 | __decorate([
|
34876 | context_1.Autowired('componentRecipes'),
|
34877 | __metadata("design:type", componentRecipes_1.ComponentRecipes)
|
34878 | ], HeaderGroupWrapperComp.prototype, "componentRecipes", void 0);
|
34879 | __decorate([
|
34880 | context_1.Autowired('gridApi'),
|
34881 | __metadata("design:type", gridApi_1.GridApi)
|
34882 | ], HeaderGroupWrapperComp.prototype, "gridApi", void 0);
|
34883 | __decorate([
|
34884 | context_1.Autowired('columnApi'),
|
34885 | __metadata("design:type", columnApi_1.ColumnApi)
|
34886 | ], HeaderGroupWrapperComp.prototype, "columnApi", void 0);
|
34887 | __decorate([
|
34888 | context_1.Autowired('beans'),
|
34889 | __metadata("design:type", beans_1.Beans)
|
34890 | ], HeaderGroupWrapperComp.prototype, "beans", void 0);
|
34891 | __decorate([
|
34892 | context_1.PostConstruct,
|
34893 | __metadata("design:type", Function),
|
34894 | __metadata("design:paramtypes", []),
|
34895 | __metadata("design:returntype", void 0)
|
34896 | ], HeaderGroupWrapperComp.prototype, "postConstruct", null);
|
34897 | return HeaderGroupWrapperComp;
|
34898 | }(component_1.Component));
|
34899 | exports.HeaderGroupWrapperComp = HeaderGroupWrapperComp;
|
34900 |
|
34901 |
|
34902 | }),
|
34903 |
|
34904 | (function(module, exports, __webpack_require__) {
|
34905 |
|
34906 | "use strict";
|
34907 |
|
34908 |
|
34909 |
|
34910 |
|
34911 |
|
34912 |
|
34913 |
|
34914 | Object.defineProperty(exports, "__esModule", { value: true });
|
34915 | exports.DefaultColumnTypes = {
|
34916 | numericColumn: {
|
34917 | headerClass: "ag-numeric-header",
|
34918 | cellClass: "ag-numeric-cell"
|
34919 | }
|
34920 | };
|
34921 |
|
34922 |
|
34923 | }),
|
34924 |
|
34925 | (function(module, exports, __webpack_require__) {
|
34926 |
|
34927 | "use strict";
|
34928 |
|
34929 |
|
34930 |
|
34931 |
|
34932 |
|
34933 |
|
34934 |
|
34935 | Object.defineProperty(exports, "__esModule", { value: true });
|
34936 | var grid_1 = __webpack_require__(85);
|
34937 | function initialiseAgGridWithAngular1(angular) {
|
34938 | var angularModule = angular.module("agGrid", []);
|
34939 | angularModule.directive("agGrid", function () {
|
34940 | return {
|
34941 | restrict: "A",
|
34942 | controller: ['$element', '$scope', '$compile', '$attrs', AngularDirectiveController],
|
34943 | scope: true
|
34944 | };
|
34945 | });
|
34946 | }
|
34947 | exports.initialiseAgGridWithAngular1 = initialiseAgGridWithAngular1;
|
34948 | function AngularDirectiveController($element, $scope, $compile, $attrs) {
|
34949 | var gridOptions;
|
34950 | var quickFilterOnScope;
|
34951 | var keyOfGridInScope = $attrs.agGrid;
|
34952 | quickFilterOnScope = keyOfGridInScope + '.quickFilterText';
|
34953 | gridOptions = $scope.$eval(keyOfGridInScope);
|
34954 | if (!gridOptions) {
|
34955 | console.warn("WARNING - grid options for ag-Grid not found. Please ensure the attribute ag-grid points to a valid object on the scope");
|
34956 | return;
|
34957 | }
|
34958 | var eGridDiv = $element[0];
|
34959 | var gridParams = {
|
34960 | $scope: $scope,
|
34961 | $compile: $compile,
|
34962 | quickFilterOnScope: quickFilterOnScope
|
34963 | };
|
34964 | var grid = new grid_1.Grid(eGridDiv, gridOptions, gridParams);
|
34965 | $scope.$on("$destroy", function () {
|
34966 | grid.destroy();
|
34967 | grid = null;
|
34968 | });
|
34969 | }
|
34970 |
|
34971 |
|
34972 | }),
|
34973 |
|
34974 | (function(module, exports, __webpack_require__) {
|
34975 |
|
34976 | "use strict";
|
34977 |
|
34978 |
|
34979 |
|
34980 |
|
34981 |
|
34982 |
|
34983 |
|
34984 | var __extends = (this && this.__extends) || (function () {
|
34985 | var extendStatics = Object.setPrototypeOf ||
|
34986 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
34987 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
34988 | return function (d, b) {
|
34989 | extendStatics(d, b);
|
34990 | function __() { this.constructor = d; }
|
34991 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
34992 | };
|
34993 | })();
|
34994 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
34995 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
34996 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
34997 | 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;
|
34998 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
34999 | };
|
35000 | var __metadata = (this && this.__metadata) || function (k, v) {
|
35001 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
35002 | };
|
35003 | var __param = (this && this.__param) || function (paramIndex, decorator) {
|
35004 | return function (target, key) { decorator(target, key, paramIndex); }
|
35005 | };
|
35006 | Object.defineProperty(exports, "__esModule", { value: true });
|
35007 | var context_1 = __webpack_require__(0);
|
35008 | var eventService_1 = __webpack_require__(3);
|
35009 | var events_1 = __webpack_require__(5);
|
35010 | var logger_1 = __webpack_require__(12);
|
35011 | var infiniteBlock_1 = __webpack_require__(137);
|
35012 | var rowNodeCache_1 = __webpack_require__(87);
|
35013 | var gridApi_1 = __webpack_require__(6);
|
35014 | var columnApi_1 = __webpack_require__(7);
|
35015 | var InfiniteCache = (function (_super) {
|
35016 | __extends(InfiniteCache, _super);
|
35017 | function InfiniteCache(params) {
|
35018 | return _super.call(this, params) || this;
|
35019 | }
|
35020 | InfiniteCache.prototype.setBeans = function (loggerFactory) {
|
35021 | this.logger = loggerFactory.create('InfiniteCache');
|
35022 | };
|
35023 | InfiniteCache.prototype.init = function () {
|
35024 | _super.prototype.init.call(this);
|
35025 |
|
35026 |
|
35027 | this.getRow(0);
|
35028 | };
|
35029 | InfiniteCache.prototype.moveItemsDown = function (block, moveFromIndex, moveCount) {
|
35030 | var startRow = block.getStartRow();
|
35031 | var endRow = block.getEndRow();
|
35032 | var indexOfLastRowToMove = moveFromIndex + moveCount;
|
35033 |
|
35034 | for (var currentRowIndex = endRow - 1; currentRowIndex >= startRow; currentRowIndex--) {
|
35035 |
|
35036 | if (currentRowIndex < indexOfLastRowToMove) {
|
35037 | continue;
|
35038 | }
|
35039 | var indexOfNodeWeWant = currentRowIndex - moveCount;
|
35040 | var nodeForThisIndex = this.getRow(indexOfNodeWeWant, true);
|
35041 | if (nodeForThisIndex) {
|
35042 | block.setRowNode(currentRowIndex, nodeForThisIndex);
|
35043 | }
|
35044 | else {
|
35045 | block.setBlankRowNode(currentRowIndex);
|
35046 | block.setDirty();
|
35047 | }
|
35048 | }
|
35049 | };
|
35050 | InfiniteCache.prototype.insertItems = function (block, indexToInsert, items) {
|
35051 | var pageStartRow = block.getStartRow();
|
35052 | var pageEndRow = block.getEndRow();
|
35053 | var newRowNodes = [];
|
35054 |
|
35055 | for (var index = 0; index < items.length; index++) {
|
35056 | var rowIndex = indexToInsert + index;
|
35057 | var currentRowInThisPage = rowIndex >= pageStartRow && rowIndex < pageEndRow;
|
35058 | if (currentRowInThisPage) {
|
35059 | var dataItem = items[index];
|
35060 | var newRowNode = block.setNewData(rowIndex, dataItem);
|
35061 | newRowNodes.push(newRowNode);
|
35062 | }
|
35063 | }
|
35064 | return newRowNodes;
|
35065 | };
|
35066 | InfiniteCache.prototype.insertItemsAtIndex = function (indexToInsert, items) {
|
35067 |
|
35068 | var _this = this;
|
35069 | var newNodes = [];
|
35070 | this.forEachBlockInReverseOrder(function (block) {
|
35071 | var pageEndRow = block.getEndRow();
|
35072 |
|
35073 | if (pageEndRow <= indexToInsert) {
|
35074 | return;
|
35075 | }
|
35076 | _this.moveItemsDown(block, indexToInsert, items.length);
|
35077 | var newNodesThisPage = _this.insertItems(block, indexToInsert, items);
|
35078 | newNodesThisPage.forEach(function (rowNode) { return newNodes.push(rowNode); });
|
35079 | });
|
35080 | if (this.isMaxRowFound()) {
|
35081 | this.hack_setVirtualRowCount(this.getVirtualRowCount() + items.length);
|
35082 | }
|
35083 | this.onCacheUpdated();
|
35084 | var event = {
|
35085 | type: events_1.Events.EVENT_ROW_DATA_UPDATED,
|
35086 | api: this.gridApi,
|
35087 | columnApi: this.columnApi
|
35088 | };
|
35089 | this.eventService.dispatchEvent(event);
|
35090 | };
|
35091 |
|
35092 |
|
35093 |
|
35094 | InfiniteCache.prototype.getRow = function (rowIndex, dontCreatePage) {
|
35095 | if (dontCreatePage === void 0) { dontCreatePage = false; }
|
35096 | var blockId = Math.floor(rowIndex / this.cacheParams.blockSize);
|
35097 | var block = this.getBlock(blockId);
|
35098 | if (!block) {
|
35099 | if (dontCreatePage) {
|
35100 | return null;
|
35101 | }
|
35102 | else {
|
35103 | block = this.createBlock(blockId);
|
35104 | }
|
35105 | }
|
35106 | return block.getRow(rowIndex);
|
35107 | };
|
35108 | InfiniteCache.prototype.createBlock = function (blockNumber) {
|
35109 | var newBlock = new infiniteBlock_1.InfiniteBlock(blockNumber, this.cacheParams);
|
35110 | this.context.wireBean(newBlock);
|
35111 | this.postCreateBlock(newBlock);
|
35112 | return newBlock;
|
35113 | };
|
35114 |
|
35115 |
|
35116 |
|
35117 |
|
35118 | InfiniteCache.prototype.refreshCache = function () {
|
35119 | this.forEachBlockInOrder(function (block) { return block.setDirty(); });
|
35120 | this.checkBlockToLoad();
|
35121 | };
|
35122 | __decorate([
|
35123 | context_1.Autowired('eventService'),
|
35124 | __metadata("design:type", eventService_1.EventService)
|
35125 | ], InfiniteCache.prototype, "eventService", void 0);
|
35126 | __decorate([
|
35127 | context_1.Autowired('context'),
|
35128 | __metadata("design:type", context_1.Context)
|
35129 | ], InfiniteCache.prototype, "context", void 0);
|
35130 | __decorate([
|
35131 | context_1.Autowired('columnApi'),
|
35132 | __metadata("design:type", columnApi_1.ColumnApi)
|
35133 | ], InfiniteCache.prototype, "columnApi", void 0);
|
35134 | __decorate([
|
35135 | context_1.Autowired('gridApi'),
|
35136 | __metadata("design:type", gridApi_1.GridApi)
|
35137 | ], InfiniteCache.prototype, "gridApi", void 0);
|
35138 | __decorate([
|
35139 | __param(0, context_1.Qualifier('loggerFactory')),
|
35140 | __metadata("design:type", Function),
|
35141 | __metadata("design:paramtypes", [logger_1.LoggerFactory]),
|
35142 | __metadata("design:returntype", void 0)
|
35143 | ], InfiniteCache.prototype, "setBeans", null);
|
35144 | __decorate([
|
35145 | context_1.PostConstruct,
|
35146 | __metadata("design:type", Function),
|
35147 | __metadata("design:paramtypes", []),
|
35148 | __metadata("design:returntype", void 0)
|
35149 | ], InfiniteCache.prototype, "init", null);
|
35150 | return InfiniteCache;
|
35151 | }(rowNodeCache_1.RowNodeCache));
|
35152 | exports.InfiniteCache = InfiniteCache;
|
35153 |
|
35154 |
|
35155 | }),
|
35156 |
|
35157 | (function(module, exports, __webpack_require__) {
|
35158 |
|
35159 | "use strict";
|
35160 |
|
35161 |
|
35162 |
|
35163 |
|
35164 |
|
35165 |
|
35166 |
|
35167 | var __extends = (this && this.__extends) || (function () {
|
35168 | var extendStatics = Object.setPrototypeOf ||
|
35169 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
35170 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
35171 | return function (d, b) {
|
35172 | extendStatics(d, b);
|
35173 | function __() { this.constructor = d; }
|
35174 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
35175 | };
|
35176 | })();
|
35177 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
35178 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
35179 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
35180 | 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;
|
35181 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
35182 | };
|
35183 | var __metadata = (this && this.__metadata) || function (k, v) {
|
35184 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
35185 | };
|
35186 | Object.defineProperty(exports, "__esModule", { value: true });
|
35187 | var utils_1 = __webpack_require__(1);
|
35188 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
35189 | var context_1 = __webpack_require__(0);
|
35190 | var rowNodeBlock_1 = __webpack_require__(61);
|
35191 | var rowRenderer_1 = __webpack_require__(20);
|
35192 | var InfiniteBlock = (function (_super) {
|
35193 | __extends(InfiniteBlock, _super);
|
35194 | function InfiniteBlock(pageNumber, params) {
|
35195 | var _this = _super.call(this, pageNumber, params) || this;
|
35196 | _this.cacheParams = params;
|
35197 | return _this;
|
35198 | }
|
35199 | InfiniteBlock.prototype.createBlankRowNode = function (rowIndex) {
|
35200 | var rowNode = _super.prototype.createBlankRowNode.call(this, rowIndex);
|
35201 | rowNode.uiLevel = 0;
|
35202 | this.setIndexAndTopOnRowNode(rowNode, rowIndex);
|
35203 | return rowNode;
|
35204 | };
|
35205 | InfiniteBlock.prototype.setDataAndId = function (rowNode, data, index) {
|
35206 | if (utils_1.Utils.exists(data)) {
|
35207 |
|
35208 |
|
35209 |
|
35210 |
|
35211 | rowNode.setDataAndId(data, index.toString());
|
35212 | }
|
35213 | else {
|
35214 | rowNode.setDataAndId(undefined, undefined);
|
35215 | }
|
35216 | };
|
35217 | InfiniteBlock.prototype.setRowNode = function (rowIndex, rowNode) {
|
35218 | _super.prototype.setRowNode.call(this, rowIndex, rowNode);
|
35219 | this.setIndexAndTopOnRowNode(rowNode, rowIndex);
|
35220 | };
|
35221 | InfiniteBlock.prototype.init = function () {
|
35222 | _super.prototype.init.call(this, {
|
35223 | context: this.context,
|
35224 | rowRenderer: this.rowRenderer
|
35225 | });
|
35226 | };
|
35227 | InfiniteBlock.prototype.getNodeIdPrefix = function () {
|
35228 | return null;
|
35229 | };
|
35230 | InfiniteBlock.prototype.getRow = function (displayIndex) {
|
35231 | return this.getRowUsingLocalIndex(displayIndex);
|
35232 | };
|
35233 | InfiniteBlock.prototype.setIndexAndTopOnRowNode = function (rowNode, rowIndex) {
|
35234 | rowNode.setRowIndex(rowIndex);
|
35235 | rowNode.rowTop = this.cacheParams.rowHeight * rowIndex;
|
35236 | };
|
35237 | InfiniteBlock.prototype.loadFromDatasource = function () {
|
35238 | var _this = this;
|
35239 |
|
35240 |
|
35241 |
|
35242 |
|
35243 | var params = {
|
35244 | startRow: this.getStartRow(),
|
35245 | endRow: this.getEndRow(),
|
35246 | successCallback: this.pageLoaded.bind(this, this.getVersion()),
|
35247 | failCallback: this.pageLoadFailed.bind(this),
|
35248 | sortModel: this.cacheParams.sortModel,
|
35249 | filterModel: this.cacheParams.filterModel,
|
35250 | context: this.gridOptionsWrapper.getContext()
|
35251 | };
|
35252 | if (utils_1.Utils.missing(this.cacheParams.datasource.getRows)) {
|
35253 | console.warn("ag-Grid: datasource is missing getRows method");
|
35254 | return;
|
35255 | }
|
35256 |
|
35257 | var getRowsParams = utils_1.Utils.getFunctionParameters(this.cacheParams.datasource.getRows);
|
35258 | if (getRowsParams.length > 1) {
|
35259 | console.warn('ag-grid: It looks like your paging datasource is of the old type, taking more than one parameter.');
|
35260 | console.warn('ag-grid: From ag-grid 1.9.0, now the getRows takes one parameter. See the documentation for details.');
|
35261 | }
|
35262 |
|
35263 | setTimeout(function () {
|
35264 | _this.cacheParams.datasource.getRows(params);
|
35265 | }, 0);
|
35266 | };
|
35267 | __decorate([
|
35268 | context_1.Autowired('gridOptionsWrapper'),
|
35269 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
35270 | ], InfiniteBlock.prototype, "gridOptionsWrapper", void 0);
|
35271 | __decorate([
|
35272 | context_1.Autowired('context'),
|
35273 | __metadata("design:type", context_1.Context)
|
35274 | ], InfiniteBlock.prototype, "context", void 0);
|
35275 | __decorate([
|
35276 | context_1.Autowired('rowRenderer'),
|
35277 | __metadata("design:type", rowRenderer_1.RowRenderer)
|
35278 | ], InfiniteBlock.prototype, "rowRenderer", void 0);
|
35279 | __decorate([
|
35280 | context_1.PostConstruct,
|
35281 | __metadata("design:type", Function),
|
35282 | __metadata("design:paramtypes", []),
|
35283 | __metadata("design:returntype", void 0)
|
35284 | ], InfiniteBlock.prototype, "init", null);
|
35285 | return InfiniteBlock;
|
35286 | }(rowNodeBlock_1.RowNodeBlock));
|
35287 | exports.InfiniteBlock = InfiniteBlock;
|
35288 |
|
35289 |
|
35290 | }),
|
35291 |
|
35292 | (function(module, exports, __webpack_require__) {
|
35293 |
|
35294 | "use strict";
|
35295 |
|
35296 |
|
35297 |
|
35298 |
|
35299 |
|
35300 |
|
35301 |
|
35302 | var __extends = (this && this.__extends) || (function () {
|
35303 | var extendStatics = Object.setPrototypeOf ||
|
35304 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
35305 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
35306 | return function (d, b) {
|
35307 | extendStatics(d, b);
|
35308 | function __() { this.constructor = d; }
|
35309 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
35310 | };
|
35311 | })();
|
35312 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
35313 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
35314 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
35315 | 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;
|
35316 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
35317 | };
|
35318 | var __metadata = (this && this.__metadata) || function (k, v) {
|
35319 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
35320 | };
|
35321 | Object.defineProperty(exports, "__esModule", { value: true });
|
35322 | var context_1 = __webpack_require__(0);
|
35323 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
35324 | var changedPath_1 = __webpack_require__(88);
|
35325 | var rowRenderer_1 = __webpack_require__(20);
|
35326 | var eventService_1 = __webpack_require__(3);
|
35327 | var constants_1 = __webpack_require__(9);
|
35328 | var beanStub_1 = __webpack_require__(13);
|
35329 | var events_1 = __webpack_require__(5);
|
35330 | var ChangeDetectionService = (function (_super) {
|
35331 | __extends(ChangeDetectionService, _super);
|
35332 | function ChangeDetectionService() {
|
35333 | return _super !== null && _super.apply(this, arguments) || this;
|
35334 | }
|
35335 | ChangeDetectionService.prototype.init = function () {
|
35336 | if (this.rowModel.getType() === constants_1.Constants.ROW_MODEL_TYPE_CLIENT_SIDE) {
|
35337 | this.clientSideRowModel = this.rowModel;
|
35338 | }
|
35339 | this.addDestroyableEventListener(this.eventService, events_1.Events.EVENT_CELL_VALUE_CHANGED, this.onCellValueChanged.bind(this));
|
35340 | };
|
35341 | ChangeDetectionService.prototype.onCellValueChanged = function (event) {
|
35342 | this.doChangeDetection(event.node, event.column);
|
35343 | };
|
35344 | ChangeDetectionService.prototype.doChangeDetection = function (rowNode, column) {
|
35345 | if (this.gridOptionsWrapper.isSuppressChangeDetection()) {
|
35346 | return;
|
35347 | }
|
35348 |
|
35349 | if (this.clientSideRowModel && !rowNode.isRowPinned()) {
|
35350 | var onlyChangedColumns = this.gridOptionsWrapper.isAggregateOnlyChangedColumns();
|
35351 | var changedPath = new changedPath_1.ChangedPath(onlyChangedColumns);
|
35352 | changedPath.addParentNode(rowNode.parent, [column]);
|
35353 | this.clientSideRowModel.doAggregate(changedPath);
|
35354 | }
|
35355 |
|
35356 | this.rowRenderer.refreshCells();
|
35357 | };
|
35358 | __decorate([
|
35359 | context_1.Autowired('gridOptionsWrapper'),
|
35360 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
35361 | ], ChangeDetectionService.prototype, "gridOptionsWrapper", void 0);
|
35362 | __decorate([
|
35363 | context_1.Autowired('rowModel'),
|
35364 | __metadata("design:type", Object)
|
35365 | ], ChangeDetectionService.prototype, "rowModel", void 0);
|
35366 | __decorate([
|
35367 | context_1.Autowired('rowRenderer'),
|
35368 | __metadata("design:type", rowRenderer_1.RowRenderer)
|
35369 | ], ChangeDetectionService.prototype, "rowRenderer", void 0);
|
35370 | __decorate([
|
35371 | context_1.Autowired('eventService'),
|
35372 | __metadata("design:type", eventService_1.EventService)
|
35373 | ], ChangeDetectionService.prototype, "eventService", void 0);
|
35374 | __decorate([
|
35375 | context_1.PostConstruct,
|
35376 | __metadata("design:type", Function),
|
35377 | __metadata("design:paramtypes", []),
|
35378 | __metadata("design:returntype", void 0)
|
35379 | ], ChangeDetectionService.prototype, "init", null);
|
35380 | ChangeDetectionService = __decorate([
|
35381 | context_1.Bean('changeDetectionService')
|
35382 | ], ChangeDetectionService);
|
35383 | return ChangeDetectionService;
|
35384 | }(beanStub_1.BeanStub));
|
35385 | exports.ChangeDetectionService = ChangeDetectionService;
|
35386 |
|
35387 |
|
35388 | }),
|
35389 |
|
35390 | (function(module, exports, __webpack_require__) {
|
35391 |
|
35392 | "use strict";
|
35393 |
|
35394 |
|
35395 |
|
35396 |
|
35397 |
|
35398 |
|
35399 |
|
35400 | var __extends = (this && this.__extends) || (function () {
|
35401 | var extendStatics = Object.setPrototypeOf ||
|
35402 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
35403 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
35404 | return function (d, b) {
|
35405 | extendStatics(d, b);
|
35406 | function __() { this.constructor = d; }
|
35407 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
35408 | };
|
35409 | })();
|
35410 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
35411 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
35412 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
35413 | 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;
|
35414 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
35415 | };
|
35416 | var __metadata = (this && this.__metadata) || function (k, v) {
|
35417 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
35418 | };
|
35419 | Object.defineProperty(exports, "__esModule", { value: true });
|
35420 | var component_1 = __webpack_require__(8);
|
35421 | var context_1 = __webpack_require__(0);
|
35422 | var gridOptionsWrapper_1 = __webpack_require__(2);
|
35423 | var componentAnnotations_1 = __webpack_require__(11);
|
35424 | var utils_1 = __webpack_require__(1);
|
35425 | var eventService_1 = __webpack_require__(3);
|
35426 | var events_1 = __webpack_require__(5);
|
35427 | var rowRenderer_1 = __webpack_require__(20);
|
35428 | var paginationProxy_1 = __webpack_require__(29);
|
35429 | var PaginationComp = (function (_super) {
|
35430 | __extends(PaginationComp, _super);
|
35431 | function PaginationComp() {
|
35432 | return _super.call(this) || this;
|
35433 | }
|
35434 | PaginationComp.prototype.postConstruct = function () {
|
35435 | this.setTemplate(this.getTemplate());
|
35436 | var isPaging = this.gridOptionsWrapper.isPagination();
|
35437 | var paginationPanelEnabled = isPaging && !this.gridOptionsWrapper.isSuppressPaginationPanel();
|
35438 | if (!paginationPanelEnabled) {
|
35439 | this.setVisible(false);
|
35440 | return;
|
35441 | }
|
35442 | this.addDestroyableEventListener(this.eventService, events_1.Events.EVENT_PAGINATION_CHANGED, this.onPaginationChanged.bind(this));
|
35443 | this.addDestroyableEventListener(this.btFirst, 'click', this.onBtFirst.bind(this));
|
35444 | this.addDestroyableEventListener(this.btLast, 'click', this.onBtLast.bind(this));
|
35445 | this.addDestroyableEventListener(this.btNext, 'click', this.onBtNext.bind(this));
|
35446 | this.addDestroyableEventListener(this.btPrevious, 'click', this.onBtPrevious.bind(this));
|
35447 | this.onPaginationChanged();
|
35448 | };
|
35449 | PaginationComp.prototype.onPaginationChanged = function () {
|
35450 | this.enableOrDisableButtons();
|
35451 | this.updateRowLabels();
|
35452 | this.setCurrentPageLabel();
|
35453 | this.setTotalLabels();
|
35454 | };
|
35455 | PaginationComp.prototype.setCurrentPageLabel = function () {
|
35456 | var pagesExist = this.paginationProxy.getTotalPages() > 0;
|
35457 | var currentPage = this.paginationProxy.getCurrentPage();
|
35458 | var toDisplay = pagesExist ? currentPage + 1 : 0;
|
35459 | this.lbCurrent.innerHTML = this.formatNumber(toDisplay);
|
35460 | };
|
35461 | PaginationComp.prototype.formatNumber = function (value) {
|
35462 | var userFunc = this.gridOptionsWrapper.getPaginationNumberFormatterFunc();
|
35463 | if (userFunc) {
|
35464 | return userFunc({ value: value });
|
35465 | }
|
35466 | else {
|
35467 | return utils_1._.formatNumberCommas(value);
|
35468 | }
|
35469 | };
|
35470 | PaginationComp.prototype.getTemplate = function () {
|
35471 | var localeTextFunc = this.gridOptionsWrapper.getLocaleTextFunc();
|
35472 | var strPage = localeTextFunc('page', 'Page');
|
35473 | var strTo = localeTextFunc('to', 'to');
|
35474 | var strOf = localeTextFunc('of', 'of');
|
35475 | var strFirst = localeTextFunc('first', 'First');
|
35476 | var strPrevious = localeTextFunc('previous', 'Previous');
|
35477 | var strNext = localeTextFunc('next', 'Next');
|
35478 | var strLast = localeTextFunc('last', 'Last');
|
35479 | return "<div class=\"ag-paging-panel ag-font-style\">\n <span ref=\"eSummaryPanel\" class=\"ag-paging-row-summary-panel\">\n <span ref=\"lbFirstRowOnPage\"></span> " + strTo + " <span ref=\"lbLastRowOnPage\"></span> " + strOf + " <span ref=\"lbRecordCount\"></span>\n </span>\n <span class=\"ag-paging-page-summary-panel\">\n <button type=\"button\" class=\"ag-paging-button\" ref=\"btFirst\">" + strFirst + "</button>\n <button type=\"button\" class=\"ag-paging-button\" ref=\"btPrevious\">" + strPrevious + "</button>\n " + strPage + " <span ref=\"lbCurrent\"></span> " + strOf + " <span ref=\"lbTotal\"></span>\n <button type=\"button\" class=\"ag-paging-button\" ref=\"btNext\">" + strNext + "</button>\n <button type=\"button\" class=\"ag-paging-button\" ref=\"btLast\">" + strLast + "</button>\n </span>\n </div>";
|
35480 | };
|
35481 | PaginationComp.prototype.onBtNext = function () {
|
35482 | this.paginationProxy.goToNextPage();
|
35483 | };
|
35484 | PaginationComp.prototype.onBtPrevious = function () {
|
35485 | this.paginationProxy.goToPreviousPage();
|
35486 | };
|
35487 | PaginationComp.prototype.onBtFirst = function () {
|
35488 | this.paginationProxy.goToFirstPage();
|
35489 | };
|
35490 | PaginationComp.prototype.onBtLast = function () {
|
35491 | this.paginationProxy.goToLastPage();
|
35492 | };
|
35493 | PaginationComp.prototype.enableOrDisableButtons = function () {
|
35494 | var currentPage = this.paginationProxy.getCurrentPage();
|
35495 | var maxRowFound = this.paginationProxy.isLastPageFound();
|
35496 | var totalPages = this.paginationProxy.getTotalPages();
|
35497 | var disablePreviousAndFirst = currentPage === 0;
|
35498 | this.btPrevious.disabled = disablePreviousAndFirst;
|
35499 | this.btFirst.disabled = disablePreviousAndFirst;
|
35500 | var zeroPagesToDisplay = this.isZeroPagesToDisplay();
|
35501 | var onLastPage = maxRowFound && currentPage === (totalPages - 1);
|
35502 | var disableNext = onLastPage || zeroPagesToDisplay;
|
35503 | this.btNext.disabled = disableNext;
|
35504 | var disableLast = !maxRowFound || zeroPagesToDisplay || currentPage === (totalPages - 1);
|
35505 | this.btLast.disabled = disableLast;
|
35506 | };
|
35507 | PaginationComp.prototype.updateRowLabels = function () {
|
35508 | var currentPage = this.paginationProxy.getCurrentPage();
|
35509 | var pageSize = this.paginationProxy.getPageSize();
|
35510 | var maxRowFound = this.paginationProxy.isLastPageFound();
|
35511 | var rowCount = this.paginationProxy.isLastPageFound() ?
|
35512 | this.paginationProxy.getTotalRowCount() : null;
|
35513 | var startRow;
|
35514 | var endRow;
|
35515 | if (this.isZeroPagesToDisplay()) {
|
35516 | startRow = 0;
|
35517 | endRow = 0;
|
35518 | }
|
35519 | else {
|
35520 | startRow = (pageSize * currentPage) + 1;
|
35521 | endRow = startRow + pageSize - 1;
|
35522 | if (maxRowFound && endRow > rowCount) {
|
35523 | endRow = rowCount;
|
35524 | }
|
35525 | }
|
35526 | this.lbFirstRowOnPage.innerHTML = this.formatNumber(startRow);
|
35527 | this.lbLastRowOnPage.innerHTML = this.formatNumber(endRow);
|
35528 | };
|
35529 | PaginationComp.prototype.isZeroPagesToDisplay = function () {
|
35530 | var maxRowFound = this.paginationProxy.isLastPageFound();
|
35531 | var totalPages = this.paginationProxy.getTotalPages();
|
35532 | return maxRowFound && totalPages === 0;
|
35533 | };
|
35534 | PaginationComp.prototype.setTotalLabels = function () {
|
35535 | var lastPageFound = this.paginationProxy.isLastPageFound();
|
35536 | var totalPages = this.paginationProxy.getTotalPages();
|
35537 | var rowCount = this.paginationProxy.isLastPageFound() ?
|
35538 | this.paginationProxy.getTotalRowCount() : null;
|
35539 | if (lastPageFound) {
|
35540 | this.lbTotal.innerHTML = this.formatNumber(totalPages);
|
35541 | this.lbRecordCount.innerHTML = this.formatNumber(rowCount);
|
35542 | }
|
35543 | else {
|
35544 | var moreText = this.gridOptionsWrapper.getLocaleTextFunc()('more', 'more');
|
35545 | this.lbTotal.innerHTML = moreText;
|
35546 | this.lbRecordCount.innerHTML = moreText;
|
35547 | }
|
35548 | };
|
35549 | __decorate([
|
35550 | context_1.Autowired('gridOptionsWrapper'),
|
35551 | __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
|
35552 | ], PaginationComp.prototype, "gridOptionsWrapper", void 0);
|
35553 | __decorate([
|
35554 | context_1.Autowired('eventService'),
|
35555 | __metadata("design:type", eventService_1.EventService)
|
35556 | ], PaginationComp.prototype, "eventService", void 0);
|
35557 | __decorate([
|
35558 | context_1.Autowired('paginationProxy'),
|
35559 | __metadata("design:type", paginationProxy_1.PaginationProxy)
|
35560 | ], PaginationComp.prototype, "paginationProxy", void 0);
|
35561 | __decorate([
|
35562 | context_1.Autowired('rowRenderer'),
|
35563 | __metadata("design:type", rowRenderer_1.RowRenderer)
|
35564 | ], PaginationComp.prototype, "rowRenderer", void 0);
|
35565 | __decorate([
|
35566 | componentAnnotations_1.RefSelector('btFirst'),
|
35567 | __metadata("design:type", HTMLButtonElement)
|
35568 | ], PaginationComp.prototype, "btFirst", void 0);
|
35569 | __decorate([
|
35570 | componentAnnotations_1.RefSelector('btPrevious'),
|
35571 | __metadata("design:type", HTMLButtonElement)
|
35572 | ], PaginationComp.prototype, "btPrevious", void 0);
|
35573 | __decorate([
|
35574 | componentAnnotations_1.RefSelector('btNext'),
|
35575 | __metadata("design:type", HTMLButtonElement)
|
35576 | ], PaginationComp.prototype, "btNext", void 0);
|
35577 | __decorate([
|
35578 | componentAnnotations_1.RefSelector('btLast'),
|
35579 | __metadata("design:type", HTMLButtonElement)
|
35580 | ], PaginationComp.prototype, "btLast", void 0);
|
35581 | __decorate([
|
35582 | componentAnnotations_1.RefSelector('lbRecordCount'),
|
35583 | __metadata("design:type", Object)
|
35584 | ], PaginationComp.prototype, "lbRecordCount", void 0);
|
35585 | __decorate([
|
35586 | componentAnnotations_1.RefSelector('lbFirstRowOnPage'),
|
35587 | __metadata("design:type", Object)
|
35588 | ], PaginationComp.prototype, "lbFirstRowOnPage", void 0);
|
35589 | __decorate([
|
35590 | componentAnnotations_1.RefSelector('lbLastRowOnPage'),
|
35591 | __metadata("design:type", Object)
|
35592 | ], PaginationComp.prototype, "lbLastRowOnPage", void 0);
|
35593 | __decorate([
|
35594 | componentAnnotations_1.RefSelector('eSummaryPanel'),
|
35595 | __metadata("design:type", Object)
|
35596 | ], PaginationComp.prototype, "eSummaryPanel", void 0);
|
35597 | __decorate([
|
35598 | componentAnnotations_1.RefSelector('lbCurrent'),
|
35599 | __metadata("design:type", Object)
|
35600 | ], PaginationComp.prototype, "lbCurrent", void 0);
|
35601 | __decorate([
|
35602 | componentAnnotations_1.RefSelector('lbTotal'),
|
35603 | __metadata("design:type", Object)
|
35604 | ], PaginationComp.prototype, "lbTotal", void 0);
|
35605 | __decorate([
|
35606 | context_1.PostConstruct,
|
35607 | __metadata("design:type", Function),
|
35608 | __metadata("design:paramtypes", []),
|
35609 | __metadata("design:returntype", void 0)
|
35610 | ], PaginationComp.prototype, "postConstruct", null);
|
35611 | return PaginationComp;
|
35612 | }(component_1.Component));
|
35613 | exports.PaginationComp = PaginationComp;
|
35614 |
|
35615 |
|
35616 | }),
|
35617 |
|
35618 | (function(module, exports, __webpack_require__) {
|
35619 |
|
35620 | "use strict";
|
35621 |
|
35622 |
|
35623 |
|
35624 |
|
35625 |
|
35626 |
|
35627 |
|
35628 | Object.defineProperty(exports, "__esModule", { value: true });
|
35629 | var componentUtil_1 = __webpack_require__(62);
|
35630 | var grid_1 = __webpack_require__(85);
|
35631 | var registered = false;
|
35632 | function initialiseAgGridWithWebComponents() {
|
35633 | console.warn('ag-grid: initialiseAgGridWithWebComponents is deprecated. Please use the ag-grid-webcomponent dependency instead. ');
|
35634 |
|
35635 | if (registered) {
|
35636 | return;
|
35637 | }
|
35638 | registered = true;
|
35639 | if (typeof document === 'undefined' || !document.registerElement) {
|
35640 | console.error('ag-Grid: unable to find document.registerElement() function, unable to initialise ag-Grid as a Web Component');
|
35641 | }
|
35642 |
|
35643 |
|
35644 | var AgileGridProto = Object.create(HTMLElement.prototype);
|
35645 |
|
35646 | componentUtil_1.ComponentUtil.ALL_PROPERTIES.forEach(function (key) {
|
35647 | Object.defineProperty(AgileGridProto, key, {
|
35648 | set: function (v) {
|
35649 | this.__agGridSetProperty(key, v);
|
35650 | },
|
35651 | get: function () {
|
35652 | return this.__agGridGetProperty(key);
|
35653 | },
|
35654 | enumerable: true,
|
35655 | configurable: true
|
35656 | });
|
35657 | });
|
35658 | var agGridProtoNoType = AgileGridProto;
|
35659 | agGridProtoNoType.__agGridSetProperty = function (key, value) {
|
35660 | if (!this.__attributes) {
|
35661 | this.__attributes = {};
|
35662 | }
|
35663 | this.__attributes[key] = value;
|
35664 |
|
35665 | var changeObject = {};
|
35666 | changeObject[key] = { currentValue: value };
|
35667 | this.onChange(changeObject);
|
35668 | };
|
35669 | agGridProtoNoType.onChange = function (changes) {
|
35670 | if (this._initialised) {
|
35671 | componentUtil_1.ComponentUtil.processOnChange(changes, this._gridOptions, this.api, this.columnApi);
|
35672 | }
|
35673 | };
|
35674 | agGridProtoNoType.__agGridGetProperty = function (key) {
|
35675 | if (!this.__attributes) {
|
35676 | this.__attributes = {};
|
35677 | }
|
35678 | return this.__attributes[key];
|
35679 | };
|
35680 | agGridProtoNoType.setGridOptions = function (options) {
|
35681 | var globalEventListener = this.globalEventListener.bind(this);
|
35682 | this._gridOptions = componentUtil_1.ComponentUtil.copyAttributesToGridOptions(options, this);
|
35683 | var gridParams = {
|
35684 | globalEventListener: globalEventListener
|
35685 | };
|
35686 | this._agGrid = new grid_1.Grid(this, this._gridOptions, gridParams);
|
35687 | this.api = options.api;
|
35688 | this.columnApi = options.columnApi;
|
35689 | this._initialised = true;
|
35690 | };
|
35691 |
|
35692 | agGridProtoNoType.createdCallback = function () {
|
35693 | for (var i = 0; i < this.attributes.length; i++) {
|
35694 | var attribute = this.attributes[i];
|
35695 | this.setPropertyFromAttribute(attribute);
|
35696 | }
|
35697 | };
|
35698 | agGridProtoNoType.setPropertyFromAttribute = function (attribute) {
|
35699 | var name = toCamelCase(attribute.nodeName);
|
35700 | var value = attribute.nodeValue;
|
35701 | if (componentUtil_1.ComponentUtil.ALL_PROPERTIES.indexOf(name) >= 0) {
|
35702 | this[name] = value;
|
35703 | }
|
35704 | };
|
35705 | agGridProtoNoType.attachedCallback = function (params) { };
|
35706 | agGridProtoNoType.detachedCallback = function (params) { };
|
35707 | agGridProtoNoType.attributeChangedCallback = function (attributeName) {
|
35708 | var attribute = this.attributes[attributeName];
|
35709 | this.setPropertyFromAttribute(attribute);
|
35710 | };
|
35711 | agGridProtoNoType.globalEventListener = function (eventType, event) {
|
35712 | var eventLowerCase = eventType.toLowerCase();
|
35713 | var browserEvent = new Event(eventLowerCase);
|
35714 | var browserEventNoType = browserEvent;
|
35715 | browserEventNoType.agGridDetails = event;
|
35716 | this.dispatchEvent(browserEvent);
|
35717 | var callbackMethod = 'on' + eventLowerCase;
|
35718 | if (typeof this[callbackMethod] === 'function') {
|
35719 | this[callbackMethod](browserEvent);
|
35720 | }
|
35721 | };
|
35722 |
|
35723 | document.registerElement('ag-grid', { prototype: AgileGridProto });
|
35724 | }
|
35725 | exports.initialiseAgGridWithWebComponents = initialiseAgGridWithWebComponents;
|
35726 | function toCamelCase(myString) {
|
35727 | if (typeof myString === 'string') {
|
35728 | var result = myString.replace(/-([a-z])/g, function (g) {
|
35729 | return g[1].toUpperCase();
|
35730 | });
|
35731 | return result;
|
35732 | }
|
35733 | else {
|
35734 | return myString;
|
35735 | }
|
35736 | }
|
35737 |
|
35738 |
|
35739 | }),
|
35740 |
|
35741 | (function(module, exports, __webpack_require__) {
|
35742 |
|
35743 | "use strict";
|
35744 |
|
35745 |
|
35746 |
|
35747 |
|
35748 |
|
35749 |
|
35750 |
|
35751 | Object.defineProperty(exports, "__esModule", { value: true });
|
35752 | var utils_1 = __webpack_require__(1);
|
35753 | var TabbedLayout = (function () {
|
35754 | function TabbedLayout(params) {
|
35755 | var _this = this;
|
35756 | this.items = [];
|
35757 | this.params = params;
|
35758 | this.eGui = document.createElement('div');
|
35759 | this.eGui.innerHTML = TabbedLayout.TEMPLATE;
|
35760 | this.eHeader = this.eGui.querySelector('[ref="tabHeader"]');
|
35761 | this.eBody = this.eGui.querySelector('[ref="tabBody"]');
|
35762 | utils_1.Utils.addCssClass(this.eGui, params.cssClass);
|
35763 | if (params.items) {
|
35764 | params.items.forEach(function (item) { return _this.addItem(item); });
|
35765 | }
|
35766 | }
|
35767 | TabbedLayout.prototype.setAfterAttachedParams = function (params) {
|
35768 | this.afterAttachedParams = params;
|
35769 | };
|
35770 | TabbedLayout.prototype.getMinWidth = function () {
|
35771 | var eDummyContainer = document.createElement('span');
|
35772 |
|
35773 | eDummyContainer.style.position = 'fixed';
|
35774 |
|
35775 |
|
35776 | this.eGui.appendChild(eDummyContainer);
|
35777 | var minWidth = 0;
|
35778 | this.items.forEach(function (itemWrapper) {
|
35779 | utils_1.Utils.removeAllChildren(eDummyContainer);
|
35780 | var eClone = itemWrapper.tabbedItem.bodyPromise.resolveNow(null, function (body) { return body.cloneNode(true); });
|
35781 | if (eClone == null) {
|
35782 | return;
|
35783 | }
|
35784 | eDummyContainer.appendChild(eClone);
|
35785 | if (minWidth < eDummyContainer.offsetWidth) {
|
35786 | minWidth = eDummyContainer.offsetWidth;
|
35787 | }
|
35788 | });
|
35789 |
|
35790 |
|
35791 | if (minWidth < this.eGui.offsetWidth) {
|
35792 | minWidth = this.eGui.offsetWidth;
|
35793 | }
|
35794 | this.eGui.removeChild(eDummyContainer);
|
35795 | return minWidth;
|
35796 | };
|
35797 | TabbedLayout.prototype.showFirstItem = function () {
|
35798 | if (this.items.length > 0) {
|
35799 | this.showItemWrapper(this.items[0]);
|
35800 | }
|
35801 | };
|
35802 | TabbedLayout.prototype.addItem = function (item) {
|
35803 | var eHeaderButton = document.createElement('span');
|
35804 | eHeaderButton.appendChild(item.title);
|
35805 | utils_1.Utils.addCssClass(eHeaderButton, 'ag-tab');
|
35806 | this.eHeader.appendChild(eHeaderButton);
|
35807 | var wrapper = {
|
35808 | tabbedItem: item,
|
35809 | eHeaderButton: eHeaderButton
|
35810 | };
|
35811 | this.items.push(wrapper);
|
35812 | eHeaderButton.addEventListener('click', this.showItemWrapper.bind(this, wrapper));
|
35813 | };
|
35814 | TabbedLayout.prototype.showItem = function (tabbedItem) {
|
35815 | var itemWrapper = utils_1.Utils.find(this.items, function (itemWrapper) {
|
35816 | return itemWrapper.tabbedItem === tabbedItem;
|
35817 | });
|
35818 | if (itemWrapper) {
|
35819 | this.showItemWrapper(itemWrapper);
|
35820 | }
|
35821 | };
|
35822 | TabbedLayout.prototype.showItemWrapper = function (wrapper) {
|
35823 | var _this = this;
|
35824 | if (this.params.onItemClicked) {
|
35825 | this.params.onItemClicked({ item: wrapper.tabbedItem });
|
35826 | }
|
35827 | if (this.activeItem === wrapper) {
|
35828 | utils_1.Utils.callIfPresent(this.params.onActiveItemClicked);
|
35829 | return;
|
35830 | }
|
35831 | utils_1.Utils.removeAllChildren(this.eBody);
|
35832 | wrapper.tabbedItem.bodyPromise.then(function (body) {
|
35833 | _this.eBody.appendChild(body);
|
35834 | });
|
35835 | if (this.activeItem) {
|
35836 | utils_1.Utils.removeCssClass(this.activeItem.eHeaderButton, 'ag-tab-selected');
|
35837 | }
|
35838 | utils_1.Utils.addCssClass(wrapper.eHeaderButton, 'ag-tab-selected');
|
35839 | this.activeItem = wrapper;
|
35840 | if (wrapper.tabbedItem.afterAttachedCallback) {
|
35841 | wrapper.tabbedItem.afterAttachedCallback(this.afterAttachedParams);
|
35842 | }
|
35843 | };
|
35844 | TabbedLayout.prototype.getGui = function () {
|
35845 | return this.eGui;
|
35846 | };
|
35847 | TabbedLayout.TEMPLATE = '<div>' +
|
35848 | '<div ref="tabHeader" class="ag-tab-header"></div>' +
|
35849 | '<div ref="tabBody" class="ag-tab-body"></div>' +
|
35850 | '</div>';
|
35851 | return TabbedLayout;
|
35852 | }());
|
35853 | exports.TabbedLayout = TabbedLayout;
|
35854 |
|
35855 |
|
35856 | }),
|
35857 |
|
35858 | (function(module, exports, __webpack_require__) {
|
35859 |
|
35860 | "use strict";
|
35861 |
|
35862 |
|
35863 |
|
35864 |
|
35865 |
|
35866 |
|
35867 |
|
35868 | Object.defineProperty(exports, "__esModule", { value: true });
|
35869 | var VerticalStack = (function () {
|
35870 | function VerticalStack() {
|
35871 | this.isLayoutPanel = true;
|
35872 | this.childPanels = [];
|
35873 | this.eGui = document.createElement('div');
|
35874 | this.eGui.style.height = '100%';
|
35875 | }
|
35876 | VerticalStack.prototype.addPanel = function (panel, height) {
|
35877 | var component;
|
35878 | if (panel.isLayoutPanel) {
|
35879 | this.childPanels.push(panel);
|
35880 | component = panel.getGui();
|
35881 | }
|
35882 | else {
|
35883 | component = panel;
|
35884 | }
|
35885 | if (height) {
|
35886 | component.style.height = height;
|
35887 | }
|
35888 | this.eGui.appendChild(component);
|
35889 | };
|
35890 | VerticalStack.prototype.getGui = function () {
|
35891 | return this.eGui;
|
35892 | };
|
35893 | VerticalStack.prototype.doLayout = function () {
|
35894 | for (var i = 0; i < this.childPanels.length; i++) {
|
35895 | this.childPanels[i].doLayout();
|
35896 | }
|
35897 | };
|
35898 | return VerticalStack;
|
35899 | }());
|
35900 | exports.VerticalStack = VerticalStack;
|
35901 |
|
35902 |
|
35903 | }),
|
35904 |
|
35905 | (function(module, exports, __webpack_require__) {
|
35906 |
|
35907 | "use strict";
|
35908 |
|
35909 |
|
35910 |
|
35911 |
|
35912 |
|
35913 |
|
35914 |
|
35915 | Object.defineProperty(exports, "__esModule", { value: true });
|
35916 | var utils_1 = __webpack_require__(1);
|
35917 | function simpleHttpRequest(params) {
|
35918 | return new utils_1.Promise(function (resolve) {
|
35919 | var httpRequest = new XMLHttpRequest();
|
35920 | httpRequest.open('GET', params.url);
|
35921 | httpRequest.send();
|
35922 | httpRequest.onreadystatechange = function () {
|
35923 | if (httpRequest.readyState == 4 && httpRequest.status == 200) {
|
35924 | var httpResponse = JSON.parse(httpRequest.responseText);
|
35925 | resolve(httpResponse);
|
35926 | }
|
35927 | };
|
35928 | });
|
35929 | }
|
35930 | exports.simpleHttpRequest = simpleHttpRequest;
|
35931 |
|
35932 |
|
35933 | }),
|
35934 |
|
35935 | (function(module, exports, __webpack_require__) {
|
35936 |
|
35937 | "use strict";
|
35938 |
|
35939 |
|
35940 |
|
35941 |
|
35942 |
|
35943 |
|
35944 |
|
35945 | Object.defineProperty(exports, "__esModule", { value: true });
|
35946 | var utils_1 = __webpack_require__(1);
|
35947 | function defaultGroupComparator(valueA, valueB, nodeA, nodeB, accentedCompare) {
|
35948 | if (accentedCompare === void 0) { accentedCompare = false; }
|
35949 | console.warn('ag-Grid: Since ag-grid 11.0.0 defaultGroupComparator is not necessary. You can remove this from your colDef');
|
35950 | var nodeAIsGroup = utils_1.Utils.exists(nodeA) && nodeA.group;
|
35951 | var nodeBIsGroup = utils_1.Utils.exists(nodeB) && nodeB.group;
|
35952 | var bothAreGroups = nodeAIsGroup && nodeBIsGroup;
|
35953 | var bothAreNormal = !nodeAIsGroup && !nodeBIsGroup;
|
35954 | if (bothAreGroups) {
|
35955 | return utils_1.Utils.defaultComparator(nodeA.key, nodeB.key, accentedCompare);
|
35956 | }
|
35957 | else if (bothAreNormal) {
|
35958 | return utils_1.Utils.defaultComparator(valueA, valueB, accentedCompare);
|
35959 | }
|
35960 | else if (nodeAIsGroup) {
|
35961 | return 1;
|
35962 | }
|
35963 | else {
|
35964 | return -1;
|
35965 | }
|
35966 | }
|
35967 | exports.defaultGroupComparator = defaultGroupComparator;
|
35968 |
|
35969 |
|
35970 | }),
|
35971 |
|
35972 | (function(module, exports, __webpack_require__) {
|
35973 |
|
35974 | "use strict";
|
35975 |
|
35976 |
|
35977 |
|
35978 |
|
35979 |
|
35980 |
|
35981 |
|
35982 | Object.defineProperty(exports, "__esModule", { value: true });
|
35983 | var BaseComponentWrapper = (function () {
|
35984 | function BaseComponentWrapper() {
|
35985 | }
|
35986 | BaseComponentWrapper.prototype.wrap = function (OriginalConstructor, mandatoryMethodList, optionalMethodList, componentName) {
|
35987 | var _this = this;
|
35988 | var wrapper = this.createWrapper(OriginalConstructor, componentName);
|
35989 | mandatoryMethodList.forEach((function (methodName) {
|
35990 | _this.createMethod(wrapper, methodName, true);
|
35991 | }));
|
35992 | if (optionalMethodList) {
|
35993 | optionalMethodList.forEach((function (methodName) {
|
35994 | _this.createMethod(wrapper, methodName, false);
|
35995 | }));
|
35996 | }
|
35997 | return wrapper;
|
35998 | };
|
35999 | BaseComponentWrapper.prototype.createMethod = function (wrapper, methodName, mandatory) {
|
36000 | wrapper.addMethod(methodName, this.createMethodProxy(wrapper, methodName, mandatory));
|
36001 | };
|
36002 | BaseComponentWrapper.prototype.createMethodProxy = function (wrapper, methodName, mandatory) {
|
36003 | return function () {
|
36004 | if (wrapper.hasMethod(methodName)) {
|
36005 | return wrapper.callMethod(methodName, arguments);
|
36006 | }
|
36007 | if (mandatory) {
|
36008 | console.warn('ag-Grid: Framework component is missing the method ' + methodName + '()');
|
36009 | }
|
36010 | return null;
|
36011 | };
|
36012 | };
|
36013 | return BaseComponentWrapper;
|
36014 | }());
|
36015 | exports.BaseComponentWrapper = BaseComponentWrapper;
|
36016 |
|
36017 |
|
36018 | })
|
36019 | ]);
|
36020 | }); |
\ | No newline at end of file |