// ag-grid v16.0.0 (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); else if(typeof define === 'function' && define.amd) define([], factory); else if(typeof exports === 'object') exports["agGrid"] = factory(); else root["agGrid"] = factory(); })(this, function() { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { /******/ configurable: false, /******/ enumerable: true, /******/ get: getter /******/ }); /******/ } /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 116); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v16.0.0 * @link http://www.ag-grid.com/ * @license MIT */ Object.defineProperty(exports, "__esModule", { value: true }); var utils_1 = __webpack_require__(1); var Context = (function () { function Context(params, logger) { this.beans = {}; this.componentsMappedByName = {}; this.destroyed = false; if (!params || !params.beans) { return; } this.contextParams = params; this.logger = logger; this.logger.log('>> creating ag-Application Context'); this.setupComponents(); this.createBeans(); var beans = utils_1.Utils.mapObject(this.beans, function (beanEntry) { return beanEntry.beanInstance; }); this.wireBeans(beans); this.logger.log('>> ag-Application Context ready - component is alive'); } Context.prototype.setupComponents = function () { var _this = this; if (this.contextParams.components) { this.contextParams.components.forEach(function (componentMeta) { return _this.addComponent(componentMeta); }); } }; Context.prototype.addComponent = function (componentMeta) { // get name of the class as a string // let className = _.getNameOfClass(ComponentClass); // insert a dash after every capital letter // let classEscaped = className.replace(/([A-Z])/g, "-$1").toLowerCase(); var classEscaped = componentMeta.componentName.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase(); // put all to upper case var classUpperCase = classEscaped.toUpperCase(); // finally store this.componentsMappedByName[classUpperCase] = componentMeta.theClass; }; Context.prototype.createComponent = function (element) { var key = element.nodeName; if (this.componentsMappedByName && this.componentsMappedByName[key]) { var newComponent = new this.componentsMappedByName[key]; this.wireBean(newComponent); this.copyAttributesFromNode(element, newComponent.getGui()); newComponent.attributesSet(); return newComponent; } else { return null; } }; Context.prototype.copyAttributesFromNode = function (fromNode, toNode) { if (fromNode.attributes) { var count = fromNode.attributes.length; for (var i = 0; i < count; i++) { var attr = fromNode.attributes[i]; toNode.setAttribute(attr.name, attr.value); } } }; Context.prototype.wireBean = function (bean) { if (!bean) throw Error("Can't wire to bean since it is null"); this.wireBeans([bean]); }; Context.prototype.wireBeans = function (beans) { this.autoWireBeans(beans); this.methodWireBeans(beans); this.preConstruct(beans); this.postConstruct(beans); }; Context.prototype.createBeans = function () { var _this = this; // register all normal beans this.contextParams.beans.forEach(this.createBeanEntry.bind(this)); // register override beans, these will overwrite beans above of same name if (this.contextParams.overrideBeans) { this.contextParams.overrideBeans.forEach(this.createBeanEntry.bind(this)); } // instantiate all beans - overridden beans will be left out utils_1.Utils.iterateObject(this.beans, function (key, beanEntry) { var constructorParamsMeta; if (beanEntry.bean.__agBeanMetaData && beanEntry.bean.__agBeanMetaData.autowireMethods && beanEntry.bean.__agBeanMetaData.autowireMethods.agConstructor) { constructorParamsMeta = beanEntry.bean.__agBeanMetaData.autowireMethods.agConstructor; } var constructorParams = _this.getBeansForParameters(constructorParamsMeta, beanEntry.bean.name); var newInstance = applyToConstructor(beanEntry.bean, constructorParams); beanEntry.beanInstance = newInstance; _this.logger.log('bean ' + _this.getBeanName(newInstance) + ' created'); }); }; Context.prototype.createBeanEntry = function (Bean) { var metaData = Bean.__agBeanMetaData; if (!metaData) { var beanName = void 0; if (Bean.prototype.constructor) { beanName = Bean.prototype.constructor.name; } else { beanName = '' + Bean; } console.error('context item ' + beanName + ' is not a bean'); return; } var beanEntry = { bean: Bean, beanInstance: null, beanName: metaData.beanName }; this.beans[metaData.beanName] = beanEntry; }; Context.prototype.autoWireBeans = function (beans) { var _this = this; beans.forEach(function (bean) { return _this.autoWireBean(bean); }); }; Context.prototype.methodWireBeans = function (beans) { var _this = this; beans.forEach(function (bean) { if (!bean) throw Error("Can't wire to bean since it is null"); return _this.methodWireBean(bean); }); }; Context.prototype.autoWireBean = function (bean) { var _this = this; var currentBean = bean; var _loop_1 = function () { var currentConstructor = currentBean.constructor; if (currentConstructor.__agBeanMetaData && currentConstructor.__agBeanMetaData.agClassAttributes) { var attributes = currentConstructor.__agBeanMetaData.agClassAttributes; if (!attributes) { return { value: void 0 }; } var beanName_1 = this_1.getBeanName(currentConstructor); attributes.forEach(function (attribute) { var otherBean = _this.lookupBeanInstance(beanName_1, attribute.beanName, attribute.optional); bean[attribute.attributeName] = otherBean; }); } currentBean = Object.getPrototypeOf(currentBean) ? Object.getPrototypeOf(currentBean) : null; }; var this_1 = this; while (currentBean != null) { var state_1 = _loop_1(); if (typeof state_1 === "object") return state_1.value; } }; Context.prototype.getBeanName = function (constructor) { if (constructor.__agBeanMetaData && constructor.__agBeanMetaData.beanName) { return constructor.__agBeanMetaData.beanName; } var constructorString = constructor.toString(); var beanName = constructorString.substring(9, constructorString.indexOf('(')); return beanName; }; Context.prototype.methodWireBean = function (bean) { var _this = this; var autowiredMethods; if (bean.constructor.__agBeanMetaData && bean.constructor.__agBeanMetaData.autowireMethods) { autowiredMethods = bean.constructor.__agBeanMetaData.autowireMethods; } utils_1.Utils.iterateObject(autowiredMethods, function (methodName, wireParams) { // skip constructor, as this is dealt with elsewhere if (methodName === 'agConstructor') { return; } var beanName = _this.getBeanName(bean.constructor); var initParams = _this.getBeansForParameters(wireParams, beanName); bean[methodName].apply(bean, initParams); }); }; Context.prototype.getBeansForParameters = function (parameters, beanName) { var _this = this; var beansList = []; if (parameters) { utils_1.Utils.iterateObject(parameters, function (paramIndex, otherBeanName) { var otherBean = _this.lookupBeanInstance(beanName, otherBeanName); beansList[Number(paramIndex)] = otherBean; }); } return beansList; }; Context.prototype.lookupBeanInstance = function (wiringBean, beanName, optional) { if (optional === void 0) { optional = false; } if (beanName === 'context') { return this; } else if (this.contextParams.seed && this.contextParams.seed.hasOwnProperty(beanName)) { return this.contextParams.seed[beanName]; } else { var beanEntry = this.beans[beanName]; if (beanEntry) { return beanEntry.beanInstance; } if (!optional) { console.error('ag-Grid: unable to find bean reference ' + beanName + ' while initialising ' + wiringBean); } return null; } }; Context.prototype.postConstruct = function (beans) { beans.forEach(function (bean) { // try calling init methods if (bean.constructor.__agBeanMetaData && bean.constructor.__agBeanMetaData.postConstructMethods) { bean.constructor.__agBeanMetaData && bean.constructor.__agBeanMetaData.postConstructMethods.forEach(function (methodName) { return bean[methodName](); }); } }); }; Context.prototype.preConstruct = function (beans) { beans.forEach(function (bean) { // try calling init methods if (bean.constructor.__agBeanMetaData && bean.constructor.__agBeanMetaData.preConstructMethods) { bean.constructor.__agBeanMetaData.preConstructMethods.forEach(function (methodName) { return bean[methodName](); }); } }); }; Context.prototype.getBean = function (name) { return this.lookupBeanInstance('getBean', name, true); }; Context.prototype.destroy = function () { // should only be able to destroy once if (this.destroyed) { return; } this.logger.log('>> Shutting down ag-Application Context'); // try calling destroy methods utils_1.Utils.iterateObject(this.beans, function (key, beanEntry) { var bean = beanEntry.beanInstance; if (bean.constructor.__agBeanMetaData && bean.constructor.__agBeanMetaData.preDestroyMethods) { bean.constructor.__agBeanMetaData.preDestroyMethods.forEach(function (methodName) { return bean[methodName](); }); } }); this.destroyed = true; this.logger.log('>> ag-Application Context shut down - component is dead'); }; return Context; }()); exports.Context = Context; // taken from: http://stackoverflow.com/questions/3362471/how-can-i-call-a-javascript-constructor-using-call-or-apply // allows calling 'apply' on a constructor function applyToConstructor(constructor, argArray) { var args = [null].concat(argArray); var factoryFunction = constructor.bind.apply(constructor, args); return new factoryFunction(); } function PreConstruct(target, methodName, descriptor) { var props = getOrCreateProps(target.constructor); if (!props.postConstructMethods) { props.preConstructMethods = []; } props.preConstructMethods.push(methodName); } exports.PreConstruct = PreConstruct; function PostConstruct(target, methodName, descriptor) { var props = getOrCreateProps(target.constructor); if (!props.postConstructMethods) { props.postConstructMethods = []; } props.postConstructMethods.push(methodName); } exports.PostConstruct = PostConstruct; function PreDestroy(target, methodName, descriptor) { var props = getOrCreateProps(target.constructor); if (!props.preDestroyMethods) { props.preDestroyMethods = []; } props.preDestroyMethods.push(methodName); } exports.PreDestroy = PreDestroy; function Bean(beanName) { return function (classConstructor) { var props = getOrCreateProps(classConstructor); props.beanName = beanName; }; } exports.Bean = Bean; function Autowired(name) { return function (target, propertyKey, descriptor) { autowiredFunc(target, name, false, target, propertyKey, null); }; } exports.Autowired = Autowired; function Optional(name) { return function (target, propertyKey, descriptor) { autowiredFunc(target, name, true, target, propertyKey, null); }; } exports.Optional = Optional; function autowiredFunc(target, name, optional, classPrototype, methodOrAttributeName, index) { if (name === null) { console.error('ag-Grid: Autowired name should not be null'); return; } if (typeof index === 'number') { console.error('ag-Grid: Autowired should be on an attribute'); return; } // it's an attribute on the class var props = getOrCreateProps(target.constructor); if (!props.agClassAttributes) { props.agClassAttributes = []; } props.agClassAttributes.push({ attributeName: methodOrAttributeName, beanName: name, optional: optional }); } function Qualifier(name) { return function (classPrototype, methodOrAttributeName, index) { var constructor = (typeof classPrototype == 'function') ? classPrototype : classPrototype.constructor; var props; if (typeof index === 'number') { // it's a parameter on a method var methodName = void 0; if (methodOrAttributeName) { props = getOrCreateProps(constructor); methodName = methodOrAttributeName; } else { props = getOrCreateProps(constructor); methodName = 'agConstructor'; } if (!props.autowireMethods) { props.autowireMethods = {}; } if (!props.autowireMethods[methodName]) { props.autowireMethods[methodName] = {}; } props.autowireMethods[methodName][index] = name; } }; } exports.Qualifier = Qualifier; function getOrCreateProps(target) { if (!target.hasOwnProperty('__agBeanMetaData')) { target.__agBeanMetaData = {}; } return target.__agBeanMetaData; } /***/ }), /* 1 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v16.0.0 * @link http://www.ag-grid.com/ * @license MIT */ Object.defineProperty(exports, "__esModule", { value: true }); var constants_1 = __webpack_require__(8); var FUNCTION_STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg; var FUNCTION_ARGUMENT_NAMES = /([^\s,]+)/g; var AG_GRID_STOP_PROPAGATION = '__ag_Grid_Stop_Propagation'; // util class, only used when debugging, for printing time to console var Timer = (function () { function Timer() { this.timestamp = new Date().getTime(); } Timer.prototype.print = function (msg) { var duration = (new Date().getTime()) - this.timestamp; console.log(msg + " = " + duration); this.timestamp = new Date().getTime(); }; return Timer; }()); exports.Timer = Timer; /** HTML Escapes. */ var HTML_ESCAPES = { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }; var reUnescapedHtml = /[&<>"']/g; var Utils = (function () { function Utils() { } // if the key was passed before, then doesn't execute the func Utils.doOnce = function (func, key) { if (this.doOnceFlags[key]) { return; } func(); this.doOnceFlags[key] = true; }; // returns true if the event is close to the original event by X pixels either vertically or horizontally. // we only start dragging after X pixels so this allows us to know if we should start dragging yet. Utils.areEventsNear = function (e1, e2, pixelCount) { // by default, we wait 4 pixels before starting the drag if (pixelCount === 0) { return false; } var diffX = Math.abs(e1.clientX - e2.clientX); var diffY = Math.abs(e1.clientY - e2.clientY); return Math.max(diffX, diffY) <= pixelCount; }; Utils.shallowCompare = function (arr1, arr2) { // if both are missing, then they are the same if (this.missing(arr1) && this.missing(arr2)) { return true; } // if one is present, but other is missing, then then are different if (this.missing(arr1) || this.missing(arr2)) { return false; } if (arr1.length !== arr2.length) { return false; } for (var i = 0; i < arr1.length; i++) { if (arr1[i] !== arr2[i]) { return false; } } return true; }; Utils.getNameOfClass = function (TheClass) { var funcNameRegex = /function (.{1,})\(/; var funcAsString = TheClass.toString(); var results = (funcNameRegex).exec(funcAsString); return (results && results.length > 1) ? results[1] : ""; }; Utils.values = function (object) { var result = []; this.iterateObject(object, function (key, value) { result.push(value); }); return result; }; Utils.getValueUsingField = function (data, field, fieldContainsDots) { if (!field || !data) { return; } // if no '.', then it's not a deep value if (!fieldContainsDots) { return data[field]; } else { // otherwise it is a deep value, so need to dig for it var fields = field.split('.'); var currentObject = data; for (var i = 0; i < fields.length; i++) { currentObject = currentObject[fields[i]]; if (this.missing(currentObject)) { return null; } } return currentObject; } }; Utils.getScrollLeft = function (element, rtl) { var scrollLeft = element.scrollLeft; if (rtl) { // Absolute value - for FF that reports RTL scrolls in negative numbers scrollLeft = Math.abs(scrollLeft); // Get Chrome and Safari to return the same value as well if (this.isBrowserSafari() || this.isBrowserChrome()) { scrollLeft = element.scrollWidth - element.clientWidth - scrollLeft; } } return scrollLeft; }; Utils.cleanNumber = function (value) { if (typeof value === 'string') { value = parseInt(value); } if (typeof value === 'number') { value = Math.floor(value); } else { value = null; } return value; }; Utils.setScrollLeft = function (element, value, rtl) { if (rtl) { // Chrome and Safari when doing RTL have the END position of the scroll as zero, not the start if (this.isBrowserSafari() || this.isBrowserChrome()) { value = element.scrollWidth - element.clientWidth - value; } // Firefox uses negative numbers when doing RTL scrolling if (this.isBrowserFirefox()) { value *= -1; } } element.scrollLeft = value; }; Utils.iterateObject = function (object, callback) { if (this.missing(object)) { return; } var keys = Object.keys(object); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = object[key]; callback(key, value); } }; Utils.cloneObject = function (object) { var copy = {}; var keys = Object.keys(object); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = object[key]; copy[key] = value; } return copy; }; Utils.map = function (array, callback) { var result = []; for (var i = 0; i < array.length; i++) { var item = array[i]; var mappedItem = callback(item); result.push(mappedItem); } return result; }; Utils.mapObject = function (object, callback) { var result = []; Utils.iterateObject(object, function (key, value) { result.push(callback(value)); }); return result; }; Utils.forEach = function (array, callback) { if (!array) { return; } for (var i = 0; i < array.length; i++) { var value = array[i]; callback(value, i); } }; Utils.filter = function (array, callback) { var result = []; array.forEach(function (item) { if (callback(item)) { result.push(item); } }); return result; }; Utils.getAllKeysInObjects = function (objects) { var allValues = {}; objects.forEach(function (obj) { if (obj) { Object.keys(obj).forEach(function (key) { return allValues[key] = null; }); } }); return Object.keys(allValues); }; Utils.mergeDeep = function (dest, source) { if (this.exists(source)) { this.iterateObject(source, function (key, newValue) { var oldValue = dest[key]; if (oldValue === newValue) { return; } if (typeof oldValue === 'object' && typeof newValue === 'object') { Utils.mergeDeep(oldValue, newValue); } else { dest[key] = newValue; } }); } }; Utils.assign = function (object) { var _this = this; var sources = []; for (var _i = 1; _i < arguments.length; _i++) { sources[_i - 1] = arguments[_i]; } sources.forEach(function (source) { if (_this.exists(source)) { _this.iterateObject(source, function (key, value) { object[key] = value; }); } }); return object; }; Utils.parseYyyyMmDdToDate = function (yyyyMmDd, separator) { try { if (!yyyyMmDd) return null; if (yyyyMmDd.indexOf(separator) === -1) return null; var fields = yyyyMmDd.split(separator); if (fields.length != 3) return null; return new Date(Number(fields[0]), Number(fields[1]) - 1, Number(fields[2])); } catch (e) { return null; } }; Utils.serializeDateToYyyyMmDd = function (date, separator) { if (!date) return null; return date.getFullYear() + separator + Utils.pad(date.getMonth() + 1, 2) + separator + Utils.pad(date.getDate(), 2); }; Utils.pad = function (num, totalStringSize) { var asString = num + ""; while (asString.length < totalStringSize) asString = "0" + asString; return asString; }; Utils.pushAll = function (target, source) { if (this.missing(source) || this.missing(target)) { return; } source.forEach(function (func) { return target.push(func); }); }; Utils.createArrayOfNumbers = function (first, last) { var result = []; for (var i = first; i <= last; i++) { result.push(i); } return result; }; Utils.getFunctionParameters = function (func) { var fnStr = func.toString().replace(FUNCTION_STRIP_COMMENTS, ''); var result = fnStr.slice(fnStr.indexOf('(') + 1, fnStr.indexOf(')')).match(FUNCTION_ARGUMENT_NAMES); if (result === null) { return []; } else { return result; } }; Utils.find = function (collection, predicate, value) { if (collection === null || collection === undefined) { return null; } if (!Array.isArray(collection)) { var objToArray = this.values(collection); return this.find(objToArray, predicate, value); } var collectionAsArray = collection; var firstMatchingItem; for (var i = 0; i < collectionAsArray.length; i++) { var item = collectionAsArray[i]; if (typeof predicate === 'string') { if (item[predicate] === value) { firstMatchingItem = item; break; } } else { var callback = predicate; if (callback(item)) { firstMatchingItem = item; break; } } } return firstMatchingItem; }; Utils.toStrings = function (array) { return this.map(array, function (item) { if (item === undefined || item === null || !item.toString) { return null; } else { return item.toString(); } }); }; Utils.iterateArray = function (array, callback) { for (var index = 0; index < array.length; index++) { var value = array[index]; callback(value, index); } }; //Returns true if it is a DOM node //taken from: http://stackoverflow.com/questions/384286/javascript-isdom-how-do-you-check-if-a-javascript-object-is-a-dom-object Utils.isNode = function (o) { return (typeof Node === "function" ? o instanceof Node : o && typeof o === "object" && typeof o.nodeType === "number" && typeof o.nodeName === "string"); }; //Returns true if it is a DOM element //taken from: http://stackoverflow.com/questions/384286/javascript-isdom-how-do-you-check-if-a-javascript-object-is-a-dom-object Utils.isElement = function (o) { return (typeof HTMLElement === "function" ? o instanceof HTMLElement : o && typeof o === "object" && o !== null && o.nodeType === 1 && typeof o.nodeName === "string"); }; Utils.isNodeOrElement = function (o) { return this.isNode(o) || this.isElement(o); }; Utils.isEventFromPrintableCharacter = function (event) { var pressedChar = String.fromCharCode(event.charCode); // newline is an exception, as it counts as a printable character, but we don't // want to start editing when it is pressed. without this check, if user is in chrome // and editing a cell, and they press ctrl+enter, the cell stops editing, and then // starts editing again with a blank value (two 'key down' events are fired). to // test this, remove the line below, edit a cell in chrome and hit ctrl+enter while editing. // https://ag-grid.atlassian.net/browse/AG-605 if (this.isKeyPressed(event, constants_1.Constants.KEY_NEW_LINE)) { return false; } if (exports._.exists(event.key)) { // modern browser will implement key, so we return if key is length 1, eg if it is 'a' for the // a key, or '2' for the '2' key. non-printable characters have names, eg 'Enter' or 'Backspace'. return event.key.length === 1; } else { // otherwise, for older browsers, we test against a list of characters, which doesn't include // accents for non-English, but don't care much, as most users are on modern browsers return Utils.PRINTABLE_CHARACTERS.indexOf(pressedChar) >= 0; } }; //adds all type of change listeners to an element, intended to be a text field Utils.addChangeListener = function (element, listener) { element.addEventListener("changed", listener); element.addEventListener("paste", listener); element.addEventListener("input", listener); // IE doesn't fire changed for special keys (eg delete, backspace), so need to // listen for this further ones element.addEventListener("keydown", listener); element.addEventListener("keyup", listener); }; //if value is undefined, null or blank, returns null, otherwise returns the value Utils.makeNull = function (value) { var valueNoType = value; if (value === null || value === undefined || valueNoType === "") { return null; } else { return value; } }; Utils.missing = function (value) { return !this.exists(value); }; Utils.missingOrEmpty = function (value) { return this.missing(value) || value.length === 0; }; Utils.missingOrEmptyObject = function (value) { return this.missing(value) || Object.keys(value).length === 0; }; Utils.exists = function (value) { if (value === null || value === undefined || value === '') { return false; } else { return true; } }; Utils.firstExistingValue = function () { var values = []; for (var _i = 0; _i < arguments.length; _i++) { values[_i] = arguments[_i]; } for (var i = 0; i < values.length; i++) { var value = values[i]; if (exports._.exists(value)) return value; } return null; }; Utils.anyExists = function (values) { if (values) { for (var i = 0; i < values.length; i++) { if (this.exists(values[i])) { return true; } } } return false; }; Utils.existsAndNotEmpty = function (value) { return this.exists(value) && value.length > 0; }; Utils.removeAllChildren = function (node) { if (node) { while (node.hasChildNodes()) { node.removeChild(node.lastChild); } } }; Utils.removeElement = function (parent, cssSelector) { this.removeFromParent(parent.querySelector(cssSelector)); }; Utils.removeFromParent = function (node) { if (node && node.parentNode) { node.parentNode.removeChild(node); } }; Utils.isVisible = function (element) { return (element.offsetParent !== null); }; /** * loads the template and returns it as an element. makes up for no simple way in * the dom api to load html directly, eg we cannot do this: document.createElement(template) */ Utils.loadTemplate = function (template) { var tempDiv = document.createElement("div"); tempDiv.innerHTML = template; return tempDiv.firstChild; }; Utils.appendHtml = function (eContainer, htmlTemplate) { if (eContainer.lastChild) { // https://developer.mozilla.org/en-US/docs/Web/API/Element/insertAdjacentHTML // we put the items at the start, so new items appear underneath old items, // so when expanding/collapsing groups, the new rows don't go on top of the // rows below that are moving our of the way eContainer.insertAdjacentHTML('afterbegin', htmlTemplate); } else { eContainer.innerHTML = htmlTemplate; } }; Utils.addOrRemoveCssClass = function (element, className, addOrRemove) { if (addOrRemove) { this.addCssClass(element, className); } else { this.removeCssClass(element, className); } }; Utils.callIfPresent = function (func) { if (func) { func(); } }; Utils.addCssClass = function (element, className) { var _this = this; if (!className || className.length === 0) { return; } if (className.indexOf(' ') >= 0) { className.split(' ').forEach(function (value) { return _this.addCssClass(element, value); }); return; } if (element.classList) { if (!element.classList.contains(className)) { element.classList.add(className); } } else { if (element.className && element.className.length > 0) { var cssClasses = element.className.split(' '); if (cssClasses.indexOf(className) < 0) { cssClasses.push(className); element.className = cssClasses.join(' '); } } else { element.className = className; } } }; Utils.containsClass = function (element, className) { if (element.classList) { // for modern browsers return element.classList.contains(className); } else if (element.className) { // for older browsers, check against the string of class names // if only one class, can check for exact match var onlyClass = element.className === className; // if many classes, check for class name, we have to pad with ' ' to stop other // class names that are a substring of this class var contains = element.className.indexOf(' ' + className + ' ') >= 0; // the padding above then breaks when it's the first or last class names var startsWithClass = element.className.indexOf(className + ' ') === 0; var endsWithClass = element.className.lastIndexOf(' ' + className) === (element.className.length - className.length - 1); return onlyClass || contains || startsWithClass || endsWithClass; } else { // if item is not a node return false; } }; Utils.getElementAttribute = function (element, attributeName) { if (element.attributes) { if (element.attributes[attributeName]) { var attribute = element.attributes[attributeName]; return attribute.value; } else { return null; } } else { return null; } }; Utils.offsetHeight = function (element) { return element && element.clientHeight ? element.clientHeight : 0; }; Utils.offsetWidth = function (element) { return element && element.clientWidth ? element.clientWidth : 0; }; Utils.sortNumberArray = function (numberArray) { numberArray.sort(function (a, b) { return a - b; }); }; Utils.removeCssClass = function (element, className) { if (element.classList) { if (element.classList.contains(className)) { element.classList.remove(className); } } else { if (element.className && element.className.length > 0) { var cssClasses = element.className.split(' '); if (cssClasses.indexOf(className) >= 0) { // remove all instances of the item, not just the first, in case it's in more than once while (cssClasses.indexOf(className) >= 0) { cssClasses.splice(cssClasses.indexOf(className), 1); } element.className = cssClasses.join(' '); } } } }; Utils.removeRepeatsFromArray = function (array, object) { if (!array) { return; } for (var index = array.length - 2; index >= 0; index--) { var thisOneMatches = array[index] === object; var nextOneMatches = array[index + 1] === object; if (thisOneMatches && nextOneMatches) { array.splice(index + 1, 1); } } }; Utils.removeFromArray = function (array, object) { if (array.indexOf(object) >= 0) { array.splice(array.indexOf(object), 1); } }; Utils.removeAllFromArray = function (array, toRemove) { toRemove.forEach(function (item) { if (array.indexOf(item) >= 0) { array.splice(array.indexOf(item), 1); } }); }; Utils.insertIntoArray = function (array, object, toIndex) { array.splice(toIndex, 0, object); }; Utils.insertArrayIntoArray = function (dest, src, toIndex) { if (this.missing(dest) || this.missing(src)) { return; } // put items in backwards, otherwise inserted items end up in reverse order for (var i = src.length - 1; i >= 0; i--) { var item = src[i]; this.insertIntoArray(dest, item, toIndex); } }; Utils.moveInArray = function (array, objectsToMove, toIndex) { var _this = this; // first take out it items from the array objectsToMove.forEach(function (obj) { _this.removeFromArray(array, obj); }); // now add the objects, in same order as provided to us, that means we start at the end // as the objects will be pushed to the right as they are inserted objectsToMove.slice().reverse().forEach(function (obj) { _this.insertIntoArray(array, obj, toIndex); }); }; Utils.defaultComparator = function (valueA, valueB, accentedCompare) { if (accentedCompare === void 0) { accentedCompare = false; } var valueAMissing = valueA === null || valueA === undefined; var valueBMissing = valueB === null || valueB === undefined; // this is for aggregations sum and avg, where the result can be a number that is wrapped. // if we didn't do this, then the toString() value would be used, which would result in // the strings getting used instead of the numbers. if (valueA && valueA.toNumber) { valueA = valueA.toNumber(); } if (valueB && valueB.toNumber) { valueB = valueB.toNumber(); } if (valueAMissing && valueBMissing) { return 0; } if (valueAMissing) { return -1; } if (valueBMissing) { return 1; } if (typeof valueA === "string") { if (!accentedCompare) { return doQuickCompare(valueA, valueB); } else { try { // using local compare also allows chinese comparisons return valueA.localeCompare(valueB); } catch (e) { // if something wrong with localeCompare, eg not supported // by browser, then just continue with the quick one return doQuickCompare(valueA, valueB); } } } if (valueA < valueB) { return -1; } else if (valueA > valueB) { return 1; } else { return 0; } function doQuickCompare(a, b) { return (a > b ? 1 : (a < b ? -1 : 0)); } }; Utils.compareArrays = function (array1, array2) { if (this.missing(array1) && this.missing(array2)) { return true; } if (this.missing(array1) || this.missing(array2)) { return false; } if (array1.length !== array2.length) { return false; } for (var i = 0; i < array1.length; i++) { if (array1[i] !== array2[i]) { return false; } } return true; }; Utils.ensureDomOrder = function (eContainer, eChild, eChildBefore) { // if already in right order, do nothing if (eChildBefore && eChildBefore.nextSibling === eChild) { return; } if (eChildBefore) { if (eChildBefore.nextSibling) { // insert between the eRowBefore and the row after it eContainer.insertBefore(eChild, eChildBefore.nextSibling); } else { // if nextSibling is missing, means other row is at end, so just append new row at the end eContainer.appendChild(eChild); } } else { // otherwise put at start if (eContainer.firstChild) { // insert it at the first location eContainer.insertBefore(eChild, eContainer.firstChild); } } }; Utils.insertWithDomOrder = function (eContainer, eChild, eChildBefore) { if (eChildBefore) { if (eChildBefore.nextSibling) { // insert between the eRowBefore and the row after it eContainer.insertBefore(eChild, eChildBefore.nextSibling); } else { // if nextSibling is missing, means other row is at end, so just append new row at the end eContainer.appendChild(eChild); } } else { if (eContainer.firstChild) { // insert it at the first location eContainer.insertBefore(eChild, eContainer.firstChild); } else { // otherwise eContainer is empty, so just append it eContainer.appendChild(eChild); } } }; Utils.insertTemplateWithDomOrder = function (eContainer, htmlTemplate, eChildBefore) { var res; if (eChildBefore) { // if previous element exists, just slot in after the previous element eChildBefore.insertAdjacentHTML('afterend', htmlTemplate); res = eChildBefore.nextSibling; } else { if (eContainer.firstChild) { // insert it at the first location eContainer.insertAdjacentHTML('afterbegin', htmlTemplate); } else { // otherwise eContainer is empty, so just append it eContainer.innerHTML = htmlTemplate; } res = eContainer.firstChild; } return res; }; Utils.toStringOrNull = function (value) { if (this.exists(value) && value.toString) { return value.toString(); } else { return null; } }; Utils.formatWidth = function (width) { if (typeof width === "number") { return width + "px"; } else { return width; } }; Utils.formatNumberTwoDecimalPlacesAndCommas = function (value) { if (typeof value !== 'number') { return ''; } // took this from: http://blog.tompawlak.org/number-currency-formatting-javascript return (Math.round(value * 100) / 100).toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1,"); }; // the native method number.toLocaleString(undefined, {minimumFractionDigits: 0}) puts in decimal places in IE, // so we use this method instead Utils.formatNumberCommas = function (value) { if (typeof value !== 'number') { return ''; } // took this from: http://blog.tompawlak.org/number-currency-formatting-javascript return value.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1,"); }; Utils.prependDC = function (parent, documentFragment) { if (this.exists(parent.firstChild)) { parent.insertBefore(documentFragment, parent.firstChild); } else { parent.appendChild(documentFragment); } }; /** * If icon provided, use this (either a string, or a function callback). * if not, then use the default icon from the theme */ Utils.createIcon = function (iconName, gridOptionsWrapper, column) { var iconContents = this.createIconNoSpan(iconName, gridOptionsWrapper, column); if (iconContents.className.indexOf('ag-icon') > -1) { return iconContents; } else { var eResult = document.createElement('span'); eResult.appendChild(iconContents); return eResult; } }; Utils.createIconNoSpan = function (iconName, gridOptionsWrapper, column) { var userProvidedIcon; // check col for icon first if (column && column.getColDef().icons) { userProvidedIcon = column.getColDef().icons[iconName]; } // it not in col, try grid options if (!userProvidedIcon && gridOptionsWrapper.getIcons()) { userProvidedIcon = gridOptionsWrapper.getIcons()[iconName]; } // now if user provided, use it if (userProvidedIcon) { var rendererResult = void 0; if (typeof userProvidedIcon === 'function') { rendererResult = userProvidedIcon(); } else if (typeof userProvidedIcon === 'string') { rendererResult = userProvidedIcon; } else { throw 'icon from grid options needs to be a string or a function'; } if (typeof rendererResult === 'string') { return this.loadTemplate(rendererResult); } else if (this.isNodeOrElement(rendererResult)) { return rendererResult; } else { throw 'iconRenderer should return back a string or a dom object'; } } else { var span = document.createElement('span'); var cssClass = this.iconNameClassMap[iconName]; if (!cssClass) { throw new Error(iconName + " did not find class"); } span.setAttribute("class", "ag-icon ag-icon-" + cssClass); return span; } }; Utils.addStylesToElement = function (eElement, styles) { var _this = this; if (!styles) { return; } Object.keys(styles).forEach(function (key) { var keyCamelCase = _this.hyphenToCamelCase(key); eElement.style[keyCamelCase] = styles[key]; }); }; Utils.isHorizontalScrollShowing = function (element) { return element.clientWidth < element.scrollWidth; }; Utils.isVerticalScrollShowing = function (element) { return element.clientHeight < element.scrollHeight; }; Utils.getScrollbarWidth = function () { var outer = document.createElement("div"); outer.style.visibility = "hidden"; outer.style.width = "100px"; outer.style.msOverflowStyle = "scrollbar"; // needed for WinJS apps document.body.appendChild(outer); var widthNoScroll = outer.offsetWidth; // force scrollbars outer.style.overflow = "scroll"; // add innerdiv var inner = document.createElement("div"); inner.style.width = "100%"; outer.appendChild(inner); var widthWithScroll = inner.offsetWidth; // remove divs outer.parentNode.removeChild(outer); return widthNoScroll - widthWithScroll; }; Utils.isKeyPressed = function (event, keyToCheck) { var pressedKey = event.which || event.keyCode; return pressedKey === keyToCheck; }; Utils.setVisible = function (element, visible) { this.addOrRemoveCssClass(element, 'ag-hidden', !visible); }; Utils.setHidden = function (element, hidden) { this.addOrRemoveCssClass(element, 'ag-visibility-hidden', hidden); }; Utils.isBrowserIE = function () { if (this.isIE === undefined) { this.isIE = false || !!document.documentMode; // At least IE6 } return this.isIE; }; Utils.isBrowserEdge = function () { if (this.isEdge === undefined) { this.isEdge = !this.isBrowserIE() && !!window.StyleMedia; } return this.isEdge; }; Utils.isBrowserSafari = function () { if (this.isSafari === undefined) { var anyWindow = window; // taken from https://github.com/ag-grid/ag-grid/issues/550 this.isSafari = Object.prototype.toString.call(anyWindow.HTMLElement).indexOf('Constructor') > 0 || (function (p) { return p.toString() === "[object SafariRemoteNotification]"; })(!anyWindow.safari || anyWindow.safari.pushNotification); } return this.isSafari; }; Utils.isBrowserChrome = function () { if (this.isChrome === undefined) { var anyWindow = window; this.isChrome = !!anyWindow.chrome && !!anyWindow.chrome.webstore; } return this.isChrome; }; Utils.isBrowserFirefox = function () { if (this.isFirefox === undefined) { var anyWindow = window; this.isFirefox = typeof anyWindow.InstallTrigger !== 'undefined'; } return this.isFirefox; }; Utils.isUserAgentIPad = function () { if (this.isIPad === undefined) { // taken from https://davidwalsh.name/detect-ipad this.isIPad = navigator.userAgent.match(/iPad/i) != null; } return this.isIPad; }; // srcElement is only available in IE. In all other browsers it is target // http://stackoverflow.com/questions/5301643/how-can-i-make-event-srcelement-work-in-firefox-and-what-does-it-mean Utils.getTarget = function (event) { var eventNoType = event; return eventNoType.target || eventNoType.srcElement; }; Utils.isElementInEventPath = function (element, event) { if (!event || !element) { return false; } var path = exports._.getEventPath(event); return path.indexOf(element) >= 0; }; Utils.createEventPath = function (event) { var res = []; var pointer = exports._.getTarget(event); while (pointer) { res.push(pointer); pointer = pointer.parentElement; } return res; }; // firefox doesn't have event.path set, or any alternative to it, so we hack // it in. this is needed as it's to late to work out the path when the item is // removed from the dom. used by MouseEventService, where it works out if a click // was from the current grid, or a detail grid (master / detail). Utils.addAgGridEventPath = function (event) { event.__agGridEventPath = this.getEventPath(event); }; Utils.getEventPath = function (event) { // https://stackoverflow.com/questions/39245488/event-path-undefined-with-firefox-and-vue-js // https://developer.mozilla.org/en-US/docs/Web/API/Event var eventNoType = event; if (event.deepPath) { // IE supports deep path return event.deepPath(); } else if (eventNoType.path) { // Chrome supports path return eventNoType.path; } else if (eventNoType.composedPath) { // Firefox supports composePath return eventNoType.composedPath(); } else if (eventNoType.__agGridEventPath) { // Firefox supports composePath return eventNoType.__agGridEventPath; } else { // and finally, if none of the above worked, // we create the path ourselves return this.createEventPath(event); } }; Utils.forEachSnapshotFirst = function (list, callback) { if (list) { var arrayCopy = list.slice(0); arrayCopy.forEach(callback); } }; // taken from: http://stackoverflow.com/questions/1038727/how-to-get-browser-width-using-javascript-code Utils.getBodyWidth = function () { if (document.body) { return document.body.clientWidth; } if (window.innerHeight) { return window.innerWidth; } if (document.documentElement && document.documentElement.clientWidth) { return document.documentElement.clientWidth; } return -1; }; // taken from: http://stackoverflow.com/questions/1038727/how-to-get-browser-width-using-javascript-code Utils.getBodyHeight = function () { if (document.body) { return document.body.clientHeight; } if (window.innerHeight) { return window.innerHeight; } if (document.documentElement && document.documentElement.clientHeight) { return document.documentElement.clientHeight; } return -1; }; Utils.setCheckboxState = function (eCheckbox, state) { if (typeof state === 'boolean') { eCheckbox.checked = state; eCheckbox.indeterminate = false; } else { // isNodeSelected returns back undefined if it's a group and the children // are a mix of selected and unselected eCheckbox.indeterminate = true; } }; Utils.traverseNodesWithKey = function (nodes, callback) { var keyParts = []; recursiveSearchNodes(nodes); function recursiveSearchNodes(nodes) { nodes.forEach(function (node) { if (node.group) { keyParts.push(node.key); var key = keyParts.join('|'); callback(node, key); recursiveSearchNodes(node.childrenAfterGroup); keyParts.pop(); } }); } }; // from https://gist.github.com/youssman/745578062609e8acac9f Utils.camelCaseToHyphen = function (str) { if (str === null || str === undefined) { return null; } return str.replace(/([A-Z])/g, function (g) { return '-' + g[0].toLowerCase(); }); }; // from https://stackoverflow.com/questions/6660977/convert-hyphens-to-camel-case-camelcase Utils.hyphenToCamelCase = function (str) { if (str === null || str === undefined) { return null; } return str.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); }); }; // pas in an object eg: {color: 'black', top: '25px'} and it returns "color: black; top: 25px;" for html Utils.cssStyleObjectToMarkup = function (stylesToUse) { var _this = this; if (!stylesToUse) { return ''; } var resParts = []; this.iterateObject(stylesToUse, function (styleKey, styleValue) { var styleKeyDashed = _this.camelCaseToHyphen(styleKey); resParts.push(styleKeyDashed + ": " + styleValue + ";"); }); return resParts.join(' '); }; /** * From http://stackoverflow.com/questions/9716468/is-there-any-function-like-isnumeric-in-javascript-to-validate-numbers */ Utils.isNumeric = function (value) { if (value === '') return false; return !isNaN(parseFloat(value)) && isFinite(value); }; Utils.escape = function (toEscape) { if (toEscape === null || toEscape === undefined || !toEscape.replace) { return toEscape; } return toEscape.replace(reUnescapedHtml, function (chr) { return HTML_ESCAPES[chr]; }); }; // Taken from here: https://github.com/facebook/fixed-data-table/blob/master/src/vendor_upstream/dom/normalizeWheel.js /** * Mouse wheel (and 2-finger trackpad) support on the web sucks. It is * complicated, thus this doc is long and (hopefully) detailed enough to answer * your questions. * * If you need to react to the mouse wheel in a predictable way, this code is * like your bestest friend. * hugs * * * As of today, there are 4 DOM event types you can listen to: * * 'wheel' -- Chrome(31+), FF(17+), IE(9+) * 'mousewheel' -- Chrome, IE(6+), Opera, Safari * 'MozMousePixelScroll' -- FF(3.5 only!) (2010-2013) -- don't bother! * 'DOMMouseScroll' -- FF(0.9.7+) since 2003 * * So what to do? The is the best: * * normalizeWheel.getEventType(); * * In your event callback, use this code to get sane interpretation of the * deltas. This code will return an object with properties: * * spinX -- normalized spin speed (use for zoom) - x plane * spinY -- " - y plane * pixelX -- normalized distance (to pixels) - x plane * pixelY -- " - y plane * * Wheel values are provided by the browser assuming you are using the wheel to * scroll a web page by a number of lines or pixels (or pages). Values can vary * significantly on different platforms and browsers, forgetting that you can * scroll at different speeds. Some devices (like trackpads) emit more events * at smaller increments with fine granularity, and some emit massive jumps with * linear speed or acceleration. * * This code does its best to normalize the deltas for you: * * - spin is trying to normalize how far the wheel was spun (or trackpad * dragged). This is super useful for zoom support where you want to * throw away the chunky scroll steps on the PC and make those equal to * the slow and smooth tiny steps on the Mac. Key data: This code tries to * resolve a single slow step on a wheel to 1. * * - pixel is normalizing the desired scroll delta in pixel units. You'll * get the crazy differences between browsers, but at least it'll be in * pixels! * * - positive value indicates scrolling DOWN/RIGHT, negative UP/LEFT. This * should translate to positive value zooming IN, negative zooming OUT. * This matches the newer 'wheel' event. * * Why are there spinX, spinY (or pixels)? * * - spinX is a 2-finger side drag on the trackpad, and a shift + wheel turn * with a mouse. It results in side-scrolling in the browser by default. * * - spinY is what you expect -- it's the classic axis of a mouse wheel. * * - I dropped spinZ/pixelZ. It is supported by the DOM 3 'wheel' event and * probably is by browsers in conjunction with fancy 3D controllers .. but * you know. * * Implementation info: * * Examples of 'wheel' event if you scroll slowly (down) by one step with an * average mouse: * * OS X + Chrome (mouse) - 4 pixel delta (wheelDelta -120) * OS X + Safari (mouse) - N/A pixel delta (wheelDelta -12) * OS X + Firefox (mouse) - 0.1 line delta (wheelDelta N/A) * Win8 + Chrome (mouse) - 100 pixel delta (wheelDelta -120) * Win8 + Firefox (mouse) - 3 line delta (wheelDelta -120) * * On the trackpad: * * OS X + Chrome (trackpad) - 2 pixel delta (wheelDelta -6) * OS X + Firefox (trackpad) - 1 pixel delta (wheelDelta N/A) * * On other/older browsers.. it's more complicated as there can be multiple and * also missing delta values. * * The 'wheel' event is more standard: * * http://www.w3.org/TR/DOM-Level-3-Events/#events-wheelevents * * The basics is that it includes a unit, deltaMode (pixels, lines, pages), and * deltaX, deltaY and deltaZ. Some browsers provide other values to maintain * backward compatibility with older events. Those other values help us * better normalize spin speed. Example of what the browsers provide: * * | event.wheelDelta | event.detail * ------------------+------------------+-------------- * Safari v5/OS X | -120 | 0 * Safari v5/Win7 | -120 | 0 * Chrome v17/OS X | -120 | 0 * Chrome v17/Win7 | -120 | 0 * IE9/Win7 | -120 | undefined * Firefox v4/OS X | undefined | 1 * Firefox v4/Win7 | undefined | 3 * */ Utils.normalizeWheel = function (event) { var PIXEL_STEP = 10; var LINE_HEIGHT = 40; var PAGE_HEIGHT = 800; // spinX, spinY var sX = 0; var sY = 0; // pixelX, pixelY var pX = 0; var pY = 0; // Legacy if ('detail' in event) { sY = event.detail; } if ('wheelDelta' in event) { sY = -event.wheelDelta / 120; } if ('wheelDeltaY' in event) { sY = -event.wheelDeltaY / 120; } if ('wheelDeltaX' in event) { sX = -event.wheelDeltaX / 120; } // side scrolling on FF with DOMMouseScroll if ('axis' in event && event.axis === event.HORIZONTAL_AXIS) { sX = sY; sY = 0; } pX = sX * PIXEL_STEP; pY = sY * PIXEL_STEP; if ('deltaY' in event) { pY = event.deltaY; } if ('deltaX' in event) { pX = event.deltaX; } if ((pX || pY) && event.deltaMode) { if (event.deltaMode == 1) { pX *= LINE_HEIGHT; pY *= LINE_HEIGHT; } else { pX *= PAGE_HEIGHT; pY *= PAGE_HEIGHT; } } // Fall-back if spin cannot be determined if (pX && !sX) { sX = (pX < 1) ? -1 : 1; } if (pY && !sY) { sY = (pY < 1) ? -1 : 1; } return { spinX: sX, spinY: sY, pixelX: pX, pixelY: pY }; }; /** * https://stackoverflow.com/questions/24004791/can-someone-explain-the-debounce-function-in-javascript */ Utils.debounce = function (func, wait, immediate) { if (immediate === void 0) { immediate = false; } // 'private' variable for instance // The returned function will be able to reference this due to closure. // Each call to the returned function will share this common timer. var timeout; // Calling debounce returns a new anonymous function return function () { // reference the context and args for the setTimeout function var context = this, args = arguments; // Should the function be called now? If immediate is true // and not already in a timeout then the answer is: Yes var callNow = immediate && !timeout; // This is the basic debounce behaviour where you can call this // function several times, but it will only execute once // [before or after imposing a delay]. // Each time the returned function is called, the timer starts over. clearTimeout(timeout); // Set the new timeout timeout = setTimeout(function () { // Inside the timeout function, clear the timeout variable // which will let the next execution run when in 'immediate' mode timeout = null; // Check if the function already ran with the immediate flag if (!immediate) { // Call the original function with apply // apply lets you define the 'this' object as well as the arguments // (both captured before setTimeout) func.apply(context, args); } }, wait); // Immediate mode and no wait timer? Execute the function.. if (callNow) func.apply(context, args); }; }; ; // a user once raised an issue - they said that when you opened a popup (eg context menu) // and then clicked on a selection checkbox, the popup wasn't closed. this is because the // popup listens for clicks on the body, however ag-grid WAS stopping propagation on the // checkbox clicks (so the rows didn't pick them up as row selection selection clicks). // to get around this, we have a pattern to stop propagation for the purposes of ag-Grid, // but we still let the event pass back to teh body. Utils.stopPropagationForAgGrid = function (event) { event[AG_GRID_STOP_PROPAGATION] = true; }; Utils.isStopPropagationForAgGrid = function (event) { return event[AG_GRID_STOP_PROPAGATION] === true; }; Utils.executeInAWhile = function (funcs) { this.executeAfter(funcs, 400); }; Utils.executeNextVMTurn = function (funcs) { this.executeAfter(funcs, 0); }; Utils.executeAfter = function (funcs, millis) { if (funcs.length > 0) { setTimeout(function () { funcs.forEach(function (func) { return func(); }); }, millis); } }; Utils.referenceCompare = function (left, right) { if (left == null && right == null) return true; if (left == null && right) return false; if (left && right == null) return false; return left === right; }; Utils.get = function (source, expression, defaultValue) { if (source == null) return defaultValue; if (expression.indexOf('.') > -1) { var fields = expression.split('.'); var thisKey = fields[0]; var nextValue = source[thisKey]; if (nextValue != null) { return Utils.get(nextValue, fields.slice(1, fields.length).join('.'), defaultValue); } else { return defaultValue; } } else { var nextValue = source[expression]; return nextValue != null ? nextValue : defaultValue; } }; Utils.addSafePassiveEventListener = function (eElement, event, listener) { eElement.addEventListener(event, listener, (Utils.passiveEvents.indexOf(event) > -1 ? { passive: true } : undefined)); }; Utils.camelCaseToHumanText = function (camelCase) { if (camelCase == null) return null; // Who needs to learn how to code when you have stack overflow! // from: https://stackoverflow.com/questions/15369566/putting-space-in-camel-case-string-using-regular-expression var rex = /([A-Z])([A-Z])([a-z])|([a-z])([A-Z])/g; var words = camelCase.replace(rex, '$1$4 $2$3$5').replace('.', ' ').split(' '); return words.map(function (word) { return word.substring(0, 1).toUpperCase() + ((word.length > 1) ? word.substring(1, word.length) : ''); }).join(' '); }; // displays a message to the browser. this is useful in iPad, where you can't easily see the console. // so the javascript code can use this to give feedback. this is NOT intended to be called in production. // it is intended the ag-Grid developer calls this to troubleshoot, but then takes out the calls before // checking in. Utils.message = function (msg) { var eMessage = document.createElement('div'); eMessage.innerHTML = msg; var eBox = document.querySelector('#__ag__message'); if (!eBox) { var template = "
"; eBox = this.loadTemplate(template); if (document.body) { document.body.appendChild(eBox); } } eBox.appendChild(eMessage); }; // gets called by: a) InMemoryRowNodeManager and b) GroupStage to do sorting. // when in InMemoryRowNodeManager we always have indexes (as this sorts the items the // user provided) but when in GroupStage, the nodes can contain filler nodes that // don't have order id's Utils.sortRowNodesByOrder = function (rowNodes, rowNodeOrder) { if (!rowNodes) { return; } rowNodes.sort(function (nodeA, nodeB) { var positionA = rowNodeOrder[nodeA.id]; var positionB = rowNodeOrder[nodeB.id]; var aHasIndex = positionA !== undefined; var bHasIndex = positionB !== undefined; var bothNodesAreUserNodes = aHasIndex && bHasIndex; var bothNodesAreFillerNodes = !aHasIndex && !bHasIndex; if (bothNodesAreUserNodes) { // when comparing two nodes the user has provided, they always // have indexes return positionA - positionB; } else if (bothNodesAreFillerNodes) { // when comparing two filler nodes, we have no index to compare them // against, however we want this sorting to be deterministic, so that // the rows don't jump around as the user does delta updates. so we // want the same sort result. so we use the id - which doesn't make sense // from a sorting point of view, but does give consistent behaviour between // calls. otherwise groups jump around as delta updates are done. return nodeA.id > nodeB.id ? 1 : -1; } else if (aHasIndex) { return 1; } else { return -1; } }); }; Utils.PRINTABLE_CHARACTERS = 'qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890!"£$%^&*()_+-=[];\'#,./\\|<>?:@~{}'; Utils.doOnceFlags = {}; // static prepend(parent: HTMLElement, child: HTMLElement): void { // if (this.exists(parent.firstChild)) { // parent.insertBefore(child, parent.firstChild); // } else { // parent.appendChild(child); // } // } Utils.iconNameClassMap = { 'columnMovePin': 'pin', 'columnMoveAdd': 'plus', 'columnMoveHide': 'eye-slash', 'columnMoveMove': 'arrows', 'columnMoveLeft': 'left', 'columnMoveRight': 'right', 'columnMoveGroup': 'group', 'columnMoveValue': 'aggregation', 'columnMovePivot': 'pivot', 'dropNotAllowed': 'not-allowed', 'groupContracted': 'expanded', 'groupExpanded': 'contracted', 'checkboxChecked': 'checkbox-checked', 'checkboxUnchecked': 'checkbox-unchecked', 'checkboxIndeterminate': 'checkbox-indeterminate', 'checkboxCheckedReadOnly': 'checkbox-checked-readonly', 'checkboxUncheckedReadOnly': 'checkbox-unchecked-readonly', 'checkboxIndeterminateReadOnly': 'checkbox-indeterminate-readonly', 'groupLoading': 'loading', 'menu': 'menu', 'filter': 'filter', 'columns': 'columns', 'menuPin': 'pin', 'menuValue': 'aggregation', 'menuAddRowGroup': 'group', 'menuRemoveRowGroup': 'group', 'clipboardCopy': 'copy', 'clipboardCut': 'cut', 'clipboardPaste': 'paste', 'pivotPanel': 'pivot', 'rowGroupPanel': 'group', 'valuePanel': 'aggregation', 'columnGroupOpened': 'expanded', 'columnGroupClosed': 'contracted', 'columnSelectClosed': 'tree-closed', 'columnSelectOpen': 'tree-open', // from deprecated header, remove at some point 'sortAscending': 'asc', 'sortDescending': 'desc', 'sortUnSort': 'none' }; Utils.passiveEvents = ['touchstart', 'touchend', 'touchmove', 'touchcancel']; return Utils; }()); exports.Utils = Utils; var NumberSequence = (function () { function NumberSequence(initValue, step) { if (initValue === void 0) { initValue = 0; } if (step === void 0) { step = 1; } this.nextValue = initValue; this.step = step; } NumberSequence.prototype.next = function () { var valToReturn = this.nextValue; this.nextValue += this.step; return valToReturn; }; NumberSequence.prototype.peek = function () { return this.nextValue; }; NumberSequence.prototype.skip = function (count) { this.nextValue += count; }; return NumberSequence; }()); exports.NumberSequence = NumberSequence; exports._ = Utils; var PromiseStatus; (function (PromiseStatus) { PromiseStatus[PromiseStatus["IN_PROGRESS"] = 0] = "IN_PROGRESS"; PromiseStatus[PromiseStatus["RESOLVED"] = 1] = "RESOLVED"; })(PromiseStatus = exports.PromiseStatus || (exports.PromiseStatus = {})); var Promise = (function () { function Promise(callback) { this.status = PromiseStatus.IN_PROGRESS; this.resolution = null; this.listOfWaiters = []; callback(this.onDone.bind(this), this.onReject.bind(this)); } Promise.all = function (toCombine) { return new Promise(function (resolve) { var combinedValues = []; var remainingToResolve = toCombine.length; toCombine.forEach(function (source, index) { source.then(function (sourceResolved) { remainingToResolve--; combinedValues[index] = sourceResolved; if (remainingToResolve == 0) { resolve(combinedValues); } }); combinedValues.push(null); }); }); }; Promise.resolve = function (value) { return new Promise(function (resolve) { return resolve(value); }); }; Promise.external = function () { var capture; var promise = new Promise(function (resolve) { capture = resolve; }); return { promise: promise, resolve: function (value) { capture(value); } }; }; Promise.prototype.then = function (func) { if (this.status === PromiseStatus.IN_PROGRESS) { this.listOfWaiters.push(func); } else { func(this.resolution); } }; Promise.prototype.firstOneOnly = function (func) { if (this.status === PromiseStatus.IN_PROGRESS) { if (this.listOfWaiters.length === 0) { this.listOfWaiters.push(func); } } else { func(this.resolution); } }; Promise.prototype.map = function (adapter) { var _this = this; return new Promise(function (resolve) { _this.then(function (unmapped) { resolve(adapter(unmapped)); }); }); }; Promise.prototype.resolveNow = function (ifNotResolvedValue, ifResolved) { if (this.status == PromiseStatus.IN_PROGRESS) return ifNotResolvedValue; return ifResolved(this.resolution); }; Promise.prototype.onDone = function (value) { this.status = PromiseStatus.RESOLVED; this.resolution = value; this.listOfWaiters.forEach(function (waiter) { return waiter(value); }); }; Promise.prototype.onReject = function (params) { console.warn('TBI'); }; return Promise; }()); exports.Promise = Promise; /***/ }), /* 2 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v16.0.0 * @link http://www.ag-grid.com/ * @license MIT */ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 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; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; var __param = (this && this.__param) || function (paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } }; Object.defineProperty(exports, "__esModule", { value: true }); var eventService_1 = __webpack_require__(3); var constants_1 = __webpack_require__(8); var componentUtil_1 = __webpack_require__(61); var gridApi_1 = __webpack_require__(6); var context_1 = __webpack_require__(0); var columnApi_1 = __webpack_require__(7); var columnController_1 = __webpack_require__(4); var utils_1 = __webpack_require__(1); var environment_1 = __webpack_require__(39); var DEFAULT_ROW_HEIGHT = 25; var DEFAULT_DETAIL_ROW_HEIGHT = 300; var DEFAULT_VIEWPORT_ROW_MODEL_PAGE_SIZE = 5; var DEFAULT_VIEWPORT_ROW_MODEL_BUFFER_SIZE = 5; var legacyThemes = [ 'ag-fresh', 'ag-bootstrap', 'ag-blue', 'ag-dark', 'ag-material' ]; function isTrue(value) { return value === true || value === 'true'; } function zeroOrGreater(value, defaultValue) { if (value >= 0) { return value; } else { // zero gets returned if number is missing or the wrong type return defaultValue; } } function oneOrGreater(value, defaultValue) { if (value > 0) { return value; } else { // zero gets returned if number is missing or the wrong type return defaultValue; } } var GridOptionsWrapper = (function () { function GridOptionsWrapper() { this.propertyEventService = new eventService_1.EventService(); this.domDataKey = '__AG_' + Math.random().toString(); } GridOptionsWrapper_1 = GridOptionsWrapper; GridOptionsWrapper.prototype.agWire = function (gridApi, columnApi) { this.gridOptions.api = gridApi; this.gridOptions.columnApi = columnApi; this.checkForDeprecated(); }; GridOptionsWrapper.prototype.destroy = function () { // need to remove these, as we don't own the lifecycle of the gridOptions, we need to // remove the references in case the user keeps the grid options, we want the rest // of the grid to be picked up by the garbage collector this.gridOptions.api = null; this.gridOptions.columnApi = null; }; GridOptionsWrapper.prototype.init = function () { var async = this.useAsyncEvents(); this.eventService.addGlobalListener(this.globalEventHandler.bind(this), async); if (this.isGroupSelectsChildren() && this.isSuppressParentsInRowNodes()) { console.warn('ag-Grid: groupSelectsChildren does not work wth suppressParentsInRowNodes, this selection method needs the part in rowNode to work'); } if (this.isGroupSelectsChildren()) { if (!this.isRowSelectionMulti()) { console.warn("ag-Grid: rowSelection must be 'multiple' for groupSelectsChildren to make sense"); } if (this.isRowModelEnterprise()) { console.warn('ag-Grid: group selects children is NOT support for Enterprise Row Model. ' + 'This is because the rows are lazy loaded, so selecting a group is not possible as' + 'the grid has no way of knowing what the children are.'); } } if (this.isGroupRemoveSingleChildren() && this.isGroupHideOpenParents()) { 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!'); } }; // returns the dom data, or undefined if not found GridOptionsWrapper.prototype.getDomData = function (element, key) { var domData = element[this.domDataKey]; if (domData) { return domData[key]; } else { return undefined; } }; GridOptionsWrapper.prototype.setDomData = function (element, key, value) { var domData = element[this.domDataKey]; if (utils_1.Utils.missing(domData)) { domData = {}; element[this.domDataKey] = domData; } domData[key] = value; }; GridOptionsWrapper.prototype.isEnterprise = function () { return this.enterprise; }; GridOptionsWrapper.prototype.isRowSelection = function () { return this.gridOptions.rowSelection === "single" || this.gridOptions.rowSelection === "multiple"; }; GridOptionsWrapper.prototype.isRowDeselection = function () { return isTrue(this.gridOptions.rowDeselection); }; GridOptionsWrapper.prototype.isRowSelectionMulti = function () { return this.gridOptions.rowSelection === 'multiple'; }; GridOptionsWrapper.prototype.getContext = function () { return this.gridOptions.context; }; GridOptionsWrapper.prototype.isPivotMode = function () { return isTrue(this.gridOptions.pivotMode); }; GridOptionsWrapper.prototype.isPivotTotals = function () { return isTrue(this.gridOptions.pivotTotals); }; GridOptionsWrapper.prototype.isRowModelInfinite = function () { return this.gridOptions.rowModelType === constants_1.Constants.ROW_MODEL_TYPE_INFINITE; }; GridOptionsWrapper.prototype.isRowModelViewport = function () { return this.gridOptions.rowModelType === constants_1.Constants.ROW_MODEL_TYPE_VIEWPORT; }; GridOptionsWrapper.prototype.isRowModelEnterprise = function () { return this.gridOptions.rowModelType === constants_1.Constants.ROW_MODEL_TYPE_ENTERPRISE; }; GridOptionsWrapper.prototype.isRowModelDefault = function () { return utils_1.Utils.missing(this.gridOptions.rowModelType) || this.gridOptions.rowModelType === constants_1.Constants.ROW_MODEL_TYPE_IN_MEMORY || this.gridOptions.rowModelType === constants_1.Constants.DEPRECATED_ROW_MODEL_TYPE_NORMAL; }; GridOptionsWrapper.prototype.isFullRowEdit = function () { return this.gridOptions.editType === 'fullRow'; }; GridOptionsWrapper.prototype.isSuppressFocusAfterRefresh = function () { return isTrue(this.gridOptions.suppressFocusAfterRefresh); }; GridOptionsWrapper.prototype.isShowToolPanel = function () { return isTrue(this.gridOptions.showToolPanel); }; GridOptionsWrapper.prototype.isToolPanelSuppressValues = function () { return isTrue(this.gridOptions.toolPanelSuppressValues); }; GridOptionsWrapper.prototype.isToolPanelSuppressPivots = function () { // we don't allow pivots when doing tree data return isTrue(this.gridOptions.toolPanelSuppressPivots) || this.isTreeData(); }; GridOptionsWrapper.prototype.isToolPanelSuppressRowGroups = function () { // we don't allow row grouping when doing tree data return isTrue(this.gridOptions.toolPanelSuppressRowGroups) || this.isTreeData(); }; GridOptionsWrapper.prototype.isToolPanelSuppressPivotMode = function () { return isTrue(this.gridOptions.toolPanelSuppressPivotMode) || this.isTreeData(); }; GridOptionsWrapper.prototype.isSuppressTouch = function () { return isTrue(this.gridOptions.suppressTouch); }; GridOptionsWrapper.prototype.useAsyncEvents = function () { return !isTrue(this.gridOptions.suppressAsyncEvents); }; GridOptionsWrapper.prototype.isEnableCellChangeFlash = function () { return isTrue(this.gridOptions.enableCellChangeFlash); }; GridOptionsWrapper.prototype.isGroupSelectsChildren = function () { var result = isTrue(this.gridOptions.groupSelectsChildren); if (result && this.isTreeData()) { console.warn('ag-Grid: groupSelectsChildren does not work with tree data'); return false; } else { return result; } }; GridOptionsWrapper.prototype.isGroupSelectsFiltered = function () { return isTrue(this.gridOptions.groupSelectsFiltered); }; GridOptionsWrapper.prototype.isGroupHideOpenParents = function () { return isTrue(this.gridOptions.groupHideOpenParents); }; // if we are doing hideOpenParents, then we always have groupMultiAutoColumn, otherwise hideOpenParents would not work GridOptionsWrapper.prototype.isGroupMultiAutoColumn = function () { return isTrue(this.gridOptions.groupMultiAutoColumn) || isTrue(this.gridOptions.groupHideOpenParents); }; GridOptionsWrapper.prototype.isGroupRemoveSingleChildren = function () { return isTrue(this.gridOptions.groupRemoveSingleChildren); }; GridOptionsWrapper.prototype.isGroupRemoveLowestSingleChildren = function () { return isTrue(this.gridOptions.groupRemoveLowestSingleChildren); }; GridOptionsWrapper.prototype.isGroupIncludeFooter = function () { return isTrue(this.gridOptions.groupIncludeFooter); }; GridOptionsWrapper.prototype.isGroupSuppressBlankHeader = function () { return isTrue(this.gridOptions.groupSuppressBlankHeader); }; GridOptionsWrapper.prototype.isSuppressRowClickSelection = function () { return isTrue(this.gridOptions.suppressRowClickSelection); }; GridOptionsWrapper.prototype.isSuppressCellSelection = function () { return isTrue(this.gridOptions.suppressCellSelection); }; GridOptionsWrapper.prototype.isSuppressMultiSort = function () { return isTrue(this.gridOptions.suppressMultiSort); }; GridOptionsWrapper.prototype.isGroupSuppressAutoColumn = function () { return isTrue(this.gridOptions.groupSuppressAutoColumn); }; GridOptionsWrapper.prototype.isSuppressDragLeaveHidesColumns = function () { return isTrue(this.gridOptions.suppressDragLeaveHidesColumns); }; GridOptionsWrapper.prototype.isSuppressScrollOnNewData = function () { return isTrue(this.gridOptions.suppressScrollOnNewData); }; GridOptionsWrapper.prototype.isRowDragManaged = function () { return isTrue(this.gridOptions.rowDragManaged); }; GridOptionsWrapper.prototype.isSuppressRowDrag = function () { return isTrue(this.gridOptions.suppressRowDrag); }; GridOptionsWrapper.prototype.isForPrint = function () { return this.gridOptions.domLayout === 'forPrint'; }; GridOptionsWrapper.prototype.isAutoHeight = function () { return this.gridOptions.domLayout === 'autoHeight'; }; GridOptionsWrapper.prototype.isNormalDomLayout = function () { return !this.isForPrint() && !this.isAutoHeight(); }; GridOptionsWrapper.prototype.isSuppressHorizontalScroll = function () { return isTrue(this.gridOptions.suppressHorizontalScroll); }; GridOptionsWrapper.prototype.isSuppressLoadingOverlay = function () { return isTrue(this.gridOptions.suppressLoadingOverlay); }; GridOptionsWrapper.prototype.isSuppressNoRowsOverlay = function () { return isTrue(this.gridOptions.suppressNoRowsOverlay); }; GridOptionsWrapper.prototype.isSuppressFieldDotNotation = function () { return isTrue(this.gridOptions.suppressFieldDotNotation); }; GridOptionsWrapper.prototype.getPinnedTopRowData = function () { return this.gridOptions.pinnedTopRowData; }; GridOptionsWrapper.prototype.getPinnedBottomRowData = function () { return this.gridOptions.pinnedBottomRowData; }; GridOptionsWrapper.prototype.isFunctionsPassive = function () { return isTrue(this.gridOptions.functionsPassive); }; GridOptionsWrapper.prototype.isSuppressTabbing = function () { return isTrue(this.gridOptions.suppressTabbing); }; GridOptionsWrapper.prototype.isSuppressChangeDetection = function () { return isTrue(this.gridOptions.suppressChangeDetection); }; GridOptionsWrapper.prototype.isSuppressAnimationFrame = function () { return isTrue(this.gridOptions.suppressAnimationFrame); }; GridOptionsWrapper.prototype.getQuickFilterText = function () { return this.gridOptions.quickFilterText; }; GridOptionsWrapper.prototype.isCacheQuickFilter = function () { return isTrue(this.gridOptions.cacheQuickFilter); }; GridOptionsWrapper.prototype.isUnSortIcon = function () { return isTrue(this.gridOptions.unSortIcon); }; GridOptionsWrapper.prototype.isSuppressMenuHide = function () { return isTrue(this.gridOptions.suppressMenuHide); }; GridOptionsWrapper.prototype.isEnterMovesDownAfterEdit = function () { return isTrue(this.gridOptions.enterMovesDownAfterEdit); }; GridOptionsWrapper.prototype.getRowStyle = function () { return this.gridOptions.rowStyle; }; GridOptionsWrapper.prototype.getRowClass = function () { return this.gridOptions.rowClass; }; GridOptionsWrapper.prototype.getRowStyleFunc = function () { return this.gridOptions.getRowStyle; }; GridOptionsWrapper.prototype.getRowClassFunc = function () { return this.gridOptions.getRowClass; }; GridOptionsWrapper.prototype.rowClassRules = function () { return this.gridOptions.rowClassRules; }; GridOptionsWrapper.prototype.getPopupParent = function () { return this.gridOptions.popupParent; }; GridOptionsWrapper.prototype.getPostProcessPopupFunc = function () { return this.gridOptions.postProcessPopup; }; GridOptionsWrapper.prototype.getDoesDataFlowerFunc = function () { return this.gridOptions.doesDataFlower; }; GridOptionsWrapper.prototype.getPaginationNumberFormatterFunc = function () { return this.gridOptions.paginationNumberFormatter; }; GridOptionsWrapper.prototype.getChildCountFunc = function () { return this.gridOptions.getChildCount; }; GridOptionsWrapper.prototype.getIsFullWidthCellFunc = function () { return this.gridOptions.isFullWidthCell; }; GridOptionsWrapper.prototype.getFullWidthCellRendererParams = function () { return this.gridOptions.fullWidthCellRendererParams; }; GridOptionsWrapper.prototype.isEmbedFullWidthRows = function () { // if autoHeight, we always embed fullWidth rows, otherwise we let the user decide return this.isAutoHeight() || isTrue(this.gridOptions.embedFullWidthRows); }; GridOptionsWrapper.prototype.getBusinessKeyForNodeFunc = function () { return this.gridOptions.getBusinessKeyForNode; }; GridOptionsWrapper.prototype.getApi = function () { return this.gridOptions.api; }; GridOptionsWrapper.prototype.getColumnApi = function () { return this.gridOptions.columnApi; }; GridOptionsWrapper.prototype.isDeltaRowDataMode = function () { return isTrue(this.gridOptions.deltaRowDataMode); }; GridOptionsWrapper.prototype.isEnsureDomOrder = function () { return isTrue(this.gridOptions.ensureDomOrder); }; GridOptionsWrapper.prototype.isEnableColResize = function () { return isTrue(this.gridOptions.enableColResize); }; GridOptionsWrapper.prototype.isSingleClickEdit = function () { return isTrue(this.gridOptions.singleClickEdit); }; GridOptionsWrapper.prototype.isSuppressClickEdit = function () { return isTrue(this.gridOptions.suppressClickEdit); }; GridOptionsWrapper.prototype.isStopEditingWhenGridLosesFocus = function () { return isTrue(this.gridOptions.stopEditingWhenGridLosesFocus); }; GridOptionsWrapper.prototype.getGroupDefaultExpanded = function () { return this.gridOptions.groupDefaultExpanded; }; GridOptionsWrapper.prototype.getMaxConcurrentDatasourceRequests = function () { return this.gridOptions.maxConcurrentDatasourceRequests; }; GridOptionsWrapper.prototype.getMaxBlocksInCache = function () { return this.gridOptions.maxBlocksInCache; }; GridOptionsWrapper.prototype.getCacheOverflowSize = function () { return this.gridOptions.cacheOverflowSize; }; GridOptionsWrapper.prototype.getPaginationPageSize = function () { return this.gridOptions.paginationPageSize; }; GridOptionsWrapper.prototype.getCacheBlockSize = function () { return this.gridOptions.cacheBlockSize; }; GridOptionsWrapper.prototype.getInfiniteInitialRowCount = function () { return this.gridOptions.infiniteInitialRowCount; }; GridOptionsWrapper.prototype.isPurgeClosedRowNodes = function () { return isTrue(this.gridOptions.purgeClosedRowNodes); }; GridOptionsWrapper.prototype.isSuppressPaginationPanel = function () { return isTrue(this.gridOptions.suppressPaginationPanel); }; GridOptionsWrapper.prototype.getRowData = function () { return this.gridOptions.rowData; }; GridOptionsWrapper.prototype.isGroupUseEntireRow = function () { return isTrue(this.gridOptions.groupUseEntireRow); }; GridOptionsWrapper.prototype.isEnableRtl = function () { return isTrue(this.gridOptions.enableRtl); }; GridOptionsWrapper.prototype.getAutoGroupColumnDef = function () { return this.gridOptions.autoGroupColumnDef; }; GridOptionsWrapper.prototype.isGroupSuppressRow = function () { return isTrue(this.gridOptions.groupSuppressRow); }; GridOptionsWrapper.prototype.getRowGroupPanelShow = function () { return this.gridOptions.rowGroupPanelShow; }; GridOptionsWrapper.prototype.getPivotPanelShow = function () { return this.gridOptions.pivotPanelShow; }; GridOptionsWrapper.prototype.isAngularCompileRows = function () { return isTrue(this.gridOptions.angularCompileRows); }; GridOptionsWrapper.prototype.isAngularCompileFilters = function () { return isTrue(this.gridOptions.angularCompileFilters); }; GridOptionsWrapper.prototype.isAngularCompileHeaders = function () { return isTrue(this.gridOptions.angularCompileHeaders); }; GridOptionsWrapper.prototype.isDebug = function () { return isTrue(this.gridOptions.debug); }; GridOptionsWrapper.prototype.getColumnDefs = function () { return this.gridOptions.columnDefs; }; GridOptionsWrapper.prototype.getColumnTypes = function () { return this.gridOptions.columnTypes; }; GridOptionsWrapper.prototype.getDatasource = function () { return this.gridOptions.datasource; }; GridOptionsWrapper.prototype.getViewportDatasource = function () { return this.gridOptions.viewportDatasource; }; GridOptionsWrapper.prototype.getEnterpriseDatasource = function () { return this.gridOptions.enterpriseDatasource; }; GridOptionsWrapper.prototype.isEnableSorting = function () { return isTrue(this.gridOptions.enableSorting) || isTrue(this.gridOptions.enableServerSideSorting); }; GridOptionsWrapper.prototype.isAccentedSort = function () { return isTrue(this.gridOptions.accentedSort); }; GridOptionsWrapper.prototype.isEnableCellExpressions = function () { return isTrue(this.gridOptions.enableCellExpressions); }; GridOptionsWrapper.prototype.isEnableGroupEdit = function () { return isTrue(this.gridOptions.enableGroupEdit); }; GridOptionsWrapper.prototype.isSuppressMiddleClickScrolls = function () { return isTrue(this.gridOptions.suppressMiddleClickScrolls); }; GridOptionsWrapper.prototype.isSuppressPreventDefaultOnMouseWheel = function () { return isTrue(this.gridOptions.suppressPreventDefaultOnMouseWheel); }; GridOptionsWrapper.prototype.isSuppressColumnVirtualisation = function () { return isTrue(this.gridOptions.suppressColumnVirtualisation); }; GridOptionsWrapper.prototype.isSuppressContextMenu = function () { return isTrue(this.gridOptions.suppressContextMenu); }; GridOptionsWrapper.prototype.isAllowContextMenuWithControlKey = function () { return isTrue(this.gridOptions.allowContextMenuWithControlKey); }; GridOptionsWrapper.prototype.isSuppressCopyRowsToClipboard = function () { return isTrue(this.gridOptions.suppressCopyRowsToClipboard); }; GridOptionsWrapper.prototype.isEnableFilter = function () { return isTrue(this.gridOptions.enableFilter) || isTrue(this.gridOptions.enableServerSideFilter); }; GridOptionsWrapper.prototype.isPagination = function () { return isTrue(this.gridOptions.pagination); }; // these are deprecated, should remove them when we take out server side pagination GridOptionsWrapper.prototype.isEnableServerSideFilter = function () { return this.gridOptions.enableServerSideFilter; }; GridOptionsWrapper.prototype.isEnableServerSideSorting = function () { return isTrue(this.gridOptions.enableServerSideSorting); }; GridOptionsWrapper.prototype.isSuppressMovableColumns = function () { return isTrue(this.gridOptions.suppressMovableColumns); }; GridOptionsWrapper.prototype.isAnimateRows = function () { // never allow animating if enforcing the row order if (this.isEnsureDomOrder()) { return false; } return isTrue(this.gridOptions.animateRows); }; GridOptionsWrapper.prototype.isSuppressColumnMoveAnimation = function () { return isTrue(this.gridOptions.suppressColumnMoveAnimation); }; GridOptionsWrapper.prototype.isSuppressAggFuncInHeader = function () { return isTrue(this.gridOptions.suppressAggFuncInHeader); }; GridOptionsWrapper.prototype.isSuppressAggAtRootLevel = function () { return isTrue(this.gridOptions.suppressAggAtRootLevel); }; GridOptionsWrapper.prototype.isEnableRangeSelection = function () { return isTrue(this.gridOptions.enableRangeSelection); }; GridOptionsWrapper.prototype.isSuppressMultiRangeSelection = function () { return isTrue(this.gridOptions.suppressMultiRangeSelection); }; GridOptionsWrapper.prototype.isPaginationAutoPageSize = function () { return isTrue(this.gridOptions.paginationAutoPageSize); }; GridOptionsWrapper.prototype.isRememberGroupStateWhenNewData = function () { return isTrue(this.gridOptions.rememberGroupStateWhenNewData); }; GridOptionsWrapper.prototype.getIcons = function () { return this.gridOptions.icons; }; GridOptionsWrapper.prototype.getAggFuncs = function () { return this.gridOptions.aggFuncs; }; GridOptionsWrapper.prototype.getSortingOrder = function () { return this.gridOptions.sortingOrder; }; GridOptionsWrapper.prototype.getAlignedGrids = function () { return this.gridOptions.alignedGrids; }; GridOptionsWrapper.prototype.isMasterDetail = function () { var _this = this; var usingMasterDetail = isTrue(this.gridOptions.masterDetail); utils_1.Utils.doOnce(function () { if (usingMasterDetail && !_this.enterprise) { console.warn('ag-grid: Master Detail is an Enterprise feature of ag-Grid.'); } }, 'MasterDetailEnterpriseCheck'); return usingMasterDetail && this.enterprise; }; GridOptionsWrapper.prototype.getIsRowMasterFunc = function () { return this.gridOptions.isRowMaster; }; GridOptionsWrapper.prototype.getGroupRowRendererParams = function () { return this.gridOptions.groupRowRendererParams; }; GridOptionsWrapper.prototype.getOverlayLoadingTemplate = function () { return this.gridOptions.overlayLoadingTemplate; }; GridOptionsWrapper.prototype.getOverlayNoRowsTemplate = function () { return this.gridOptions.overlayNoRowsTemplate; }; GridOptionsWrapper.prototype.isSuppressAutoSize = function () { return isTrue(this.gridOptions.suppressAutoSize); }; GridOptionsWrapper.prototype.isSuppressParentsInRowNodes = function () { return isTrue(this.gridOptions.suppressParentsInRowNodes); }; GridOptionsWrapper.prototype.isEnableStatusBar = function () { return isTrue(this.gridOptions.enableStatusBar); }; GridOptionsWrapper.prototype.isAlwaysShowStatusBar = function () { return isTrue(this.gridOptions.alwaysShowStatusBar); }; GridOptionsWrapper.prototype.isFunctionsReadOnly = function () { return isTrue(this.gridOptions.functionsReadOnly); }; GridOptionsWrapper.prototype.isFloatingFilter = function () { return this.gridOptions.floatingFilter; }; // public isFloatingFilter(): boolean { return true; } GridOptionsWrapper.prototype.getDefaultColDef = function () { return this.gridOptions.defaultColDef; }; GridOptionsWrapper.prototype.getDefaultColGroupDef = function () { return this.gridOptions.defaultColGroupDef; }; GridOptionsWrapper.prototype.getDefaultExportParams = function () { return this.gridOptions.defaultExportParams; }; GridOptionsWrapper.prototype.isSuppressCsvExport = function () { return isTrue(this.gridOptions.suppressCsvExport); }; GridOptionsWrapper.prototype.isSuppressExcelExport = function () { return isTrue(this.gridOptions.suppressExcelExport); }; GridOptionsWrapper.prototype.getNodeChildDetailsFunc = function () { return this.gridOptions.getNodeChildDetails; }; GridOptionsWrapper.prototype.getDataPathFunc = function () { return this.gridOptions.getDataPath; }; // public getIsGroupFunc(): ((dataItem: any) => boolean) { return this.gridOptions.isGroup } GridOptionsWrapper.prototype.getGroupRowAggNodesFunc = function () { return this.gridOptions.groupRowAggNodes; }; GridOptionsWrapper.prototype.getContextMenuItemsFunc = function () { return this.gridOptions.getContextMenuItems; }; GridOptionsWrapper.prototype.getMainMenuItemsFunc = function () { return this.gridOptions.getMainMenuItems; }; GridOptionsWrapper.prototype.getRowNodeIdFunc = function () { return this.gridOptions.getRowNodeId; }; GridOptionsWrapper.prototype.getNavigateToNextCellFunc = function () { return this.gridOptions.navigateToNextCell; }; GridOptionsWrapper.prototype.getTabToNextCellFunc = function () { return this.gridOptions.tabToNextCell; }; GridOptionsWrapper.prototype.isTreeData = function () { return isTrue(this.gridOptions.treeData); }; GridOptionsWrapper.prototype.isValueCache = function () { return isTrue(this.gridOptions.valueCache); }; GridOptionsWrapper.prototype.isValueCacheNeverExpires = function () { return isTrue(this.gridOptions.valueCacheNeverExpires); }; GridOptionsWrapper.prototype.isAggregateOnlyChangedColumns = function () { return isTrue(this.gridOptions.aggregateOnlyChangedColumns); }; GridOptionsWrapper.prototype.getProcessSecondaryColDefFunc = function () { return this.gridOptions.processSecondaryColDef; }; GridOptionsWrapper.prototype.getProcessSecondaryColGroupDefFunc = function () { return this.gridOptions.processSecondaryColGroupDef; }; GridOptionsWrapper.prototype.getSendToClipboardFunc = function () { return this.gridOptions.sendToClipboard; }; GridOptionsWrapper.prototype.getProcessRowPostCreateFunc = function () { return this.gridOptions.processRowPostCreate; }; GridOptionsWrapper.prototype.getProcessCellForClipboardFunc = function () { return this.gridOptions.processCellForClipboard; }; GridOptionsWrapper.prototype.getProcessCellFromClipboardFunc = function () { return this.gridOptions.processCellFromClipboard; }; GridOptionsWrapper.prototype.getViewportRowModelPageSize = function () { return oneOrGreater(this.gridOptions.viewportRowModelPageSize, DEFAULT_VIEWPORT_ROW_MODEL_PAGE_SIZE); }; GridOptionsWrapper.prototype.getViewportRowModelBufferSize = function () { return zeroOrGreater(this.gridOptions.viewportRowModelBufferSize, DEFAULT_VIEWPORT_ROW_MODEL_BUFFER_SIZE); }; // public getCellRenderers(): {[key: string]: {new(): ICellRenderer} | ICellRendererFunc} { return this.gridOptions.cellRenderers; } // public getCellEditors(): {[key: string]: {new(): ICellEditor}} { return this.gridOptions.cellEditors; } GridOptionsWrapper.prototype.getClipboardDeliminator = function () { return utils_1.Utils.exists(this.gridOptions.clipboardDeliminator) ? this.gridOptions.clipboardDeliminator : '\t'; }; GridOptionsWrapper.prototype.setProperty = function (key, value) { var gridOptionsNoType = this.gridOptions; var previousValue = gridOptionsNoType[key]; if (previousValue !== value) { gridOptionsNoType[key] = value; var event_1 = { type: key, currentValue: value, previousValue: previousValue }; this.propertyEventService.dispatchEvent(event_1); } }; GridOptionsWrapper.prototype.addEventListener = function (key, listener) { this.propertyEventService.addEventListener(key, listener); }; GridOptionsWrapper.prototype.removeEventListener = function (key, listener) { this.propertyEventService.removeEventListener(key, listener); }; GridOptionsWrapper.prototype.getAutoSizePadding = function () { return this.gridOptions.autoSizePadding > 0 ? this.gridOptions.autoSizePadding : 0; }; // properties GridOptionsWrapper.prototype.getHeaderHeight = function () { if (typeof this.gridOptions.headerHeight === 'number') { return this.gridOptions.headerHeight; } else { return this.specialForNewMaterial(25, 'headerHeight'); } }; GridOptionsWrapper.prototype.getFloatingFiltersHeight = function () { if (typeof this.gridOptions.floatingFiltersHeight === 'number') { return this.gridOptions.floatingFiltersHeight; } else { return this.specialForNewMaterial(25, 'headerHeight'); } }; GridOptionsWrapper.prototype.getGroupHeaderHeight = function () { if (typeof this.gridOptions.groupHeaderHeight === 'number') { return this.gridOptions.groupHeaderHeight; } else { return this.getHeaderHeight(); } }; GridOptionsWrapper.prototype.getPivotHeaderHeight = function () { if (typeof this.gridOptions.pivotHeaderHeight === 'number') { return this.gridOptions.pivotHeaderHeight; } else { return this.getHeaderHeight(); } }; GridOptionsWrapper.prototype.getPivotGroupHeaderHeight = function () { if (typeof this.gridOptions.pivotGroupHeaderHeight === 'number') { return this.gridOptions.pivotGroupHeaderHeight; } else { return this.getGroupHeaderHeight(); } }; GridOptionsWrapper.prototype.isExternalFilterPresent = function () { if (typeof this.gridOptions.isExternalFilterPresent === 'function') { return this.gridOptions.isExternalFilterPresent(); } else { return false; } }; GridOptionsWrapper.prototype.doesExternalFilterPass = function (node) { if (typeof this.gridOptions.doesExternalFilterPass === 'function') { return this.gridOptions.doesExternalFilterPass(node); } else { return false; } }; GridOptionsWrapper.prototype.getDocument = function () { // if user is providing document, we use the users one, // otherwise we use the document on the global namespace. var result; if (utils_1.Utils.exists(this.gridOptions.getDocument)) { result = this.gridOptions.getDocument(); } if (utils_1.Utils.exists(result)) { return result; } else { return document; } }; GridOptionsWrapper.prototype.getLayoutInterval = function () { if (typeof this.gridOptions.layoutInterval === 'number') { return this.gridOptions.layoutInterval; } else { return constants_1.Constants.LAYOUT_INTERVAL; } }; GridOptionsWrapper.prototype.getMinColWidth = function () { if (this.gridOptions.minColWidth > GridOptionsWrapper_1.MIN_COL_WIDTH) { return this.gridOptions.minColWidth; } else { return GridOptionsWrapper_1.MIN_COL_WIDTH; } }; GridOptionsWrapper.prototype.getMaxColWidth = function () { if (this.gridOptions.maxColWidth > GridOptionsWrapper_1.MIN_COL_WIDTH) { return this.gridOptions.maxColWidth; } else { return null; } }; GridOptionsWrapper.prototype.getColWidth = function () { if (typeof this.gridOptions.colWidth !== 'number' || this.gridOptions.colWidth < GridOptionsWrapper_1.MIN_COL_WIDTH) { return 200; } else { return this.gridOptions.colWidth; } }; GridOptionsWrapper.prototype.getRowBuffer = function () { if (typeof this.gridOptions.rowBuffer === 'number') { if (this.gridOptions.rowBuffer < 0) { console.warn('ag-Grid: rowBuffer should not be negative'); } return this.gridOptions.rowBuffer; } else { return constants_1.Constants.ROW_BUFFER_SIZE; } }; // the user might be using some non-standard scrollbar, eg a scrollbar that has zero // width and overlays (like the Safari scrollbar, but presented in Chrome). so we // allow the user to provide the scroll width before we work it out. GridOptionsWrapper.prototype.getScrollbarWidth = function () { var scrollbarWidth = this.gridOptions.scrollbarWidth; if (typeof scrollbarWidth !== 'number' || scrollbarWidth < 0) { scrollbarWidth = utils_1.Utils.getScrollbarWidth(); } return scrollbarWidth; }; GridOptionsWrapper.prototype.checkForDeprecated = function () { // casting to generic object, so typescript compiles even though // we are looking for attributes that don't exist var options = this.gridOptions; if (options.suppressUnSort) { console.warn('ag-grid: as of v1.12.4 suppressUnSort is not used. Please use sortingOrder instead.'); } if (options.suppressDescSort) { console.warn('ag-grid: as of v1.12.4 suppressDescSort is not used. Please use sortingOrder instead.'); } if (options.groupAggFields) { console.warn('ag-grid: as of v3 groupAggFields is not used. Please add appropriate agg fields to your columns.'); } if (options.groupHidePivotColumns) { console.warn('ag-grid: as of v3 groupHidePivotColumns is not used as pivot columns are now called rowGroup columns. Please refer to the documentation'); } if (options.groupKeys) { 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'); } if (typeof options.groupDefaultExpanded === 'boolean') { console.warn('ag-grid: groupDefaultExpanded can no longer be boolean. for groupDefaultExpanded=true, use groupDefaultExpanded=9999 instead, to expand all the groups'); } if (options.onRowDeselected || options.rowDeselected) { console.warn('ag-grid: since version 3.4 event rowDeselected no longer exists, please check the docs'); } if (options.rowsAlreadyGrouped) { console.warn('ag-grid: since version 3.4 rowsAlreadyGrouped no longer exists, please use getNodeChildDetails() instead'); } if (options.groupAggFunction) { console.warn('ag-grid: since version 4.3.x groupAggFunction is now called groupRowAggNodes'); } if (options.checkboxSelection) { console.warn('ag-grid: since version 8.0.x checkboxSelection is not supported as a grid option. ' + 'If you want this on all columns, use defaultColDef instead and set it there'); } if (options.paginationInitialRowCount) { console.warn('ag-grid: since version 9.0.x paginationInitialRowCount is now called infiniteInitialRowCount'); } if (options.infinitePageSize) { console.warn('ag-grid: since version 9.0.x infinitePageSize is now called cacheBlockSize'); } if (options.infiniteBlockSize) { console.warn('ag-grid: since version 10.0.x infiniteBlockSize is now called cacheBlockSize'); } if (options.maxPagesInCache) { console.warn('ag-grid: since version 10.0.x maxPagesInCache is now called maxBlocksInCache'); } if (options.paginationOverflowSize) { console.warn('ag-grid: since version 10.0.x paginationOverflowSize is now called cacheOverflowSize'); } if (options.forPrint) { console.warn('ag-grid: since version 10.1.x, use property domLayout="forPrint" instead of forPrint=true'); } if (options.suppressMenuFilterPanel) { console.warn("ag-grid: since version 11.0.x, use property colDef.menuTabs=['generalMenuTab','columnsMenuTab'] instead of suppressMenuFilterPanel=true"); } if (options.suppressMenuMainPanel) { console.warn("ag-grid: since version 11.0.x, use property colDef.menuTabs=['filterMenuTab','columnsMenuTab'] instead of suppressMenuMainPanel=true"); } if (options.suppressMenuColumnPanel) { console.warn("ag-grid: since version 11.0.x, use property colDef.menuTabs=['generalMenuTab','filterMenuTab'] instead of suppressMenuColumnPanel=true"); } if (options.suppressUseColIdForGroups) { 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"); } if (options.groupColumnDef) { console.warn("ag-grid: since version 11.0.x, groupColumnDef has been renamed, this property is now called autoGroupColumnDef. Please change your configuration accordingly"); } if (options.slaveGrids) { console.warn("ag-grid: since version 12.x, slaveGrids has been renamed, this property is now called alignedGrids. Please change your configuration accordingly"); } if (options.floatingTopRowData) { console.warn("ag-grid: since version 12.x, floatingTopRowData is now called pinnedTopRowData"); } if (options.floatingBottomRowData) { console.warn("ag-grid: since version 12.x, floatingBottomRowData is now called pinnedBottomRowData"); } if (options.paginationStartPage) { console.warn("ag-grid: since version 12.x, paginationStartPage is gone, please call api.paginationGoToPage(" + options.paginationStartPage + ") instead."); } if (options.getHeaderCellTemplate) { console.warn("ag-grid: since version 15.x, getHeaderCellTemplate is gone, please check the header documentation on how to set header templates."); } if (options.headerCellTemplate) { console.warn("ag-grid: since version 15.x, headerCellTemplate is gone, please check the header documentation on how to set header templates."); } if (options.headerCellRenderer) { console.warn("ag-grid: since version 15.x, headerCellRenderer is gone, please check the header documentation on how to set header templates."); } }; GridOptionsWrapper.prototype.getLocaleTextFunc = function () { if (this.gridOptions.localeTextFunc) { return this.gridOptions.localeTextFunc; } var that = this; return function (key, defaultValue) { var localeText = that.gridOptions.localeText; if (localeText && localeText[key]) { return localeText[key]; } else { return defaultValue; } }; }; // responsible for calling the onXXX functions on gridOptions GridOptionsWrapper.prototype.globalEventHandler = function (eventName, event) { if (eventName === 'columnVisible') { console.log('columnVisible'); } var callbackMethodName = componentUtil_1.ComponentUtil.getCallbackForEvent(eventName); if (typeof this.gridOptions[callbackMethodName] === 'function') { this.gridOptions[callbackMethodName](event); } }; // we don't allow dynamic row height for virtual paging GridOptionsWrapper.prototype.getRowHeightAsNumber = function () { var rowHeight = this.gridOptions.rowHeight; if (utils_1.Utils.missing(rowHeight)) { return this.getDefaultRowHeight(); } else if (this.isNumeric(this.gridOptions.rowHeight)) { return this.gridOptions.rowHeight; } else { console.warn('ag-Grid row height must be a number if not using standard row model'); return this.getDefaultRowHeight(); } }; GridOptionsWrapper.prototype.getRowHeightForNode = function (rowNode) { // check the function first, in case use set both function and // number, when using virtual pagination then function can be // used for pinned rows and the number for the body rows. if (typeof this.gridOptions.getRowHeight === 'function') { var params = { node: rowNode, data: rowNode.data, api: this.gridOptions.api, context: this.gridOptions.context }; return this.gridOptions.getRowHeight(params); } else if (rowNode.detail && this.isMasterDetail()) { if (this.isNumeric(this.gridOptions.detailRowHeight)) { return this.gridOptions.detailRowHeight; } else { return DEFAULT_DETAIL_ROW_HEIGHT; } } else if (this.isNumeric(this.gridOptions.rowHeight)) { return this.gridOptions.rowHeight; } else { return this.getDefaultRowHeight(); } }; GridOptionsWrapper.prototype.isDynamicRowHeight = function () { return typeof this.gridOptions.getRowHeight === 'function'; }; GridOptionsWrapper.prototype.getVirtualItemHeight = function () { return this.specialForNewMaterial(20, 'virtualItemHeight'); }; GridOptionsWrapper.prototype.isNumeric = function (value) { return !isNaN(value) && typeof value === 'number'; }; // Material data table has strict guidelines about whitespace, and these values are different than the ones // ag-grid uses by default. We override the default ones for the sake of making it better out of the box GridOptionsWrapper.prototype.specialForNewMaterial = function (defaultValue, sassVariableName) { var theme = this.environment.getTheme(); if (theme.indexOf('ag-theme') === 0) { return this.environment.getSassVariable(theme, sassVariableName); } else { return defaultValue; } }; GridOptionsWrapper.prototype.getDefaultRowHeight = function () { return this.specialForNewMaterial(DEFAULT_ROW_HEIGHT, 'rowHeight'); }; GridOptionsWrapper.MIN_COL_WIDTH = 10; GridOptionsWrapper.PROP_HEADER_HEIGHT = 'headerHeight'; GridOptionsWrapper.PROP_GROUP_REMOVE_SINGLE_CHILDREN = 'groupRemoveSingleChildren'; GridOptionsWrapper.PROP_GROUP_REMOVE_LOWEST_SINGLE_CHILDREN = 'groupRemoveLowestSingleChildren'; GridOptionsWrapper.PROP_PIVOT_HEADER_HEIGHT = 'pivotHeaderHeight'; GridOptionsWrapper.PROP_GROUP_HEADER_HEIGHT = 'groupHeaderHeight'; GridOptionsWrapper.PROP_PIVOT_GROUP_HEADER_HEIGHT = 'pivotGroupHeaderHeight'; GridOptionsWrapper.PROP_FLOATING_FILTERS_HEIGHT = 'floatingFiltersHeight'; GridOptionsWrapper.PROP_SUPPRESS_ROW_DRAG = 'suppressRowDrag'; GridOptionsWrapper.PROP_POPUP_PARENT = 'popupParent'; __decorate([ context_1.Autowired('gridOptions'), __metadata("design:type", Object) ], GridOptionsWrapper.prototype, "gridOptions", void 0); __decorate([ context_1.Autowired('columnController'), __metadata("design:type", columnController_1.ColumnController) ], GridOptionsWrapper.prototype, "columnController", void 0); __decorate([ context_1.Autowired('eventService'), __metadata("design:type", eventService_1.EventService) ], GridOptionsWrapper.prototype, "eventService", void 0); __decorate([ context_1.Autowired('enterprise'), __metadata("design:type", Boolean) ], GridOptionsWrapper.prototype, "enterprise", void 0); __decorate([ context_1.Autowired('frameworkFactory'), __metadata("design:type", Object) ], GridOptionsWrapper.prototype, "frameworkFactory", void 0); __decorate([ context_1.Autowired('gridApi'), __metadata("design:type", gridApi_1.GridApi) ], GridOptionsWrapper.prototype, "gridApi", void 0); __decorate([ context_1.Autowired('columnApi'), __metadata("design:type", columnApi_1.ColumnApi) ], GridOptionsWrapper.prototype, "columnApi", void 0); __decorate([ context_1.Autowired('environment'), __metadata("design:type", environment_1.Environment) ], GridOptionsWrapper.prototype, "environment", void 0); __decorate([ __param(0, context_1.Qualifier('gridApi')), __param(1, context_1.Qualifier('columnApi')), __metadata("design:type", Function), __metadata("design:paramtypes", [gridApi_1.GridApi, columnApi_1.ColumnApi]), __metadata("design:returntype", void 0) ], GridOptionsWrapper.prototype, "agWire", null); __decorate([ context_1.PreDestroy, __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", void 0) ], GridOptionsWrapper.prototype, "destroy", null); __decorate([ context_1.PostConstruct, __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", void 0) ], GridOptionsWrapper.prototype, "init", null); GridOptionsWrapper = GridOptionsWrapper_1 = __decorate([ context_1.Bean('gridOptionsWrapper') ], GridOptionsWrapper); return GridOptionsWrapper; var GridOptionsWrapper_1; }()); exports.GridOptionsWrapper = GridOptionsWrapper; /***/ }), /* 3 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v16.0.0 * @link http://www.ag-grid.com/ * @license MIT */ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 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; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; var __param = (this && this.__param) || function (paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } }; Object.defineProperty(exports, "__esModule", { value: true }); var logger_1 = __webpack_require__(12); var utils_1 = __webpack_require__(1); var context_1 = __webpack_require__(0); var context_2 = __webpack_require__(0); var gridOptionsWrapper_1 = __webpack_require__(2); var EventService = (function () { function EventService() { this.allSyncListeners = {}; this.allAsyncListeners = {}; this.globalSyncListeners = []; this.globalAsyncListeners = []; this.asyncFunctionsQueue = []; this.scheduled = false; } EventService_1 = EventService; // because this class is used both inside the context and outside the context, we do not // use autowired attributes, as that would be confusing, as sometimes the attributes // would be wired, and sometimes not. // // the global event servers used by ag-Grid is autowired by the context once, and this // setBeans method gets called once. // // the times when this class is used outside of the context (eg RowNode has an instance of this // class) then it is not a bean, and this setBeans method is not called. EventService.prototype.setBeans = function (loggerFactory, gridOptionsWrapper, globalEventListener) { if (globalEventListener === void 0) { globalEventListener = null; } this.logger = loggerFactory.create('EventService'); if (globalEventListener) { var async = gridOptionsWrapper.useAsyncEvents(); this.addGlobalListener(globalEventListener, async); } }; EventService.prototype.getListenerList = function (eventType, async) { var listenerMap = async ? this.allAsyncListeners : this.allSyncListeners; var listenerList = listenerMap[eventType]; if (!listenerList) { listenerList = []; listenerMap[eventType] = listenerList; } return listenerList; }; EventService.prototype.addEventListener = function (eventType, listener, async) { if (async === void 0) { async = false; } if (!this.assertNotDeprecated(eventType)) return; var listenerList = this.getListenerList(eventType, async); if (listenerList.indexOf(listener) < 0) { listenerList.push(listener); } }; EventService.prototype.assertNotDeprecated = function (eventType) { if (eventType === 'floatingRowDataChanged') { console.warn('ag-Grid: floatingRowDataChanged is now called pinnedRowDataChanged'); return false; } else { return true; } }; // for some events, it's important that the model gets to hear about them before the view, // as the model may need to update before the view works on the info. if you register // via this method, you get notified before the view parts EventService.prototype.addModalPriorityEventListener = function (eventType, listener, async) { if (async === void 0) { async = false; } if (!this.assertNotDeprecated(eventType)) return; this.addEventListener(eventType + EventService_1.PRIORITY, listener, async); }; EventService.prototype.addGlobalListener = function (listener, async) { if (async === void 0) { async = false; } if (async) { this.globalAsyncListeners.push(listener); } else { this.globalSyncListeners.push(listener); } }; EventService.prototype.removeEventListener = function (eventType, listener, async) { if (async === void 0) { async = false; } var listenerList = this.getListenerList(eventType, async); utils_1.Utils.removeFromArray(listenerList, listener); }; EventService.prototype.removeGlobalListener = function (listener, async) { if (async === void 0) { async = false; } if (async) { utils_1.Utils.removeFromArray(this.globalAsyncListeners, listener); } else { utils_1.Utils.removeFromArray(this.globalSyncListeners, listener); } }; // why do we pass the type here? the type is in ColumnChangeEvent, so unless the // type is not in other types of events??? EventService.prototype.dispatchEvent = function (event) { // console.log(`dispatching ${eventType}: ${event}`); this.dispatchToListeners(event, true); this.dispatchToListeners(event, false); }; EventService.prototype.dispatchToListeners = function (event, async) { var _this = this; var globalListeners = async ? this.globalAsyncListeners : this.globalSyncListeners; var eventType = event.type; // this allows the columnController to get events before anyone else var p1ListenerList = this.getListenerList(eventType + EventService_1.PRIORITY, async); utils_1.Utils.forEachSnapshotFirst(p1ListenerList, function (listener) { if (async) { _this.dispatchAsync(function () { return listener(event); }); } else { listener(event); } }); var listenerList = this.getListenerList(eventType, async); utils_1.Utils.forEachSnapshotFirst(listenerList, function (listener) { if (async) { _this.dispatchAsync(function () { return listener(event); }); } else { listener(event); } }); utils_1.Utils.forEachSnapshotFirst(globalListeners, function (listener) { if (async) { _this.dispatchAsync(function () { return listener(eventType, event); }); } else { listener(eventType, event); } }); }; // this gets called inside the grid's thread, for each event that it // wants to set async. the grid then batches the events into one setTimeout() // because setTimeout() is an expensive operation. ideally we would have // each event in it's own setTimeout(), but we batch for performance. EventService.prototype.dispatchAsync = function (func) { // add to the queue for executing later in the next VM turn this.asyncFunctionsQueue.push(func); // check if timeout is already scheduled. the first time the grid calls // this within it's thread turn, this should be false, so it will schedule // the 'flush queue' method the first time it comes here. then the flag is // set to 'true' so it will know it's already scheduled for subsequent calls. if (!this.scheduled) { // if not scheduled, schedule one setTimeout(this.flushAsyncQueue.bind(this), 0); // mark that it is scheduled this.scheduled = true; } }; // this happens in the next VM turn only, and empties the queue of events EventService.prototype.flushAsyncQueue = function () { this.scheduled = false; // we take a copy, because the event listener could be using // the grid, which would cause more events, which would be potentially // added to the queue, so safe to take a copy, the new events will // get executed in a later VM turn rather than risk updating the // queue as we are flushing it. var queueCopy = this.asyncFunctionsQueue.slice(); this.asyncFunctionsQueue = []; // execute the queue queueCopy.forEach(function (func) { return func(); }); }; // this is an old idea niall had, should really take it out, was to do with ordering who gets to process // events first, to give model and service objects preference over the view EventService.PRIORITY = '-P1'; __decorate([ __param(0, context_2.Qualifier('loggerFactory')), __param(1, context_2.Qualifier('gridOptionsWrapper')), __param(2, context_2.Qualifier('globalEventListener')), __metadata("design:type", Function), __metadata("design:paramtypes", [logger_1.LoggerFactory, gridOptionsWrapper_1.GridOptionsWrapper, Function]), __metadata("design:returntype", void 0) ], EventService.prototype, "setBeans", null); EventService = EventService_1 = __decorate([ context_1.Bean('eventService') ], EventService); return EventService; var EventService_1; }()); exports.EventService = EventService; /***/ }), /* 4 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v16.0.0 * @link http://www.ag-grid.com/ * @license MIT */ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 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; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; var __param = (this && this.__param) || function (paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } }; Object.defineProperty(exports, "__esModule", { value: true }); var utils_1 = __webpack_require__(1); var columnGroup_1 = __webpack_require__(28); var column_1 = __webpack_require__(10); var gridOptionsWrapper_1 = __webpack_require__(2); var expressionService_1 = __webpack_require__(22); var balancedColumnTreeBuilder_1 = __webpack_require__(44); var displayedGroupCreator_1 = __webpack_require__(46); var autoWidthCalculator_1 = __webpack_require__(64); var eventService_1 = __webpack_require__(3); var columnUtils_1 = __webpack_require__(32); var logger_1 = __webpack_require__(12); var events_1 = __webpack_require__(5); var originalColumnGroup_1 = __webpack_require__(33); var groupInstanceIdCreator_1 = __webpack_require__(83); var context_1 = __webpack_require__(0); var gridPanel_1 = __webpack_require__(11); var columnAnimationService_1 = __webpack_require__(70); var autoGroupColService_1 = __webpack_require__(102); var valueCache_1 = __webpack_require__(34); var gridApi_1 = __webpack_require__(6); var columnApi_1 = __webpack_require__(7); var ColumnController = (function () { function ColumnController() { // header row count, based on user provided columns this.primaryHeaderRowCount = 0; this.secondaryHeaderRowCount = 0; this.secondaryColumnsPresent = false; // header row count, either above, or based on pivoting if we are pivoting this.gridHeaderRowCount = 0; // these are the lists used by the rowRenderer to render nodes. almost the leaf nodes of the above // displayed trees, however it also takes into account if the groups are open or not. this.displayedLeftColumns = []; this.displayedRightColumns = []; this.displayedCenterColumns = []; // all three lists above combined this.allDisplayedColumns = []; // same as above, except trimmed down to only columns within the viewport this.allDisplayedVirtualColumns = []; this.allDisplayedCenterVirtualColumns = []; this.rowGroupColumns = []; this.valueColumns = []; this.pivotColumns = []; this.ready = false; this.autoGroupsNeedBuilding = false; this.pivotMode = false; this.bodyWidth = 0; this.leftWidth = 0; this.rightWidth = 0; this.bodyWidthDirty = true; } ColumnController.prototype.init = function () { var pivotMode = this.gridOptionsWrapper.isPivotMode(); if (this.isPivotSettingAllowed(pivotMode)) { this.pivotMode = pivotMode; } this.usingTreeData = this.gridOptionsWrapper.isTreeData(); }; ColumnController.prototype.setVirtualViewportLeftAndRight = function () { if (this.gridOptionsWrapper.isEnableRtl()) { this.viewportLeft = this.bodyWidth - this.scrollPosition - this.scrollWidth; this.viewportRight = this.bodyWidth - this.scrollPosition; } else { this.viewportLeft = this.scrollPosition; this.viewportRight = this.scrollWidth + this.scrollPosition; } }; // used by clipboard service, to know what columns to paste into ColumnController.prototype.getDisplayedColumnsStartingAt = function (column) { var currentColumn = column; var result = []; while (utils_1.Utils.exists(currentColumn)) { result.push(currentColumn); currentColumn = this.getDisplayedColAfter(currentColumn); } return result; }; // checks what columns are currently displayed due to column virtualisation. fires an event // if the list of columns has changed. // + setColumnWidth(), setVirtualViewportPosition(), setColumnDefs(), sizeColumnsToFit() ColumnController.prototype.checkDisplayedVirtualColumns = function () { // check displayCenterColumnTree exists first, as it won't exist when grid is initialising if (utils_1.Utils.exists(this.displayedCenterColumns)) { var hashBefore = this.allDisplayedVirtualColumns.map(function (column) { return column.getId(); }).join('#'); this.updateVirtualSets(); var hashAfter = this.allDisplayedVirtualColumns.map(function (column) { return column.getId(); }).join('#'); if (hashBefore !== hashAfter) { var event_1 = { type: events_1.Events.EVENT_VIRTUAL_COLUMNS_CHANGED, api: this.gridApi, columnApi: this.columnApi }; this.eventService.dispatchEvent(event_1); } } }; ColumnController.prototype.setVirtualViewportPosition = function (scrollWidth, scrollPosition) { if (scrollWidth !== this.scrollWidth || scrollPosition !== this.scrollPosition || this.bodyWidthDirty) { this.scrollWidth = scrollWidth; this.scrollPosition = scrollPosition; // we need to call setVirtualViewportLeftAndRight() at least once after the body width changes, // as the viewport can stay the same, but in RTL, if body width changes, we need to work out the // virtual columns again this.bodyWidthDirty = true; this.setVirtualViewportLeftAndRight(); if (this.ready) { this.checkDisplayedVirtualColumns(); } } }; ColumnController.prototype.isPivotMode = function () { return this.pivotMode; }; ColumnController.prototype.isPivotSettingAllowed = function (pivot) { if (pivot) { if (this.gridOptionsWrapper.isTreeData()) { console.warn("ag-Grid: Pivot mode not available in conjunction Tree Data i.e. 'gridOptions.treeData: true'"); return false; } else { return true; } } else { return true; } }; ColumnController.prototype.setPivotMode = function (pivotMode, source) { if (source === void 0) { source = "api"; } if (pivotMode === this.pivotMode) { return; } if (!this.isPivotSettingAllowed(this.pivotMode)) { return; } this.pivotMode = pivotMode; this.updateDisplayedColumns(source); var event = { type: events_1.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED, api: this.gridApi, columnApi: this.columnApi }; this.eventService.dispatchEvent(event); }; ColumnController.prototype.getSecondaryPivotColumn = function (pivotKeys, valueColKey) { if (!this.secondaryColumnsPresent) { return null; } var valueColumnToFind = this.getPrimaryColumn(valueColKey); var foundColumn = null; this.secondaryColumns.forEach(function (column) { var thisPivotKeys = column.getColDef().pivotKeys; var pivotValueColumn = column.getColDef().pivotValueColumn; var pivotKeyMatches = utils_1.Utils.compareArrays(thisPivotKeys, pivotKeys); var pivotValueMatches = pivotValueColumn === valueColumnToFind; if (pivotKeyMatches && pivotValueMatches) { foundColumn = column; } }); return foundColumn; }; ColumnController.prototype.setBeans = function (loggerFactory) { this.logger = loggerFactory.create('ColumnController'); }; ColumnController.prototype.setFirstRightAndLastLeftPinned = function (source) { var lastLeft; var firstRight; if (this.gridOptionsWrapper.isEnableRtl()) { lastLeft = this.displayedLeftColumns ? this.displayedLeftColumns[0] : null; firstRight = this.displayedRightColumns ? this.displayedRightColumns[this.displayedRightColumns.length - 1] : null; } else { lastLeft = this.displayedLeftColumns ? this.displayedLeftColumns[this.displayedLeftColumns.length - 1] : null; firstRight = this.displayedRightColumns ? this.displayedRightColumns[0] : null; } this.gridColumns.forEach(function (column) { column.setLastLeftPinned(column === lastLeft, source); column.setFirstRightPinned(column === firstRight, source); }); }; ColumnController.prototype.autoSizeColumns = function (keys, source) { // because of column virtualisation, we can only do this function on columns that are // actually rendered, as non-rendered columns (outside the viewport and not rendered // due to column virtualisation) are not present. this can result in all rendered columns // getting narrowed, which in turn introduces more rendered columns on the RHS which // did not get autosized in the original run, leaving the visible grid with columns on // the LHS sized, but RHS no. so we keep looping through teh visible columns until // no more cols are available (rendered) to be resized var _this = this; if (source === void 0) { source = "api"; } // keep track of which cols we have resized in here var columnsAutosized = []; // initialise with anything except 0 so that while loop executs at least once var changesThisTimeAround = -1; while (changesThisTimeAround !== 0) { changesThisTimeAround = 0; this.actionOnGridColumns(keys, function (column) { // if already autosized, skip it if (columnsAutosized.indexOf(column) >= 0) { return; } // get how wide this col should be var preferredWidth = _this.autoWidthCalculator.getPreferredWidthForColumn(column); // preferredWidth = -1 if this col is not on the screen if (preferredWidth > 0) { var newWidth = _this.normaliseColumnWidth(column, preferredWidth); column.setActualWidth(newWidth, source); columnsAutosized.push(column); changesThisTimeAround++; } return true; }, source); } if (columnsAutosized.length > 0) { var event_2 = { type: events_1.Events.EVENT_COLUMN_RESIZED, columns: columnsAutosized, column: columnsAutosized.length === 1 ? columnsAutosized[0] : null, finished: true, api: this.gridApi, columnApi: this.columnApi, source: "autosizeColumns" }; this.eventService.dispatchEvent(event_2); } }; ColumnController.prototype.autoSizeColumn = function (key, source) { if (source === void 0) { source = "api"; } this.autoSizeColumns([key], source); }; ColumnController.prototype.autoSizeAllColumns = function (source) { if (source === void 0) { source = "api"; } var allDisplayedColumns = this.getAllDisplayedColumns(); this.autoSizeColumns(allDisplayedColumns, source); }; ColumnController.prototype.getColumnsFromTree = function (rootColumns) { var result = []; recursiveFindColumns(rootColumns); return result; function recursiveFindColumns(childColumns) { for (var i = 0; i < childColumns.length; i++) { var child = childColumns[i]; if (child instanceof column_1.Column) { result.push(child); } else if (child instanceof originalColumnGroup_1.OriginalColumnGroup) { recursiveFindColumns(child.getChildren()); } } } }; ColumnController.prototype.getAllDisplayedColumnGroups = function () { if (this.displayedLeftColumnTree && this.displayedRightColumnTree && this.displayedCentreColumnTree) { return this.displayedLeftColumnTree .concat(this.displayedCentreColumnTree) .concat(this.displayedRightColumnTree); } else { return null; } }; // + columnSelectPanel ColumnController.prototype.getPrimaryColumnTree = function () { return this.primaryBalancedTree; }; // + gridPanel -> for resizing the body and setting top margin ColumnController.prototype.getHeaderRowCount = function () { return this.gridHeaderRowCount; }; // + headerRenderer -> setting pinned body width ColumnController.prototype.getLeftDisplayedColumnGroups = function () { return this.displayedLeftColumnTree; }; // + headerRenderer -> setting pinned body width ColumnController.prototype.getRightDisplayedColumnGroups = function () { return this.displayedRightColumnTree; }; // + headerRenderer -> setting pinned body width ColumnController.prototype.getCenterDisplayedColumnGroups = function () { return this.displayedCentreColumnTree; }; ColumnController.prototype.getDisplayedColumnGroups = function (type) { switch (type) { case column_1.Column.PINNED_LEFT: return this.getLeftDisplayedColumnGroups(); case column_1.Column.PINNED_RIGHT: return this.getRightDisplayedColumnGroups(); default: return this.getCenterDisplayedColumnGroups(); } }; // gridPanel -> ensureColumnVisible ColumnController.prototype.isColumnDisplayed = function (column) { return this.getAllDisplayedColumns().indexOf(column) >= 0; }; // + csvCreator ColumnController.prototype.getAllDisplayedColumns = function () { return this.allDisplayedColumns; }; ColumnController.prototype.getAllDisplayedVirtualColumns = function () { return this.allDisplayedVirtualColumns; }; ColumnController.prototype.getDisplayedLeftColumnsForRow = function (rowNode) { if (!this.colSpanActive) { return this.displayedLeftColumns; } else { return this.getDisplayedColumnsForRow(rowNode, this.displayedLeftColumns); } }; ColumnController.prototype.getDisplayedRightColumnsForRow = function (rowNode) { if (!this.colSpanActive) { return this.displayedRightColumns; } else { return this.getDisplayedColumnsForRow(rowNode, this.displayedRightColumns); } }; ColumnController.prototype.getDisplayedColumnsForRow = function (rowNode, displayedColumns, filterCallback, gapBeforeCallback) { var result = []; var lastConsideredCol = null; for (var i = 0; i < displayedColumns.length; i++) { var col = displayedColumns[i]; var colSpan = col.getColSpan(rowNode); if (colSpan > 1) { var colsToRemove = colSpan - 1; i += colsToRemove; } var filterPasses = filterCallback ? filterCallback(col) : true; if (filterPasses) { var gapBeforeColumn = gapBeforeCallback ? gapBeforeCallback(col) : false; var addInPreviousColumn = result.length === 0 && gapBeforeColumn && lastConsideredCol; if (addInPreviousColumn) { result.push(lastConsideredCol); } result.push(col); } lastConsideredCol = col; } return result; }; // + rowRenderer // if we are not column spanning, this just returns back the virtual centre columns, // however if we are column spanning, then different rows can have different virtual // columns, so we have to work out the list for each individual row. ColumnController.prototype.getAllDisplayedCenterVirtualColumnsForRow = function (rowNode) { var _this = this; if (!this.colSpanActive) { return this.allDisplayedCenterVirtualColumns; } var gapBeforeCallback = function (col) { return col.getLeft() > _this.viewportLeft; }; return this.getDisplayedColumnsForRow(rowNode, this.displayedCenterColumns, this.isColumnInViewport.bind(this), gapBeforeCallback); }; ColumnController.prototype.isColumnInViewport = function (col) { var columnLeft = col.getLeft(); var columnRight = col.getLeft() + col.getActualWidth(); var columnToMuchLeft = columnLeft < this.viewportLeft && columnRight < this.viewportLeft; var columnToMuchRight = columnLeft > this.viewportRight && columnRight > this.viewportRight; return !columnToMuchLeft && !columnToMuchRight; }; // used by: // + angularGrid -> setting pinned body width // todo: this needs to be cached ColumnController.prototype.getPinnedLeftContainerWidth = function () { return this.getWidthOfColsInList(this.displayedLeftColumns); }; // todo: this needs to be cached ColumnController.prototype.getPinnedRightContainerWidth = function () { return this.getWidthOfColsInList(this.displayedRightColumns); }; ColumnController.prototype.updatePrimaryColumnList = function (keys, masterList, actionIsAdd, columnCallback, eventType, source) { var _this = this; if (source === void 0) { source = "api"; } if (utils_1.Utils.missingOrEmpty(keys)) { return; } var atLeastOne = false; keys.forEach(function (key) { var columnToAdd = _this.getPrimaryColumn(key); if (!columnToAdd) { return; } if (actionIsAdd) { if (masterList.indexOf(columnToAdd) >= 0) { return; } masterList.push(columnToAdd); } else { if (masterList.indexOf(columnToAdd) < 0) { return; } utils_1.Utils.removeFromArray(masterList, columnToAdd); } columnCallback(columnToAdd); atLeastOne = true; }); if (!atLeastOne) { return; } if (this.autoGroupsNeedBuilding) { this.updateGridColumns(); } this.updateDisplayedColumns(source); var event = { type: eventType, columns: masterList, column: masterList.length === 1 ? masterList[0] : null, api: this.gridApi, columnApi: this.columnApi, source: source }; this.eventService.dispatchEvent(event); }; ColumnController.prototype.setRowGroupColumns = function (colKeys, source) { if (source === void 0) { source = "api"; } this.autoGroupsNeedBuilding = true; this.setPrimaryColumnList(colKeys, this.rowGroupColumns, events_1.Events.EVENT_COLUMN_ROW_GROUP_CHANGED, this.setRowGroupActive.bind(this), source); }; ColumnController.prototype.setRowGroupActive = function (active, column, source) { if (active === column.isRowGroupActive()) { return; } column.setRowGroupActive(active, source); if (!active) { column.setVisible(true, source); } }; ColumnController.prototype.addRowGroupColumn = function (key, source) { if (source === void 0) { source = "api"; } this.addRowGroupColumns([key], source); }; ColumnController.prototype.addRowGroupColumns = function (keys, source) { if (source === void 0) { source = "api"; } this.autoGroupsNeedBuilding = true; this.updatePrimaryColumnList(keys, this.rowGroupColumns, true, this.setRowGroupActive.bind(this, true), events_1.Events.EVENT_COLUMN_ROW_GROUP_CHANGED, source); }; ColumnController.prototype.removeRowGroupColumns = function (keys, source) { if (source === void 0) { source = "api"; } this.autoGroupsNeedBuilding = true; this.updatePrimaryColumnList(keys, this.rowGroupColumns, false, this.setRowGroupActive.bind(this, false), events_1.Events.EVENT_COLUMN_ROW_GROUP_CHANGED, source); }; ColumnController.prototype.removeRowGroupColumn = function (key, source) { if (source === void 0) { source = "api"; } this.removeRowGroupColumns([key], source); }; ColumnController.prototype.addPivotColumns = function (keys, source) { if (source === void 0) { source = "api"; } this.updatePrimaryColumnList(keys, this.pivotColumns, true, function (column) { return column.setPivotActive(true, source); }, events_1.Events.EVENT_COLUMN_PIVOT_CHANGED, source); }; ColumnController.prototype.setPivotColumns = function (colKeys, source) { if (source === void 0) { source = "api"; } this.setPrimaryColumnList(colKeys, this.pivotColumns, events_1.Events.EVENT_COLUMN_PIVOT_CHANGED, function (added, column) { column.setPivotActive(added, source); }, source); }; ColumnController.prototype.addPivotColumn = function (key, source) { if (source === void 0) { source = "api"; } this.addPivotColumns([key], source); }; ColumnController.prototype.removePivotColumns = function (keys, source) { if (source === void 0) { source = "api"; } this.updatePrimaryColumnList(keys, this.pivotColumns, false, function (column) { return column.setPivotActive(false, source); }, events_1.Events.EVENT_COLUMN_PIVOT_CHANGED, source); }; ColumnController.prototype.removePivotColumn = function (key, source) { if (source === void 0) { source = "api"; } this.removePivotColumns([key], source); }; ColumnController.prototype.setPrimaryColumnList = function (colKeys, masterList, eventName, columnCallback, source) { var _this = this; masterList.length = 0; if (utils_1.Utils.exists(colKeys)) { colKeys.forEach(function (key) { var column = _this.getPrimaryColumn(key); masterList.push(column); }); } this.primaryColumns.forEach(function (column) { var added = masterList.indexOf(column) >= 0; columnCallback(added, column); }); if (this.autoGroupsNeedBuilding) { this.updateGridColumns(); } this.updateDisplayedColumns(source); var event = { type: eventName, columns: masterList, column: masterList.length === 1 ? masterList[0] : null, api: this.gridApi, columnApi: this.columnApi, source: source }; this.eventService.dispatchEvent(event); }; ColumnController.prototype.setValueColumns = function (colKeys, source) { if (source === void 0) { source = "api"; } this.setPrimaryColumnList(colKeys, this.valueColumns, events_1.Events.EVENT_COLUMN_VALUE_CHANGED, this.setValueActive.bind(this), source); }; ColumnController.prototype.setValueActive = function (active, column, source) { if (active === column.isValueActive()) { return; } column.setValueActive(active, source); if (active && !column.getAggFunc()) { var defaultAggFunc = this.aggFuncService.getDefaultAggFunc(column); column.setAggFunc(defaultAggFunc); } }; ColumnController.prototype.addValueColumns = function (keys, source) { if (source === void 0) { source = "api"; } this.updatePrimaryColumnList(keys, this.valueColumns, true, this.setValueActive.bind(this, true), events_1.Events.EVENT_COLUMN_VALUE_CHANGED, source); }; ColumnController.prototype.addValueColumn = function (colKey, source) { if (source === void 0) { source = "api"; } this.addValueColumns([colKey], source); }; ColumnController.prototype.removeValueColumn = function (colKey, source) { if (source === void 0) { source = "api"; } this.removeValueColumns([colKey], source); }; ColumnController.prototype.removeValueColumns = function (keys, source) { if (source === void 0) { source = "api"; } this.updatePrimaryColumnList(keys, this.valueColumns, false, this.setValueActive.bind(this, false), events_1.Events.EVENT_COLUMN_VALUE_CHANGED, source); }; // returns the width we can set to this col, taking into consideration min and max widths ColumnController.prototype.normaliseColumnWidth = function (column, newWidth) { if (newWidth < column.getMinWidth()) { newWidth = column.getMinWidth(); } if (column.isGreaterThanMax(newWidth)) { newWidth = column.getMaxWidth(); } return newWidth; }; ColumnController.prototype.getPrimaryOrGridColumn = function (key) { var column = this.getPrimaryColumn(key); if (column) { return column; } else { return this.getGridColumn(key); } }; ColumnController.prototype.setColumnWidth = function (key, newWidth, finished, source) { if (source === void 0) { source = "api"; } var column = this.getPrimaryOrGridColumn(key); if (!column) { return; } newWidth = this.normaliseColumnWidth(column, newWidth); var widthChanged = column.getActualWidth() !== newWidth; if (widthChanged) { column.setActualWidth(newWidth, source); this.setLeftValues(source); } this.updateBodyWidths(); this.checkDisplayedVirtualColumns(); // check for change first, to avoid unnecessary firing of events // however we always fire 'finished' events. this is important // when groups are resized, as if the group is changing slowly, // eg 1 pixel at a time, then each change will fire change events // in all the columns in the group, but only one with get the pixel. if (finished || widthChanged) { var event_3 = { type: events_1.Events.EVENT_COLUMN_RESIZED, columns: [column], column: column, finished: finished, api: this.gridApi, columnApi: this.columnApi, source: source }; this.eventService.dispatchEvent(event_3); } }; ColumnController.prototype.setColumnAggFunc = function (column, aggFunc, source) { if (source === void 0) { source = "api"; } column.setAggFunc(aggFunc); var event = { type: events_1.Events.EVENT_COLUMN_VALUE_CHANGED, columns: [column], column: column, api: this.gridApi, columnApi: this.columnApi, source: source }; this.eventService.dispatchEvent(event); }; ColumnController.prototype.moveRowGroupColumn = function (fromIndex, toIndex, source) { if (source === void 0) { source = "api"; } var column = this.rowGroupColumns[fromIndex]; this.rowGroupColumns.splice(fromIndex, 1); this.rowGroupColumns.splice(toIndex, 0, column); var event = { type: events_1.Events.EVENT_COLUMN_ROW_GROUP_CHANGED, columns: this.rowGroupColumns, column: this.rowGroupColumns.length === 1 ? this.rowGroupColumns[0] : null, api: this.gridApi, columnApi: this.columnApi, source: source }; this.eventService.dispatchEvent(event); }; ColumnController.prototype.moveColumns = function (columnsToMoveKeys, toIndex, source) { if (source === void 0) { source = "api"; } this.columnAnimationService.start(); if (toIndex > this.gridColumns.length - columnsToMoveKeys.length) { console.warn('ag-Grid: tried to insert columns in invalid location, toIndex = ' + toIndex); console.warn('ag-Grid: remember that you should not count the moving columns when calculating the new index'); return; } // we want to pull all the columns out first and put them into an ordered list var columnsToMove = this.getGridColumns(columnsToMoveKeys); var failedRules = !this.doesMovePassRules(columnsToMove, toIndex); if (failedRules) { return; } utils_1.Utils.moveInArray(this.gridColumns, columnsToMove, toIndex); this.updateDisplayedColumns(source); var event = { type: events_1.Events.EVENT_COLUMN_MOVED, columns: columnsToMove, column: columnsToMove.length === 1 ? columnsToMove[0] : null, toIndex: toIndex, api: this.gridApi, columnApi: this.columnApi, source: source }; this.eventService.dispatchEvent(event); this.columnAnimationService.finish(); }; ColumnController.prototype.doesMovePassRules = function (columnsToMove, toIndex) { // make a copy of what the grid columns would look like after the move var proposedColumnOrder = this.gridColumns.slice(); utils_1.Utils.moveInArray(proposedColumnOrder, columnsToMove, toIndex); // then check that the new proposed order of the columns passes all rules if (!this.doesMovePassMarryChildren(proposedColumnOrder)) { return false; } if (!this.doesMovePassLockedPositions(proposedColumnOrder)) { return false; } return true; }; ColumnController.prototype.doesMovePassLockedPositions = function (proposedColumnOrder) { var foundNonLocked = false; var rulePassed = true; // go though the cols, see if any non-locked appear before any locked proposedColumnOrder.forEach(function (col) { if (col.isLockPosition()) { if (foundNonLocked) { rulePassed = false; } } else { foundNonLocked = true; } }); return rulePassed; }; ColumnController.prototype.doesMovePassMarryChildren = function (allColumnsCopy) { var rulePassed = true; this.columnUtils.depthFirstOriginalTreeSearch(this.gridBalancedTree, function (child) { if (!(child instanceof originalColumnGroup_1.OriginalColumnGroup)) { return; } var columnGroup = child; var marryChildren = columnGroup.getColGroupDef() && columnGroup.getColGroupDef().marryChildren; if (!marryChildren) { return; } var newIndexes = []; columnGroup.getLeafColumns().forEach(function (col) { var newColIndex = allColumnsCopy.indexOf(col); newIndexes.push(newColIndex); }); var maxIndex = Math.max.apply(Math, newIndexes); var minIndex = Math.min.apply(Math, newIndexes); // spread is how far the first column in this group is away from the last column var spread = maxIndex - minIndex; var maxSpread = columnGroup.getLeafColumns().length - 1; // if the columns if (spread > maxSpread) { rulePassed = false; } // console.log(`maxIndex = ${maxIndex}, minIndex = ${minIndex}, spread = ${spread}, maxSpread = ${maxSpread}, fail = ${spread > (count-1)}`) // console.log(allColumnsCopy.map( col => col.getColDef().field).join(',')); }); return rulePassed; }; ColumnController.prototype.moveColumn = function (key, toIndex, source) { if (source === void 0) { source = "api"; } this.moveColumns([key], toIndex, source); }; ColumnController.prototype.moveColumnByIndex = function (fromIndex, toIndex, source) { if (source === void 0) { source = "api"; } var column = this.gridColumns[fromIndex]; this.moveColumn(column, toIndex, source); }; // used by: // + angularGrid -> for setting body width // + rowController -> setting main row widths (when inserting and resizing) // need to cache this ColumnController.prototype.getBodyContainerWidth = function () { return this.bodyWidth; }; ColumnController.prototype.getContainerWidth = function (pinned) { switch (pinned) { case column_1.Column.PINNED_LEFT: return this.leftWidth; case column_1.Column.PINNED_RIGHT: return this.rightWidth; default: return this.bodyWidth; } }; // after setColumnWidth or updateGroupsAndDisplayedColumns ColumnController.prototype.updateBodyWidths = function () { var newBodyWidth = this.getWidthOfColsInList(this.displayedCenterColumns); var newLeftWidth = this.getWidthOfColsInList(this.displayedLeftColumns); var newRightWidth = this.getWidthOfColsInList(this.displayedRightColumns); // this is used by virtual col calculation, for RTL only, as a change to body width can impact displayed // columns, due to RTL inverting the y coordinates this.bodyWidthDirty = this.bodyWidth !== newBodyWidth; var atLeastOneChanged = this.bodyWidth !== newBodyWidth || this.leftWidth !== newLeftWidth || this.rightWidth !== newRightWidth; if (atLeastOneChanged) { this.bodyWidth = newBodyWidth; this.leftWidth = newLeftWidth; this.rightWidth = newRightWidth; // when this fires, it is picked up by the gridPanel, which ends up in // gridPanel calling setWidthAndScrollPosition(), which in turn calls setVirtualViewportPosition() var event_4 = { type: events_1.Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED, api: this.gridApi, columnApi: this.columnApi }; this.eventService.dispatchEvent(event_4); } }; // + rowController ColumnController.prototype.getValueColumns = function () { return this.valueColumns ? this.valueColumns : []; }; // + rowController ColumnController.prototype.getPivotColumns = function () { return this.pivotColumns ? this.pivotColumns : []; }; // + inMemoryRowModel ColumnController.prototype.isPivotActive = function () { return this.pivotColumns && this.pivotColumns.length > 0 && this.pivotMode; }; // + toolPanel ColumnController.prototype.getRowGroupColumns = function () { return this.rowGroupColumns ? this.rowGroupColumns : []; }; // + rowController -> while inserting rows ColumnController.prototype.getDisplayedCenterColumns = function () { return this.displayedCenterColumns; }; // + rowController -> while inserting rows ColumnController.prototype.getDisplayedLeftColumns = function () { return this.displayedLeftColumns; }; ColumnController.prototype.getDisplayedRightColumns = function () { return this.displayedRightColumns; }; ColumnController.prototype.getDisplayedColumns = function (type) { switch (type) { case column_1.Column.PINNED_LEFT: return this.getDisplayedLeftColumns(); case column_1.Column.PINNED_RIGHT: return this.getDisplayedRightColumns(); default: return this.getDisplayedCenterColumns(); } }; // used by: // + inMemoryRowController -> sorting, building quick filter text // + headerRenderer -> sorting (clearing icon) ColumnController.prototype.getAllPrimaryColumns = function () { return this.primaryColumns; }; ColumnController.prototype.getAllColumnsForQuickFilter = function () { return this.columnsForQuickFilter; }; // + moveColumnController ColumnController.prototype.getAllGridColumns = function () { return this.gridColumns; }; ColumnController.prototype.isEmpty = function () { return utils_1.Utils.missingOrEmpty(this.gridColumns); }; ColumnController.prototype.isRowGroupEmpty = function () { return utils_1.Utils.missingOrEmpty(this.rowGroupColumns); }; ColumnController.prototype.setColumnVisible = function (key, visible, source) { if (source === void 0) { source = "api"; } this.setColumnsVisible([key], visible, source); }; ColumnController.prototype.setColumnsVisible = function (keys, visible, source) { var _this = this; if (source === void 0) { source = "api"; } this.columnAnimationService.start(); this.actionOnGridColumns(keys, function (column) { if (column.isVisible() !== visible) { column.setVisible(visible, source); return true; } else { return false; } }, source, function () { var event = { type: events_1.Events.EVENT_COLUMN_VISIBLE, visible: visible, column: null, columns: null, api: _this.gridApi, columnApi: _this.columnApi, source: source }; return event; }); this.columnAnimationService.finish(); }; ColumnController.prototype.setColumnPinned = function (key, pinned, source) { if (source === void 0) { source = "api"; } this.setColumnsPinned([key], pinned, source); }; ColumnController.prototype.setColumnsPinned = function (keys, pinned, source) { var _this = this; if (source === void 0) { source = "api"; } this.columnAnimationService.start(); var actualPinned; if (pinned === true || pinned === column_1.Column.PINNED_LEFT) { actualPinned = column_1.Column.PINNED_LEFT; } else if (pinned === column_1.Column.PINNED_RIGHT) { actualPinned = column_1.Column.PINNED_RIGHT; } else { actualPinned = null; } this.actionOnGridColumns(keys, function (col) { if (col.getPinned() !== actualPinned) { col.setPinned(actualPinned); return true; } else { return false; } }, source, function () { var event = { type: events_1.Events.EVENT_COLUMN_PINNED, pinned: actualPinned, column: null, columns: null, api: _this.gridApi, columnApi: _this.columnApi, source: source }; return event; }); this.columnAnimationService.finish(); }; // does an action on a set of columns. provides common functionality for looking up the // columns based on key, getting a list of effected columns, and then updated the event // with either one column (if it was just one col) or a list of columns // used by: autoResize, setVisible, setPinned ColumnController.prototype.actionOnGridColumns = function (// the column keys this action will be on keys, // the action to do - if this returns false, the column was skipped // and won't be included in the event action, // should return back a column event of the right type source, createEvent) { var _this = this; if (utils_1.Utils.missingOrEmpty(keys)) { return; } var updatedColumns = []; keys.forEach(function (key) { var column = _this.getGridColumn(key); if (!column) { return; } // need to check for false with type (ie !== instead of !=) // as not returning anything (undefined) would also be false var resultOfAction = action(column); if (resultOfAction !== false) { updatedColumns.push(column); } }); if (updatedColumns.length === 0) { return; } this.updateDisplayedColumns(source); if (utils_1.Utils.exists(createEvent)) { var event_5 = createEvent(); event_5.columns = updatedColumns; event_5.column = updatedColumns.length === 1 ? updatedColumns[0] : null; this.eventService.dispatchEvent(event_5); } }; ColumnController.prototype.getDisplayedColBefore = function (col) { var allDisplayedColumns = this.getAllDisplayedColumns(); var oldIndex = allDisplayedColumns.indexOf(col); if (oldIndex > 0) { return allDisplayedColumns[oldIndex - 1]; } else { return null; } }; // used by: // + rowRenderer -> for navigation ColumnController.prototype.getDisplayedColAfter = function (col) { var allDisplayedColumns = this.getAllDisplayedColumns(); var oldIndex = allDisplayedColumns.indexOf(col); if (oldIndex < (allDisplayedColumns.length - 1)) { return allDisplayedColumns[oldIndex + 1]; } else { return null; } }; ColumnController.prototype.isPinningLeft = function () { return this.displayedLeftColumns.length > 0; }; ColumnController.prototype.isPinningRight = function () { return this.displayedRightColumns.length > 0; }; ColumnController.prototype.getPrimaryAndSecondaryAndAutoColumns = function () { var result = this.primaryColumns ? this.primaryColumns.slice(0) : []; if (utils_1.Utils.exists(this.groupAutoColumns)) { this.groupAutoColumns.forEach(function (col) { return result.push(col); }); } if (this.secondaryColumnsPresent) { this.secondaryColumns.forEach(function (column) { return result.push(column); }); } return result; }; ColumnController.prototype.createStateItemFromColumn = function (column) { var rowGroupIndex = column.isRowGroupActive() ? this.rowGroupColumns.indexOf(column) : null; var pivotIndex = column.isPivotActive() ? this.pivotColumns.indexOf(column) : null; var aggFunc = column.isValueActive() ? column.getAggFunc() : null; var resultItem = { colId: column.getColId(), hide: !column.isVisible(), aggFunc: aggFunc, width: column.getActualWidth(), pivotIndex: pivotIndex, pinned: column.getPinned(), rowGroupIndex: rowGroupIndex }; return resultItem; }; ColumnController.prototype.getColumnState = function () { if (utils_1.Utils.missing(this.primaryColumns)) { return []; } var columnStateList = this.primaryColumns.map(this.createStateItemFromColumn.bind(this)); if (!this.pivotMode) { this.orderColumnStateList(columnStateList); } return columnStateList; }; ColumnController.prototype.orderColumnStateList = function (columnStateList) { var gridColumnIds = this.gridColumns.map(function (column) { return column.getColId(); }); columnStateList.sort(function (itemA, itemB) { var posA = gridColumnIds.indexOf(itemA.colId); var posB = gridColumnIds.indexOf(itemB.colId); return posA - posB; }); }; ColumnController.prototype.resetColumnState = function (source) { if (source === void 0) { source = "api"; } // we can't use 'allColumns' as the order might of messed up, so get the primary ordered list var primaryColumns = this.getColumnsFromTree(this.primaryBalancedTree); var state = []; if (primaryColumns) { primaryColumns.forEach(function (column) { state.push({ colId: column.getColId(), aggFunc: column.getColDef().aggFunc, hide: column.getColDef().hide, pinned: column.getColDef().pinned, rowGroupIndex: column.getColDef().rowGroupIndex, pivotIndex: column.getColDef().pivotIndex, width: column.getColDef().width }); }); } this.setColumnState(state, source); }; ColumnController.prototype.setColumnState = function (columnState, source) { var _this = this; if (source === void 0) { source = "api"; } if (utils_1.Utils.missingOrEmpty(this.primaryColumns)) { return false; } this.autoGroupsNeedBuilding = true; // at the end below, this list will have all columns we got no state for var columnsWithNoState = this.primaryColumns.slice(); this.rowGroupColumns = []; this.valueColumns = []; this.pivotColumns = []; var success = true; var rowGroupIndexes = {}; var pivotIndexes = {}; if (columnState) { columnState.forEach(function (stateItem) { var column = _this.getPrimaryColumn(stateItem.colId); if (!column) { console.warn('ag-grid: column ' + stateItem.colId + ' not found'); success = false; } else { _this.syncColumnWithStateItem(column, stateItem, rowGroupIndexes, pivotIndexes, source); utils_1.Utils.removeFromArray(columnsWithNoState, column); } }); } // anything left over, we got no data for, so add in the column as non-value, non-rowGroup and hidden columnsWithNoState.forEach(this.syncColumnWithNoState.bind(this)); // sort the lists according to the indexes that were provided this.rowGroupColumns.sort(this.sortColumnListUsingIndexes.bind(this, rowGroupIndexes)); this.pivotColumns.sort(this.sortColumnListUsingIndexes.bind(this, pivotIndexes)); this.updateGridColumns(); if (columnState) { var orderOfColIds_1 = columnState.map(function (stateItem) { return stateItem.colId; }); this.gridColumns.sort(function (colA, colB) { var indexA = orderOfColIds_1.indexOf(colA.getId()); var indexB = orderOfColIds_1.indexOf(colB.getId()); return indexA - indexB; }); } this.updateDisplayedColumns(source); var event = { type: events_1.Events.EVENT_COLUMN_EVERYTHING_CHANGED, api: this.gridApi, columnApi: this.columnApi }; this.eventService.dispatchEvent(event); return success; }; ColumnController.prototype.sortColumnListUsingIndexes = function (indexes, colA, colB) { var indexA = indexes[colA.getId()]; var indexB = indexes[colB.getId()]; return indexA - indexB; }; ColumnController.prototype.syncColumnWithNoState = function (column, source) { column.setVisible(false, source); column.setAggFunc(null); column.setPinned(null); column.setRowGroupActive(false, source); column.setPivotActive(false, source); column.setValueActive(false, source); }; ColumnController.prototype.syncColumnWithStateItem = function (column, stateItem, rowGroupIndexes, pivotIndexes, source) { // following ensures we are left with boolean true or false, eg converts (null, undefined, 0) all to true column.setVisible(!stateItem.hide, source); // sets pinned to 'left' or 'right' column.setPinned(stateItem.pinned); // if width provided and valid, use it, otherwise stick with the old width if (stateItem.width >= this.gridOptionsWrapper.getMinColWidth()) { column.setActualWidth(stateItem.width, source); } if (typeof stateItem.aggFunc === 'string') { column.setAggFunc(stateItem.aggFunc); column.setValueActive(true, source); this.valueColumns.push(column); } else { if (utils_1.Utils.exists(stateItem.aggFunc)) { console.warn('ag-Grid: stateItem.aggFunc must be a string. if using your own aggregation ' + 'functions, register the functions first before using them in get/set state. This is because it is' + 'intended for the column state to be stored and retrieved as simple JSON.'); } column.setAggFunc(null); column.setValueActive(false, source); } if (typeof stateItem.rowGroupIndex === 'number') { this.rowGroupColumns.push(column); column.setRowGroupActive(true, source); rowGroupIndexes[column.getId()] = stateItem.rowGroupIndex; } else { column.setRowGroupActive(false, source); } if (typeof stateItem.pivotIndex === 'number') { this.pivotColumns.push(column); column.setPivotActive(true, source); pivotIndexes[column.getId()] = stateItem.pivotIndex; } else { column.setPivotActive(false, source); } }; ColumnController.prototype.getGridColumns = function (keys) { return this.getColumns(keys, this.getGridColumn.bind(this)); }; ColumnController.prototype.getColumns = function (keys, columnLookupCallback) { var foundColumns = []; if (keys) { keys.forEach(function (key) { var column = columnLookupCallback(key); if (column) { foundColumns.push(column); } }); } return foundColumns; }; // used by growGroupPanel ColumnController.prototype.getColumnWithValidation = function (key) { var column = this.getPrimaryColumn(key); if (!column) { console.warn('ag-Grid: could not find column ' + column); } return column; }; ColumnController.prototype.getPrimaryColumn = function (key) { return this.getColumn(key, this.primaryColumns); }; ColumnController.prototype.getGridColumn = function (key) { return this.getColumn(key, this.gridColumns); }; ColumnController.prototype.getColumn = function (key, columnList) { if (!key) { return null; } for (var i = 0; i < columnList.length; i++) { if (this.columnsMatch(columnList[i], key)) { return columnList[i]; } } return this.getAutoColumn(key); }; ColumnController.prototype.getAutoColumn = function (key) { var _this = this; if (!utils_1.Utils.exists(this.groupAutoColumns) || utils_1.Utils.missing(this.groupAutoColumns)) { return null; } return utils_1.Utils.find(this.groupAutoColumns, function (groupCol) { return _this.columnsMatch(groupCol, key); }); }; ColumnController.prototype.columnsMatch = function (column, key) { var columnMatches = column === key; var colDefMatches = column.getColDef() === key; var idMatches = column.getColId() == key; return columnMatches || colDefMatches || idMatches; }; ColumnController.prototype.getDisplayNameForColumn = function (column, location, includeAggFunc) { if (includeAggFunc === void 0) { includeAggFunc = false; } var headerName = this.getHeaderName(column.getColDef(), column, null, location); if (includeAggFunc) { return this.wrapHeaderNameWithAggFunc(column, headerName); } else { return headerName; } }; ColumnController.prototype.getDisplayNameForColumnGroup = function (columnGroup, location) { var colGroupDef = columnGroup.getOriginalColumnGroup().getColGroupDef(); if (colGroupDef) { return this.getHeaderName(colGroupDef, null, columnGroup, location); } else { return null; } }; // location is where the column is going to appear, ie who is calling us ColumnController.prototype.getHeaderName = function (colDef, column, columnGroup, location) { var headerValueGetter = colDef.headerValueGetter; if (headerValueGetter) { var params = { colDef: colDef, column: column, columnGroup: columnGroup, location: location, api: this.gridOptionsWrapper.getApi(), context: this.gridOptionsWrapper.getContext() }; if (typeof headerValueGetter === 'function') { // valueGetter is a function, so just call it return headerValueGetter(params); } else if (typeof headerValueGetter === 'string') { // valueGetter is an expression, so execute the expression return this.expressionService.evaluate(headerValueGetter, params); } else { console.warn('ag-grid: headerValueGetter must be a function or a string'); return ''; } } else if (colDef.headerName != null) { return colDef.headerName; } else if (colDef.field) { return utils_1.Utils.camelCaseToHumanText(colDef.field); } else { return ''; } }; /* private getHeaderGroupName(columnGroup: ColumnGroup): string { let colGroupDef = columnGroup.getOriginalColumnGroup().getColGroupDef(); let headerValueGetter = colGroupDef.headerValueGetter; if (headerValueGetter) { let params = { columnGroup: columnGroup, colDef: colGroupDef, api: this.gridOptionsWrapper.getApi(), context: this.gridOptionsWrapper.getContext() }; if (typeof headerValueGetter === 'function') { // valueGetter is a function, so just call it return headerValueGetter(params); } else if (typeof headerValueGetter === 'string') { // valueGetter is an expression, so execute the expression return this.expressionService.evaluate(headerValueGetter, params); } else { console.warn('ag-grid: headerValueGetter must be a function or a string'); return ''; } } else { return colGroupDef.headerName; } } */ ColumnController.prototype.wrapHeaderNameWithAggFunc = function (column, headerName) { if (this.gridOptionsWrapper.isSuppressAggFuncInHeader()) { return headerName; } // only columns with aggregation active can have aggregations var pivotValueColumn = column.getColDef().pivotValueColumn; var pivotActiveOnThisColumn = utils_1.Utils.exists(pivotValueColumn); var aggFunc = null; var aggFuncFound; // otherwise we have a measure that is active, and we are doing aggregation on it if (pivotActiveOnThisColumn) { aggFunc = pivotValueColumn.getAggFunc(); aggFuncFound = true; } else { var measureActive = column.isValueActive(); var aggregationPresent = this.pivotMode || !this.isRowGroupEmpty(); if (measureActive && aggregationPresent) { aggFunc = column.getAggFunc(); aggFuncFound = true; } else { aggFuncFound = false; } } if (aggFuncFound) { var aggFuncString = (typeof aggFunc === 'string') ? aggFunc : 'func'; var localeTextFunc = this.gridOptionsWrapper.getLocaleTextFunc(); var aggFuncStringTranslated = localeTextFunc(aggFuncString, aggFuncString); return aggFuncStringTranslated + "(" + headerName + ")"; } else { return headerName; } }; // returns the group with matching colId and instanceId. If instanceId is missing, // matches only on the colId. ColumnController.prototype.getColumnGroup = function (colId, instanceId) { if (!colId) { return null; } if (colId instanceof columnGroup_1.ColumnGroup) { return colId; } var allColumnGroups = this.getAllDisplayedColumnGroups(); var checkInstanceId = typeof instanceId === 'number'; var result = null; this.columnUtils.depthFirstAllColumnTreeSearch(allColumnGroups, function (child) { if (child instanceof columnGroup_1.ColumnGroup) { var columnGroup = child; var matched = void 0; if (checkInstanceId) { matched = colId === columnGroup.getGroupId() && instanceId === columnGroup.getInstanceId(); } else { matched = colId === columnGroup.getGroupId(); } if (matched) { result = columnGroup; } } }); return result; }; ColumnController.prototype.setColumnDefs = function (columnDefs, source) { if (source === void 0) { source = "api"; } // always invalidate cache on changing columns, as the column id's for the new columns // could overlap with the old id's, so the cache would return old values for new columns. this.valueCache.expire(); // NOTE ================== // we should be destroying the existing columns and groups if they exist, for example, the original column // group adds a listener to the columns, it should be also removing the listeners this.autoGroupsNeedBuilding = true; var balancedTreeResult = this.balancedColumnTreeBuilder.createBalancedColumnGroups(columnDefs, true); this.primaryBalancedTree = balancedTreeResult.balancedTree; this.primaryHeaderRowCount = balancedTreeResult.treeDept + 1; this.primaryColumns = this.getColumnsFromTree(this.primaryBalancedTree); this.extractRowGroupColumns(source); this.extractPivotColumns(source); this.createValueColumns(source); this.updateGridColumns(); this.updateDisplayedColumns(source); this.checkDisplayedVirtualColumns(); this.ready = true; var eventEverythingChanged = { type: events_1.Events.EVENT_COLUMN_EVERYTHING_CHANGED, api: this.gridApi, columnApi: this.columnApi }; this.eventService.dispatchEvent(eventEverythingChanged); var newColumnsLoadedEvent = { type: events_1.Events.EVENT_NEW_COLUMNS_LOADED, api: this.gridApi, columnApi: this.columnApi }; this.eventService.dispatchEvent(newColumnsLoadedEvent); }; ColumnController.prototype.isReady = function () { return this.ready; }; ColumnController.prototype.extractRowGroupColumns = function (source) { var _this = this; this.rowGroupColumns.forEach(function (column) { return column.setRowGroupActive(false, source); }); this.rowGroupColumns = []; // pull out items with rowGroupIndex this.primaryColumns.forEach(function (column) { if (typeof column.getColDef().rowGroupIndex === 'number') { _this.rowGroupColumns.push(column); column.setRowGroupActive(true, source); } }); // then sort them this.rowGroupColumns.sort(function (colA, colB) { return colA.getColDef().rowGroupIndex - colB.getColDef().rowGroupIndex; }); // now just pull out items rowGroup, they will be added at the end // after the indexed ones, but in the order the columns appear this.primaryColumns.forEach(function (column) { if (column.getColDef().rowGroup) { // if user already specified rowGroupIndex then we skip it as this col already included if (_this.rowGroupColumns.indexOf(column) >= 0) { return; } _this.rowGroupColumns.push(column); column.setRowGroupActive(true, source); } }); }; ColumnController.prototype.extractPivotColumns = function (source) { var _this = this; this.pivotColumns.forEach(function (column) { return column.setPivotActive(false, source); }); this.pivotColumns = []; // pull out items with pivotIndex this.primaryColumns.forEach(function (column) { if (typeof column.getColDef().pivotIndex === 'number') { _this.pivotColumns.push(column); column.setPivotActive(true, source); } }); // then sort them this.pivotColumns.sort(function (colA, colB) { return colA.getColDef().pivotIndex - colB.getColDef().pivotIndex; }); // now check the boolean equivalent this.primaryColumns.forEach(function (column) { if (column.getColDef().pivot) { // if user already specified pivotIndex then we skip it as this col already included if (_this.pivotColumns.indexOf(column) >= 0) { return; } _this.pivotColumns.push(column); column.setPivotActive(true, source); } }); }; ColumnController.prototype.resetColumnGroupState = function (source) { if (source === void 0) { source = "api"; } var stateItems = []; this.columnUtils.depthFirstOriginalTreeSearch(this.primaryBalancedTree, function (child) { if (child instanceof originalColumnGroup_1.OriginalColumnGroup) { var groupState = { groupId: child.getGroupId(), open: child.getColGroupDef().openByDefault }; stateItems.push(groupState); } }); this.setColumnGroupState(stateItems, source); }; ColumnController.prototype.getColumnGroupState = function () { var columnGroupState = []; this.columnUtils.depthFirstOriginalTreeSearch(this.gridBalancedTree, function (node) { if (node instanceof originalColumnGroup_1.OriginalColumnGroup) { var originalColumnGroup = node; columnGroupState.push({ groupId: originalColumnGroup.getGroupId(), open: originalColumnGroup.isExpanded() }); } }); return columnGroupState; }; ColumnController.prototype.setColumnGroupState = function (stateItems, source) { var _this = this; if (source === void 0) { source = "api"; } this.columnAnimationService.start(); var impactedGroups = []; stateItems.forEach(function (stateItem) { var groupKey = stateItem.groupId; var newValue = stateItem.open; var originalColumnGroup = _this.getOriginalColumnGroup(groupKey); if (!originalColumnGroup) { return; } if (originalColumnGroup.isExpanded() === newValue) { return; } _this.logger.log('columnGroupOpened(' + originalColumnGroup.getGroupId() + ',' + newValue + ')'); originalColumnGroup.setExpanded(newValue); impactedGroups.push(originalColumnGroup); }); this.updateGroupsAndDisplayedColumns(source); impactedGroups.forEach(function (originalColumnGroup) { var event = { type: events_1.Events.EVENT_COLUMN_GROUP_OPENED, columnGroup: originalColumnGroup, api: _this.gridApi, columnApi: _this.columnApi }; _this.eventService.dispatchEvent(event); }); this.columnAnimationService.finish(); }; // called by headerRenderer - when a header is opened or closed ColumnController.prototype.setColumnGroupOpened = function (key, newValue, source) { if (source === void 0) { source = "api"; } var keyAsString; if (key instanceof originalColumnGroup_1.OriginalColumnGroup) { keyAsString = key.getId(); } else { keyAsString = key; } this.setColumnGroupState([{ groupId: keyAsString, open: newValue }], source); }; ColumnController.prototype.getOriginalColumnGroup = function (key) { if (key instanceof originalColumnGroup_1.OriginalColumnGroup) { return key; } if (typeof key !== 'string') { console.error('ag-Grid: group key must be a string'); } // otherwise, search for the column group by id var res = null; this.columnUtils.depthFirstOriginalTreeSearch(this.gridBalancedTree, function (node) { if (node instanceof originalColumnGroup_1.OriginalColumnGroup) { var originalColumnGroup = node; if (originalColumnGroup.getId() === key) { res = originalColumnGroup; } } }); return res; }; ColumnController.prototype.calculateColumnsForDisplay = function () { var _this = this; var columnsForDisplay; if (this.pivotMode && !this.secondaryColumnsPresent) { // pivot mode is on, but we are not pivoting, so we only // show columns we are aggregating on columnsForDisplay = utils_1.Utils.filter(this.gridColumns, function (column) { var isAutoGroupCol = _this.groupAutoColumns && _this.groupAutoColumns.indexOf(column) >= 0; var isValueCol = _this.valueColumns && _this.valueColumns.indexOf(column) >= 0; return isAutoGroupCol || isValueCol; }); } else { // otherwise continue as normal. this can be working on the primary // or secondary columns, whatever the gridColumns are set to columnsForDisplay = utils_1.Utils.filter(this.gridColumns, function (column) { // keep col if a) it's auto-group or b) it's visible var isAutoGroupCol = _this.groupAutoColumns && _this.groupAutoColumns.indexOf(column) >= 0; return isAutoGroupCol || column.isVisible(); }); } return columnsForDisplay; }; ColumnController.prototype.checkColSpanActiveInCols = function (columns) { var result = false; columns.forEach(function (col) { if (utils_1.Utils.exists(col.getColDef().colSpan)) { result = true; } }); return result; }; ColumnController.prototype.calculateColumnsForGroupDisplay = function () { var _this = this; this.groupDisplayColumns = []; var checkFunc = function (col) { var colDef = col.getColDef(); if (colDef && utils_1.Utils.exists(colDef.showRowGroup)) { _this.groupDisplayColumns.push(col); } }; this.gridColumns.forEach(checkFunc); if (this.groupAutoColumns) { this.groupAutoColumns.forEach(checkFunc); } }; ColumnController.prototype.getGroupDisplayColumns = function () { return this.groupDisplayColumns; }; ColumnController.prototype.updateDisplayedColumns = function (source) { var columnsForDisplay = this.calculateColumnsForDisplay(); this.buildDisplayedTrees(columnsForDisplay); this.calculateColumnsForGroupDisplay(); // this is also called when a group is opened or closed this.updateGroupsAndDisplayedColumns(source); this.setFirstRightAndLastLeftPinned(source); }; ColumnController.prototype.isSecondaryColumnsPresent = function () { return this.secondaryColumnsPresent; }; ColumnController.prototype.setSecondaryColumns = function (colDefs, source) { if (source === void 0) { source = "api"; } var newColsPresent = colDefs && colDefs.length > 0; // if not cols passed, and we had to cols anyway, then do nothing if (!newColsPresent && !this.secondaryColumnsPresent) { return; } if (newColsPresent) { this.processSecondaryColumnDefinitions(colDefs); var balancedTreeResult = this.balancedColumnTreeBuilder.createBalancedColumnGroups(colDefs, false); this.secondaryBalancedTree = balancedTreeResult.balancedTree; this.secondaryHeaderRowCount = balancedTreeResult.treeDept + 1; this.secondaryColumns = this.getColumnsFromTree(this.secondaryBalancedTree); this.secondaryColumnsPresent = true; } else { this.secondaryBalancedTree = null; this.secondaryHeaderRowCount = -1; this.secondaryColumns = null; this.secondaryColumnsPresent = false; } this.updateGridColumns(); this.updateDisplayedColumns(source); }; ColumnController.prototype.processSecondaryColumnDefinitions = function (colDefs) { var columnCallback = this.gridOptionsWrapper.getProcessSecondaryColDefFunc(); var groupCallback = this.gridOptionsWrapper.getProcessSecondaryColGroupDefFunc(); if (!columnCallback && !groupCallback) { return; } searchForColDefs(colDefs); function searchForColDefs(colDefs2) { colDefs2.forEach(function (abstractColDef) { var isGroup = utils_1.Utils.exists(abstractColDef.children); if (isGroup) { var colGroupDef = abstractColDef; if (groupCallback) { groupCallback(colGroupDef); } searchForColDefs(colGroupDef.children); } else { var colDef = abstractColDef; if (columnCallback) { columnCallback(colDef); } } }); } }; // called from: setColumnState, setColumnDefs, setSecondaryColumns ColumnController.prototype.updateGridColumns = function () { if (this.secondaryColumns) { this.gridBalancedTree = this.secondaryBalancedTree.slice(); this.gridHeaderRowCount = this.secondaryHeaderRowCount; this.gridColumns = this.secondaryColumns.slice(); } else { this.gridBalancedTree = this.primaryBalancedTree.slice(); this.gridHeaderRowCount = this.primaryHeaderRowCount; this.gridColumns = this.primaryColumns.slice(); } this.putFixedColumnsFirst(); this.addAutoGroupToGridColumns(); this.setupQuickFilterColumns(); this.clearDisplayedColumns(); this.colSpanActive = this.checkColSpanActiveInCols(this.gridColumns); var event = { type: events_1.Events.EVENT_GRID_COLUMNS_CHANGED, api: this.gridApi, columnApi: this.columnApi }; this.eventService.dispatchEvent(event); }; // if we are using autoGroupCols, then they should be included for quick filter. this covers the // following scenarios: // a) user provides 'field' into autoGroupCol of normal grid, so now because a valid col to filter leafs on // b) using tree data and user depends on autoGroupCol for first col, and we also want to filter on this // (tree data is a bit different, as parent rows can be filtered on, unlike row grouping) ColumnController.prototype.setupQuickFilterColumns = function () { if (this.groupAutoColumns) { this.columnsForQuickFilter = this.primaryColumns.concat(this.groupAutoColumns); } else { this.columnsForQuickFilter = this.primaryColumns; } }; ColumnController.prototype.putFixedColumnsFirst = function () { var locked = this.gridColumns.filter(function (c) { return c.isLockPosition(); }); var unlocked = this.gridColumns.filter(function (c) { return !c.isLockPosition(); }); this.gridColumns = locked.concat(unlocked); }; ColumnController.prototype.addAutoGroupToGridColumns = function () { // add in auto-group here this.createGroupAutoColumnsIfNeeded(); if (utils_1.Utils.missing(this.groupAutoColumns)) { return; } this.gridColumns = this.groupAutoColumns.concat(this.gridColumns); var autoColBalancedTree = this.balancedColumnTreeBuilder.createForAutoGroups(this.groupAutoColumns, this.gridBalancedTree); this.gridBalancedTree = autoColBalancedTree.concat(this.gridBalancedTree); }; // gets called after we copy down grid columns, to make sure any part of the gui // that tries to draw, eg the header, it will get empty lists of columns rather // than stale columns. for example, the header will received gridColumnsChanged // event, so will try and draw, but it will draw successfully when it acts on the // virtualColumnsChanged event ColumnController.prototype.clearDisplayedColumns = function () { this.displayedLeftColumnTree = []; this.displayedRightColumnTree = []; this.displayedCentreColumnTree = []; this.displayedLeftHeaderRows = {}; this.displayedRightHeaderRows = {}; this.displayedCentreHeaderRows = {}; this.displayedLeftColumns = []; this.displayedRightColumns = []; this.displayedCenterColumns = []; this.allDisplayedColumns = []; this.allDisplayedVirtualColumns = []; }; ColumnController.prototype.updateGroupsAndDisplayedColumns = function (source) { this.updateOpenClosedVisibilityInColumnGroups(); this.updateDisplayedColumnsFromTrees(source); this.updateVirtualSets(); this.updateBodyWidths(); // this event is picked up by the gui, headerRenderer and rowRenderer, to recalculate what columns to display var event = { type: events_1.Events.EVENT_DISPLAYED_COLUMNS_CHANGED, api: this.gridApi, columnApi: this.columnApi }; this.eventService.dispatchEvent(event); }; ColumnController.prototype.updateDisplayedColumnsFromTrees = function (source) { this.addToDisplayedColumns(this.displayedLeftColumnTree, this.displayedLeftColumns); this.addToDisplayedColumns(this.displayedCentreColumnTree, this.displayedCenterColumns); this.addToDisplayedColumns(this.displayedRightColumnTree, this.displayedRightColumns); this.setupAllDisplayedColumns(); this.setLeftValues(source); }; ColumnController.prototype.setupAllDisplayedColumns = function () { if (this.gridOptionsWrapper.isEnableRtl()) { this.allDisplayedColumns = this.displayedRightColumns .concat(this.displayedCenterColumns) .concat(this.displayedLeftColumns); } else { this.allDisplayedColumns = this.displayedLeftColumns .concat(this.displayedCenterColumns) .concat(this.displayedRightColumns); } }; // sets the left pixel position of each column ColumnController.prototype.setLeftValues = function (source) { this.setLeftValuesOfColumns(source); this.setLeftValuesOfGroups(); }; ColumnController.prototype.setLeftValuesOfColumns = function (source) { var _this = this; // go through each list of displayed columns var allColumns = this.primaryColumns.slice(0); // let totalColumnWidth = this.getWidthOfColsInList() var doingRtl = this.gridOptionsWrapper.isEnableRtl(); [this.displayedLeftColumns, this.displayedRightColumns, this.displayedCenterColumns].forEach(function (columns) { if (doingRtl) { // when doing RTL, we start at the top most pixel (ie RHS) and work backwards var left_1 = _this.getWidthOfColsInList(columns); columns.forEach(function (column) { left_1 -= column.getActualWidth(); column.setLeft(left_1, source); }); } else { // otherwise normal LTR, we start at zero var left_2 = 0; columns.forEach(function (column) { column.setLeft(left_2, source); left_2 += column.getActualWidth(); }); } utils_1.Utils.removeAllFromArray(allColumns, columns); }); // items left in allColumns are columns not displayed, so remove the left position. this is // important for the rows, as if a col is made visible, then taken out, then made visible again, // we don't want the animation of the cell floating in from the old position, whatever that was. allColumns.forEach(function (column) { column.setLeft(null, source); }); }; ColumnController.prototype.setLeftValuesOfGroups = function () { // a groups left value is the lest left value of it's children [this.displayedLeftColumnTree, this.displayedRightColumnTree, this.displayedCentreColumnTree].forEach(function (columns) { columns.forEach(function (column) { if (column instanceof columnGroup_1.ColumnGroup) { var columnGroup = column; columnGroup.checkLeft(); } }); }); }; ColumnController.prototype.addToDisplayedColumns = function (displayedColumnTree, displayedColumns) { displayedColumns.length = 0; this.columnUtils.depthFirstDisplayedColumnTreeSearch(displayedColumnTree, function (child) { if (child instanceof column_1.Column) { displayedColumns.push(child); } }); }; ColumnController.prototype.updateDisplayedCenterVirtualColumns = function () { var skipVirtualisation = this.gridOptionsWrapper.isSuppressColumnVirtualisation() || this.gridOptionsWrapper.isForPrint(); if (skipVirtualisation) { // no virtualisation, so don't filter this.allDisplayedCenterVirtualColumns = this.displayedCenterColumns; } else { // filter out what should be visible this.allDisplayedCenterVirtualColumns = this.filterOutColumnsWithinViewport(); } this.allDisplayedVirtualColumns = this.allDisplayedCenterVirtualColumns .concat(this.displayedLeftColumns) .concat(this.displayedRightColumns); // return map of virtual col id's, for easy lookup when building the groups. // the map will be colId=>true, ie col id's mapping to 'true'. var result = {}; this.allDisplayedVirtualColumns.forEach(function (col) { result[col.getId()] = true; }); return result; }; ColumnController.prototype.getVirtualHeaderGroupRow = function (type, dept) { var result; switch (type) { case column_1.Column.PINNED_LEFT: result = this.displayedLeftHeaderRows[dept]; break; case column_1.Column.PINNED_RIGHT: result = this.displayedRightHeaderRows[dept]; break; default: result = this.displayedCentreHeaderRows[dept]; break; } if (utils_1.Utils.missing(result)) { result = []; } return result; }; ColumnController.prototype.updateDisplayedVirtualGroups = function (virtualColIds) { // go through each group, see if any of it's cols are displayed, and if yes, // then this group is included this.displayedLeftHeaderRows = {}; this.displayedRightHeaderRows = {}; this.displayedCentreHeaderRows = {}; testGroup(this.displayedLeftColumnTree, this.displayedLeftHeaderRows, 0); testGroup(this.displayedRightColumnTree, this.displayedRightHeaderRows, 0); testGroup(this.displayedCentreColumnTree, this.displayedCentreHeaderRows, 0); function testGroup(children, result, dept) { var returnValue = false; for (var i = 0; i < children.length; i++) { // see if this item is within viewport var child = children[i]; var addThisItem = void 0; if (child instanceof column_1.Column) { // for column, test if column is included addThisItem = virtualColIds[child.getId()] === true; } else { // if group, base decision on children var columnGroup = child; addThisItem = testGroup(columnGroup.getDisplayedChildren(), result, dept + 1); } if (addThisItem) { returnValue = true; if (!result[dept]) { result[dept] = []; } result[dept].push(child); } } return returnValue; } }; ColumnController.prototype.updateVirtualSets = function () { var virtualColIds = this.updateDisplayedCenterVirtualColumns(); this.updateDisplayedVirtualGroups(virtualColIds); }; ColumnController.prototype.filterOutColumnsWithinViewport = function () { return utils_1.Utils.filter(this.displayedCenterColumns, this.isColumnInViewport.bind(this)); }; // called from api ColumnController.prototype.sizeColumnsToFit = function (gridWidth, source) { var _this = this; if (source === void 0) { source = "api"; } // avoid divide by zero var allDisplayedColumns = this.getAllDisplayedColumns(); if (gridWidth <= 0 || allDisplayedColumns.length === 0) { return; } var colsToNotSpread = utils_1.Utils.filter(allDisplayedColumns, function (column) { return column.getColDef().suppressSizeToFit === true; }); var colsToSpread = utils_1.Utils.filter(allDisplayedColumns, function (column) { return column.getColDef().suppressSizeToFit !== true; }); // make a copy of the cols that are going to be resized var colsToFireEventFor = colsToSpread.slice(0); var finishedResizing = false; while (!finishedResizing) { finishedResizing = true; var availablePixels = gridWidth - this.getWidthOfColsInList(colsToNotSpread); if (availablePixels <= 0) { // no width, set everything to minimum colsToSpread.forEach(function (column) { column.setMinimum(source); }); } else { var scale = availablePixels / this.getWidthOfColsInList(colsToSpread); // we set the pixels for the last col based on what's left, as otherwise // we could be a pixel or two short or extra because of rounding errors. var pixelsForLastCol = availablePixels; // backwards through loop, as we are removing items as we go for (var i = colsToSpread.length - 1; i >= 0; i--) { var column = colsToSpread[i]; var newWidth = Math.round(column.getActualWidth() * scale); if (newWidth < column.getMinWidth()) { column.setMinimum(source); moveToNotSpread(column); finishedResizing = false; } else if (column.isGreaterThanMax(newWidth)) { column.setActualWidth(column.getMaxWidth(), source); moveToNotSpread(column); finishedResizing = false; } else { var onLastCol = i === 0; if (onLastCol) { column.setActualWidth(pixelsForLastCol, source); } else { column.setActualWidth(newWidth, source); } } pixelsForLastCol -= newWidth; } } } this.setLeftValues(source); this.updateBodyWidths(); colsToFireEventFor.forEach(function (column) { var event = { type: events_1.Events.EVENT_COLUMN_RESIZED, column: column, columns: [column], finished: true, api: _this.gridApi, columnApi: _this.columnApi, source: "sizeColumnsToFit" }; _this.eventService.dispatchEvent(event); }); function moveToNotSpread(column) { utils_1.Utils.removeFromArray(colsToSpread, column); colsToNotSpread.push(column); } }; ColumnController.prototype.buildDisplayedTrees = function (visibleColumns) { var leftVisibleColumns = utils_1.Utils.filter(visibleColumns, function (column) { return column.getPinned() === 'left'; }); var rightVisibleColumns = utils_1.Utils.filter(visibleColumns, function (column) { return column.getPinned() === 'right'; }); var centerVisibleColumns = utils_1.Utils.filter(visibleColumns, function (column) { return column.getPinned() !== 'left' && column.getPinned() !== 'right'; }); var groupInstanceIdCreator = new groupInstanceIdCreator_1.GroupInstanceIdCreator(); this.displayedLeftColumnTree = this.displayedGroupCreator.createDisplayedGroups(leftVisibleColumns, this.gridBalancedTree, groupInstanceIdCreator, this.displayedLeftColumnTree); this.displayedRightColumnTree = this.displayedGroupCreator.createDisplayedGroups(rightVisibleColumns, this.gridBalancedTree, groupInstanceIdCreator, this.displayedRightColumnTree); this.displayedCentreColumnTree = this.displayedGroupCreator.createDisplayedGroups(centerVisibleColumns, this.gridBalancedTree, groupInstanceIdCreator, this.displayedCentreColumnTree); }; ColumnController.prototype.updateOpenClosedVisibilityInColumnGroups = function () { var allColumnGroups = this.getAllDisplayedColumnGroups(); this.columnUtils.depthFirstAllColumnTreeSearch(allColumnGroups, function (child) { if (child instanceof columnGroup_1.ColumnGroup) { var columnGroup = child; columnGroup.calculateDisplayedColumns(); } }); }; ColumnController.prototype.getGroupAutoColumns = function () { return this.groupAutoColumns; }; ColumnController.prototype.createGroupAutoColumnsIfNeeded = function () { if (!this.autoGroupsNeedBuilding) { return; } this.autoGroupsNeedBuilding = false; // see if we need to insert the default grouping column var needAutoColumns = (this.rowGroupColumns.length > 0 || this.usingTreeData) && !this.gridOptionsWrapper.isGroupSuppressAutoColumn() && !this.gridOptionsWrapper.isGroupUseEntireRow() && !this.gridOptionsWrapper.isGroupSuppressRow(); if (needAutoColumns) { this.groupAutoColumns = this.autoGroupColService.createAutoGroupColumns(this.rowGroupColumns); } else { this.groupAutoColumns = null; } }; ColumnController.prototype.createValueColumns = function (source) { this.valueColumns.forEach(function (column) { return column.setValueActive(false, source); }); this.valueColumns = []; // override with columns that have the aggFunc specified explicitly for (var i = 0; i < this.primaryColumns.length; i++) { var column = this.primaryColumns[i]; if (column.getColDef().aggFunc) { column.setAggFunc(column.getColDef().aggFunc); this.valueColumns.push(column); column.setValueActive(true, source); } } }; ColumnController.prototype.getWidthOfColsInList = function (columnList) { var result = 0; for (var i = 0; i < columnList.length; i++) { result += columnList[i].getActualWidth(); } return result; }; ColumnController.prototype.getGridBalancedTree = function () { return this.gridBalancedTree; }; __decorate([ context_1.Autowired('gridOptionsWrapper'), __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper) ], ColumnController.prototype, "gridOptionsWrapper", void 0); __decorate([ context_1.Autowired('expressionService'), __metadata("design:type", expressionService_1.ExpressionService) ], ColumnController.prototype, "expressionService", void 0); __decorate([ context_1.Autowired('balancedColumnTreeBuilder'), __metadata("design:type", balancedColumnTreeBuilder_1.BalancedColumnTreeBuilder) ], ColumnController.prototype, "balancedColumnTreeBuilder", void 0); __decorate([ context_1.Autowired('displayedGroupCreator'), __metadata("design:type", displayedGroupCreator_1.DisplayedGroupCreator) ], ColumnController.prototype, "displayedGroupCreator", void 0); __decorate([ context_1.Autowired('autoWidthCalculator'), __metadata("design:type", autoWidthCalculator_1.AutoWidthCalculator) ], ColumnController.prototype, "autoWidthCalculator", void 0); __decorate([ context_1.Autowired('eventService'), __metadata("design:type", eventService_1.EventService) ], ColumnController.prototype, "eventService", void 0); __decorate([ context_1.Autowired('columnUtils'), __metadata("design:type", columnUtils_1.ColumnUtils) ], ColumnController.prototype, "columnUtils", void 0); __decorate([ context_1.Autowired('gridPanel'), __metadata("design:type", gridPanel_1.GridPanel) ], ColumnController.prototype, "gridPanel", void 0); __decorate([ context_1.Autowired('context'), __metadata("design:type", context_1.Context) ], ColumnController.prototype, "context", void 0); __decorate([ context_1.Autowired('columnAnimationService'), __metadata("design:type", columnAnimationService_1.ColumnAnimationService) ], ColumnController.prototype, "columnAnimationService", void 0); __decorate([ context_1.Autowired('autoGroupColService'), __metadata("design:type", autoGroupColService_1.AutoGroupColService) ], ColumnController.prototype, "autoGroupColService", void 0); __decorate([ context_1.Optional('aggFuncService'), __metadata("design:type", Object) ], ColumnController.prototype, "aggFuncService", void 0); __decorate([ context_1.Optional('valueCache'), __metadata("design:type", valueCache_1.ValueCache) ], ColumnController.prototype, "valueCache", void 0); __decorate([ context_1.Autowired('columnApi'), __metadata("design:type", columnApi_1.ColumnApi) ], ColumnController.prototype, "columnApi", void 0); __decorate([ context_1.Autowired('gridApi'), __metadata("design:type", gridApi_1.GridApi) ], ColumnController.prototype, "gridApi", void 0); __decorate([ context_1.PostConstruct, __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", void 0) ], ColumnController.prototype, "init", null); __decorate([ __param(0, context_1.Qualifier('loggerFactory')), __metadata("design:type", Function), __metadata("design:paramtypes", [logger_1.LoggerFactory]), __metadata("design:returntype", void 0) ], ColumnController.prototype, "setBeans", null); ColumnController = __decorate([ context_1.Bean('columnController') ], ColumnController); return ColumnController; }()); exports.ColumnController = ColumnController; /***/ }), /* 5 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v16.0.0 * @link http://www.ag-grid.com/ * @license MIT */ Object.defineProperty(exports, "__esModule", { value: true }); var eventKeys_1 = __webpack_require__(62); exports.Events = eventKeys_1.Events; /***/ }), /* 6 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v16.0.0 * @link http://www.ag-grid.com/ * @license MIT */ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 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; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; Object.defineProperty(exports, "__esModule", { value: true }); var csvCreator_1 = __webpack_require__(45); var rowRenderer_1 = __webpack_require__(23); var headerRenderer_1 = __webpack_require__(57); var filterManager_1 = __webpack_require__(19); var columnController_1 = __webpack_require__(4); var selectionController_1 = __webpack_require__(16); var gridOptionsWrapper_1 = __webpack_require__(2); var gridPanel_1 = __webpack_require__(11); var valueService_1 = __webpack_require__(18); var eventService_1 = __webpack_require__(3); var constants_1 = __webpack_require__(8); var context_1 = __webpack_require__(0); var gridCore_1 = __webpack_require__(43); var sortController_1 = __webpack_require__(27); var focusedCellController_1 = __webpack_require__(24); var gridCell_1 = __webpack_require__(26); var utils_1 = __webpack_require__(1); var cellRendererFactory_1 = __webpack_require__(56); var cellEditorFactory_1 = __webpack_require__(54); var paginationProxy_1 = __webpack_require__(29); var immutableService_1 = __webpack_require__(103); var valueCache_1 = __webpack_require__(34); var alignedGridsService_1 = __webpack_require__(48); var pinnedRowModel_1 = __webpack_require__(30); var GridApi = (function () { function GridApi() { this.detailGridInfoMap = {}; /* Taking these out, as we want to reconsider how we register components public addCellRenderer(key: string, cellRenderer: {new(): ICellRenderer} | ICellRendererFunc): void { this.cellRendererFactory.addCellRenderer(key, cellRenderer); } public addCellEditor(key: string, cellEditor: {new(): ICellEditor}): void { this.cellEditorFactory.addCellEditor(key, cellEditor); }*/ } GridApi.prototype.init = function () { switch (this.rowModel.getType()) { case constants_1.Constants.ROW_MODEL_TYPE_IN_MEMORY: this.inMemoryRowModel = this.rowModel; break; case constants_1.Constants.ROW_MODEL_TYPE_INFINITE: this.infinitePageRowModel = this.rowModel; break; case constants_1.Constants.ROW_MODEL_TYPE_ENTERPRISE: this.enterpriseRowModel = this.rowModel; break; } }; /** Used internally by grid. Not intended to be used by the client. Interface may change between releases. */ GridApi.prototype.__getAlignedGridService = function () { return this.alignedGridsService; }; GridApi.prototype.addDetailGridInfo = function (id, gridInfo) { this.detailGridInfoMap[id] = gridInfo; }; GridApi.prototype.removeDetailGridInfo = function (id) { this.detailGridInfoMap[id] = undefined; }; GridApi.prototype.getDetailGridInfo = function (id) { return this.detailGridInfoMap[id]; }; GridApi.prototype.forEachDetailGridInfo = function (callback) { var index = 0; utils_1.Utils.iterateObject(this.detailGridInfoMap, function (id, gridInfo) { // check for undefined, as old references will still be lying around if (utils_1.Utils.exists(gridInfo)) { callback(gridInfo, index); index++; } }); }; GridApi.prototype.getDataAsCsv = function (params) { return this.csvCreator.getDataAsCsv(params); }; GridApi.prototype.exportDataAsCsv = function (params) { this.csvCreator.exportDataAsCsv(params); }; GridApi.prototype.getDataAsExcel = function (params) { if (!this.excelCreator) { console.warn('ag-Grid: Excel export is only available in ag-Grid Enterprise'); } return this.excelCreator.getDataAsExcelXml(params); }; GridApi.prototype.exportDataAsExcel = function (params) { if (!this.excelCreator) { console.warn('ag-Grid: Excel export is only available in ag-Grid Enterprise'); } this.excelCreator.exportDataAsExcel(params); }; GridApi.prototype.setEnterpriseDatasource = function (datasource) { if (this.gridOptionsWrapper.isRowModelEnterprise()) { // should really have an IEnterpriseRowModel interface, so we are not casting to any this.rowModel.setDatasource(datasource); } else { console.warn("ag-Grid: you can only use an enterprise datasource when gridOptions.rowModelType is '" + constants_1.Constants.ROW_MODEL_TYPE_ENTERPRISE + "'"); } }; GridApi.prototype.setDatasource = function (datasource) { if (this.gridOptionsWrapper.isRowModelInfinite()) { this.rowModel.setDatasource(datasource); } else { console.warn("ag-Grid: you can only use a datasource when gridOptions.rowModelType is '" + constants_1.Constants.ROW_MODEL_TYPE_INFINITE + "'"); } }; GridApi.prototype.setViewportDatasource = function (viewportDatasource) { if (this.gridOptionsWrapper.isRowModelViewport()) { // this is bad coding, because it's using an interface that's exposed in the enterprise. // really we should create an interface in the core for viewportDatasource and let // the enterprise implement it, rather than casting to 'any' here this.rowModel.setViewportDatasource(viewportDatasource); } else { console.warn("ag-Grid: you can only use a viewport datasource when gridOptions.rowModelType is '" + constants_1.Constants.ROW_MODEL_TYPE_VIEWPORT + "'"); } }; GridApi.prototype.setRowData = function (rowData) { if (this.gridOptionsWrapper.isRowModelDefault()) { if (this.gridOptionsWrapper.isDeltaRowDataMode()) { var _a = this.immutableService.createTransactionForRowData(rowData), transaction = _a[0], orderIdMap = _a[1]; this.inMemoryRowModel.updateRowData(transaction, orderIdMap); } else { this.selectionController.reset(); this.inMemoryRowModel.setRowData(rowData); } } else { console.log('cannot call setRowData unless using normal row model'); } }; // DEPRECATED GridApi.prototype.setFloatingTopRowData = function (rows) { console.warn('ag-Grid: since v12, api.setFloatingTopRowData() is now api.setPinnedTopRowData()'); this.setPinnedTopRowData(rows); }; // DEPRECATED GridApi.prototype.setFloatingBottomRowData = function (rows) { console.warn('ag-Grid: since v12, api.setFloatingBottomRowData() is now api.setPinnedBottomRowData()'); this.setPinnedBottomRowData(rows); }; // DEPRECATED GridApi.prototype.getFloatingTopRowCount = function () { console.warn('ag-Grid: since v12, api.getFloatingTopRowCount() is now api.getPinnedTopRowCount()'); return this.getPinnedTopRowCount(); }; // DEPRECATED GridApi.prototype.getFloatingBottomRowCount = function () { console.warn('ag-Grid: since v12, api.getFloatingBottomRowCount() is now api.getPinnedBottomRowCount()'); return this.getPinnedBottomRowCount(); }; // DEPRECATED GridApi.prototype.getFloatingTopRow = function (index) { console.warn('ag-Grid: since v12, api.getFloatingTopRow() is now api.getPinnedTopRow()'); return this.getPinnedTopRow(index); }; // DEPRECATED GridApi.prototype.getFloatingBottomRow = function (index) { console.warn('ag-Grid: since v12, api.getFloatingBottomRow() is now api.getPinnedBottomRow()'); return this.getPinnedBottomRow(index); }; GridApi.prototype.setPinnedTopRowData = function (rows) { this.pinnedRowModel.setPinnedTopRowData(rows); }; GridApi.prototype.setPinnedBottomRowData = function (rows) { this.pinnedRowModel.setPinnedBottomRowData(rows); }; GridApi.prototype.getPinnedTopRowCount = function () { return this.pinnedRowModel.getPinnedTopRowCount(); }; GridApi.prototype.getPinnedBottomRowCount = function () { return this.pinnedRowModel.getPinnedBottomRowCount(); }; GridApi.prototype.getPinnedTopRow = function (index) { return this.pinnedRowModel.getPinnedTopRow(index); }; GridApi.prototype.getPinnedBottomRow = function (index) { return this.pinnedRowModel.getPinnedBottomRow(index); }; GridApi.prototype.setColumnDefs = function (colDefs, source) { if (source === void 0) { source = "api"; } this.columnController.setColumnDefs(colDefs, source); }; GridApi.prototype.expireValueCache = function () { this.valueCache.expire(); }; GridApi.prototype.getVerticalPixelRange = function () { return this.gridPanel.getVerticalPixelRange(); }; GridApi.prototype.refreshToolPanel = function () { if (this.toolPanel) { this.toolPanel.refresh(); } }; GridApi.prototype.refreshCells = function (params) { if (params === void 0) { params = {}; } if (Array.isArray(params)) { // the old version of refreshCells() took an array of rowNodes for the first argument console.warn('since ag-Grid v11.1, refreshCells() now takes parameters, please see the documentation.'); return; } this.rowRenderer.refreshCells(params); }; GridApi.prototype.redrawRows = function (params) { if (params === void 0) { params = {}; } if (params && params.rowNodes) { this.rowRenderer.redrawRows(params.rowNodes); } else { this.rowRenderer.redrawAfterModelUpdate(); } }; GridApi.prototype.timeFullRedraw = function (count) { if (count === void 0) { count = 1; } var iterationCount = 0; var totalProcessing = 0; var totalReflow = 0; var that = this; doOneIteration(); function doOneIteration() { var start = (new Date()).getTime(); that.rowRenderer.redrawAfterModelUpdate(); var endProcessing = (new Date()).getTime(); setTimeout(function () { var endReflow = (new Date()).getTime(); var durationProcessing = endProcessing - start; var durationReflow = endReflow - endProcessing; console.log('duration: processing = ' + durationProcessing + 'ms, reflow = ' + durationReflow + 'ms'); iterationCount++; totalProcessing += durationProcessing; totalReflow += durationReflow; if (iterationCount < count) { // wait for 1s between tests setTimeout(doOneIteration, 1000); } else { finish(); } }, 0); } function finish() { console.log('tests complete. iteration count = ' + iterationCount); console.log('average processing = ' + (totalProcessing / iterationCount) + 'ms'); console.log('average reflow = ' + (totalReflow / iterationCount) + 'ms'); } }; // *** deprecated GridApi.prototype.refreshView = function () { console.warn('ag-Grid: since v11.1, refreshView() is deprecated, please call refreshCells() or redrawRows() instead'); this.redrawRows(); }; // *** deprecated GridApi.prototype.refreshRows = function (rowNodes) { console.warn('since ag-Grid v11.1, refreshRows() is deprecated, please use refreshCells({rowNodes: rows}) or redrawRows({rowNodes: rows}) instead'); this.refreshCells({ rowNodes: rowNodes }); }; // *** deprecated GridApi.prototype.rowDataChanged = function (rows) { 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'); this.redrawRows(); }; // *** deprecated GridApi.prototype.softRefreshView = function () { console.error('ag-Grid: since v16, softRefreshView() is no longer supported. Please check the documentation on how to refresh.'); }; // *** deprecated GridApi.prototype.refreshGroupRows = function () { console.warn('ag-Grid: since v11.1, refreshGroupRows() is no longer supported, call refreshCells() instead. ' + 'Because refreshCells() now does dirty checking, it will only refresh cells that have changed, so it should ' + 'not be necessary to only refresh the group rows.'); this.refreshCells(); }; GridApi.prototype.setFunctionsReadOnly = function (readOnly) { this.gridOptionsWrapper.setProperty('functionsReadOnly', readOnly); }; GridApi.prototype.refreshHeader = function () { this.headerRenderer.refreshHeader(); this.gridPanel.setBodyAndHeaderHeights(); }; GridApi.prototype.isAnyFilterPresent = function () { return this.filterManager.isAnyFilterPresent(); }; GridApi.prototype.isAdvancedFilterPresent = function () { return this.filterManager.isAdvancedFilterPresent(); }; GridApi.prototype.isQuickFilterPresent = function () { return this.filterManager.isQuickFilterPresent(); }; GridApi.prototype.getModel = function () { return this.rowModel; }; GridApi.prototype.onGroupExpandedOrCollapsed = function (deprecated_refreshFromIndex) { if (utils_1.Utils.missing(this.inMemoryRowModel)) { console.log('ag-Grid: cannot call onGroupExpandedOrCollapsed unless using normal row model'); } if (utils_1.Utils.exists(deprecated_refreshFromIndex)) { console.log('ag-Grid: api.onGroupExpandedOrCollapsed - refreshFromIndex parameter is no longer used, the grid will refresh all rows'); } // we don't really want the user calling this if one one rowNode was expanded, instead they should be // calling rowNode.setExpanded(boolean) - this way we do a 'keepRenderedRows=false' so that the whole // grid gets refreshed again - otherwise the row with the rowNodes that were changed won't get updated, // and thus the expand icon in the group cell won't get 'opened' or 'closed'. this.inMemoryRowModel.refreshModel({ step: constants_1.Constants.STEP_MAP }); }; GridApi.prototype.refreshInMemoryRowModel = function (step) { if (utils_1.Utils.missing(this.inMemoryRowModel)) { console.log('cannot call refreshInMemoryRowModel unless using normal row model'); } var paramsStep = constants_1.Constants.STEP_EVERYTHING; var stepsMapped = { group: constants_1.Constants.STEP_EVERYTHING, filter: constants_1.Constants.STEP_FILTER, map: constants_1.Constants.STEP_MAP, aggregate: constants_1.Constants.STEP_AGGREGATE, sort: constants_1.Constants.STEP_SORT, pivot: constants_1.Constants.STEP_PIVOT }; if (utils_1.Utils.exists(step)) { paramsStep = stepsMapped[step]; } if (utils_1.Utils.missing(paramsStep)) { console.error("ag-Grid: invalid step " + step + ", available steps are " + Object.keys(stepsMapped).join(', ')); return; } var modelParams = { step: paramsStep, keepRenderedRows: true, animate: true, keepEditingRows: true }; this.inMemoryRowModel.refreshModel(modelParams); }; GridApi.prototype.getRowNode = function (id) { if (utils_1.Utils.missing(this.inMemoryRowModel)) { console.warn('ag-Grid: cannot call getRowNode unless using normal row model'); return; } return this.inMemoryRowModel.getRowNode(id); }; GridApi.prototype.expandAll = function () { if (utils_1.Utils.missing(this.inMemoryRowModel)) { console.warn('ag-Grid: cannot call expandAll unless using normal row model'); return; } this.inMemoryRowModel.expandOrCollapseAll(true); }; GridApi.prototype.collapseAll = function () { if (utils_1.Utils.missing(this.inMemoryRowModel)) { console.warn('ag-Grid: cannot call collapseAll unless using normal row model'); return; } this.inMemoryRowModel.expandOrCollapseAll(false); }; GridApi.prototype.addVirtualRowListener = function (eventName, rowIndex, callback) { if (typeof eventName !== 'string') { console.log('ag-Grid: addVirtualRowListener is deprecated, please use addRenderedRowListener.'); } this.addRenderedRowListener(eventName, rowIndex, callback); }; GridApi.prototype.addRenderedRowListener = function (eventName, rowIndex, callback) { if (eventName === 'virtualRowSelected') { console.log('ag-Grid: event virtualRowSelected is deprecated, to register for individual row ' + 'selection events, add a listener directly to the row node.'); } this.rowRenderer.addRenderedRowListener(eventName, rowIndex, callback); }; GridApi.prototype.setQuickFilter = function (newFilter) { this.filterManager.setQuickFilter(newFilter); }; GridApi.prototype.selectIndex = function (index, tryMulti, suppressEvents) { console.log('ag-Grid: do not use api for selection, call node.setSelected(value) instead'); if (suppressEvents) { console.log('ag-Grid: suppressEvents is no longer supported, stop listening for the event if you no longer want it'); } this.selectionController.selectIndex(index, tryMulti); }; GridApi.prototype.deselectIndex = function (index, suppressEvents) { if (suppressEvents === void 0) { suppressEvents = false; } console.log('ag-Grid: do not use api for selection, call node.setSelected(value) instead'); if (suppressEvents) { console.log('ag-Grid: suppressEvents is no longer supported, stop listening for the event if you no longer want it'); } this.selectionController.deselectIndex(index); }; GridApi.prototype.selectNode = function (node, tryMulti, suppressEvents) { if (tryMulti === void 0) { tryMulti = false; } if (suppressEvents === void 0) { suppressEvents = false; } console.log('ag-Grid: API for selection is deprecated, call node.setSelected(value) instead'); if (suppressEvents) { console.log('ag-Grid: suppressEvents is no longer supported, stop listening for the event if you no longer want it'); } node.setSelectedParams({ newValue: true, clearSelection: !tryMulti }); }; GridApi.prototype.deselectNode = function (node, suppressEvents) { if (suppressEvents === void 0) { suppressEvents = false; } console.log('ag-Grid: API for selection is deprecated, call node.setSelected(value) instead'); if (suppressEvents) { console.log('ag-Grid: suppressEvents is no longer supported, stop listening for the event if you no longer want it'); } node.setSelectedParams({ newValue: false }); }; GridApi.prototype.selectAll = function () { this.selectionController.selectAllRowNodes(); }; GridApi.prototype.deselectAll = function () { this.selectionController.deselectAllRowNodes(); }; GridApi.prototype.selectAllFiltered = function () { this.selectionController.selectAllRowNodes(true); }; GridApi.prototype.deselectAllFiltered = function () { this.selectionController.deselectAllRowNodes(true); }; GridApi.prototype.recomputeAggregates = function () { if (utils_1.Utils.missing(this.inMemoryRowModel)) { console.warn('cannot call recomputeAggregates unless using normal row model'); } console.warn("recomputeAggregates is deprecated, please call api.refreshInMemoryRowModel('aggregate') instead"); this.inMemoryRowModel.refreshModel({ step: constants_1.Constants.STEP_AGGREGATE }); }; GridApi.prototype.sizeColumnsToFit = function () { if (this.gridOptionsWrapper.isForPrint()) { console.warn('ag-grid: sizeColumnsToFit does not work when forPrint=true'); return; } this.gridPanel.sizeColumnsToFit(); }; GridApi.prototype.showLoadingOverlay = function () { this.gridPanel.showLoadingOverlay(); }; GridApi.prototype.showNoRowsOverlay = function () { this.gridPanel.showNoRowsOverlay(); }; GridApi.prototype.hideOverlay = function () { this.gridPanel.hideOverlay(); }; GridApi.prototype.isNodeSelected = function (node) { console.log('ag-Grid: no need to call api.isNodeSelected(), just call node.isSelected() instead'); return node.isSelected(); }; GridApi.prototype.getSelectedNodesById = function () { console.error('ag-Grid: since version 3.4, getSelectedNodesById no longer exists, use getSelectedNodes() instead'); return null; }; GridApi.prototype.getSelectedNodes = function () { return this.selectionController.getSelectedNodes(); }; GridApi.prototype.getSelectedRows = function () { return this.selectionController.getSelectedRows(); }; GridApi.prototype.getBestCostNodeSelection = function () { return this.selectionController.getBestCostNodeSelection(); }; GridApi.prototype.getRenderedNodes = function () { return this.rowRenderer.getRenderedNodes(); }; GridApi.prototype.ensureColIndexVisible = function (index) { console.warn('ag-Grid: ensureColIndexVisible(index) no longer supported, use ensureColumnVisible(colKey) instead.'); }; GridApi.prototype.ensureColumnVisible = function (key) { this.gridPanel.ensureColumnVisible(key); }; // Valid values for position are bottom, middle and top GridApi.prototype.ensureIndexVisible = function (index, position) { this.gridPanel.ensureIndexVisible(index, position); }; // Valid values for position are bottom, middle and top GridApi.prototype.ensureNodeVisible = function (comparator, position) { this.gridCore.ensureNodeVisible(comparator, position); }; GridApi.prototype.forEachLeafNode = function (callback) { if (utils_1.Utils.missing(this.inMemoryRowModel)) { console.log('cannot call forEachNode unless using normal row model'); } this.inMemoryRowModel.forEachLeafNode(callback); }; GridApi.prototype.forEachNode = function (callback) { this.rowModel.forEachNode(callback); }; GridApi.prototype.forEachNodeAfterFilter = function (callback) { if (utils_1.Utils.missing(this.inMemoryRowModel)) { console.log('cannot call forEachNodeAfterFilter unless using normal row model'); } this.inMemoryRowModel.forEachNodeAfterFilter(callback); }; GridApi.prototype.forEachNodeAfterFilterAndSort = function (callback) { if (utils_1.Utils.missing(this.inMemoryRowModel)) { console.log('cannot call forEachNodeAfterFilterAndSort unless using normal row model'); } this.inMemoryRowModel.forEachNodeAfterFilterAndSort(callback); }; GridApi.prototype.getFilterApiForColDef = function (colDef) { console.warn('ag-grid API method getFilterApiForColDef deprecated, use getFilterApi instead'); return this.getFilterInstance(colDef); }; GridApi.prototype.getFilterInstance = function (key) { var column = this.columnController.getPrimaryColumn(key); if (column) { return this.filterManager.getFilterComponent(column).resolveNow(null, function (filterComp) { return filterComp; }); } }; GridApi.prototype.getFilterApi = function (key) { console.warn('ag-Grid: getFilterApi is deprecated, use getFilterInstance instead'); return this.getFilterInstance(key); }; GridApi.prototype.destroyFilter = function (key) { var column = this.columnController.getPrimaryColumn(key); if (column) { return this.filterManager.destroyFilter(column, "filterDestroyed"); } }; GridApi.prototype.getColumnDef = function (key) { var column = this.columnController.getPrimaryColumn(key); if (column) { return column.getColDef(); } else { return null; } }; GridApi.prototype.onFilterChanged = function () { this.filterManager.onFilterChanged(); }; GridApi.prototype.onSortChanged = function () { this.sortController.onSortChanged(); }; GridApi.prototype.setSortModel = function (sortModel, source) { if (source === void 0) { source = "api"; } this.sortController.setSortModel(sortModel, source); }; GridApi.prototype.getSortModel = function () { return this.sortController.getSortModel(); }; GridApi.prototype.setFilterModel = function (model) { this.filterManager.setFilterModel(model); }; GridApi.prototype.getFilterModel = function () { return this.filterManager.getFilterModel(); }; GridApi.prototype.getFocusedCell = function () { return this.focusedCellController.getFocusedCell(); }; GridApi.prototype.clearFocusedCell = function () { return this.focusedCellController.clearFocusedCell(); }; GridApi.prototype.setFocusedCell = function (rowIndex, colKey, floating) { this.focusedCellController.setFocusedCell(rowIndex, colKey, floating, true); }; GridApi.prototype.setSuppressRowDrag = function (value) { this.gridOptionsWrapper.setProperty(gridOptionsWrapper_1.GridOptionsWrapper.PROP_SUPPRESS_ROW_DRAG, value); }; GridApi.prototype.setHeaderHeight = function (headerHeight) { this.gridOptionsWrapper.setProperty(gridOptionsWrapper_1.GridOptionsWrapper.PROP_HEADER_HEIGHT, headerHeight); this.doLayout(); }; GridApi.prototype.setGroupHeaderHeight = function (headerHeight) { this.gridOptionsWrapper.setProperty(gridOptionsWrapper_1.GridOptionsWrapper.PROP_GROUP_HEADER_HEIGHT, headerHeight); this.doLayout(); }; GridApi.prototype.setFloatingFiltersHeight = function (headerHeight) { this.gridOptionsWrapper.setProperty(gridOptionsWrapper_1.GridOptionsWrapper.PROP_FLOATING_FILTERS_HEIGHT, headerHeight); this.doLayout(); }; GridApi.prototype.setPivotGroupHeaderHeight = function (headerHeight) { this.gridOptionsWrapper.setProperty(gridOptionsWrapper_1.GridOptionsWrapper.PROP_PIVOT_GROUP_HEADER_HEIGHT, headerHeight); this.doLayout(); }; GridApi.prototype.setPivotHeaderHeight = function (headerHeight) { this.gridOptionsWrapper.setProperty(gridOptionsWrapper_1.GridOptionsWrapper.PROP_PIVOT_HEADER_HEIGHT, headerHeight); this.doLayout(); }; GridApi.prototype.showToolPanel = function (show) { this.gridCore.showToolPanel(show); }; GridApi.prototype.isToolPanelShowing = function () { return this.gridCore.isToolPanelShowing(); }; GridApi.prototype.doLayout = function () { this.gridCore.doLayout(); // if the column is not visible, then made visible, it will be right size, but the // correct virtual columns will not be displayed. the setLeftAndRightBounds() gets // called when size changes. however when size is not changed, then wrong cols are shown. // this was to fix https://ag-grid.atlassian.net/browse/AG-1081 this.gridPanel.setLeftAndRightBounds(); }; GridApi.prototype.resetRowHeights = function () { if (utils_1.Utils.exists(this.inMemoryRowModel)) { this.inMemoryRowModel.resetRowHeights(); } }; GridApi.prototype.setGroupRemoveSingleChildren = function (value) { this.gridOptionsWrapper.setProperty(gridOptionsWrapper_1.GridOptionsWrapper.PROP_GROUP_REMOVE_SINGLE_CHILDREN, value); }; GridApi.prototype.setGroupRemoveLowestSingleChildren = function (value) { this.gridOptionsWrapper.setProperty(gridOptionsWrapper_1.GridOptionsWrapper.PROP_GROUP_REMOVE_LOWEST_SINGLE_CHILDREN, value); }; GridApi.prototype.onRowHeightChanged = function () { if (utils_1.Utils.exists(this.inMemoryRowModel)) { this.inMemoryRowModel.onRowHeightChanged(); } }; GridApi.prototype.getValue = function (colKey, rowNode) { var column = this.columnController.getPrimaryColumn(colKey); if (utils_1.Utils.missing(column)) { column = this.columnController.getGridColumn(colKey); } if (utils_1.Utils.missing(column)) { return null; } else { return this.valueService.getValue(column, rowNode); } }; GridApi.prototype.addEventListener = function (eventType, listener) { var async = this.gridOptionsWrapper.useAsyncEvents(); this.eventService.addEventListener(eventType, listener, async); }; GridApi.prototype.addGlobalListener = function (listener) { var async = this.gridOptionsWrapper.useAsyncEvents(); this.eventService.addGlobalListener(listener, async); }; GridApi.prototype.removeEventListener = function (eventType, listener) { var async = this.gridOptionsWrapper.useAsyncEvents(); this.eventService.removeEventListener(eventType, listener, async); }; GridApi.prototype.removeGlobalListener = function (listener) { var async = this.gridOptionsWrapper.useAsyncEvents(); this.eventService.removeGlobalListener(listener, async); }; GridApi.prototype.dispatchEvent = function (event) { this.eventService.dispatchEvent(event); }; GridApi.prototype.destroy = function () { this.context.destroy(); }; GridApi.prototype.resetQuickFilter = function () { this.rowModel.forEachNode(function (node) { return node.quickFilterAggregateText = null; }); }; GridApi.prototype.getRangeSelections = function () { if (this.rangeController) { return this.rangeController.getCellRanges(); } else { console.warn('ag-Grid: cell range selection is only available in ag-Grid Enterprise'); return null; } }; GridApi.prototype.camelCaseToHumanReadable = function (camelCase) { return utils_1.Utils.camelCaseToHumanText(camelCase); }; GridApi.prototype.addRangeSelection = function (rangeSelection) { if (!this.rangeController) { console.warn('ag-Grid: cell range selection is only available in ag-Grid Enterprise'); } this.rangeController.addRange(rangeSelection); }; GridApi.prototype.clearRangeSelection = function () { if (!this.rangeController) { console.warn('ag-Grid: cell range selection is only available in ag-Grid Enterprise'); } this.rangeController.clearSelection(); }; GridApi.prototype.copySelectedRowsToClipboard = function (includeHeader, columnKeys) { if (!this.clipboardService) { console.warn('ag-Grid: clipboard is only available in ag-Grid Enterprise'); } this.clipboardService.copySelectedRowsToClipboard(includeHeader, columnKeys); }; GridApi.prototype.copySelectedRangeToClipboard = function (includeHeader) { if (!this.clipboardService) { console.warn('ag-Grid: clipboard is only available in ag-Grid Enterprise'); } this.clipboardService.copySelectedRangeToClipboard(includeHeader); }; GridApi.prototype.copySelectedRangeDown = function () { if (!this.clipboardService) { console.warn('ag-Grid: clipboard is only available in ag-Grid Enterprise'); } this.clipboardService.copyRangeDown(); }; GridApi.prototype.showColumnMenuAfterButtonClick = function (colKey, buttonElement) { var column = this.columnController.getPrimaryColumn(colKey); this.menuFactory.showMenuAfterButtonClick(column, buttonElement); }; GridApi.prototype.showColumnMenuAfterMouseClick = function (colKey, mouseEvent) { var column = this.columnController.getPrimaryColumn(colKey); this.menuFactory.showMenuAfterMouseEvent(column, mouseEvent); }; GridApi.prototype.hidePopupMenu = function () { // hide the context menu if in enterprise if (this.contextMenuFactory) { this.contextMenuFactory.hideActiveMenu(); } // and hide the column menu always this.menuFactory.hideActiveMenu(); }; GridApi.prototype.setPopupParent = function (ePopupParent) { this.gridOptionsWrapper.setProperty(gridOptionsWrapper_1.GridOptionsWrapper.PROP_POPUP_PARENT, ePopupParent); }; GridApi.prototype.tabToNextCell = function () { return this.rowRenderer.tabToNextCell(false); }; GridApi.prototype.tabToPreviousCell = function () { return this.rowRenderer.tabToNextCell(true); }; GridApi.prototype.stopEditing = function (cancel) { if (cancel === void 0) { cancel = false; } this.rowRenderer.stopEditing(cancel); }; GridApi.prototype.startEditingCell = function (params) { var column = this.columnController.getGridColumn(params.colKey); if (!column) { console.warn("ag-Grid: no column found for " + params.colKey); return; } var gridCellDef = { rowIndex: params.rowIndex, floating: params.rowPinned, column: column }; var gridCell = new gridCell_1.GridCell(gridCellDef); var notPinned = utils_1.Utils.missing(params.rowPinned); if (notPinned) { this.gridPanel.ensureIndexVisible(params.rowIndex); } this.rowRenderer.startEditingCell(gridCell, params.keyPress, params.charPress); }; GridApi.prototype.addAggFunc = function (key, aggFunc) { if (this.aggFuncService) { this.aggFuncService.addAggFunc(key, aggFunc); } }; GridApi.prototype.addAggFuncs = function (aggFuncs) { if (this.aggFuncService) { this.aggFuncService.addAggFuncs(aggFuncs); } }; GridApi.prototype.clearAggFuncs = function () { if (this.aggFuncService) { this.aggFuncService.clear(); } }; GridApi.prototype.updateRowData = function (rowDataTransaction) { var res = null; if (this.inMemoryRowModel) { res = this.inMemoryRowModel.updateRowData(rowDataTransaction); } else if (this.infinitePageRowModel) { this.infinitePageRowModel.updateRowData(rowDataTransaction); } else { console.error('ag-Grid: updateRowData() only works with InMemoryRowModel and InfiniteRowModel.'); } // do change detection for all present cells if (!this.gridOptionsWrapper.isSuppressChangeDetection()) { this.rowRenderer.refreshCells(); } return res; }; GridApi.prototype.insertItemsAtIndex = function (index, items, skipRefresh) { if (skipRefresh === void 0) { skipRefresh = false; } console.warn('ag-Grid: insertItemsAtIndex() is deprecated, use updateRowData(transaction) instead.'); this.updateRowData({ add: items, addIndex: index, update: null, remove: null }); }; GridApi.prototype.removeItems = function (rowNodes, skipRefresh) { if (skipRefresh === void 0) { skipRefresh = false; } console.warn('ag-Grid: removeItems() is deprecated, use updateRowData(transaction) instead.'); var dataToRemove = rowNodes.map(function (rowNode) { return rowNode.data; }); this.updateRowData({ add: null, addIndex: null, update: null, remove: dataToRemove }); }; GridApi.prototype.addItems = function (items, skipRefresh) { if (skipRefresh === void 0) { skipRefresh = false; } console.warn('ag-Grid: addItems() is deprecated, use updateRowData(transaction) instead.'); this.updateRowData({ add: items, addIndex: null, update: null, remove: null }); }; GridApi.prototype.refreshVirtualPageCache = function () { console.warn('ag-Grid: refreshVirtualPageCache() is now called refreshInfiniteCache(), please call refreshInfiniteCache() instead'); this.refreshInfiniteCache(); }; GridApi.prototype.refreshInfinitePageCache = function () { console.warn('ag-Grid: refreshInfinitePageCache() is now called refreshInfiniteCache(), please call refreshInfiniteCache() instead'); this.refreshInfiniteCache(); }; GridApi.prototype.refreshInfiniteCache = function () { if (this.infinitePageRowModel) { this.infinitePageRowModel.refreshCache(); } else { console.warn("ag-Grid: api.refreshInfiniteCache is only available when rowModelType='infinite'."); } }; GridApi.prototype.purgeVirtualPageCache = function () { console.warn('ag-Grid: purgeVirtualPageCache() is now called purgeInfiniteCache(), please call purgeInfiniteCache() instead'); this.purgeInfinitePageCache(); }; GridApi.prototype.purgeInfinitePageCache = function () { console.warn('ag-Grid: purgeInfinitePageCache() is now called purgeInfiniteCache(), please call purgeInfiniteCache() instead'); this.purgeInfiniteCache(); }; GridApi.prototype.purgeInfiniteCache = function () { if (this.infinitePageRowModel) { this.infinitePageRowModel.purgeCache(); } else { console.warn("ag-Grid: api.purgeInfiniteCache is only available when rowModelType='infinite'."); } }; GridApi.prototype.purgeEnterpriseCache = function (route) { if (this.enterpriseRowModel) { this.enterpriseRowModel.purgeCache(route); } else { console.warn("ag-Grid: api.purgeEnterpriseCache is only available when rowModelType='enterprise'."); } }; GridApi.prototype.getVirtualRowCount = function () { console.warn('ag-Grid: getVirtualRowCount() is now called getInfiniteRowCount(), please call getInfiniteRowCount() instead'); return this.getInfiniteRowCount(); }; GridApi.prototype.getInfiniteRowCount = function () { if (this.infinitePageRowModel) { return this.infinitePageRowModel.getVirtualRowCount(); } else { console.warn("ag-Grid: api.getVirtualRowCount is only available when rowModelType='virtual'."); } }; GridApi.prototype.isMaxRowFound = function () { if (this.infinitePageRowModel) { return this.infinitePageRowModel.isMaxRowFound(); } else { console.warn("ag-Grid: api.isMaxRowFound is only available when rowModelType='virtual'."); } }; GridApi.prototype.setVirtualRowCount = function (rowCount, maxRowFound) { console.warn('ag-Grid: setVirtualRowCount() is now called setInfiniteRowCount(), please call setInfiniteRowCount() instead'); this.setInfiniteRowCount(rowCount, maxRowFound); }; GridApi.prototype.setInfiniteRowCount = function (rowCount, maxRowFound) { if (this.infinitePageRowModel) { this.infinitePageRowModel.setVirtualRowCount(rowCount, maxRowFound); } else { console.warn("ag-Grid: api.setVirtualRowCount is only available when rowModelType='virtual'."); } }; GridApi.prototype.getVirtualPageState = function () { console.warn('ag-Grid: getVirtualPageState() is now called getCacheBlockState(), please call getCacheBlockState() instead'); return this.getCacheBlockState(); }; GridApi.prototype.getInfinitePageState = function () { console.warn('ag-Grid: getInfinitePageState() is now called getCacheBlockState(), please call getCacheBlockState() instead'); return this.getCacheBlockState(); }; GridApi.prototype.getCacheBlockState = function () { if (this.infinitePageRowModel) { return this.infinitePageRowModel.getBlockState(); } else if (this.enterpriseRowModel) { return this.enterpriseRowModel.getBlockState(); } else { console.warn("ag-Grid: api.getCacheBlockState() is only available when rowModelType='infinite' or rowModelType='enterprise'."); } }; GridApi.prototype.checkGridSize = function () { this.gridPanel.setBodyAndHeaderHeights(); }; GridApi.prototype.getFirstRenderedRow = function () { console.log('in ag-Grid v12, getFirstRenderedRow() was renamed to getFirstDisplayedRow()'); return this.getFirstDisplayedRow(); }; GridApi.prototype.getFirstDisplayedRow = function () { return this.rowRenderer.getFirstVirtualRenderedRow(); }; GridApi.prototype.getLastRenderedRow = function () { console.log('in ag-Grid v12, getLastRenderedRow() was renamed to getLastDisplayedRow()'); return this.getLastDisplayedRow(); }; GridApi.prototype.getLastDisplayedRow = function () { return this.rowRenderer.getLastVirtualRenderedRow(); }; GridApi.prototype.getDisplayedRowAtIndex = function (index) { return this.rowModel.getRow(index); }; GridApi.prototype.getDisplayedRowCount = function () { return this.rowModel.getRowCount(); }; GridApi.prototype.paginationIsLastPageFound = function () { return this.paginationProxy.isLastPageFound(); }; GridApi.prototype.paginationGetPageSize = function () { return this.paginationProxy.getPageSize(); }; GridApi.prototype.paginationSetPageSize = function (size) { this.gridOptionsWrapper.setProperty('paginationPageSize', size); }; GridApi.prototype.paginationGetCurrentPage = function () { return this.paginationProxy.getCurrentPage(); }; GridApi.prototype.paginationGetTotalPages = function () { return this.paginationProxy.getTotalPages(); }; GridApi.prototype.paginationGetRowCount = function () { return this.paginationProxy.getTotalRowCount(); }; GridApi.prototype.paginationGoToNextPage = function () { this.paginationProxy.goToNextPage(); }; GridApi.prototype.paginationGoToPreviousPage = function () { this.paginationProxy.goToPreviousPage(); }; GridApi.prototype.paginationGoToFirstPage = function () { this.paginationProxy.goToFirstPage(); }; GridApi.prototype.paginationGoToLastPage = function () { this.paginationProxy.goToLastPage(); }; GridApi.prototype.paginationGoToPage = function (page) { this.paginationProxy.goToPage(page); }; __decorate([ context_1.Autowired('immutableService'), __metadata("design:type", immutableService_1.ImmutableService) ], GridApi.prototype, "immutableService", void 0); __decorate([ context_1.Autowired('csvCreator'), __metadata("design:type", csvCreator_1.CsvCreator) ], GridApi.prototype, "csvCreator", void 0); __decorate([ context_1.Optional('excelCreator'), __metadata("design:type", Object) ], GridApi.prototype, "excelCreator", void 0); __decorate([ context_1.Autowired('gridCore'), __metadata("design:type", gridCore_1.GridCore) ], GridApi.prototype, "gridCore", void 0); __decorate([ context_1.Autowired('rowRenderer'), __metadata("design:type", rowRenderer_1.RowRenderer) ], GridApi.prototype, "rowRenderer", void 0); __decorate([ context_1.Autowired('headerRenderer'), __metadata("design:type", headerRenderer_1.HeaderRenderer) ], GridApi.prototype, "headerRenderer", void 0); __decorate([ context_1.Autowired('filterManager'), __metadata("design:type", filterManager_1.FilterManager) ], GridApi.prototype, "filterManager", void 0); __decorate([ context_1.Autowired('columnController'), __metadata("design:type", columnController_1.ColumnController) ], GridApi.prototype, "columnController", void 0); __decorate([ context_1.Autowired('selectionController'), __metadata("design:type", selectionController_1.SelectionController) ], GridApi.prototype, "selectionController", void 0); __decorate([ context_1.Autowired('gridOptionsWrapper'), __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper) ], GridApi.prototype, "gridOptionsWrapper", void 0); __decorate([ context_1.Autowired('gridPanel'), __metadata("design:type", gridPanel_1.GridPanel) ], GridApi.prototype, "gridPanel", void 0); __decorate([ context_1.Autowired('valueService'), __metadata("design:type", valueService_1.ValueService) ], GridApi.prototype, "valueService", void 0); __decorate([ context_1.Autowired('alignedGridsService'), __metadata("design:type", alignedGridsService_1.AlignedGridsService) ], GridApi.prototype, "alignedGridsService", void 0); __decorate([ context_1.Autowired('eventService'), __metadata("design:type", eventService_1.EventService) ], GridApi.prototype, "eventService", void 0); __decorate([ context_1.Autowired('pinnedRowModel'), __metadata("design:type", pinnedRowModel_1.PinnedRowModel) ], GridApi.prototype, "pinnedRowModel", void 0); __decorate([ context_1.Autowired('context'), __metadata("design:type", context_1.Context) ], GridApi.prototype, "context", void 0); __decorate([ context_1.Autowired('rowModel'), __metadata("design:type", Object) ], GridApi.prototype, "rowModel", void 0); __decorate([ context_1.Autowired('sortController'), __metadata("design:type", sortController_1.SortController) ], GridApi.prototype, "sortController", void 0); __decorate([ context_1.Autowired('paginationProxy'), __metadata("design:type", paginationProxy_1.PaginationProxy) ], GridApi.prototype, "paginationProxy", void 0); __decorate([ context_1.Autowired('focusedCellController'), __metadata("design:type", focusedCellController_1.FocusedCellController) ], GridApi.prototype, "focusedCellController", void 0); __decorate([ context_1.Optional('rangeController'), __metadata("design:type", Object) ], GridApi.prototype, "rangeController", void 0); __decorate([ context_1.Optional('clipboardService'), __metadata("design:type", Object) ], GridApi.prototype, "clipboardService", void 0); __decorate([ context_1.Optional('aggFuncService'), __metadata("design:type", Object) ], GridApi.prototype, "aggFuncService", void 0); __decorate([ context_1.Autowired('menuFactory'), __metadata("design:type", Object) ], GridApi.prototype, "menuFactory", void 0); __decorate([ context_1.Optional('contextMenuFactory'), __metadata("design:type", Object) ], GridApi.prototype, "contextMenuFactory", void 0); __decorate([ context_1.Autowired('cellRendererFactory'), __metadata("design:type", cellRendererFactory_1.CellRendererFactory) ], GridApi.prototype, "cellRendererFactory", void 0); __decorate([ context_1.Autowired('cellEditorFactory'), __metadata("design:type", cellEditorFactory_1.CellEditorFactory) ], GridApi.prototype, "cellEditorFactory", void 0); __decorate([ context_1.Autowired('valueCache'), __metadata("design:type", valueCache_1.ValueCache) ], GridApi.prototype, "valueCache", void 0); __decorate([ context_1.Optional('toolPanel'), __metadata("design:type", Object) ], GridApi.prototype, "toolPanel", void 0); __decorate([ context_1.PostConstruct, __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", void 0) ], GridApi.prototype, "init", null); GridApi = __decorate([ context_1.Bean('gridApi') ], GridApi); return GridApi; }()); exports.GridApi = GridApi; /***/ }), /* 7 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v16.0.0 * @link http://www.ag-grid.com/ * @license MIT */ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 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; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; Object.defineProperty(exports, "__esModule", { value: true }); var columnController_1 = __webpack_require__(4); var context_1 = __webpack_require__(0); var ColumnApi = (function () { function ColumnApi() { } ColumnApi.prototype.sizeColumnsToFit = function (gridWidth) { this.columnController.sizeColumnsToFit(gridWidth); }; ColumnApi.prototype.setColumnGroupOpened = function (group, newValue) { this.columnController.setColumnGroupOpened(group, newValue); }; ColumnApi.prototype.getColumnGroup = function (name, instanceId) { return this.columnController.getColumnGroup(name, instanceId); }; ColumnApi.prototype.getOriginalColumnGroup = function (name) { return this.columnController.getOriginalColumnGroup(name); }; ColumnApi.prototype.getDisplayNameForColumn = function (column, location) { return this.columnController.getDisplayNameForColumn(column, location); }; ColumnApi.prototype.getDisplayNameForColumnGroup = function (columnGroup, location) { return this.columnController.getDisplayNameForColumnGroup(columnGroup, location); }; ColumnApi.prototype.getColumn = function (key) { return this.columnController.getPrimaryColumn(key); }; ColumnApi.prototype.setColumnState = function (columnState) { return this.columnController.setColumnState(columnState); }; ColumnApi.prototype.getColumnState = function () { return this.columnController.getColumnState(); }; ColumnApi.prototype.resetColumnState = function () { this.columnController.resetColumnState(); }; ColumnApi.prototype.getColumnGroupState = function () { return this.columnController.getColumnGroupState(); }; ColumnApi.prototype.setColumnGroupState = function (stateItems) { this.columnController.setColumnGroupState(stateItems); }; ColumnApi.prototype.resetColumnGroupState = function () { this.columnController.resetColumnGroupState(); }; ColumnApi.prototype.isPinning = function () { return this.columnController.isPinningLeft() || this.columnController.isPinningRight(); }; ColumnApi.prototype.isPinningLeft = function () { return this.columnController.isPinningLeft(); }; ColumnApi.prototype.isPinningRight = function () { return this.columnController.isPinningRight(); }; ColumnApi.prototype.getDisplayedColAfter = function (col) { return this.columnController.getDisplayedColAfter(col); }; ColumnApi.prototype.getDisplayedColBefore = function (col) { return this.columnController.getDisplayedColBefore(col); }; ColumnApi.prototype.setColumnVisible = function (key, visible) { this.columnController.setColumnVisible(key, visible); }; ColumnApi.prototype.setColumnsVisible = function (keys, visible) { this.columnController.setColumnsVisible(keys, visible); }; ColumnApi.prototype.setColumnPinned = function (key, pinned) { this.columnController.setColumnPinned(key, pinned); }; ColumnApi.prototype.setColumnsPinned = function (keys, pinned) { this.columnController.setColumnsPinned(keys, pinned); }; ColumnApi.prototype.getAllColumns = function () { return this.columnController.getAllPrimaryColumns(); }; ColumnApi.prototype.getAllGridColumns = function () { return this.columnController.getAllGridColumns(); }; ColumnApi.prototype.getDisplayedLeftColumns = function () { return this.columnController.getDisplayedLeftColumns(); }; ColumnApi.prototype.getDisplayedCenterColumns = function () { return this.columnController.getDisplayedCenterColumns(); }; ColumnApi.prototype.getDisplayedRightColumns = function () { return this.columnController.getDisplayedRightColumns(); }; ColumnApi.prototype.getAllDisplayedColumns = function () { return this.columnController.getAllDisplayedColumns(); }; ColumnApi.prototype.getAllDisplayedVirtualColumns = function () { return this.columnController.getAllDisplayedVirtualColumns(); }; ColumnApi.prototype.moveColumn = function (key, toIndex) { if (typeof key === 'number') { // moveColumn used to take indexes, so this is advising user who hasn't moved to new method name 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'); this.columnController.moveColumnByIndex(key, toIndex); } else { this.columnController.moveColumn(key, toIndex); } }; ColumnApi.prototype.moveColumnByIndex = function (fromIndex, toIndex) { this.columnController.moveColumnByIndex(fromIndex, toIndex); }; ColumnApi.prototype.moveColumns = function (columnsToMoveKeys, toIndex) { this.columnController.moveColumns(columnsToMoveKeys, toIndex); }; ColumnApi.prototype.moveRowGroupColumn = function (fromIndex, toIndex) { this.columnController.moveRowGroupColumn(fromIndex, toIndex); }; ColumnApi.prototype.setColumnAggFunc = function (column, aggFunc) { this.columnController.setColumnAggFunc(column, aggFunc); }; ColumnApi.prototype.setColumnWidth = function (key, newWidth, finished) { if (finished === void 0) { finished = true; } this.columnController.setColumnWidth(key, newWidth, finished); }; ColumnApi.prototype.setPivotMode = function (pivotMode, source) { if (source === void 0) { source = "api"; } this.columnController.setPivotMode(pivotMode); }; ColumnApi.prototype.isPivotMode = function () { return this.columnController.isPivotMode(); }; ColumnApi.prototype.getSecondaryPivotColumn = function (pivotKeys, valueColKey) { return this.columnController.getSecondaryPivotColumn(pivotKeys, valueColKey); }; ColumnApi.prototype.setValueColumns = function (colKeys) { this.columnController.setValueColumns(colKeys); }; ColumnApi.prototype.getValueColumns = function () { return this.columnController.getValueColumns(); }; ColumnApi.prototype.removeValueColumn = function (colKey) { this.columnController.removeValueColumn(colKey); }; ColumnApi.prototype.removeValueColumns = function (colKeys) { this.columnController.removeValueColumns(colKeys); }; ColumnApi.prototype.addValueColumn = function (colKey) { this.columnController.addValueColumn(colKey); }; ColumnApi.prototype.addValueColumns = function (colKeys) { this.columnController.addValueColumns(colKeys); }; ColumnApi.prototype.setRowGroupColumns = function (colKeys) { this.columnController.setRowGroupColumns(colKeys); }; ColumnApi.prototype.removeRowGroupColumn = function (colKey) { this.columnController.removeRowGroupColumn(colKey); }; ColumnApi.prototype.removeRowGroupColumns = function (colKeys) { this.columnController.removeRowGroupColumns(colKeys); }; ColumnApi.prototype.addRowGroupColumn = function (colKey) { this.columnController.addRowGroupColumn(colKey); }; ColumnApi.prototype.addRowGroupColumns = function (colKeys) { this.columnController.addRowGroupColumns(colKeys); }; ColumnApi.prototype.getRowGroupColumns = function () { return this.columnController.getRowGroupColumns(); }; ColumnApi.prototype.setPivotColumns = function (colKeys) { this.columnController.setPivotColumns(colKeys); }; ColumnApi.prototype.removePivotColumn = function (colKey) { this.columnController.removePivotColumn(colKey); }; ColumnApi.prototype.removePivotColumns = function (colKeys) { this.columnController.removePivotColumns(colKeys); }; ColumnApi.prototype.addPivotColumn = function (colKey) { this.columnController.addPivotColumn(colKey); }; ColumnApi.prototype.addPivotColumns = function (colKeys) { this.columnController.addPivotColumns(colKeys); }; ColumnApi.prototype.getPivotColumns = function () { return this.columnController.getPivotColumns(); }; ColumnApi.prototype.getLeftDisplayedColumnGroups = function () { return this.columnController.getLeftDisplayedColumnGroups(); }; ColumnApi.prototype.getCenterDisplayedColumnGroups = function () { return this.columnController.getCenterDisplayedColumnGroups(); }; ColumnApi.prototype.getRightDisplayedColumnGroups = function () { return this.columnController.getRightDisplayedColumnGroups(); }; ColumnApi.prototype.getAllDisplayedColumnGroups = function () { return this.columnController.getAllDisplayedColumnGroups(); }; ColumnApi.prototype.autoSizeColumn = function (key) { return this.columnController.autoSizeColumn(key); }; ColumnApi.prototype.autoSizeColumns = function (keys) { return this.columnController.autoSizeColumns(keys); }; ColumnApi.prototype.autoSizeAllColumns = function () { this.columnController.autoSizeAllColumns(); }; ColumnApi.prototype.setSecondaryColumns = function (colDefs) { this.columnController.setSecondaryColumns(colDefs); }; // below goes through deprecated items, prints message to user, then calls the new version of the same method ColumnApi.prototype.columnGroupOpened = function (group, newValue) { console.error('ag-Grid: columnGroupOpened no longer exists, use setColumnGroupOpened'); this.setColumnGroupOpened(group, newValue); }; ColumnApi.prototype.hideColumns = function (colIds, hide) { console.error('ag-Grid: hideColumns is deprecated, use setColumnsVisible'); this.columnController.setColumnsVisible(colIds, !hide); }; ColumnApi.prototype.hideColumn = function (colId, hide) { console.error('ag-Grid: hideColumn is deprecated, use setColumnVisible'); this.columnController.setColumnVisible(colId, !hide); }; ColumnApi.prototype.setState = function (columnState) { console.error('ag-Grid: setState is deprecated, use setColumnState'); return this.setColumnState(columnState); }; ColumnApi.prototype.getState = function () { console.error('ag-Grid: getState is deprecated, use getColumnState'); return this.getColumnState(); }; ColumnApi.prototype.resetState = function () { console.error('ag-Grid: resetState is deprecated, use resetColumnState'); this.resetColumnState(); }; ColumnApi.prototype.getAggregationColumns = function () { console.error('ag-Grid: getAggregationColumns is deprecated, use getValueColumns'); return this.columnController.getValueColumns(); }; ColumnApi.prototype.removeAggregationColumn = function (colKey) { console.error('ag-Grid: removeAggregationColumn is deprecated, use removeValueColumn'); this.columnController.removeValueColumn(colKey); }; ColumnApi.prototype.removeAggregationColumns = function (colKeys) { console.error('ag-Grid: removeAggregationColumns is deprecated, use removeValueColumns'); this.columnController.removeValueColumns(colKeys); }; ColumnApi.prototype.addAggregationColumn = function (colKey) { console.error('ag-Grid: addAggregationColumn is deprecated, use addValueColumn'); this.columnController.addValueColumn(colKey); }; ColumnApi.prototype.addAggregationColumns = function (colKeys) { console.error('ag-Grid: addAggregationColumns is deprecated, use addValueColumns'); this.columnController.addValueColumns(colKeys); }; ColumnApi.prototype.setColumnAggFunction = function (column, aggFunc) { console.error('ag-Grid: setColumnAggFunction is deprecated, use setColumnAggFunc'); this.columnController.setColumnAggFunc(column, aggFunc); }; ColumnApi.prototype.getDisplayNameForCol = function (column) { console.error('ag-Grid: getDisplayNameForCol is deprecated, use getDisplayNameForColumn'); return this.getDisplayNameForColumn(column, null); }; __decorate([ context_1.Autowired('columnController'), __metadata("design:type", columnController_1.ColumnController) ], ColumnApi.prototype, "columnController", void 0); ColumnApi = __decorate([ context_1.Bean('columnApi') ], ColumnApi); return ColumnApi; }()); exports.ColumnApi = ColumnApi; /***/ }), /* 8 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v16.0.0 * @link http://www.ag-grid.com/ * @license MIT */ Object.defineProperty(exports, "__esModule", { value: true }); var Constants = (function () { function Constants() { } Constants.STEP_EVERYTHING = 0; Constants.STEP_FILTER = 1; Constants.STEP_SORT = 2; Constants.STEP_MAP = 3; Constants.STEP_AGGREGATE = 4; Constants.STEP_PIVOT = 5; Constants.ROW_BUFFER_SIZE = 10; Constants.LAYOUT_INTERVAL = 500; Constants.EXPORT_TYPE_DRAG_COPY = 'dragCopy'; Constants.EXPORT_TYPE_CLIPBOARD = 'clipboard'; Constants.EXPORT_TYPE_EXCEL = 'excel'; Constants.EXPORT_TYPE_CSV = 'csv'; Constants.KEY_BACKSPACE = 8; Constants.KEY_TAB = 9; Constants.KEY_NEW_LINE = 10; Constants.KEY_ENTER = 13; Constants.KEY_SHIFT = 16; Constants.KEY_ESCAPE = 27; Constants.KEY_SPACE = 32; Constants.KEY_LEFT = 37; Constants.KEY_UP = 38; Constants.KEY_RIGHT = 39; Constants.KEY_DOWN = 40; Constants.KEY_DELETE = 46; Constants.KEY_A = 65; Constants.KEY_C = 67; Constants.KEY_V = 86; Constants.KEY_D = 68; Constants.KEY_F2 = 113; Constants.KEY_PAGE_UP = 33; Constants.KEY_PAGE_DOWN = 34; Constants.KEY_PAGE_HOME = 36; Constants.KEY_PAGE_END = 35; Constants.ROW_MODEL_TYPE_INFINITE = 'infinite'; Constants.ROW_MODEL_TYPE_VIEWPORT = 'viewport'; Constants.ROW_MODEL_TYPE_IN_MEMORY = 'inMemory'; Constants.ROW_MODEL_TYPE_ENTERPRISE = 'enterprise'; Constants.DEPRECATED_ROW_MODEL_TYPE_NORMAL = 'normal'; Constants.ALWAYS = 'always'; Constants.ONLY_WHEN_GROUPING = 'onlyWhenGrouping'; Constants.PINNED_TOP = 'top'; Constants.PINNED_BOTTOM = 'bottom'; return Constants; }()); exports.Constants = Constants; /***/ }), /* 9 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v16.0.0 * @link http://www.ag-grid.com/ * @license MIT */ var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); var utils_1 = __webpack_require__(1); var beanStub_1 = __webpack_require__(14); var compIdSequence = new utils_1.NumberSequence(); var Component = (function (_super) { __extends(Component, _super); function Component(template) { var _this = _super.call(this) || this; _this.childComponents = []; _this.annotatedEventListeners = []; _this.visible = true; // unique id for this row component. this is used for getting a reference to the HTML dom. // we cannot use the RowNode id as this is not unique (due to animation, old rows can be lying // around as we create a new rowComp instance for the same row node). _this.compId = compIdSequence.next(); if (template) { _this.setTemplate(template); } return _this; } Component.prototype.getCompId = function () { return this.compId; }; Component.prototype.instantiate = function (context) { this.instantiateRecurse(this.getGui(), context); }; Component.prototype.instantiateRecurse = function (parentNode, context) { var childCount = parentNode.childNodes ? parentNode.childNodes.length : 0; for (var i = 0; i < childCount; i++) { var childNode = parentNode.childNodes[i]; var newComponent = context.createComponent(childNode); if (newComponent) { this.swapComponentForNode(newComponent, parentNode, childNode); } else { if (childNode.childNodes) { this.instantiateRecurse(childNode, context); } } } }; Component.prototype.swapComponentForNode = function (newComponent, parentNode, childNode) { parentNode.replaceChild(newComponent.getGui(), childNode); this.childComponents.push(newComponent); this.swapInComponentForQuerySelectors(newComponent, childNode); }; Component.prototype.swapInComponentForQuerySelectors = function (newComponent, childNode) { var thisProto = Object.getPrototypeOf(this); var thisNoType = this; while (thisProto != null) { var metaData = thisProto.__agComponentMetaData; var currentProtoName = (thisProto.constructor).name; if (metaData && metaData[currentProtoName] && metaData[currentProtoName].querySelectors) { metaData[currentProtoName].querySelectors.forEach(function (querySelector) { if (thisNoType[querySelector.attributeName] === childNode) { thisNoType[querySelector.attributeName] = newComponent; } }); } thisProto = Object.getPrototypeOf(thisProto); } }; Component.prototype.setTemplate = function (template) { var eGui = utils_1.Utils.loadTemplate(template); this.setTemplateFromElement(eGui); }; Component.prototype.setTemplateFromElement = function (element) { this.eGui = element; this.eGui.__agComponent = this; this.addAnnotatedEventListeners(); this.wireQuerySelectors(); }; Component.prototype.attributesSet = function () { }; Component.prototype.wireQuerySelectors = function () { var _this = this; if (!this.eGui) { return; } var thisProto = Object.getPrototypeOf(this); var _loop_1 = function () { var metaData = thisProto.__agComponentMetaData; var currentProtoName = (thisProto.constructor).name; if (metaData && metaData[currentProtoName] && metaData[currentProtoName].querySelectors) { var thisNoType_1 = this_1; metaData[currentProtoName].querySelectors.forEach(function (querySelector) { var resultOfQuery = _this.eGui.querySelector(querySelector.querySelector); if (resultOfQuery) { var backingComponent = resultOfQuery.__agComponent; if (backingComponent) { thisNoType_1[querySelector.attributeName] = backingComponent; } else { thisNoType_1[querySelector.attributeName] = resultOfQuery; } } else { // put debug msg in here if query selector fails??? } }); } thisProto = Object.getPrototypeOf(thisProto); }; var this_1 = this; while (thisProto != null) { _loop_1(); } }; Component.prototype.addAnnotatedEventListeners = function () { var _this = this; this.removeAnnotatedEventListeners(); if (!this.eGui) { return; } var thisProto = Object.getPrototypeOf(this); while (thisProto != null) { var metaData = thisProto.__agComponentMetaData; var currentProtoName = (thisProto.constructor).name; if (metaData && metaData[currentProtoName] && metaData[currentProtoName].listenerMethods) { if (!this.annotatedEventListeners) { this.annotatedEventListeners = []; } metaData[currentProtoName].listenerMethods.forEach(function (eventListener) { var listener = _this[eventListener.methodName].bind(_this); _this.eGui.addEventListener(eventListener.eventName, listener); _this.annotatedEventListeners.push({ eventName: eventListener.eventName, listener: listener }); }); } thisProto = Object.getPrototypeOf(thisProto); } }; Component.prototype.removeAnnotatedEventListeners = function () { var _this = this; if (!this.annotatedEventListeners) { return; } if (!this.eGui) { return; } this.annotatedEventListeners.forEach(function (eventListener) { _this.eGui.removeEventListener(eventListener.eventName, eventListener.listener); }); this.annotatedEventListeners = null; }; Component.prototype.getGui = function () { return this.eGui; }; // this method is for older code, that wants to provide the gui element, // it is not intended for this to be in ag-Stack Component.prototype.setGui = function (eGui) { this.eGui = eGui; }; Component.prototype.queryForHtmlElement = function (cssSelector) { return this.eGui.querySelector(cssSelector); }; Component.prototype.queryForHtmlInputElement = function (cssSelector) { return this.eGui.querySelector(cssSelector); }; Component.prototype.appendChild = function (newChild) { if (utils_1.Utils.isNodeOrElement(newChild)) { this.eGui.appendChild(newChild); } else { var childComponent = newChild; this.eGui.appendChild(childComponent.getGui()); this.childComponents.push(childComponent); } }; Component.prototype.addFeature = function (context, feature) { context.wireBean(feature); if (feature.destroy) { this.addDestroyFunc(feature.destroy.bind(feature)); } }; Component.prototype.isVisible = function () { return this.visible; }; Component.prototype.setVisible = function (visible) { if (visible !== this.visible) { this.visible = visible; utils_1.Utils.addOrRemoveCssClass(this.eGui, 'ag-hidden', !visible); var event_1 = { type: Component.EVENT_VISIBLE_CHANGED, visible: this.visible }; this.dispatchEvent(event_1); } }; Component.prototype.addOrRemoveCssClass = function (className, addOrRemove) { utils_1.Utils.addOrRemoveCssClass(this.eGui, className, addOrRemove); }; Component.prototype.destroy = function () { _super.prototype.destroy.call(this); this.childComponents.forEach(function (childComponent) { return childComponent.destroy(); }); this.childComponents.length = 0; this.removeAnnotatedEventListeners(); }; Component.prototype.addGuiEventListener = function (event, listener) { var _this = this; this.getGui().addEventListener(event, listener); this.addDestroyFunc(function () { return _this.getGui().removeEventListener(event, listener); }); }; Component.prototype.addCssClass = function (className) { utils_1.Utils.addCssClass(this.getGui(), className); }; Component.prototype.removeCssClass = function (className) { utils_1.Utils.removeCssClass(this.getGui(), className); }; Component.prototype.getAttribute = function (key) { var eGui = this.getGui(); if (eGui) { return eGui.getAttribute(key); } else { return null; } }; Component.prototype.getRefElement = function (refName) { return this.queryForHtmlElement('[ref="' + refName + '"]'); }; Component.EVENT_VISIBLE_CHANGED = 'visibleChanged'; return Component; }(beanStub_1.BeanStub)); exports.Component = Component; /***/ }), /* 10 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v16.0.0 * @link http://www.ag-grid.com/ * @license MIT */ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 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; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; Object.defineProperty(exports, "__esModule", { value: true }); var eventService_1 = __webpack_require__(3); var utils_1 = __webpack_require__(1); var context_1 = __webpack_require__(0); var gridOptionsWrapper_1 = __webpack_require__(2); var columnUtils_1 = __webpack_require__(32); var columnApi_1 = __webpack_require__(7); var gridApi_1 = __webpack_require__(6); // Wrapper around a user provide column definition. The grid treats the column definition as ready only. // This class contains all the runtime information about a column, plus some logic (the definition has no logic). // This class implements both interfaces ColumnGroupChild and OriginalColumnGroupChild as the class can // appear as a child of either the original tree or the displayed tree. However the relevant group classes // for each type only implements one, as each group can only appear in it's associated tree (eg OriginalColumnGroup // can only appear in OriginalColumn tree). var Column = (function () { function Column(colDef, colId, primary) { this.moving = false; this.menuVisible = false; this.filterActive = false; this.eventService = new eventService_1.EventService(); this.rowGroupActive = false; this.pivotActive = false; this.aggregationActive = false; this.colDef = colDef; this.visible = !colDef.hide; this.sort = colDef.sort; this.sortedAt = colDef.sortedAt; this.colId = colId; this.primary = primary; this.lockPosition = colDef.lockPosition === true; this.lockPinned = colDef.lockPinned === true; this.lockVisible = colDef.lockVisible === true; } Column.prototype.isLockPosition = function () { return this.lockPosition; }; Column.prototype.isLockVisible = function () { return this.lockVisible; }; Column.prototype.isLockPinned = function () { return this.lockPinned; }; Column.prototype.setParent = function (parent) { this.parent = parent; }; Column.prototype.getParent = function () { return this.parent; }; // this is done after constructor as it uses gridOptionsWrapper Column.prototype.initialise = function () { this.setPinned(this.colDef.pinned); var minColWidth = this.gridOptionsWrapper.getMinColWidth(); var maxColWidth = this.gridOptionsWrapper.getMaxColWidth(); if (this.colDef.minWidth) { this.minWidth = this.colDef.minWidth; } else { this.minWidth = minColWidth; } if (this.colDef.maxWidth) { this.maxWidth = this.colDef.maxWidth; } else { this.maxWidth = maxColWidth; } this.actualWidth = this.columnUtils.calculateColInitialWidth(this.colDef); var suppressDotNotation = this.gridOptionsWrapper.isSuppressFieldDotNotation(); this.fieldContainsDots = utils_1.Utils.exists(this.colDef.field) && this.colDef.field.indexOf('.') >= 0 && !suppressDotNotation; this.tooltipFieldContainsDots = utils_1.Utils.exists(this.colDef.tooltipField) && this.colDef.tooltipField.indexOf('.') >= 0 && !suppressDotNotation; this.validate(); }; Column.prototype.isEmptyGroup = function () { return false; }; Column.prototype.isRowGroupDisplayed = function (colId) { if (utils_1.Utils.missing(this.colDef) || utils_1.Utils.missing(this.colDef.showRowGroup)) { return false; } var showingAllGroups = this.colDef.showRowGroup === true; var showingThisGroup = this.colDef.showRowGroup === colId; return showingAllGroups || showingThisGroup; }; Column.prototype.getUniqueId = function () { return this.getId(); }; Column.prototype.isPrimary = function () { return this.primary; }; Column.prototype.isFilterAllowed = function () { return this.primary && !this.colDef.suppressFilter; }; Column.prototype.isFieldContainsDots = function () { return this.fieldContainsDots; }; Column.prototype.isTooltipFieldContainsDots = function () { return this.tooltipFieldContainsDots; }; Column.prototype.validate = function () { var colDefAny = this.colDef; if (!this.gridOptionsWrapper.isEnterprise()) { var itemsNotAllowedWithoutEnterprise = ['enableRowGroup', 'rowGroup', 'rowGroupIndex', 'enablePivot', 'pivot', 'pivotIndex', 'aggFunc']; itemsNotAllowedWithoutEnterprise.forEach(function (item) { if (utils_1.Utils.exists(colDefAny[item])) { console.warn("ag-Grid: " + item + " is only valid in ag-Grid-Enterprise, your column definition should not have " + item); } }); } if (this.gridOptionsWrapper.isTreeData()) { var itemsNotAllowedWithTreeData = ['enableRowGroup', 'rowGroup', 'rowGroupIndex', 'enablePivot', 'pivot', 'pivotIndex']; itemsNotAllowedWithTreeData.forEach(function (item) { if (utils_1.Utils.exists(colDefAny[item])) { console.warn("ag-Grid: " + item + " is not possible when doing tree data, your column definition should not have " + item); } }); } if (utils_1.Utils.exists(this.colDef.width) && typeof this.colDef.width !== 'number') { console.warn('ag-Grid: colDef.width should be a number, not ' + typeof this.colDef.width); } if (utils_1.Utils.get(this, 'colDef.cellRendererParams.restrictToOneGroup', null)) { console.warn('ag-Grid: Since ag-grid 11.0.0 cellRendererParams.restrictToOneGroup is deprecated. You should use showRowGroup'); } if (utils_1.Utils.get(this, 'colDef.cellRendererParams.keyMap', null)) { console.warn('ag-Grid: Since ag-grid 11.0.0 cellRendererParams.keyMap is deprecated. You should use colDef.keyCreator'); } if (utils_1.Utils.get(this, 'colDef.cellRendererParams.keyMap', null)) { console.warn('ag-Grid: Since ag-grid 11.0.0 cellRendererParams.keyMap is deprecated. You should use colDef.keyCreator'); } if (colDefAny.floatingCellRenderer) { console.warn('ag-Grid: since v11, floatingCellRenderer is now pinnedRowCellRenderer'); this.colDef.pinnedRowCellRenderer = colDefAny.floatingCellRenderer; } if (colDefAny.floatingRendererFramework) { console.warn('ag-Grid: since v11, floatingRendererFramework is now pinnedRowCellRendererFramework'); this.colDef.pinnedRowCellRendererFramework = colDefAny.floatingRendererFramework; } if (colDefAny.floatingRendererParams) { console.warn('ag-Grid: since v11, floatingRendererParams is now pinnedRowCellRendererParams'); this.colDef.pinnedRowCellRendererParams = colDefAny.floatingRendererParams; } if (colDefAny.floatingValueFormatter) { console.warn('ag-Grid: since v11, floatingValueFormatter is now pinnedRowValueFormatter'); this.colDef.pinnedRowValueFormatter = colDefAny.floatingValueFormatter; } if (colDefAny.cellFormatter) { console.warn('ag-Grid: since v12, cellFormatter is now valueFormatter'); if (utils_1.Utils.missing(this.colDef.valueFormatter)) { this.colDef.valueFormatter = colDefAny.cellFormatter; } } if (colDefAny.headerCellTemplate) { console.warn('ag-Grid: since v15, headerCellTemplate is gone, use header component instead.'); } if (colDefAny.headerCellRenderer) { console.warn('ag-Grid: since v15, headerCellRenderer is gone, use header component instead.'); } if (colDefAny.volatile) { console.warn('ag-Grid: since v16, colDef.volatile is gone, please check refresh docs on how to refresh specific cells.'); } }; Column.prototype.addEventListener = function (eventType, listener) { this.eventService.addEventListener(eventType, listener); }; Column.prototype.removeEventListener = function (eventType, listener) { this.eventService.removeEventListener(eventType, listener); }; Column.prototype.createIsColumnFuncParams = function (rowNode) { return { node: rowNode, data: rowNode.data, column: this, colDef: this.colDef, context: this.gridOptionsWrapper.getContext(), api: this.gridOptionsWrapper.getApi(), columnApi: this.gridOptionsWrapper.getColumnApi() }; }; Column.prototype.isSuppressNavigable = function (rowNode) { // if boolean set, then just use it if (typeof this.colDef.suppressNavigable === 'boolean') { return this.colDef.suppressNavigable; } // if function, then call the function to find out if (typeof this.colDef.suppressNavigable === 'function') { var params = this.createIsColumnFuncParams(rowNode); var userFunc = this.colDef.suppressNavigable; return userFunc(params); } return false; }; Column.prototype.isCellEditable = function (rowNode) { // only allow editing of groups if the user has this option enabled if (rowNode.group && !this.gridOptionsWrapper.isEnableGroupEdit()) { return false; } return this.isColumnFunc(rowNode, this.colDef.editable); }; Column.prototype.isRowDrag = function (rowNode) { return this.isColumnFunc(rowNode, this.colDef.rowDrag); }; Column.prototype.isCellCheckboxSelection = function (rowNode) { return this.isColumnFunc(rowNode, this.colDef.checkboxSelection); }; Column.prototype.isSuppressPaste = function (rowNode) { return this.isColumnFunc(rowNode, this.colDef ? this.colDef.suppressPaste : null); }; Column.prototype.isResizable = function () { var enableColResize = this.gridOptionsWrapper.isEnableColResize(); var suppressResize = this.colDef && this.colDef.suppressResize; return enableColResize && !suppressResize; }; Column.prototype.isColumnFunc = function (rowNode, value) { // if boolean set, then just use it if (typeof value === 'boolean') { return value; } // if function, then call the function to find out if (typeof value === 'function') { var params = this.createIsColumnFuncParams(rowNode); var editableFunc = value; return editableFunc(params); } return false; }; Column.prototype.setMoving = function (moving, source) { if (source === void 0) { source = "api"; } this.moving = moving; this.eventService.dispatchEvent(this.createColumnEvent(Column.EVENT_MOVING_CHANGED, source)); }; Column.prototype.createColumnEvent = function (type, source) { return { api: this.gridApi, columnApi: this.columnApi, type: type, column: this, columns: [this], source: source }; }; Column.prototype.isMoving = function () { return this.moving; }; Column.prototype.getSort = function () { return this.sort; }; Column.prototype.setSort = function (sort, source) { if (source === void 0) { source = "api"; } if (this.sort !== sort) { this.sort = sort; this.eventService.dispatchEvent(this.createColumnEvent(Column.EVENT_SORT_CHANGED, source)); } }; Column.prototype.setMenuVisible = function (visible, source) { if (source === void 0) { source = "api"; } if (this.menuVisible !== visible) { this.menuVisible = visible; this.eventService.dispatchEvent(this.createColumnEvent(Column.EVENT_MENU_VISIBLE_CHANGED, source)); } }; Column.prototype.isMenuVisible = function () { return this.menuVisible; }; Column.prototype.isSortAscending = function () { return this.sort === Column.SORT_ASC; }; Column.prototype.isSortDescending = function () { return this.sort === Column.SORT_DESC; }; Column.prototype.isSortNone = function () { return utils_1.Utils.missing(this.sort); }; Column.prototype.isSorting = function () { return utils_1.Utils.exists(this.sort); }; Column.prototype.getSortedAt = function () { return this.sortedAt; }; Column.prototype.setSortedAt = function (sortedAt) { this.sortedAt = sortedAt; }; Column.prototype.setAggFunc = function (aggFunc) { this.aggFunc = aggFunc; }; Column.prototype.getAggFunc = function () { return this.aggFunc; }; Column.prototype.getLeft = function () { return this.left; }; Column.prototype.getOldLeft = function () { return this.oldLeft; }; Column.prototype.getRight = function () { return this.left + this.actualWidth; }; Column.prototype.setLeft = function (left, source) { if (source === void 0) { source = "api"; } this.oldLeft = this.left; if (this.left !== left) { this.left = left; this.eventService.dispatchEvent(this.createColumnEvent(Column.EVENT_LEFT_CHANGED, source)); } }; Column.prototype.isFilterActive = function () { return this.filterActive; }; Column.prototype.setFilterActive = function (active, source) { if (source === void 0) { source = "api"; } if (this.filterActive !== active) { this.filterActive = active; this.eventService.dispatchEvent(this.createColumnEvent(Column.EVENT_FILTER_ACTIVE_CHANGED, source)); } this.eventService.dispatchEvent(this.createColumnEvent(Column.EVENT_FILTER_CHANGED, source)); }; Column.prototype.setPinned = function (pinned) { // pinning is not allowed when doing 'forPrint' if (this.gridOptionsWrapper.isForPrint()) { return; } if (pinned === true || pinned === Column.PINNED_LEFT) { this.pinned = Column.PINNED_LEFT; } else if (pinned === Column.PINNED_RIGHT) { this.pinned = Column.PINNED_RIGHT; } else { this.pinned = null; } // console.log(`setColumnsPinned ${this.getColId()} ${this.pinned}`); }; Column.prototype.setFirstRightPinned = function (firstRightPinned, source) { if (source === void 0) { source = "api"; } if (this.firstRightPinned !== firstRightPinned) { this.firstRightPinned = firstRightPinned; this.eventService.dispatchEvent(this.createColumnEvent(Column.EVENT_FIRST_RIGHT_PINNED_CHANGED, source)); } }; Column.prototype.setLastLeftPinned = function (lastLeftPinned, source) { if (source === void 0) { source = "api"; } if (this.lastLeftPinned !== lastLeftPinned) { this.lastLeftPinned = lastLeftPinned; this.eventService.dispatchEvent(this.createColumnEvent(Column.EVENT_LAST_LEFT_PINNED_CHANGED, source)); } }; Column.prototype.isFirstRightPinned = function () { return this.firstRightPinned; }; Column.prototype.isLastLeftPinned = function () { return this.lastLeftPinned; }; Column.prototype.isPinned = function () { return this.pinned === Column.PINNED_LEFT || this.pinned === Column.PINNED_RIGHT; }; Column.prototype.isPinnedLeft = function () { return this.pinned === Column.PINNED_LEFT; }; Column.prototype.isPinnedRight = function () { return this.pinned === Column.PINNED_RIGHT; }; Column.prototype.getPinned = function () { return this.pinned; }; Column.prototype.setVisible = function (visible, source) { if (source === void 0) { source = "api"; } var newValue = visible === true; if (this.visible !== newValue) { this.visible = newValue; this.eventService.dispatchEvent(this.createColumnEvent(Column.EVENT_VISIBLE_CHANGED, source)); } }; Column.prototype.isVisible = function () { return this.visible; }; Column.prototype.getColDef = function () { return this.colDef; }; Column.prototype.getColumnGroupShow = function () { return this.colDef.columnGroupShow; }; Column.prototype.getColId = function () { return this.colId; }; Column.prototype.getId = function () { return this.getColId(); }; Column.prototype.getDefinition = function () { return this.colDef; }; Column.prototype.getActualWidth = function () { return this.actualWidth; }; Column.prototype.getColSpan = function (rowNode) { if (utils_1.Utils.missing(this.colDef.colSpan)) { return 1; } else { var params = { node: rowNode, data: rowNode.data, colDef: this.colDef, column: this, api: this.gridOptionsWrapper.getApi(), columnApi: this.gridOptionsWrapper.getColumnApi(), context: this.gridOptionsWrapper.getContext() }; var colSpan = this.colDef.colSpan(params); // colSpan must be number equal to or greater than 1 if (colSpan > 1) { return colSpan; } else { return 1; } } }; Column.prototype.setActualWidth = function (actualWidth, source) { if (source === void 0) { source = "api"; } if (this.actualWidth !== actualWidth) { this.actualWidth = actualWidth; this.eventService.dispatchEvent(this.createColumnEvent(Column.EVENT_WIDTH_CHANGED, source)); } }; Column.prototype.isGreaterThanMax = function (width) { if (this.maxWidth) { return width > this.maxWidth; } else { return false; } }; Column.prototype.getMinWidth = function () { return this.minWidth; }; Column.prototype.getMaxWidth = function () { return this.maxWidth; }; Column.prototype.setMinimum = function (source) { if (source === void 0) { source = "api"; } this.setActualWidth(this.minWidth, source); }; Column.prototype.setRowGroupActive = function (rowGroup, source) { if (source === void 0) { source = "api"; } if (this.rowGroupActive !== rowGroup) { this.rowGroupActive = rowGroup; this.eventService.dispatchEvent(this.createColumnEvent(Column.EVENT_ROW_GROUP_CHANGED, source)); } }; Column.prototype.isRowGroupActive = function () { return this.rowGroupActive; }; Column.prototype.setPivotActive = function (pivot, source) { if (source === void 0) { source = "api"; } if (this.pivotActive !== pivot) { this.pivotActive = pivot; this.eventService.dispatchEvent(this.createColumnEvent(Column.EVENT_PIVOT_CHANGED, source)); } }; Column.prototype.isPivotActive = function () { return this.pivotActive; }; Column.prototype.isAnyFunctionActive = function () { return this.isPivotActive() || this.isRowGroupActive() || this.isValueActive(); }; Column.prototype.isAnyFunctionAllowed = function () { return this.isAllowPivot() || this.isAllowRowGroup() || this.isAllowValue(); }; Column.prototype.setValueActive = function (value, source) { if (source === void 0) { source = "api"; } if (this.aggregationActive !== value) { this.aggregationActive = value; this.eventService.dispatchEvent(this.createColumnEvent(Column.EVENT_VALUE_CHANGED, source)); } }; Column.prototype.isValueActive = function () { return this.aggregationActive; }; Column.prototype.isAllowPivot = function () { return this.colDef.enablePivot === true; }; Column.prototype.isAllowValue = function () { return this.colDef.enableValue === true; }; Column.prototype.isAllowRowGroup = function () { return this.colDef.enableRowGroup === true; }; Column.prototype.getMenuTabs = function (defaultValues) { var menuTabs = this.getColDef().menuTabs; if (menuTabs == null) { menuTabs = defaultValues; } return menuTabs; }; // + renderedHeaderCell - for making header cell transparent when moving Column.EVENT_MOVING_CHANGED = 'movingChanged'; // + renderedCell - changing left position Column.EVENT_LEFT_CHANGED = 'leftChanged'; // + renderedCell - changing width Column.EVENT_WIDTH_CHANGED = 'widthChanged'; // + renderedCell - for changing pinned classes Column.EVENT_LAST_LEFT_PINNED_CHANGED = 'lastLeftPinnedChanged'; Column.EVENT_FIRST_RIGHT_PINNED_CHANGED = 'firstRightPinnedChanged'; // + renderedColumn - for changing visibility icon Column.EVENT_VISIBLE_CHANGED = 'visibleChanged'; // + every time the filter changes, used in the floating filters Column.EVENT_FILTER_CHANGED = 'filterChanged'; // + renderedHeaderCell - marks the header with filter icon Column.EVENT_FILTER_ACTIVE_CHANGED = 'filterActiveChanged'; // + renderedHeaderCell - marks the header with sort icon Column.EVENT_SORT_CHANGED = 'sortChanged'; Column.EVENT_MENU_VISIBLE_CHANGED = 'menuVisibleChanged'; // + toolpanel, for gui updates Column.EVENT_ROW_GROUP_CHANGED = 'columnRowGroupChanged'; // + toolpanel, for gui updates Column.EVENT_PIVOT_CHANGED = 'columnPivotChanged'; // + toolpanel, for gui updates Column.EVENT_VALUE_CHANGED = 'columnValueChanged'; Column.PINNED_RIGHT = 'right'; Column.PINNED_LEFT = 'left'; Column.SORT_ASC = 'asc'; Column.SORT_DESC = 'desc'; __decorate([ context_1.Autowired('gridOptionsWrapper'), __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper) ], Column.prototype, "gridOptionsWrapper", void 0); __decorate([ context_1.Autowired('columnUtils'), __metadata("design:type", columnUtils_1.ColumnUtils) ], Column.prototype, "columnUtils", void 0); __decorate([ context_1.Autowired('frameworkFactory'), __metadata("design:type", Object) ], Column.prototype, "frameworkFactory", void 0); __decorate([ context_1.Autowired('columnApi'), __metadata("design:type", columnApi_1.ColumnApi) ], Column.prototype, "columnApi", void 0); __decorate([ context_1.Autowired('gridApi'), __metadata("design:type", gridApi_1.GridApi) ], Column.prototype, "gridApi", void 0); __decorate([ context_1.PostConstruct, __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", void 0) ], Column.prototype, "initialise", null); return Column; }()); exports.Column = Column; /***/ }), /* 11 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v16.0.0 * @link http://www.ag-grid.com/ * @license MIT */ var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 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; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; var __param = (this && this.__param) || function (paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } }; Object.defineProperty(exports, "__esModule", { value: true }); var utils_1 = __webpack_require__(1); var gridOptionsWrapper_1 = __webpack_require__(2); var columnController_1 = __webpack_require__(4); var columnApi_1 = __webpack_require__(7); var rowRenderer_1 = __webpack_require__(23); var borderLayout_1 = __webpack_require__(65); var logger_1 = __webpack_require__(12); var context_1 = __webpack_require__(0); var eventService_1 = __webpack_require__(3); var events_1 = __webpack_require__(5); var dragService_1 = __webpack_require__(47); var constants_1 = __webpack_require__(8); var selectionController_1 = __webpack_require__(16); var csvCreator_1 = __webpack_require__(45); var mouseEventService_1 = __webpack_require__(37); var focusedCellController_1 = __webpack_require__(24); var scrollVisibleService_1 = __webpack_require__(35); var beanStub_1 = __webpack_require__(14); var rowContainerComponent_1 = __webpack_require__(121); var paginationProxy_1 = __webpack_require__(29); var popupEditorWrapper_1 = __webpack_require__(68); var alignedGridsService_1 = __webpack_require__(48); var pinnedRowModel_1 = __webpack_require__(30); var gridApi_1 = __webpack_require__(6); var animationFrameService_1 = __webpack_require__(40); var rowComp_1 = __webpack_require__(49); var navigationService_1 = __webpack_require__(89); var valueService_1 = __webpack_require__(18); var touchListener_1 = __webpack_require__(50); var componentRecipes_1 = __webpack_require__(25); var dragAndDropService_1 = __webpack_require__(15); var rowDragFeature_1 = __webpack_require__(130); // in the html below, it is important that there are no white space between some of the divs, as if there is white space, // it won't render correctly in safari, as safari renders white space as a gap var HEADER_SNIPPET = '