/**
* @ag-grid-community/all-modules - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
// @ag-grid-community/all-modules v25.0.0
define("agGrid", [], 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, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // 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 = 0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {
/**
* AUTOMATICALLY GENERATED FILE, DO NOT EDIT MANUALLY!
* Update this file by running `lerna run webpack-updater` in the monorepo root folder.
*/
var ClientSideRowModelModule = __webpack_require__(1);
var GridCoreModule = __webpack_require__(3);
var CsvExportModule = __webpack_require__(220);
var InfiniteRowModelModule = __webpack_require__(227);
var agGrid = __webpack_require__(232);
Object.keys(agGrid).forEach(function(key) {
exports[key] = agGrid[key];
});
agGrid.ModuleRegistry.register(ClientSideRowModelModule.ClientSideRowModelModule);
agGrid.ModuleRegistry.register(CsvExportModule.CsvExportModule);
agGrid.ModuleRegistry.register(InfiniteRowModelModule.InfiniteRowModelModule);
__webpack_require__(233);
__webpack_require__(237);
__webpack_require__(239);
__webpack_require__(241);
__webpack_require__(243);
__webpack_require__(245);
__webpack_require__(247);
__webpack_require__(249);
__webpack_require__(251);
__webpack_require__(253);
__webpack_require__(255);
__webpack_require__(257);
__webpack_require__(259);
__webpack_require__(261);
/***/ }),
/* 1 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _clientSideRowModelModule__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ClientSideRowModelModule", function() { return _clientSideRowModelModule__WEBPACK_IMPORTED_MODULE_0__["ClientSideRowModelModule"]; });
/***/ }),
/* 2 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ClientSideRowModelModule", function() { return ClientSideRowModelModule; });
/* harmony import */ var _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
/* harmony import */ var _clientSideRowModel_clientSideRowModel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(212);
/* harmony import */ var _clientSideRowModel_filterStage__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(214);
/* harmony import */ var _clientSideRowModel_sortStage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(215);
/* harmony import */ var _clientSideRowModel_flattenStage__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(216);
/* harmony import */ var _clientSideRowModel_sortService__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(217);
/* harmony import */ var _clientSideRowModel_filterService__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(218);
/* harmony import */ var _clientSideRowModel_immutableService__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(219);
var ClientSideRowModelModule = {
moduleName: _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["ModuleNames"].ClientSideRowModelModule,
beans: [_clientSideRowModel_filterStage__WEBPACK_IMPORTED_MODULE_2__["FilterStage"], _clientSideRowModel_sortStage__WEBPACK_IMPORTED_MODULE_3__["SortStage"], _clientSideRowModel_flattenStage__WEBPACK_IMPORTED_MODULE_4__["FlattenStage"], _clientSideRowModel_sortService__WEBPACK_IMPORTED_MODULE_5__["SortService"], _clientSideRowModel_filterService__WEBPACK_IMPORTED_MODULE_6__["FilterService"], _clientSideRowModel_immutableService__WEBPACK_IMPORTED_MODULE_7__["ImmutableService"]],
rowModels: { clientSide: _clientSideRowModel_clientSideRowModel__WEBPACK_IMPORTED_MODULE_1__["ClientSideRowModel"] }
};
/***/ }),
/* 3 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var _columnController_columnFactory__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColumnFactory", function() { return _columnController_columnFactory__WEBPACK_IMPORTED_MODULE_0__["ColumnFactory"]; });
/* harmony import */ var _columnController_columnController__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(22);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColumnController", function() { return _columnController_columnController__WEBPACK_IMPORTED_MODULE_1__["ColumnController"]; });
/* harmony import */ var _columnController_columnKeyCreator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColumnKeyCreator", function() { return _columnController_columnKeyCreator__WEBPACK_IMPORTED_MODULE_2__["ColumnKeyCreator"]; });
/* harmony import */ var _columnController_columnUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(27);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColumnUtils", function() { return _columnController_columnUtils__WEBPACK_IMPORTED_MODULE_3__["ColumnUtils"]; });
/* harmony import */ var _columnController_displayedGroupCreator__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DisplayedGroupCreator", function() { return _columnController_displayedGroupCreator__WEBPACK_IMPORTED_MODULE_4__["DisplayedGroupCreator"]; });
/* harmony import */ var _columnController_groupInstanceIdCreator__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(25);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GroupInstanceIdCreator", function() { return _columnController_groupInstanceIdCreator__WEBPACK_IMPORTED_MODULE_5__["GroupInstanceIdCreator"]; });
/* harmony import */ var _components_componentUtil__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(30);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ComponentUtil", function() { return _components_componentUtil__WEBPACK_IMPORTED_MODULE_6__["ComponentUtil"]; });
/* harmony import */ var _components_colDefUtil__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(32);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColDefUtil", function() { return _components_colDefUtil__WEBPACK_IMPORTED_MODULE_7__["ColDefUtil"]; });
/* harmony import */ var _components_framework_userComponentRegistry__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(33);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UserComponentRegistry", function() { return _components_framework_userComponentRegistry__WEBPACK_IMPORTED_MODULE_8__["UserComponentRegistry"]; });
/* harmony import */ var _components_framework_userComponentFactory__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(73);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UserComponentFactory", function() { return _components_framework_userComponentFactory__WEBPACK_IMPORTED_MODULE_9__["UserComponentFactory"]; });
/* harmony import */ var _components_agGridNg1__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(93);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "initialiseAgGridWithAngular1", function() { return _components_agGridNg1__WEBPACK_IMPORTED_MODULE_10__["initialiseAgGridWithAngular1"]; });
/* harmony import */ var _components_agGridWebComponent__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(203);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "initialiseAgGridWithWebComponents", function() { return _components_agGridWebComponent__WEBPACK_IMPORTED_MODULE_11__["initialiseAgGridWithWebComponents"]; });
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(20);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BeanStub", function() { return _context_beanStub__WEBPACK_IMPORTED_MODULE_12__["BeanStub"]; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(12);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Context", function() { return _context_context__WEBPACK_IMPORTED_MODULE_13__["Context"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Autowired", function() { return _context_context__WEBPACK_IMPORTED_MODULE_13__["Autowired"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostConstruct", function() { return _context_context__WEBPACK_IMPORTED_MODULE_13__["PostConstruct"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PreConstruct", function() { return _context_context__WEBPACK_IMPORTED_MODULE_13__["PreConstruct"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Optional", function() { return _context_context__WEBPACK_IMPORTED_MODULE_13__["Optional"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Bean", function() { return _context_context__WEBPACK_IMPORTED_MODULE_13__["Bean"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Qualifier", function() { return _context_context__WEBPACK_IMPORTED_MODULE_13__["Qualifier"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PreDestroy", function() { return _context_context__WEBPACK_IMPORTED_MODULE_13__["PreDestroy"]; });
/* harmony import */ var _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(57);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "QuerySelector", function() { return _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_14__["QuerySelector"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GuiListener", function() { return _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_14__["GuiListener"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RefSelector", function() { return _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_14__["RefSelector"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GridListener", function() { return _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_14__["GridListener"]; });
/* harmony import */ var _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(105);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DragAndDropService", function() { return _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_15__["DragAndDropService"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DragSourceType", function() { return _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_15__["DragSourceType"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HorizontalDirection", function() { return _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_15__["HorizontalDirection"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VerticalDirection", function() { return _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_15__["VerticalDirection"]; });
/* harmony import */ var _dragAndDrop_dragService__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(145);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DragService", function() { return _dragAndDrop_dragService__WEBPACK_IMPORTED_MODULE_16__["DragService"]; });
/* harmony import */ var _entities_column__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(10);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Column", function() { return _entities_column__WEBPACK_IMPORTED_MODULE_17__["Column"]; });
/* harmony import */ var _entities_columnGroup__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(9);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColumnGroup", function() { return _entities_columnGroup__WEBPACK_IMPORTED_MODULE_18__["ColumnGroup"]; });
/* harmony import */ var _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(8);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "OriginalColumnGroup", function() { return _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_19__["OriginalColumnGroup"]; });
/* harmony import */ var _entities_rowNode__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(71);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RowNode", function() { return _entities_rowNode__WEBPACK_IMPORTED_MODULE_20__["RowNode"]; });
/* harmony import */ var _filter_filterManager__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(131);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FilterManager", function() { return _filter_filterManager__WEBPACK_IMPORTED_MODULE_21__["FilterManager"]; });
/* harmony import */ var _filter_provided_providedFilter__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(63);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ProvidedFilter", function() { return _filter_provided_providedFilter__WEBPACK_IMPORTED_MODULE_22__["ProvidedFilter"]; });
/* harmony import */ var _filter_provided_simpleFilter__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(61);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SimpleFilter", function() { return _filter_provided_simpleFilter__WEBPACK_IMPORTED_MODULE_23__["SimpleFilter"]; });
/* harmony import */ var _filter_provided_scalarFilter__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(66);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ScalarFilter", function() { return _filter_provided_scalarFilter__WEBPACK_IMPORTED_MODULE_24__["ScalarFilter"]; });
/* harmony import */ var _filter_provided_number_numberFilter__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(82);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NumberFilter", function() { return _filter_provided_number_numberFilter__WEBPACK_IMPORTED_MODULE_25__["NumberFilter"]; });
/* harmony import */ var _filter_provided_text_textFilter__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(89);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TextFilter", function() { return _filter_provided_text_textFilter__WEBPACK_IMPORTED_MODULE_26__["TextFilter"]; });
/* harmony import */ var _filter_provided_date_dateFilter__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(59);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DateFilter", function() { return _filter_provided_date_dateFilter__WEBPACK_IMPORTED_MODULE_27__["DateFilter"]; });
/* harmony import */ var _filter_provided_text_textFloatingFilter__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(92);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TextFloatingFilter", function() { return _filter_provided_text_textFloatingFilter__WEBPACK_IMPORTED_MODULE_28__["TextFloatingFilter"]; });
/* harmony import */ var _filter_floating_floatingFilterWrapper__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(123);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FloatingFilterWrapper", function() { return _filter_floating_floatingFilterWrapper__WEBPACK_IMPORTED_MODULE_29__["FloatingFilterWrapper"]; });
/* harmony import */ var _filter_floating_floatingFilterMapper__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(125);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FloatingFilterMapper", function() { return _filter_floating_floatingFilterMapper__WEBPACK_IMPORTED_MODULE_30__["FloatingFilterMapper"]; });
/* harmony import */ var _gridPanel_gridPanel__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(133);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GridPanel", function() { return _gridPanel_gridPanel__WEBPACK_IMPORTED_MODULE_31__["GridPanel"]; });
/* harmony import */ var _gridPanel_scrollVisibleService__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(153);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ScrollVisibleService", function() { return _gridPanel_scrollVisibleService__WEBPACK_IMPORTED_MODULE_32__["ScrollVisibleService"]; });
/* harmony import */ var _gridPanel_mouseEventService__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(148);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MouseEventService", function() { return _gridPanel_mouseEventService__WEBPACK_IMPORTED_MODULE_33__["MouseEventService"]; });
/* harmony import */ var _headerRendering_bodyDropPivotTarget__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(128);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BodyDropPivotTarget", function() { return _headerRendering_bodyDropPivotTarget__WEBPACK_IMPORTED_MODULE_34__["BodyDropPivotTarget"]; });
/* harmony import */ var _headerRendering_bodyDropTarget__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(126);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BodyDropTarget", function() { return _headerRendering_bodyDropTarget__WEBPACK_IMPORTED_MODULE_35__["BodyDropTarget"]; });
/* harmony import */ var _headerRendering_cssClassApplier__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(113);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CssClassApplier", function() { return _headerRendering_cssClassApplier__WEBPACK_IMPORTED_MODULE_36__["CssClassApplier"]; });
/* harmony import */ var _headerRendering_headerContainer__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(110);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HeaderContainer", function() { return _headerRendering_headerContainer__WEBPACK_IMPORTED_MODULE_37__["HeaderContainer"]; });
/* harmony import */ var _headerRendering_headerRootComp__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(109);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HeaderRootComp", function() { return _headerRendering_headerRootComp__WEBPACK_IMPORTED_MODULE_38__["HeaderRootComp"]; });
/* harmony import */ var _headerRendering_headerRowComp__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(111);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HeaderRowComp", function() { return _headerRendering_headerRowComp__WEBPACK_IMPORTED_MODULE_39__["HeaderRowComp"]; });
/* harmony import */ var _headerRendering_horizontalResizeService__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(142);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HorizontalResizeService", function() { return _headerRendering_horizontalResizeService__WEBPACK_IMPORTED_MODULE_40__["HorizontalResizeService"]; });
/* harmony import */ var _headerRendering_moveColumnController__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(127);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MoveColumnController", function() { return _headerRendering_moveColumnController__WEBPACK_IMPORTED_MODULE_41__["MoveColumnController"]; });
/* harmony import */ var _headerRendering_standardMenu__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(144);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "StandardMenuFactory", function() { return _headerRendering_standardMenu__WEBPACK_IMPORTED_MODULE_42__["StandardMenuFactory"]; });
/* harmony import */ var _layout_tabbedLayout__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(204);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TabbedLayout", function() { return _layout_tabbedLayout__WEBPACK_IMPORTED_MODULE_43__["TabbedLayout"]; });
/* harmony import */ var _misc_simpleHttpRequest__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(205);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "simpleHttpRequest", function() { return _misc_simpleHttpRequest__WEBPACK_IMPORTED_MODULE_44__["simpleHttpRequest"]; });
/* harmony import */ var _misc_resizeObserverService__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(173);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ResizeObserverService", function() { return _misc_resizeObserverService__WEBPACK_IMPORTED_MODULE_45__["ResizeObserverService"]; });
/* harmony import */ var _rendering_cellEditors_largeTextCellEditor__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(81);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LargeTextCellEditor", function() { return _rendering_cellEditors_largeTextCellEditor__WEBPACK_IMPORTED_MODULE_46__["LargeTextCellEditor"]; });
/* harmony import */ var _rendering_cellEditors_popupEditorWrapper__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(106);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PopupEditorWrapper", function() { return _rendering_cellEditors_popupEditorWrapper__WEBPACK_IMPORTED_MODULE_47__["PopupEditorWrapper"]; });
/* harmony import */ var _rendering_cellEditors_popupSelectCellEditor__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(80);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PopupSelectCellEditor", function() { return _rendering_cellEditors_popupSelectCellEditor__WEBPACK_IMPORTED_MODULE_48__["PopupSelectCellEditor"]; });
/* harmony import */ var _rendering_cellEditors_popupTextCellEditor__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(79);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PopupTextCellEditor", function() { return _rendering_cellEditors_popupTextCellEditor__WEBPACK_IMPORTED_MODULE_49__["PopupTextCellEditor"]; });
/* harmony import */ var _rendering_cellEditors_selectCellEditor__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(78);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SelectCellEditor", function() { return _rendering_cellEditors_selectCellEditor__WEBPACK_IMPORTED_MODULE_50__["SelectCellEditor"]; });
/* harmony import */ var _rendering_cellEditors_textCellEditor__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(34);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TextCellEditor", function() { return _rendering_cellEditors_textCellEditor__WEBPACK_IMPORTED_MODULE_51__["TextCellEditor"]; });
/* harmony import */ var _rendering_cellRenderers_animateShowChangeCellRenderer__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(75);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AnimateShowChangeCellRenderer", function() { return _rendering_cellRenderers_animateShowChangeCellRenderer__WEBPACK_IMPORTED_MODULE_52__["AnimateShowChangeCellRenderer"]; });
/* harmony import */ var _rendering_cellRenderers_animateSlideCellRenderer__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(76);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AnimateSlideCellRenderer", function() { return _rendering_cellRenderers_animateSlideCellRenderer__WEBPACK_IMPORTED_MODULE_53__["AnimateSlideCellRenderer"]; });
/* harmony import */ var _rendering_cellRenderers_groupCellRenderer__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(70);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GroupCellRenderer", function() { return _rendering_cellRenderers_groupCellRenderer__WEBPACK_IMPORTED_MODULE_54__["GroupCellRenderer"]; });
/* harmony import */ var _rendering_features_setLeftFeature__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(115);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SetLeftFeature", function() { return _rendering_features_setLeftFeature__WEBPACK_IMPORTED_MODULE_55__["SetLeftFeature"]; });
/* harmony import */ var _rendering_autoWidthCalculator__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(141);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AutoWidthCalculator", function() { return _rendering_autoWidthCalculator__WEBPACK_IMPORTED_MODULE_56__["AutoWidthCalculator"]; });
/* harmony import */ var _rendering_checkboxSelectionComponent__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(72);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CheckboxSelectionComponent", function() { return _rendering_checkboxSelectionComponent__WEBPACK_IMPORTED_MODULE_57__["CheckboxSelectionComponent"]; });
/* harmony import */ var _rendering_cellComp__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(102);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CellComp", function() { return _rendering_cellComp__WEBPACK_IMPORTED_MODULE_58__["CellComp"]; });
/* harmony import */ var _rendering_row_rowComp__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(101);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RowComp", function() { return _rendering_row_rowComp__WEBPACK_IMPORTED_MODULE_59__["RowComp"]; });
/* harmony import */ var _rendering_rowRenderer__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(100);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RowRenderer", function() { return _rendering_rowRenderer__WEBPACK_IMPORTED_MODULE_60__["RowRenderer"]; });
/* harmony import */ var _rendering_valueFormatterService__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(150);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ValueFormatterService", function() { return _rendering_valueFormatterService__WEBPACK_IMPORTED_MODULE_61__["ValueFormatterService"]; });
/* harmony import */ var _pinnedRowModel_pinnedRowModel__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(193);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PinnedRowModel", function() { return _pinnedRowModel_pinnedRowModel__WEBPACK_IMPORTED_MODULE_62__["PinnedRowModel"]; });
/* harmony import */ var _interfaces_serverSideTransaction__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(206);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ServerSideTransactionResultStatus", function() { return _interfaces_serverSideTransaction__WEBPACK_IMPORTED_MODULE_63__["ServerSideTransactionResultStatus"]; });
/* harmony import */ var _utils_changedPath__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(98);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ChangedPath", function() { return _utils_changedPath__WEBPACK_IMPORTED_MODULE_64__["ChangedPath"]; });
/* harmony import */ var _rowNodeCache_rowNodeBlock__WEBPACK_IMPORTED_MODULE_65__ = __webpack_require__(201);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RowNodeBlock", function() { return _rowNodeCache_rowNodeBlock__WEBPACK_IMPORTED_MODULE_65__["RowNodeBlock"]; });
/* harmony import */ var _rowNodeCache_rowNodeBlockLoader__WEBPACK_IMPORTED_MODULE_66__ = __webpack_require__(200);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RowNodeBlockLoader", function() { return _rowNodeCache_rowNodeBlockLoader__WEBPACK_IMPORTED_MODULE_66__["RowNodeBlockLoader"]; });
/* harmony import */ var _pagination_paginationProxy__WEBPACK_IMPORTED_MODULE_67__ = __webpack_require__(158);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PaginationProxy", function() { return _pagination_paginationProxy__WEBPACK_IMPORTED_MODULE_67__["PaginationProxy"]; });
/* harmony import */ var _styling_stylingService__WEBPACK_IMPORTED_MODULE_68__ = __webpack_require__(154);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "StylingService", function() { return _styling_stylingService__WEBPACK_IMPORTED_MODULE_68__["StylingService"]; });
/* harmony import */ var _widgets_agAbstractField__WEBPACK_IMPORTED_MODULE_69__ = __webpack_require__(119);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgAbstractField", function() { return _widgets_agAbstractField__WEBPACK_IMPORTED_MODULE_69__["AgAbstractField"]; });
/* harmony import */ var _widgets_agCheckbox__WEBPACK_IMPORTED_MODULE_70__ = __webpack_require__(117);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgCheckbox", function() { return _widgets_agCheckbox__WEBPACK_IMPORTED_MODULE_70__["AgCheckbox"]; });
/* harmony import */ var _widgets_agRadioButton__WEBPACK_IMPORTED_MODULE_71__ = __webpack_require__(151);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgRadioButton", function() { return _widgets_agRadioButton__WEBPACK_IMPORTED_MODULE_71__["AgRadioButton"]; });
/* harmony import */ var _widgets_agToggleButton__WEBPACK_IMPORTED_MODULE_72__ = __webpack_require__(189);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgToggleButton", function() { return _widgets_agToggleButton__WEBPACK_IMPORTED_MODULE_72__["AgToggleButton"]; });
/* harmony import */ var _widgets_agInputTextField__WEBPACK_IMPORTED_MODULE_73__ = __webpack_require__(178);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgInputTextField", function() { return _widgets_agInputTextField__WEBPACK_IMPORTED_MODULE_73__["AgInputTextField"]; });
/* harmony import */ var _widgets_agInputTextArea__WEBPACK_IMPORTED_MODULE_74__ = __webpack_require__(179);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgInputTextArea", function() { return _widgets_agInputTextArea__WEBPACK_IMPORTED_MODULE_74__["AgInputTextArea"]; });
/* harmony import */ var _widgets_agInputNumberField__WEBPACK_IMPORTED_MODULE_75__ = __webpack_require__(184);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgInputNumberField", function() { return _widgets_agInputNumberField__WEBPACK_IMPORTED_MODULE_75__["AgInputNumberField"]; });
/* harmony import */ var _widgets_agInputRange__WEBPACK_IMPORTED_MODULE_76__ = __webpack_require__(185);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgInputRange", function() { return _widgets_agInputRange__WEBPACK_IMPORTED_MODULE_76__["AgInputRange"]; });
/* harmony import */ var _widgets_agSelect__WEBPACK_IMPORTED_MODULE_77__ = __webpack_require__(186);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgSelect", function() { return _widgets_agSelect__WEBPACK_IMPORTED_MODULE_77__["AgSelect"]; });
/* harmony import */ var _widgets_agSlider__WEBPACK_IMPORTED_MODULE_78__ = __webpack_require__(180);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgSlider", function() { return _widgets_agSlider__WEBPACK_IMPORTED_MODULE_78__["AgSlider"]; });
/* harmony import */ var _widgets_agAngleSelect__WEBPACK_IMPORTED_MODULE_79__ = __webpack_require__(188);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgAngleSelect", function() { return _widgets_agAngleSelect__WEBPACK_IMPORTED_MODULE_79__["AgAngleSelect"]; });
/* harmony import */ var _widgets_agColorPicker__WEBPACK_IMPORTED_MODULE_80__ = __webpack_require__(181);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgColorPicker", function() { return _widgets_agColorPicker__WEBPACK_IMPORTED_MODULE_80__["AgColorPicker"]; });
/* harmony import */ var _widgets_agGroupComponent__WEBPACK_IMPORTED_MODULE_81__ = __webpack_require__(175);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgGroupComponent", function() { return _widgets_agGroupComponent__WEBPACK_IMPORTED_MODULE_81__["AgGroupComponent"]; });
/* harmony import */ var _widgets_agDialog__WEBPACK_IMPORTED_MODULE_82__ = __webpack_require__(176);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgDialog", function() { return _widgets_agDialog__WEBPACK_IMPORTED_MODULE_82__["AgDialog"]; });
/* harmony import */ var _widgets_agPanel__WEBPACK_IMPORTED_MODULE_83__ = __webpack_require__(177);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgPanel", function() { return _widgets_agPanel__WEBPACK_IMPORTED_MODULE_83__["AgPanel"]; });
/* harmony import */ var _widgets_component__WEBPACK_IMPORTED_MODULE_84__ = __webpack_require__(36);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Component", function() { return _widgets_component__WEBPACK_IMPORTED_MODULE_84__["Component"]; });
/* harmony import */ var _widgets_managedFocusComponent__WEBPACK_IMPORTED_MODULE_85__ = __webpack_require__(65);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ManagedFocusComponent", function() { return _widgets_managedFocusComponent__WEBPACK_IMPORTED_MODULE_85__["ManagedFocusComponent"]; });
/* harmony import */ var _widgets_popupComponent__WEBPACK_IMPORTED_MODULE_86__ = __webpack_require__(35);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PopupComponent", function() { return _widgets_popupComponent__WEBPACK_IMPORTED_MODULE_86__["PopupComponent"]; });
/* harmony import */ var _widgets_popupService__WEBPACK_IMPORTED_MODULE_87__ = __webpack_require__(139);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PopupService", function() { return _widgets_popupService__WEBPACK_IMPORTED_MODULE_87__["PopupService"]; });
/* harmony import */ var _widgets_touchListener__WEBPACK_IMPORTED_MODULE_88__ = __webpack_require__(68);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TouchListener", function() { return _widgets_touchListener__WEBPACK_IMPORTED_MODULE_88__["TouchListener"]; });
/* harmony import */ var _widgets_virtualList__WEBPACK_IMPORTED_MODULE_89__ = __webpack_require__(207);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VirtualList", function() { return _widgets_virtualList__WEBPACK_IMPORTED_MODULE_89__["VirtualList"]; });
/* harmony import */ var _interfaces_iRangeController__WEBPACK_IMPORTED_MODULE_90__ = __webpack_require__(103);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CellRangeType", function() { return _interfaces_iRangeController__WEBPACK_IMPORTED_MODULE_90__["CellRangeType"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SelectionHandleType", function() { return _interfaces_iRangeController__WEBPACK_IMPORTED_MODULE_90__["SelectionHandleType"]; });
/* harmony import */ var _vanillaFrameworkOverrides__WEBPACK_IMPORTED_MODULE_91__ = __webpack_require__(152);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VanillaFrameworkOverrides", function() { return _vanillaFrameworkOverrides__WEBPACK_IMPORTED_MODULE_91__["VanillaFrameworkOverrides"]; });
/* harmony import */ var _cellNavigationService__WEBPACK_IMPORTED_MODULE_92__ = __webpack_require__(149);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CellNavigationService", function() { return _cellNavigationService__WEBPACK_IMPORTED_MODULE_92__["CellNavigationService"]; });
/* harmony import */ var _alignedGridsService__WEBPACK_IMPORTED_MODULE_93__ = __webpack_require__(162);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AlignedGridsService", function() { return _alignedGridsService__WEBPACK_IMPORTED_MODULE_93__["AlignedGridsService"]; });
/* harmony import */ var _constants_constants__WEBPACK_IMPORTED_MODULE_94__ = __webpack_require__(16);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Constants", function() { return _constants_constants__WEBPACK_IMPORTED_MODULE_94__["Constants"]; });
/* harmony import */ var _constants_keyCode__WEBPACK_IMPORTED_MODULE_95__ = __webpack_require__(58);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "KeyCode", function() { return _constants_keyCode__WEBPACK_IMPORTED_MODULE_95__["KeyCode"]; });
/* harmony import */ var _constants_keyName__WEBPACK_IMPORTED_MODULE_96__ = __webpack_require__(130);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "KeyName", function() { return _constants_keyName__WEBPACK_IMPORTED_MODULE_96__["KeyName"]; });
/* harmony import */ var _grid__WEBPACK_IMPORTED_MODULE_97__ = __webpack_require__(94);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Grid", function() { return _grid__WEBPACK_IMPORTED_MODULE_97__["Grid"]; });
/* harmony import */ var _gridApi__WEBPACK_IMPORTED_MODULE_98__ = __webpack_require__(136);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GridApi", function() { return _gridApi__WEBPACK_IMPORTED_MODULE_98__["GridApi"]; });
/* harmony import */ var _eventKeys__WEBPACK_IMPORTED_MODULE_99__ = __webpack_require__(24);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Events", function() { return _eventKeys__WEBPACK_IMPORTED_MODULE_99__["Events"]; });
/* harmony import */ var _focusController__WEBPACK_IMPORTED_MODULE_100__ = __webpack_require__(147);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FocusController", function() { return _focusController__WEBPACK_IMPORTED_MODULE_100__["FocusController"]; });
/* harmony import */ var _functions__WEBPACK_IMPORTED_MODULE_101__ = __webpack_require__(208);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaultGroupComparator", function() { return _functions__WEBPACK_IMPORTED_MODULE_101__["defaultGroupComparator"]; });
/* harmony import */ var _gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_102__ = __webpack_require__(95);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GridOptionsWrapper", function() { return _gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_102__["GridOptionsWrapper"]; });
/* harmony import */ var _eventService__WEBPACK_IMPORTED_MODULE_103__ = __webpack_require__(11);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EventService", function() { return _eventService__WEBPACK_IMPORTED_MODULE_103__["EventService"]; });
/* harmony import */ var _rowNodes_selectableService__WEBPACK_IMPORTED_MODULE_104__ = __webpack_require__(170);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SelectableService", function() { return _rowNodes_selectableService__WEBPACK_IMPORTED_MODULE_104__["SelectableService"]; });
/* harmony import */ var _rowNodes_rowNodeSorter__WEBPACK_IMPORTED_MODULE_105__ = __webpack_require__(202);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RowNodeSorter", function() { return _rowNodes_rowNodeSorter__WEBPACK_IMPORTED_MODULE_105__["RowNodeSorter"]; });
/* harmony import */ var _gridCore__WEBPACK_IMPORTED_MODULE_106__ = __webpack_require__(143);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GridCore", function() { return _gridCore__WEBPACK_IMPORTED_MODULE_106__["GridCore"]; });
/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_107__ = __webpack_require__(140);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Logger", function() { return _logger__WEBPACK_IMPORTED_MODULE_107__["Logger"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LoggerFactory", function() { return _logger__WEBPACK_IMPORTED_MODULE_107__["LoggerFactory"]; });
/* harmony import */ var _selectionController__WEBPACK_IMPORTED_MODULE_108__ = __webpack_require__(97);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SelectionController", function() { return _selectionController__WEBPACK_IMPORTED_MODULE_108__["SelectionController"]; });
/* harmony import */ var _sortController__WEBPACK_IMPORTED_MODULE_109__ = __webpack_require__(146);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SortController", function() { return _sortController__WEBPACK_IMPORTED_MODULE_109__["SortController"]; });
/* harmony import */ var _templateService__WEBPACK_IMPORTED_MODULE_110__ = __webpack_require__(138);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TemplateService", function() { return _templateService__WEBPACK_IMPORTED_MODULE_110__["TemplateService"]; });
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_111__ = __webpack_require__(37);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Color", function() { return _utils__WEBPACK_IMPORTED_MODULE_111__["Color"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stringToArray", function() { return _utils__WEBPACK_IMPORTED_MODULE_111__["stringToArray"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_", function() { return _utils__WEBPACK_IMPORTED_MODULE_111__["_"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NumberSequence", function() { return _utils__WEBPACK_IMPORTED_MODULE_111__["NumberSequence"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgPromiseStatus", function() { return _utils__WEBPACK_IMPORTED_MODULE_111__["AgPromiseStatus"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgPromise", function() { return _utils__WEBPACK_IMPORTED_MODULE_111__["AgPromise"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Timer", function() { return _utils__WEBPACK_IMPORTED_MODULE_111__["Timer"]; });
/* harmony import */ var _valueService_valueService__WEBPACK_IMPORTED_MODULE_112__ = __webpack_require__(132);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ValueService", function() { return _valueService_valueService__WEBPACK_IMPORTED_MODULE_112__["ValueService"]; });
/* harmony import */ var _valueService_valueCache__WEBPACK_IMPORTED_MODULE_113__ = __webpack_require__(160);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ValueCache", function() { return _valueService_valueCache__WEBPACK_IMPORTED_MODULE_113__["ValueCache"]; });
/* harmony import */ var _valueService_expressionService__WEBPACK_IMPORTED_MODULE_114__ = __webpack_require__(137);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ExpressionService", function() { return _valueService_expressionService__WEBPACK_IMPORTED_MODULE_114__["ExpressionService"]; });
/* harmony import */ var _entities_cellPosition__WEBPACK_IMPORTED_MODULE_115__ = __webpack_require__(192);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CellPositionUtils", function() { return _entities_cellPosition__WEBPACK_IMPORTED_MODULE_115__["CellPositionUtils"]; });
/* harmony import */ var _entities_rowPosition__WEBPACK_IMPORTED_MODULE_116__ = __webpack_require__(191);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RowPositionUtils", function() { return _entities_rowPosition__WEBPACK_IMPORTED_MODULE_116__["RowPositionUtils"]; });
/* harmony import */ var _headerRendering_header_headerPosition__WEBPACK_IMPORTED_MODULE_117__ = __webpack_require__(197);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HeaderPositionUtils", function() { return _headerRendering_header_headerPosition__WEBPACK_IMPORTED_MODULE_117__["HeaderPositionUtils"]; });
/* harmony import */ var _headerRendering_header_headerNavigationService__WEBPACK_IMPORTED_MODULE_118__ = __webpack_require__(129);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HeaderNavigationService", function() { return _headerRendering_header_headerNavigationService__WEBPACK_IMPORTED_MODULE_118__["HeaderNavigationService"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HeaderNavigationDirection", function() { return _headerRendering_header_headerNavigationService__WEBPACK_IMPORTED_MODULE_118__["HeaderNavigationDirection"]; });
/* harmony import */ var _entities_gridOptions__WEBPACK_IMPORTED_MODULE_119__ = __webpack_require__(209);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ServerSideStoreType", function() { return _entities_gridOptions__WEBPACK_IMPORTED_MODULE_119__["ServerSideStoreType"]; });
/* harmony import */ var _propertyKeys__WEBPACK_IMPORTED_MODULE_120__ = __webpack_require__(31);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PropertyKeys", function() { return _propertyKeys__WEBPACK_IMPORTED_MODULE_120__["PropertyKeys"]; });
/* harmony import */ var _columnController_columnApi__WEBPACK_IMPORTED_MODULE_121__ = __webpack_require__(99);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColumnApi", function() { return _columnController_columnApi__WEBPACK_IMPORTED_MODULE_121__["ColumnApi"]; });
/* harmony import */ var _components_framework_frameworkComponentWrapper__WEBPACK_IMPORTED_MODULE_122__ = __webpack_require__(210);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BaseComponentWrapper", function() { return _components_framework_frameworkComponentWrapper__WEBPACK_IMPORTED_MODULE_122__["BaseComponentWrapper"]; });
/* harmony import */ var _environment__WEBPACK_IMPORTED_MODULE_123__ = __webpack_require__(166);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Environment", function() { return _environment__WEBPACK_IMPORTED_MODULE_123__["Environment"]; });
/* harmony import */ var _widgets_tooltipFeature__WEBPACK_IMPORTED_MODULE_124__ = __webpack_require__(56);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TooltipFeature", function() { return _widgets_tooltipFeature__WEBPACK_IMPORTED_MODULE_124__["TooltipFeature"]; });
/* harmony import */ var _interfaces_iChartOptions__WEBPACK_IMPORTED_MODULE_125__ = __webpack_require__(211);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ChartType", function() { return _interfaces_iChartOptions__WEBPACK_IMPORTED_MODULE_125__["ChartType"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LegendPosition", function() { return _interfaces_iChartOptions__WEBPACK_IMPORTED_MODULE_125__["LegendPosition"]; });
/* harmony import */ var _modules_moduleNames__WEBPACK_IMPORTED_MODULE_126__ = __webpack_require__(17);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ModuleNames", function() { return _modules_moduleNames__WEBPACK_IMPORTED_MODULE_126__["ModuleNames"]; });
/* harmony import */ var _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_127__ = __webpack_require__(18);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ModuleRegistry", function() { return _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_127__["ModuleRegistry"]; });
/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_128__ = __webpack_require__(23);
/* empty/unused harmony star reexport *//**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var globalObj = typeof global === 'undefined' ? {} : global;
globalObj.HTMLElement = typeof HTMLElement === 'undefined' ? {} : HTMLElement;
globalObj.HTMLButtonElement = typeof HTMLButtonElement === 'undefined' ? {} : HTMLButtonElement;
globalObj.HTMLSelectElement = typeof HTMLSelectElement === 'undefined' ? {} : HTMLSelectElement;
globalObj.HTMLInputElement = typeof HTMLInputElement === 'undefined' ? {} : HTMLInputElement;
globalObj.Node = typeof Node === 'undefined' ? {} : Node;
globalObj.MouseEvent = typeof MouseEvent === 'undefined' ? {} : MouseEvent;
// columnController
// components
// context
// dragAndDrop
// entities
// gridPanel
// headerRendering
// layout
// misc
// features
// rendering
// row models
//styling
// widgets
// range
// root
// charts
// events
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4)))
/***/ }),
/* 4 */
/***/ (function(module, exports) {
var g;
// This works in non-strict mode
g = (function() {
return this;
})();
try {
// This works if eval is allowed (see CSP)
g = g || new Function("return this")();
} catch (e) {
// This works if the window reference is available
if (typeof window === "object") g = window;
}
// g can still be undefined, but nothing to do about it...
// We return undefined, instead of nothing here, so it's
// easier to handle this case. if(!global) { ...}
module.exports = g;
/***/ }),
/* 5 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColumnFactory", function() { return ColumnFactory; });
/* harmony import */ var _columnKeyCreator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6);
/* harmony import */ var _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8);
/* harmony import */ var _entities_column__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(10);
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(12);
/* harmony import */ var _entities_defaultColumnTypes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(19);
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(20);
/* harmony import */ var _constants_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(16);
/* harmony import */ var _utils_object__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(13);
/* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(7);
/* harmony import */ var _utils_array__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(14);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 __param = (undefined && undefined.__param) || function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
// takes ColDefs and ColGroupDefs and turns them into Columns and OriginalGroups
var ColumnFactory = /** @class */ (function (_super) {
__extends(ColumnFactory, _super);
function ColumnFactory() {
return _super !== null && _super.apply(this, arguments) || this;
}
ColumnFactory.prototype.setBeans = function (loggerFactory) {
this.logger = loggerFactory.create('ColumnFactory');
};
ColumnFactory.prototype.createColumnTree = function (defs, primaryColumns, existingColumns) {
// column key creator dishes out unique column id's in a deterministic way,
// so if we have two grids (that could be master/slave) with same column definitions,
// then this ensures the two grids use identical id's.
var columnKeyCreator = new _columnKeyCreator__WEBPACK_IMPORTED_MODULE_0__["ColumnKeyCreator"]();
if (existingColumns) {
var existingKeys = existingColumns.map(function (col) { return col.getId(); });
columnKeyCreator.addExistingKeys(existingKeys);
}
// we take a copy of the columns as we are going to be removing from them
var existingColsCopy = existingColumns ? existingColumns.slice() : null;
// create am unbalanced tree that maps the provided definitions
var unbalancedTree = this.recursivelyCreateColumns(defs, 0, primaryColumns, existingColsCopy, columnKeyCreator, null);
var treeDept = this.findMaxDept(unbalancedTree, 0);
this.logger.log('Number of levels for grouped columns is ' + treeDept);
var columnTree = this.balanceColumnTree(unbalancedTree, 0, treeDept, columnKeyCreator);
var deptFirstCallback = function (child, parent) {
if (child instanceof _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_1__["OriginalColumnGroup"]) {
child.setupExpandable();
}
// we set the original parents at the end, rather than when we go along, as balancing the tree
// adds extra levels into the tree. so we can only set parents when balancing is done.
child.setOriginalParent(parent);
};
this.columnUtils.depthFirstOriginalTreeSearch(null, columnTree, deptFirstCallback);
return {
columnTree: columnTree,
treeDept: treeDept
};
};
ColumnFactory.prototype.createForAutoGroups = function (autoGroupCols, gridBalancedTree) {
var _this = this;
var autoColBalancedTree = [];
autoGroupCols.forEach(function (col) {
var fakeTreeItem = _this.createAutoGroupTreeItem(gridBalancedTree, col);
autoColBalancedTree.push(fakeTreeItem);
});
return autoColBalancedTree;
};
ColumnFactory.prototype.createAutoGroupTreeItem = function (balancedColumnTree, column) {
var dept = this.findDepth(balancedColumnTree);
// at the end, this will be the top of the tree item.
var nextChild = column;
for (var i = dept - 1; i >= 0; i--) {
var autoGroup = new _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_1__["OriginalColumnGroup"](null, "FAKE_PATH_" + column.getId() + "}_" + i, true, i);
this.context.createBean(autoGroup);
autoGroup.setChildren([nextChild]);
nextChild.setOriginalParent(autoGroup);
nextChild = autoGroup;
}
// at this point, the nextChild is the top most item in the tree
return nextChild;
};
ColumnFactory.prototype.findDepth = function (balancedColumnTree) {
var dept = 0;
var pointer = balancedColumnTree;
while (pointer && pointer[0] && pointer[0] instanceof _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_1__["OriginalColumnGroup"]) {
dept++;
pointer = pointer[0].getChildren();
}
return dept;
};
ColumnFactory.prototype.balanceColumnTree = function (unbalancedTree, currentDept, columnDept, columnKeyCreator) {
var result = [];
// go through each child, for groups, recurse a level deeper,
// for columns we need to pad
for (var i = 0; i < unbalancedTree.length; i++) {
var child = unbalancedTree[i];
if (child instanceof _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_1__["OriginalColumnGroup"]) {
// child is a group, all we do is go to the next level of recursion
var originalGroup = child;
var newChildren = this.balanceColumnTree(originalGroup.getChildren(), currentDept + 1, columnDept, columnKeyCreator);
originalGroup.setChildren(newChildren);
result.push(originalGroup);
}
else {
// child is a column - so here we add in the padded column groups if needed
var firstPaddedGroup = void 0;
var currentPaddedGroup = void 0;
// this for loop will NOT run any loops if no padded column groups are needed
for (var j = columnDept - 1; j >= currentDept; j--) {
var newColId = columnKeyCreator.getUniqueKey(null, null);
var colGroupDefMerged = this.createMergedColGroupDef(null);
var paddedGroup = new _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_1__["OriginalColumnGroup"](colGroupDefMerged, newColId, true, currentDept);
this.context.createBean(paddedGroup);
if (currentPaddedGroup) {
currentPaddedGroup.setChildren([paddedGroup]);
}
currentPaddedGroup = paddedGroup;
if (!firstPaddedGroup) {
firstPaddedGroup = currentPaddedGroup;
}
}
// likewise this if statement will not run if no padded groups
if (firstPaddedGroup) {
result.push(firstPaddedGroup);
var hasGroups = unbalancedTree.some(function (child) { return child instanceof _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_1__["OriginalColumnGroup"]; });
if (hasGroups) {
currentPaddedGroup.setChildren([child]);
continue;
}
else {
currentPaddedGroup.setChildren(unbalancedTree);
break;
}
}
result.push(child);
}
}
return result;
};
ColumnFactory.prototype.findMaxDept = function (treeChildren, dept) {
var maxDeptThisLevel = dept;
for (var i = 0; i < treeChildren.length; i++) {
var abstractColumn = treeChildren[i];
if (abstractColumn instanceof _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_1__["OriginalColumnGroup"]) {
var originalGroup = abstractColumn;
var newDept = this.findMaxDept(originalGroup.getChildren(), dept + 1);
if (maxDeptThisLevel < newDept) {
maxDeptThisLevel = newDept;
}
}
}
return maxDeptThisLevel;
};
ColumnFactory.prototype.recursivelyCreateColumns = function (defs, level, primaryColumns, existingColsCopy, columnKeyCreator, parent) {
var _this = this;
var result = [];
if (!defs) {
return result;
}
defs.forEach(function (def) {
var newGroupOrColumn;
if (_this.isColumnGroup(def)) {
newGroupOrColumn = _this.createColumnGroup(primaryColumns, def, level, existingColsCopy, columnKeyCreator, parent);
}
else {
newGroupOrColumn = _this.createColumn(primaryColumns, def, existingColsCopy, columnKeyCreator, parent);
}
result.push(newGroupOrColumn);
});
return result;
};
ColumnFactory.prototype.createColumnGroup = function (primaryColumns, colGroupDef, level, existingColumns, columnKeyCreator, parent) {
var colGroupDefMerged = this.createMergedColGroupDef(colGroupDef);
var groupId = columnKeyCreator.getUniqueKey(colGroupDefMerged.groupId, null);
var originalGroup = new _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_1__["OriginalColumnGroup"](colGroupDefMerged, groupId, false, level);
this.context.createBean(originalGroup);
var children = this.recursivelyCreateColumns(colGroupDefMerged.children, level + 1, primaryColumns, existingColumns, columnKeyCreator, originalGroup);
originalGroup.setChildren(children);
return originalGroup;
};
ColumnFactory.prototype.createMergedColGroupDef = function (colGroupDef) {
var colGroupDefMerged = {};
Object(_utils_object__WEBPACK_IMPORTED_MODULE_7__["assign"])(colGroupDefMerged, this.gridOptionsWrapper.getDefaultColGroupDef());
Object(_utils_object__WEBPACK_IMPORTED_MODULE_7__["assign"])(colGroupDefMerged, colGroupDef);
this.checkForDeprecatedItems(colGroupDefMerged);
return colGroupDefMerged;
};
ColumnFactory.prototype.createColumn = function (primaryColumns, colDef, existingColsCopy, columnKeyCreator, parent) {
var colDefMerged = this.mergeColDefs(colDef);
this.checkForDeprecatedItems(colDefMerged);
// see if column already exists
var column = this.findExistingColumn(colDef, existingColsCopy);
if (!column) {
// no existing column, need to create one
var colId = columnKeyCreator.getUniqueKey(colDefMerged.colId, colDefMerged.field);
column = new _entities_column__WEBPACK_IMPORTED_MODULE_2__["Column"](colDefMerged, colDef, colId, primaryColumns);
this.context.createBean(column);
}
else {
column.setColDef(colDefMerged, colDef);
this.applyColumnState(column, colDefMerged);
}
return column;
};
ColumnFactory.prototype.applyColumnState = function (column, colDef) {
// flex
var flex = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_8__["attrToNumber"])(colDef.flex);
if (flex !== undefined) {
column.setFlex(flex);
}
// width - we only set width if column is not flexing
var noFlexThisCol = column.getFlex() <= 0;
if (noFlexThisCol) {
// both null and undefined means we skip, as it's not possible to 'clear' width (a column must have a width)
var width = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_8__["attrToNumber"])(colDef.width);
if (width != null) {
column.setActualWidth(width);
}
}
// sort - anything but undefined will set sort, thus null or empty string will clear the sort
if (colDef.sort !== undefined) {
if (colDef.sort == _constants_constants__WEBPACK_IMPORTED_MODULE_6__["Constants"].SORT_ASC || colDef.sort == _constants_constants__WEBPACK_IMPORTED_MODULE_6__["Constants"].SORT_DESC) {
column.setSort(colDef.sort);
}
else {
column.setSort(undefined);
}
}
// sorted at - anything but undefined, thus null will clear the sortIndex
var sortIndex = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_8__["attrToNumber"])(colDef.sortIndex);
if (sortIndex !== undefined) {
column.setSortIndex(sortIndex);
}
// hide - anything but undefined, thus null will clear the hide
var hide = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_8__["attrToBoolean"])(colDef.hide);
if (hide !== undefined) {
column.setVisible(!hide);
}
// pinned - anything but undefined, thus null or empty string will remove pinned
if (colDef.pinned !== undefined) {
column.setPinned(colDef.pinned);
}
};
ColumnFactory.prototype.findExistingColumn = function (newColDef, existingColsCopy) {
var res = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_8__["find"])(existingColsCopy, function (existingCol) {
var existingColDef = existingCol.getUserProvidedColDef();
if (!existingColDef) {
return false;
}
var newHasId = newColDef.colId != null;
var newHasField = newColDef.field != null;
if (newHasId) {
return existingCol.getId() === newColDef.colId;
}
if (newHasField) {
return existingColDef.field === newColDef.field;
}
// if no id or field present, then try object equivalence.
if (existingColDef === newColDef) {
return true;
}
return false;
});
// make sure we remove, so if user provided duplicate id, then we don't have more than
// one column instance for colDef with common id
if (res) {
Object(_utils_array__WEBPACK_IMPORTED_MODULE_9__["removeFromArray"])(existingColsCopy, res);
}
return res;
};
ColumnFactory.prototype.mergeColDefs = function (colDef) {
// start with empty merged definition
var colDefMerged = {};
// merge properties from default column definitions
var defaultColDef = this.gridOptionsWrapper.getDefaultColDef();
Object(_utils_object__WEBPACK_IMPORTED_MODULE_7__["mergeDeep"])(colDefMerged, defaultColDef, true, true);
// merge properties from column type properties
if (colDef.type || (defaultColDef && defaultColDef.type)) {
// if type of both colDef and defaultColDef, then colDef gets preference
var columnType = colDef.type ? colDef.type : defaultColDef.type;
this.assignColumnTypes(columnType, colDefMerged);
}
// merge properties from column definitions
Object(_utils_object__WEBPACK_IMPORTED_MODULE_7__["mergeDeep"])(colDefMerged, colDef, true, true);
return colDefMerged;
};
ColumnFactory.prototype.assignColumnTypes = function (type, colDefMerged) {
var typeKeys;
if (type instanceof Array) {
var invalidArray = type.some(function (a) { return typeof a !== 'string'; });
if (invalidArray) {
console.warn("ag-grid: if colDef.type is supplied an array it should be of type 'string[]'");
}
else {
typeKeys = type;
}
}
else if (typeof type === 'string') {
typeKeys = type.split(',');
}
else {
console.warn("ag-grid: colDef.type should be of type 'string' | 'string[]'");
return;
}
// merge user defined with default column types
var allColumnTypes = Object(_utils_object__WEBPACK_IMPORTED_MODULE_7__["assign"])({}, _entities_defaultColumnTypes__WEBPACK_IMPORTED_MODULE_4__["DefaultColumnTypes"]);
var userTypes = this.gridOptionsWrapper.getColumnTypes() || {};
Object(_utils_object__WEBPACK_IMPORTED_MODULE_7__["iterateObject"])(userTypes, function (key, value) {
if (key in allColumnTypes) {
console.warn("ag-Grid: the column type '" + key + "' is a default column type and cannot be overridden.");
}
else {
allColumnTypes[key] = value;
}
});
typeKeys.forEach(function (t) {
var typeColDef = allColumnTypes[t.trim()];
if (typeColDef) {
Object(_utils_object__WEBPACK_IMPORTED_MODULE_7__["mergeDeep"])(colDefMerged, typeColDef, true, true);
}
else {
console.warn("ag-grid: colDef.type '" + t + "' does not correspond to defined gridOptions.columnTypes");
}
});
};
ColumnFactory.prototype.checkForDeprecatedItems = function (colDef) {
if (colDef) {
var colDefNoType = colDef; // take out the type, so we can access attributes not defined in the type
if (colDefNoType.group !== undefined) {
console.warn('ag-grid: colDef.group is invalid, please check documentation on how to do grouping as it changed in version 3');
}
if (colDefNoType.headerGroup !== undefined) {
console.warn('ag-grid: colDef.headerGroup is invalid, please check documentation on how to do grouping as it changed in version 3');
}
if (colDefNoType.headerGroupShow !== undefined) {
console.warn('ag-grid: colDef.headerGroupShow is invalid, should be columnGroupShow, please check documentation on how to do grouping as it changed in version 3');
}
if (colDefNoType.suppressRowGroup !== undefined) {
console.warn('ag-grid: colDef.suppressRowGroup is deprecated, please use colDef.type instead');
}
if (colDefNoType.suppressAggregation !== undefined) {
console.warn('ag-grid: colDef.suppressAggregation is deprecated, please use colDef.type instead');
}
if (colDefNoType.suppressRowGroup || colDefNoType.suppressAggregation) {
console.warn('ag-grid: colDef.suppressAggregation and colDef.suppressRowGroup are deprecated, use allowRowGroup, allowPivot and allowValue instead');
}
if (colDefNoType.displayName) {
console.warn("ag-grid: Found displayName " + colDefNoType.displayName + ", please use headerName instead, displayName is deprecated.");
colDefNoType.headerName = colDefNoType.displayName;
}
}
};
// if object has children, we assume it's a group
ColumnFactory.prototype.isColumnGroup = function (abstractColDef) {
return abstractColDef.children !== undefined;
};
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_3__["Autowired"])('columnUtils')
], ColumnFactory.prototype, "columnUtils", void 0);
__decorate([
__param(0, Object(_context_context__WEBPACK_IMPORTED_MODULE_3__["Qualifier"])('loggerFactory'))
], ColumnFactory.prototype, "setBeans", null);
ColumnFactory = __decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_3__["Bean"])('columnFactory')
], ColumnFactory);
return ColumnFactory;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_5__["BeanStub"]));
/***/ }),
/* 6 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColumnKeyCreator", function() { return ColumnKeyCreator; });
/* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
// class returns a unique id to use for the column. it checks the existing columns, and if the requested
// id is already taken, it will start appending numbers until it gets a unique id.
// eg, if the col field is 'name', it will try ids: {name, name_1, name_2...}
// if no field or id provided in the col, it will try the ids of natural numbers
var ColumnKeyCreator = /** @class */ (function () {
function ColumnKeyCreator() {
this.existingKeys = {};
}
ColumnKeyCreator.prototype.addExistingKeys = function (keys) {
for (var i = 0; i < keys.length; i++) {
this.existingKeys[keys[i]] = true;
}
};
ColumnKeyCreator.prototype.getUniqueKey = function (colId, colField) {
// in case user passed in number for colId, convert to string
colId = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_0__["toStringOrNull"])(colId);
var count = 0;
while (true) {
var idToTry = void 0;
if (colId) {
idToTry = colId;
if (count !== 0) {
idToTry += '_' + count;
}
}
else if (colField) {
idToTry = colField;
if (count !== 0) {
idToTry += '_' + count;
}
}
else {
idToTry = '' + count;
}
if (!this.existingKeys[idToTry]) {
this.existingKeys[idToTry] = true;
return idToTry;
}
count++;
}
};
return ColumnKeyCreator;
}());
/***/ }),
/* 7 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "makeNull", function() { return makeNull; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "exists", function() { return exists; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "missing", function() { return missing; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "missingOrEmpty", function() { return missingOrEmpty; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toStringOrNull", function() { return toStringOrNull; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "attrToNumber", function() { return attrToNumber; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "attrToBoolean", function() { return attrToBoolean; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "attrToString", function() { return attrToString; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "referenceCompare", function() { return referenceCompare; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "jsonEquals", function() { return jsonEquals; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defaultComparator", function() { return defaultComparator; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "find", function() { return find; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "values", function() { return values; });
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
/**
* If value is undefined, null or blank, returns null, otherwise returns the value
* @param {T} value
* @returns {T | null}
*/
function makeNull(value) {
return value == null || value === '' ? null : value;
}
function exists(value, allowEmptyString) {
if (allowEmptyString === void 0) { allowEmptyString = false; }
return value != null && (allowEmptyString || value !== '');
}
function missing(value) {
return !exists(value);
}
function missingOrEmpty(value) {
return !value || missing(value) || value.length === 0;
}
function toStringOrNull(value) {
return exists(value) && value.toString ? value.toString() : null;
}
// for parsing html attributes, where we want empty strings and missing attributes to be undefined
function attrToNumber(value) {
if (value === undefined) {
// undefined or empty means ignore the value
return;
}
if (value === null || value === '') {
// null or blank means clear
return null;
}
if (typeof value === 'number') {
return isNaN(value) ? undefined : value;
}
var valueParsed = parseInt(value, 10);
return isNaN(valueParsed) ? undefined : valueParsed;
}
// for parsing html attributes, where we want empty strings and missing attributes to be undefined
function attrToBoolean(value) {
if (value === undefined) {
// undefined or empty means ignore the value
return;
}
if (value === null || value === '') {
// null means clear
return false;
}
if (value === true || value === false) {
// if simple boolean, return the boolean
return value;
}
// if equal to the string 'true' (ignoring case) then return true
return (/true/i).test(value);
}
// for parsing html attributes, where we want empty strings and missing attributes to be undefined
function attrToString(value) {
if (value == null || value === '') {
return;
}
return value;
}
/** @deprecated */
function referenceCompare(left, right) {
if (left == null && right == null) {
return true;
}
if (left == null && right != null) {
return false;
}
if (left != null && right == null) {
return false;
}
return left === right;
}
function jsonEquals(val1, val2) {
var val1Json = val1 ? JSON.stringify(val1) : null;
var val2Json = val2 ? JSON.stringify(val2) : null;
return val1Json === val2Json;
}
function defaultComparator(valueA, valueB, accentedCompare) {
if (accentedCompare === void 0) { accentedCompare = false; }
var valueAMissing = valueA == null;
var valueBMissing = valueB == null;
// 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;
}
function doQuickCompare(a, b) {
return (a > b ? 1 : (a < b ? -1 : 0));
}
if (typeof valueA !== 'string') {
return doQuickCompare(valueA, valueB);
}
if (!accentedCompare) {
return doQuickCompare(valueA, valueB);
}
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);
}
}
function find(collection, predicate, value) {
if (collection === null || collection === undefined) {
return null;
}
if (!Array.isArray(collection)) {
var objToArray = values(collection);
return find(objToArray, predicate, value);
}
var collectionAsArray = collection;
var firstMatchingItem = null;
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;
}
function values(object) {
if (object instanceof Set || object instanceof Map) {
var values_1 = [];
object.forEach(function (value) { return values_1.push(value); });
return values_1;
}
return Object.keys(object).map(function (key) { return object[key]; });
}
/***/ }),
/* 8 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OriginalColumnGroup", function() { return OriginalColumnGroup; });
/* harmony import */ var _columnGroup__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9);
/* harmony import */ var _column__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(10);
/* harmony import */ var _eventService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(11);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var OriginalColumnGroup = /** @class */ (function () {
function OriginalColumnGroup(colGroupDef, groupId, padding, level) {
this.localEventService = new _eventService__WEBPACK_IMPORTED_MODULE_2__["EventService"]();
this.expandable = false;
this.colGroupDef = colGroupDef;
this.groupId = groupId;
this.expanded = colGroupDef && !!colGroupDef.openByDefault;
this.padding = padding;
this.level = level;
}
OriginalColumnGroup.prototype.setOriginalParent = function (originalParent) {
this.originalParent = originalParent;
};
OriginalColumnGroup.prototype.getOriginalParent = function () {
return this.originalParent;
};
OriginalColumnGroup.prototype.getLevel = function () {
return this.level;
};
OriginalColumnGroup.prototype.isVisible = function () {
// return true if at least one child is visible
if (this.children) {
return this.children.some(function (child) { return child.isVisible(); });
}
return false;
};
OriginalColumnGroup.prototype.isPadding = function () {
return this.padding;
};
OriginalColumnGroup.prototype.setExpanded = function (expanded) {
this.expanded = expanded === undefined ? false : expanded;
var event = {
type: OriginalColumnGroup.EVENT_EXPANDED_CHANGED
};
this.localEventService.dispatchEvent(event);
};
OriginalColumnGroup.prototype.isExpandable = function () {
return this.expandable;
};
OriginalColumnGroup.prototype.isExpanded = function () {
return this.expanded;
};
OriginalColumnGroup.prototype.getGroupId = function () {
return this.groupId;
};
OriginalColumnGroup.prototype.getId = function () {
return this.getGroupId();
};
OriginalColumnGroup.prototype.setChildren = function (children) {
this.children = children;
};
OriginalColumnGroup.prototype.getChildren = function () {
return this.children;
};
OriginalColumnGroup.prototype.getColGroupDef = function () {
return this.colGroupDef;
};
OriginalColumnGroup.prototype.getLeafColumns = function () {
var result = [];
this.addLeafColumns(result);
return result;
};
OriginalColumnGroup.prototype.addLeafColumns = function (leafColumns) {
if (!this.children) {
return;
}
this.children.forEach(function (child) {
if (child instanceof _column__WEBPACK_IMPORTED_MODULE_1__["Column"]) {
leafColumns.push(child);
}
else if (child instanceof OriginalColumnGroup) {
child.addLeafColumns(leafColumns);
}
});
};
OriginalColumnGroup.prototype.getColumnGroupShow = function () {
return this.padding ? _columnGroup__WEBPACK_IMPORTED_MODULE_0__["ColumnGroup"].HEADER_GROUP_PADDING : this.colGroupDef.columnGroupShow;
};
// need to check that this group has at least one col showing when both expanded and contracted.
// if not, then we don't allow expanding and contracting on this group
OriginalColumnGroup.prototype.setupExpandable = function () {
var _this = this;
this.setExpandable();
// note - we should be removing this event listener
this.getLeafColumns().forEach(function (col) { return col.addEventListener(_column__WEBPACK_IMPORTED_MODULE_1__["Column"].EVENT_VISIBLE_CHANGED, _this.onColumnVisibilityChanged.bind(_this)); });
};
OriginalColumnGroup.prototype.setExpandable = function () {
if (this.isPadding()) {
return;
}
// want to make sure the group doesn't disappear when it's open
var atLeastOneShowingWhenOpen = false;
// want to make sure the group doesn't disappear when it's closed
var atLeastOneShowingWhenClosed = false;
// want to make sure the group has something to show / hide
var atLeastOneChangeable = false;
var children = this.findChildren();
for (var i = 0, j = children.length; i < j; i++) {
var abstractColumn = children[i];
if (!abstractColumn.isVisible()) {
continue;
}
// if the abstractColumn is a grid generated group, there will be no colDef
var headerGroupShow = abstractColumn.getColumnGroupShow();
if (headerGroupShow === _columnGroup__WEBPACK_IMPORTED_MODULE_0__["ColumnGroup"].HEADER_GROUP_SHOW_OPEN) {
atLeastOneShowingWhenOpen = true;
atLeastOneChangeable = true;
}
else if (headerGroupShow === _columnGroup__WEBPACK_IMPORTED_MODULE_0__["ColumnGroup"].HEADER_GROUP_SHOW_CLOSED) {
atLeastOneShowingWhenClosed = true;
atLeastOneChangeable = true;
}
else {
atLeastOneShowingWhenOpen = true;
atLeastOneShowingWhenClosed = true;
if (headerGroupShow === _columnGroup__WEBPACK_IMPORTED_MODULE_0__["ColumnGroup"].HEADER_GROUP_PADDING) {
var column = abstractColumn;
atLeastOneChangeable = atLeastOneChangeable || column.children.some(function (child) { return child.getColumnGroupShow() !== undefined; });
}
}
}
var expandable = atLeastOneShowingWhenOpen && atLeastOneShowingWhenClosed && atLeastOneChangeable;
if (this.expandable !== expandable) {
this.expandable = expandable;
var event_1 = {
type: OriginalColumnGroup.EVENT_EXPANDABLE_CHANGED
};
this.localEventService.dispatchEvent(event_1);
}
};
OriginalColumnGroup.prototype.findChildren = function () {
var children = this.children;
var firstChild = children[0];
if (firstChild && (!firstChild.isPadding || !firstChild.isPadding())) {
return children;
}
while (children.length === 1 && children[0] instanceof OriginalColumnGroup) {
children = children[0].children;
}
return children;
};
OriginalColumnGroup.prototype.onColumnVisibilityChanged = function () {
this.setExpandable();
};
OriginalColumnGroup.prototype.addEventListener = function (eventType, listener) {
this.localEventService.addEventListener(eventType, listener);
};
OriginalColumnGroup.prototype.removeEventListener = function (eventType, listener) {
this.localEventService.removeEventListener(eventType, listener);
};
OriginalColumnGroup.EVENT_EXPANDED_CHANGED = 'expandedChanged';
OriginalColumnGroup.EVENT_EXPANDABLE_CHANGED = 'expandableChanged';
return OriginalColumnGroup;
}());
/***/ }),
/* 9 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColumnGroup", function() { return ColumnGroup; });
/* harmony import */ var _column__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(10);
/* harmony import */ var _eventService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11);
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12);
/* harmony import */ var _utils_array__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(14);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (undefined && undefined.__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 ColumnGroup = /** @class */ (function () {
function ColumnGroup(originalColumnGroup, groupId, instanceId, pinned) {
// depends on the open/closed state of the group, only displaying columns are stored here
this.displayedChildren = [];
this.localEventService = new _eventService__WEBPACK_IMPORTED_MODULE_1__["EventService"]();
this.groupId = groupId;
this.instanceId = instanceId;
this.originalColumnGroup = originalColumnGroup;
this.pinned = pinned;
}
// this is static, a it is used outside of this class
ColumnGroup.createUniqueId = function (groupId, instanceId) {
return groupId + '_' + instanceId;
};
// as the user is adding and removing columns, the groups are recalculated.
// this reset clears out all children, ready for children to be added again
ColumnGroup.prototype.reset = function () {
this.parent = null;
this.children = null;
this.displayedChildren = null;
};
ColumnGroup.prototype.getParent = function () {
return this.parent;
};
ColumnGroup.prototype.setParent = function (parent) {
this.parent = parent;
};
ColumnGroup.prototype.getUniqueId = function () {
return ColumnGroup.createUniqueId(this.groupId, this.instanceId);
};
ColumnGroup.prototype.isEmptyGroup = function () {
return this.displayedChildren.length === 0;
};
ColumnGroup.prototype.isMoving = function () {
var allLeafColumns = this.getOriginalColumnGroup().getLeafColumns();
if (!allLeafColumns || allLeafColumns.length === 0) {
return false;
}
return allLeafColumns.every(function (col) { return col.isMoving(); });
};
ColumnGroup.prototype.checkLeft = function () {
// first get all children to setLeft, as it impacts our decision below
this.displayedChildren.forEach(function (child) {
if (child instanceof ColumnGroup) {
child.checkLeft();
}
});
// set our left based on first displayed column
if (this.displayedChildren.length > 0) {
if (this.gridOptionsWrapper.isEnableRtl()) {
var lastChild = Object(_utils_array__WEBPACK_IMPORTED_MODULE_3__["last"])(this.displayedChildren);
var lastChildLeft = lastChild.getLeft();
this.setLeft(lastChildLeft);
}
else {
var firstChildLeft = this.displayedChildren[0].getLeft();
this.setLeft(firstChildLeft);
}
}
else {
// this should never happen, as if we have no displayed columns, then
// this groups should not even exist.
this.setLeft(null);
}
};
ColumnGroup.prototype.getLeft = function () {
return this.left;
};
ColumnGroup.prototype.getOldLeft = function () {
return this.oldLeft;
};
ColumnGroup.prototype.setLeft = function (left) {
this.oldLeft = left;
if (this.left !== left) {
this.left = left;
this.localEventService.dispatchEvent(this.createAgEvent(ColumnGroup.EVENT_LEFT_CHANGED));
}
};
ColumnGroup.prototype.getPinned = function () {
return this.pinned;
};
ColumnGroup.prototype.createAgEvent = function (type) {
return { type: type };
};
ColumnGroup.prototype.addEventListener = function (eventType, listener) {
this.localEventService.addEventListener(eventType, listener);
};
ColumnGroup.prototype.removeEventListener = function (eventType, listener) {
this.localEventService.removeEventListener(eventType, listener);
};
ColumnGroup.prototype.getGroupId = function () {
return this.groupId;
};
ColumnGroup.prototype.getInstanceId = function () {
return this.instanceId;
};
ColumnGroup.prototype.isChildInThisGroupDeepSearch = function (wantedChild) {
var result = false;
this.children.forEach(function (foundChild) {
if (wantedChild === foundChild) {
result = true;
}
if (foundChild instanceof ColumnGroup) {
if (foundChild.isChildInThisGroupDeepSearch(wantedChild)) {
result = true;
}
}
});
return result;
};
ColumnGroup.prototype.getActualWidth = function () {
var groupActualWidth = 0;
if (this.displayedChildren) {
this.displayedChildren.forEach(function (child) {
groupActualWidth += child.getActualWidth();
});
}
return groupActualWidth;
};
ColumnGroup.prototype.isResizable = function () {
if (!this.displayedChildren) {
return false;
}
// if at least one child is resizable, then the group is resizable
var result = false;
this.displayedChildren.forEach(function (child) {
if (child.isResizable()) {
result = true;
}
});
return result;
};
ColumnGroup.prototype.getMinWidth = function () {
var result = 0;
this.displayedChildren.forEach(function (groupChild) {
result += groupChild.getMinWidth();
});
return result;
};
ColumnGroup.prototype.addChild = function (child) {
if (!this.children) {
this.children = [];
}
this.children.push(child);
};
ColumnGroup.prototype.getDisplayedChildren = function () {
return this.displayedChildren;
};
ColumnGroup.prototype.getLeafColumns = function () {
var result = [];
this.addLeafColumns(result);
return result;
};
ColumnGroup.prototype.getDisplayedLeafColumns = function () {
var result = [];
this.addDisplayedLeafColumns(result);
return result;
};
// why two methods here doing the same thing?
ColumnGroup.prototype.getDefinition = function () {
return this.originalColumnGroup.getColGroupDef();
};
ColumnGroup.prototype.getColGroupDef = function () {
return this.originalColumnGroup.getColGroupDef();
};
ColumnGroup.prototype.isPadding = function () {
return this.originalColumnGroup.isPadding();
};
ColumnGroup.prototype.isExpandable = function () {
return this.originalColumnGroup.isExpandable();
};
ColumnGroup.prototype.isExpanded = function () {
return this.originalColumnGroup.isExpanded();
};
ColumnGroup.prototype.setExpanded = function (expanded) {
this.originalColumnGroup.setExpanded(expanded);
};
ColumnGroup.prototype.addDisplayedLeafColumns = function (leafColumns) {
this.displayedChildren.forEach(function (child) {
if (child instanceof _column__WEBPACK_IMPORTED_MODULE_0__["Column"]) {
leafColumns.push(child);
}
else if (child instanceof ColumnGroup) {
child.addDisplayedLeafColumns(leafColumns);
}
});
};
ColumnGroup.prototype.addLeafColumns = function (leafColumns) {
this.children.forEach(function (child) {
if (child instanceof _column__WEBPACK_IMPORTED_MODULE_0__["Column"]) {
leafColumns.push(child);
}
else if (child instanceof ColumnGroup) {
child.addLeafColumns(leafColumns);
}
});
};
ColumnGroup.prototype.getChildren = function () {
return this.children;
};
ColumnGroup.prototype.getColumnGroupShow = function () {
return this.originalColumnGroup.getColumnGroupShow();
};
ColumnGroup.prototype.getOriginalColumnGroup = function () {
return this.originalColumnGroup;
};
ColumnGroup.prototype.getPaddingLevel = function () {
var parent = this.getParent();
if (!this.isPadding() || !parent || !parent.isPadding()) {
return 0;
}
return 1 + parent.getPaddingLevel();
};
ColumnGroup.prototype.calculateDisplayedColumns = function () {
var _this = this;
// clear out last time we calculated
this.displayedChildren = [];
var topLevelGroup = this;
// find the column group that is controlling expandable. this is relevant when we have padding (empty)
// groups, where the expandable is actually the first parent that is not a padding group.
if (this.isPadding()) {
while (topLevelGroup.getParent() && topLevelGroup.isPadding()) {
topLevelGroup = topLevelGroup.getParent();
}
}
var isExpandable = topLevelGroup.originalColumnGroup.isExpandable();
// it not expandable, everything is visible
if (!isExpandable) {
this.displayedChildren = this.children;
}
else {
// Add cols based on columnGroupShow
// Note - the below also adds padding groups, these are always added because they never have
// colDef.columnGroupShow set.
this.children.forEach(function (abstractColumn) {
var headerGroupShow = abstractColumn.getColumnGroupShow();
switch (headerGroupShow) {
case ColumnGroup.HEADER_GROUP_SHOW_OPEN:
// when set to open, only show col if group is open
if (topLevelGroup.originalColumnGroup.isExpanded()) {
_this.displayedChildren.push(abstractColumn);
}
break;
case ColumnGroup.HEADER_GROUP_SHOW_CLOSED:
// when set to open, only show col if group is open
if (!topLevelGroup.originalColumnGroup.isExpanded()) {
_this.displayedChildren.push(abstractColumn);
}
break;
default:
// if this abstractColumn is padding, we just want to add it
// to the displayedChildren list if it has displayedChildren itself.
if (!(abstractColumn instanceof ColumnGroup &&
abstractColumn.isPadding() &&
!abstractColumn.displayedChildren.length)) {
_this.displayedChildren.push(abstractColumn);
}
break;
}
});
}
this.localEventService.dispatchEvent(this.createAgEvent(ColumnGroup.EVENT_DISPLAYED_CHILDREN_CHANGED));
};
ColumnGroup.HEADER_GROUP_SHOW_OPEN = 'open';
ColumnGroup.HEADER_GROUP_SHOW_CLOSED = 'closed';
ColumnGroup.HEADER_GROUP_PADDING = 'padding';
ColumnGroup.EVENT_LEFT_CHANGED = 'leftChanged';
ColumnGroup.EVENT_DISPLAYED_CHILDREN_CHANGED = 'displayedChildrenChanged';
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('gridOptionsWrapper')
], ColumnGroup.prototype, "gridOptionsWrapper", void 0);
return ColumnGroup;
}());
/***/ }),
/* 10 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Column", function() { return Column; });
/* harmony import */ var _eventService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11);
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12);
/* harmony import */ var _constants_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(16);
/* harmony import */ var _modules_moduleNames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(17);
/* harmony import */ var _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(18);
/* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7);
/* harmony import */ var _utils_function__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(15);
/* harmony import */ var _utils_object__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(13);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (undefined && undefined.__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;
};
// 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 = /** @class */ (function () {
function Column(colDef, userProvidedColDef, colId, primary) {
this.moving = false;
this.menuVisible = false;
this.filterActive = false;
this.eventService = new _eventService__WEBPACK_IMPORTED_MODULE_0__["EventService"]();
this.rowGroupActive = false;
this.pivotActive = false;
this.aggregationActive = false;
this.colDef = colDef;
this.userProvidedColDef = userProvidedColDef;
this.colId = colId;
this.primary = primary;
this.setState(colDef);
}
Column.prototype.setState = function (colDef) {
// sort
if (colDef.sort !== undefined) {
if (colDef.sort === _constants_constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].SORT_ASC || colDef.sort === _constants_constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].SORT_DESC) {
this.sort = colDef.sort;
}
}
else {
if (colDef.initialSort === _constants_constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].SORT_ASC || colDef.initialSort === _constants_constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].SORT_DESC) {
this.sort = colDef.initialSort;
}
}
// sortIndex
var sortIndex = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_5__["attrToNumber"])(colDef.sortIndex);
var initialSortIndex = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_5__["attrToNumber"])(colDef.initialSortIndex);
if (sortIndex !== undefined) {
if (sortIndex !== null) {
this.sortIndex = sortIndex;
}
}
else {
if (initialSortIndex !== null) {
this.sortIndex = initialSortIndex;
}
}
// hide
var hide = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_5__["attrToBoolean"])(colDef.hide);
var initialHide = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_5__["attrToBoolean"])(colDef.initialHide);
if (hide !== undefined) {
this.visible = !hide;
}
else {
this.visible = !initialHide;
}
// pinned
if (colDef.pinned !== undefined) {
this.setPinned(colDef.pinned);
}
else {
this.setPinned(colDef.initialPinned);
}
// flex
var flex = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_5__["attrToNumber"])(colDef.flex);
var initialFlex = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_5__["attrToNumber"])(colDef.initialFlex);
if (flex !== undefined) {
this.flex = flex;
}
else if (initialFlex !== undefined) {
this.flex = initialFlex;
}
};
// gets called when user provides an alternative colDef, eg
Column.prototype.setColDef = function (colDef, userProvidedColDef) {
this.colDef = colDef;
this.userProvidedColDef = userProvidedColDef;
};
Column.prototype.getUserProvidedColDef = function () {
return this.userProvidedColDef;
};
Column.prototype.setParent = function (parent) {
this.parent = parent;
};
Column.prototype.getParent = function () {
return this.parent;
};
Column.prototype.setOriginalParent = function (originalParent) {
this.originalParent = originalParent;
};
Column.prototype.getOriginalParent = function () {
return this.originalParent;
};
// this is done after constructor as it uses gridOptionsWrapper
Column.prototype.initialise = function () {
var minColWidth = this.gridOptionsWrapper.getMinColWidth();
var maxColWidth = this.gridOptionsWrapper.getMaxColWidth();
if (this.colDef.minWidth != null) {
// we force min width to be at least one pixel, otherwise column will disappear
this.minWidth = Math.max(this.colDef.minWidth, 1);
}
else {
this.minWidth = minColWidth;
}
if (this.colDef.maxWidth != null) {
this.maxWidth = this.colDef.maxWidth;
}
else {
this.maxWidth = maxColWidth;
}
this.resetActualWidth('gridInitializing');
var suppressDotNotation = this.gridOptionsWrapper.isSuppressFieldDotNotation();
this.fieldContainsDots = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_5__["exists"])(this.colDef.field) && this.colDef.field.indexOf('.') >= 0 && !suppressDotNotation;
this.tooltipFieldContainsDots = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_5__["exists"])(this.colDef.tooltipField) && this.colDef.tooltipField.indexOf('.') >= 0 && !suppressDotNotation;
this.validate();
};
Column.prototype.resetActualWidth = function (source) {
if (source === void 0) { source = 'api'; }
var initialWidth = this.columnUtils.calculateColInitialWidth(this.colDef);
this.setActualWidth(initialWidth, source, true);
};
Column.prototype.isEmptyGroup = function () {
return false;
};
Column.prototype.isRowGroupDisplayed = function (colId) {
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_5__["missing"])(this.colDef) || Object(_utils_generic__WEBPACK_IMPORTED_MODULE_5__["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 () {
// filter defined means it's a string, class or true.
// if its false, null or undefined then it's false.
var filterDefined = !!this.colDef.filter || !!this.colDef.filterFramework;
return this.primary && filterDefined;
};
Column.prototype.isFieldContainsDots = function () {
return this.fieldContainsDots;
};
Column.prototype.isTooltipFieldContainsDots = function () {
return this.tooltipFieldContainsDots;
};
Column.prototype.validate = function () {
var colDefAny = this.colDef;
function warnOnce(msg, key, obj) {
Object(_utils_function__WEBPACK_IMPORTED_MODULE_6__["doOnce"])(function () {
if (obj) {
console.warn(msg, obj);
}
else {
Object(_utils_function__WEBPACK_IMPORTED_MODULE_6__["doOnce"])(function () { return console.warn(msg); }, key);
}
}, key);
}
if (!_modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_4__["ModuleRegistry"].isRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_3__["ModuleNames"].RowGroupingModule)) {
var rowGroupingItems = ['enableRowGroup', 'rowGroup', 'rowGroupIndex', 'enablePivot', 'enableValue', 'pivot', 'pivotIndex', 'aggFunc'];
rowGroupingItems.forEach(function (item) {
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_5__["exists"])(colDefAny[item])) {
if (_modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_4__["ModuleRegistry"].isPackageBased()) {
warnOnce("ag-Grid: " + item + " is only valid in ag-grid-enterprise, your column definition should not have " + item, 'ColumnRowGroupingMissing' + item);
}
else {
warnOnce("ag-Grid: " + item + " is only valid with ag-Grid Enterprise Module " + _modules_moduleNames__WEBPACK_IMPORTED_MODULE_3__["ModuleNames"].RowGroupingModule + " - your column definition should not have " + item, 'ColumnRowGroupingMissing' + item);
}
}
});
}
if (!_modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_4__["ModuleRegistry"].isRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_3__["ModuleNames"].RichSelectModule)) {
if (this.colDef.cellEditor === 'agRichSelect' || this.colDef.cellEditor === 'agRichSelectCellEditor') {
if (_modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_4__["ModuleRegistry"].isPackageBased()) {
warnOnce("ag-Grid: " + this.colDef.cellEditor + " can only be used with ag-grid-enterprise", 'ColumnRichSelectMissing');
}
else {
warnOnce("ag-Grid: " + this.colDef.cellEditor + " can only be used with ag-Grid Enterprise Module " + _modules_moduleNames__WEBPACK_IMPORTED_MODULE_3__["ModuleNames"].RichSelectModule, 'ColumnRichSelectMissing');
}
}
}
if (!_modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_4__["ModuleRegistry"].isRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_3__["ModuleNames"].DateTimeCellEditorModule)) {
if (this.colDef.cellEditor === 'agRichSelect' || this.colDef.cellEditor === 'agDateTimeCellEditor') {
if (_modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_4__["ModuleRegistry"].isPackageBased()) {
warnOnce("ag-Grid: " + this.colDef.cellEditor + " can only be used with ag-grid-enterprise", 'ColumnDateTimeMissing');
}
else {
warnOnce("ag-Grid: " + this.colDef.cellEditor + " can only be used with ag-Grid Enterprise Module " + _modules_moduleNames__WEBPACK_IMPORTED_MODULE_3__["ModuleNames"].DateTimeCellEditorModule, 'ColumnDateTimeMissing');
}
}
}
if (this.gridOptionsWrapper.isTreeData()) {
var itemsNotAllowedWithTreeData = ['rowGroup', 'rowGroupIndex', 'pivot', 'pivotIndex'];
itemsNotAllowedWithTreeData.forEach(function (item) {
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_5__["exists"])(colDefAny[item])) {
warnOnce("ag-Grid: " + item + " is not possible when doing tree data, your column definition should not have " + item, 'TreeDataCannotRowGroup');
}
});
}
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_5__["exists"])(this.colDef.width) && typeof this.colDef.width !== 'number') {
warnOnce('ag-Grid: colDef.width should be a number, not ' + typeof this.colDef.width, 'ColumnCheck_asdfawef');
}
};
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.isDndSource = function (rowNode) {
return this.isColumnFunc(rowNode, this.colDef.dndSource);
};
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 () {
return this.colDef.resizable === true;
};
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 === _constants_constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].SORT_ASC;
};
Column.prototype.isSortDescending = function () {
return this.sort === _constants_constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].SORT_DESC;
};
Column.prototype.isSortNone = function () {
return Object(_utils_generic__WEBPACK_IMPORTED_MODULE_5__["missing"])(this.sort);
};
Column.prototype.isSorting = function () {
return Object(_utils_generic__WEBPACK_IMPORTED_MODULE_5__["exists"])(this.sort);
};
Column.prototype.getSortIndex = function () {
return this.sortIndex;
};
Column.prototype.setSortIndex = function (sortOrder) {
this.sortIndex = sortOrder;
};
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;
};
// additionalEventAttributes is used by provided simple floating filter, so it can add 'floatingFilter=true' to the event
Column.prototype.setFilterActive = function (active, source, additionalEventAttributes) {
if (source === void 0) { source = "api"; }
if (this.filterActive !== active) {
this.filterActive = active;
this.eventService.dispatchEvent(this.createColumnEvent(Column.EVENT_FILTER_ACTIVE_CHANGED, source));
}
var filterChangedEvent = this.createColumnEvent(Column.EVENT_FILTER_CHANGED, source);
if (additionalEventAttributes) {
Object(_utils_object__WEBPACK_IMPORTED_MODULE_7__["mergeDeep"])(filterChangedEvent, additionalEventAttributes);
}
this.eventService.dispatchEvent(filterChangedEvent);
};
Column.prototype.setPinned = function (pinned) {
if (pinned === true || pinned === _constants_constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_LEFT) {
this.pinned = _constants_constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_LEFT;
}
else if (pinned === _constants_constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_RIGHT) {
this.pinned = _constants_constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_RIGHT;
}
else {
this.pinned = null;
}
};
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 === _constants_constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_LEFT || this.pinned === _constants_constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_RIGHT;
};
Column.prototype.isPinnedLeft = function () {
return this.pinned === _constants_constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_LEFT;
};
Column.prototype.isPinnedRight = function () {
return this.pinned === _constants_constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].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.createBaseColDefParams = function (rowNode) {
var params = {
node: rowNode,
data: rowNode.data,
colDef: this.colDef,
column: this,
api: this.gridOptionsWrapper.getApi(),
columnApi: this.gridOptionsWrapper.getColumnApi(),
context: this.gridOptionsWrapper.getContext()
};
return params;
};
Column.prototype.getColSpan = function (rowNode) {
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_5__["missing"])(this.colDef.colSpan)) {
return 1;
}
var params = this.createBaseColDefParams(rowNode);
var colSpan = this.colDef.colSpan(params);
// colSpan must be number equal to or greater than 1
return Math.max(colSpan, 1);
};
Column.prototype.getRowSpan = function (rowNode) {
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_5__["missing"])(this.colDef.rowSpan)) {
return 1;
}
var params = this.createBaseColDefParams(rowNode);
var rowSpan = this.colDef.rowSpan(params);
// rowSpan must be number equal to or greater than 1
return Math.max(rowSpan, 1);
};
Column.prototype.setActualWidth = function (actualWidth, source, silent) {
if (source === void 0) { source = "api"; }
if (silent === void 0) { silent = false; }
if (this.minWidth != null) {
actualWidth = Math.max(actualWidth, this.minWidth);
}
if (this.maxWidth != null) {
actualWidth = Math.min(actualWidth, this.maxWidth);
}
if (this.actualWidth !== actualWidth) {
// disable flex for this column if it was manually resized.
this.actualWidth = actualWidth;
if (this.flex && source !== 'flex' && source !== 'gridInitializing') {
this.flex = null;
}
if (!silent) {
this.fireColumnWidthChangedEvent(source);
}
}
};
Column.prototype.fireColumnWidthChangedEvent = function (source) {
this.eventService.dispatchEvent(this.createColumnEvent(Column.EVENT_WIDTH_CHANGED, source));
};
Column.prototype.isGreaterThanMax = function (width) {
if (this.maxWidth != null) {
return width > this.maxWidth;
}
return false;
};
Column.prototype.getMinWidth = function () {
return this.minWidth;
};
Column.prototype.getMaxWidth = function () {
return this.maxWidth;
};
Column.prototype.getFlex = function () {
return this.flex || 0;
};
// this method should only be used by the columnController to
// change flex when required by the setColumnState method.
Column.prototype.setFlex = function (flex) {
if (this.flex !== flex) {
this.flex = flex;
}
};
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;
};
// this used to be needed, as previous version of ag-grid had lockPosition as column state,
// so couldn't depend on colDef version.
Column.prototype.isLockPosition = function () {
console.warn('ag-Grid: since v21, col.isLockPosition() should not be used, please use col.getColDef().lockPosition instead.');
return this.colDef ? !!this.colDef.lockPosition : false;
};
// this used to be needed, as previous version of ag-grid had lockVisible as column state,
// so couldn't depend on colDef version.
Column.prototype.isLockVisible = function () {
console.warn('ag-Grid: since v21, col.isLockVisible() should not be used, please use col.getColDef().lockVisible instead.');
return this.colDef ? !!this.colDef.lockVisible : false;
};
// this used to be needed, as previous version of ag-grid had lockPinned as column state,
// so couldn't depend on colDef version.
Column.prototype.isLockPinned = function () {
console.warn('ag-Grid: since v21, col.isLockPinned() should not be used, please use col.getColDef().lockPinned instead.');
return this.colDef ? !!this.colDef.lockPinned : false;
};
// + 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';
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('gridOptionsWrapper')
], Column.prototype, "gridOptionsWrapper", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('columnUtils')
], Column.prototype, "columnUtils", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('columnApi')
], Column.prototype, "columnApi", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('gridApi')
], Column.prototype, "gridApi", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('context')
], Column.prototype, "context", void 0);
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_1__["PostConstruct"]
], Column.prototype, "initialise", null);
return Column;
}());
/***/ }),
/* 11 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EventService", function() { return EventService; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (undefined && undefined.__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 __param = (undefined && undefined.__param) || function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
var EventService = /** @class */ (function () {
function EventService() {
this.allSyncListeners = new Map();
this.allAsyncListeners = new Map();
this.globalSyncListeners = new Set();
this.globalAsyncListeners = new Set();
this.asyncFunctionsQueue = [];
this.scheduled = false;
// using an object performs better than a Set for the number of different events we have
this.firedEvents = {};
}
// 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, frameworkOverrides) {
if (globalEventListener === void 0) { globalEventListener = null; }
this.logger = loggerFactory.create('EventService');
this.frameworkOverrides = frameworkOverrides;
if (globalEventListener) {
var async = gridOptionsWrapper.useAsyncEvents();
this.addGlobalListener(globalEventListener, async);
}
};
EventService.prototype.getListeners = function (eventType, async) {
var listenerMap = async ? this.allAsyncListeners : this.allSyncListeners;
var listeners = listenerMap.get(eventType);
if (!listeners) {
listeners = new Set();
listenerMap.set(eventType, listeners);
}
return listeners;
};
EventService.prototype.addEventListener = function (eventType, listener, async) {
if (async === void 0) { async = false; }
this.getListeners(eventType, async).add(listener);
};
EventService.prototype.removeEventListener = function (eventType, listener, async) {
if (async === void 0) { async = false; }
this.getListeners(eventType, async).delete(listener);
};
EventService.prototype.addGlobalListener = function (listener, async) {
if (async === void 0) { async = false; }
(async ? this.globalAsyncListeners : this.globalSyncListeners).add(listener);
};
EventService.prototype.removeGlobalListener = function (listener, async) {
if (async === void 0) { async = false; }
(async ? this.globalAsyncListeners : this.globalSyncListeners).delete(listener);
};
EventService.prototype.dispatchEvent = function (event) {
this.dispatchToListeners(event, true);
this.dispatchToListeners(event, false);
this.firedEvents[event.type] = true;
};
EventService.prototype.dispatchEventOnce = function (event) {
if (!this.firedEvents[event.type]) {
this.dispatchEvent(event);
}
};
EventService.prototype.dispatchToListeners = function (event, async) {
var _this = this;
var eventType = event.type;
var processEventListeners = function (listeners) { return listeners.forEach(function (listener) {
if (async) {
_this.dispatchAsync(function () { return listener(event); });
}
else {
listener(event);
}
}); };
processEventListeners(this.getListeners(eventType, async));
var globalListeners = async ? this.globalAsyncListeners : this.globalSyncListeners;
globalListeners.forEach(function (listener) {
if (async) {
_this.dispatchAsync(function () { return _this.frameworkOverrides.dispatchEvent(eventType, function () { return listener(eventType, event); }); });
}
else {
_this.frameworkOverrides.dispatchEvent(eventType, function () { return 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
window.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(); });
};
__decorate([
__param(0, Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Qualifier"])('loggerFactory')),
__param(1, Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Qualifier"])('gridOptionsWrapper')),
__param(2, Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Qualifier"])('globalEventListener')),
__param(3, Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Qualifier"])('frameworkOverrides'))
], EventService.prototype, "setBeans", null);
EventService = __decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('eventService')
], EventService);
return EventService;
}());
/***/ }),
/* 12 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Context", function() { return Context; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PreConstruct", function() { return PreConstruct; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PostConstruct", function() { return PostConstruct; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PreDestroy", function() { return PreDestroy; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Bean", function() { return Bean; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Autowired", function() { return Autowired; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Optional", function() { return Optional; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Qualifier", function() { return Qualifier; });
/* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7);
/* harmony import */ var _utils_object__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(13);
/* harmony import */ var _utils_function__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(15);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var Context = /** @class */ (function () {
function Context(params, logger) {
this.beanWrappers = {};
this.destroyed = false;
if (!params || !params.beanClasses) {
return;
}
this.contextParams = params;
this.logger = logger;
this.logger.log(">> creating ag-Application Context");
this.createBeans();
var beanInstances = this.getBeanInstances();
this.wireBeans(beanInstances);
this.logger.log(">> ag-Application Context ready - component is alive");
}
Context.prototype.getBeanInstances = function () {
return Object(_utils_generic__WEBPACK_IMPORTED_MODULE_0__["values"])(this.beanWrappers).map(function (beanEntry) { return beanEntry.beanInstance; });
};
Context.prototype.createBean = function (bean, afterPreCreateCallback) {
if (!bean) {
throw Error("Can't wire to bean since it is null");
}
this.wireBeans([bean], afterPreCreateCallback);
return bean;
};
Context.prototype.wireBeans = function (beanInstances, afterPreCreateCallback) {
this.autoWireBeans(beanInstances);
this.methodWireBeans(beanInstances);
this.callLifeCycleMethods(beanInstances, 'preConstructMethods');
// the callback sets the attributes, so the component has access to attributes
// before postConstruct methods in the component are executed
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_0__["exists"])(afterPreCreateCallback)) {
beanInstances.forEach(afterPreCreateCallback);
}
this.callLifeCycleMethods(beanInstances, 'postConstructMethods');
};
Context.prototype.createBeans = function () {
var _this = this;
// register all normal beans
this.contextParams.beanClasses.forEach(this.createBeanWrapper.bind(this));
// register override beans, these will overwrite beans above of same name
// instantiate all beans - overridden beans will be left out
Object(_utils_object__WEBPACK_IMPORTED_MODULE_1__["iterateObject"])(this.beanWrappers, 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;
});
var createdBeanNames = Object.keys(this.beanWrappers).join(', ');
this.logger.log("created beans: " + createdBeanNames);
};
// tslint:disable-next-line
Context.prototype.createBeanWrapper = function (Bean) {
var metaData = Bean.__agBeanMetaData;
if (!metaData) {
var beanName = void 0;
if (Bean.prototype.constructor) {
beanName = Object(_utils_function__WEBPACK_IMPORTED_MODULE_2__["getFunctionName"])(Bean.prototype.constructor);
}
else {
beanName = "" + Bean;
}
console.error("Context item " + beanName + " is not a bean");
return;
}
var beanEntry = {
bean: Bean,
beanInstance: null,
beanName: metaData.beanName
};
this.beanWrappers[metaData.beanName] = beanEntry;
};
Context.prototype.autoWireBeans = function (beanInstances) {
var _this = this;
beanInstances.forEach(function (beanInstance) {
_this.forEachMetaDataInHierarchy(beanInstance, function (metaData, beanName) {
var attributes = metaData.agClassAttributes;
if (!attributes) {
return;
}
attributes.forEach(function (attribute) {
var otherBean = _this.lookupBeanInstance(beanName, attribute.beanName, attribute.optional);
beanInstance[attribute.attributeName] = otherBean;
});
});
});
};
Context.prototype.methodWireBeans = function (beanInstances) {
var _this = this;
beanInstances.forEach(function (beanInstance) {
_this.forEachMetaDataInHierarchy(beanInstance, function (metaData, beanName) {
Object(_utils_object__WEBPACK_IMPORTED_MODULE_1__["iterateObject"])(metaData.autowireMethods, function (methodName, wireParams) {
// skip constructor, as this is dealt with elsewhere
if (methodName === "agConstructor") {
return;
}
var initParams = _this.getBeansForParameters(wireParams, beanName);
beanInstance[methodName].apply(beanInstance, initParams);
});
});
});
};
Context.prototype.forEachMetaDataInHierarchy = function (beanInstance, callback) {
var prototype = Object.getPrototypeOf(beanInstance);
while (prototype != null) {
var constructor = prototype.constructor;
if (constructor.hasOwnProperty('__agBeanMetaData')) {
var metaData = constructor.__agBeanMetaData;
var beanName = this.getBeanName(constructor);
callback(metaData, beanName);
}
prototype = Object.getPrototypeOf(prototype);
}
};
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.getBeansForParameters = function (parameters, beanName) {
var _this = this;
var beansList = [];
if (parameters) {
Object(_utils_object__WEBPACK_IMPORTED_MODULE_1__["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;
}
if (this.contextParams.providedBeanInstances && this.contextParams.providedBeanInstances.hasOwnProperty(beanName)) {
return this.contextParams.providedBeanInstances[beanName];
}
var beanEntry = this.beanWrappers[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.callLifeCycleMethods = function (beanInstances, lifeCycleMethod) {
var _this = this;
beanInstances.forEach(function (beanInstance) { return _this.callLifeCycleMethodsOnBean(beanInstance, lifeCycleMethod); });
};
Context.prototype.callLifeCycleMethodsOnBean = function (beanInstance, lifeCycleMethod, methodToIgnore) {
// putting all methods into a map removes duplicates
var allMethods = {};
// dump methods from each level of the metadata hierarchy
this.forEachMetaDataInHierarchy(beanInstance, function (metaData) {
var methods = metaData[lifeCycleMethod];
if (methods) {
methods.forEach(function (methodName) {
if (methodName != methodToIgnore) {
allMethods[methodName] = true;
}
});
}
});
var allMethodsList = Object.keys(allMethods);
allMethodsList.forEach(function (methodName) { return beanInstance[methodName](); });
};
Context.prototype.getBean = function (name) {
return this.lookupBeanInstance("getBean", name, true);
};
Context.prototype.destroy = function () {
if (this.destroyed) {
return;
}
this.logger.log(">> Shutting down ag-Application Context");
var beanInstances = this.getBeanInstances();
this.destroyBeans(beanInstances);
this.contextParams.providedBeanInstances = null;
this.destroyed = true;
this.logger.log(">> ag-Application Context shut down - component is dead");
};
Context.prototype.destroyBean = function (bean) {
if (!bean) {
return;
}
this.destroyBeans([bean]);
};
Context.prototype.destroyBeans = function (beans) {
var _this = this;
if (!beans) {
return [];
}
beans.forEach(function (bean) {
_this.callLifeCycleMethodsOnBean(bean, 'preDestroyMethods', 'destroy');
// call destroy() explicitly if it exists
var beanAny = bean;
if (typeof beanAny.destroy === 'function') {
beanAny.destroy();
}
});
return [];
};
return 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.preConstructMethods) {
props.preConstructMethods = [];
}
props.preConstructMethods.push(methodName);
}
function PostConstruct(target, methodName, descriptor) {
var props = getOrCreateProps(target.constructor);
if (!props.postConstructMethods) {
props.postConstructMethods = [];
}
props.postConstructMethods.push(methodName);
}
function PreDestroy(target, methodName, descriptor) {
var props = getOrCreateProps(target.constructor);
if (!props.preDestroyMethods) {
props.preDestroyMethods = [];
}
props.preDestroyMethods.push(methodName);
}
function Bean(beanName) {
return function (classConstructor) {
var props = getOrCreateProps(classConstructor);
props.beanName = beanName;
};
}
function Autowired(name) {
return function (target, propertyKey, descriptor) {
autowiredFunc(target, name, false, target, propertyKey, null);
};
}
function Optional(name) {
return function (target, propertyKey, descriptor) {
autowiredFunc(target, name, true, target, propertyKey, null);
};
}
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;
}
};
}
function getOrCreateProps(target) {
if (!target.hasOwnProperty("__agBeanMetaData")) {
target.__agBeanMetaData = {};
}
return target.__agBeanMetaData;
}
/***/ }),
/* 13 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "iterateObject", function() { return iterateObject; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cloneObject", function() { return cloneObject; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "deepCloneObject", function() { return deepCloneObject; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "deepCloneDefinition", function() { return deepCloneDefinition; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getProperty", function() { return getProperty; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setProperty", function() { return setProperty; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copyPropertiesIfPresent", function() { return copyPropertiesIfPresent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copyPropertyIfPresent", function() { return copyPropertyIfPresent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAllKeysInObjects", function() { return getAllKeysInObjects; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAllValuesInObject", function() { return getAllValuesInObject; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mergeDeep", function() { return mergeDeep; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "assign", function() { return assign; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "missingOrEmptyObject", function() { return missingOrEmptyObject; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "get", function() { return get; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "set", function() { return set; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "deepFreeze", function() { return deepFreeze; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getValueUsingField", function() { return getValueUsingField; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeAllReferences", function() { return removeAllReferences; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNonNullObject", function() { return isNonNullObject; });
/* harmony import */ var _generic__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7);
/* harmony import */ var _array__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
function iterateObject(object, callback) {
if (object == null) {
return;
}
if (Array.isArray(object)) {
Object(_array__WEBPACK_IMPORTED_MODULE_1__["forEach"])(object, function (value, index) { return callback("" + index, value); });
}
else {
Object(_array__WEBPACK_IMPORTED_MODULE_1__["forEach"])(Object.keys(object), function (key) { return callback(key, object[key]); });
}
}
function cloneObject(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;
}
function deepCloneObject(object) {
return JSON.parse(JSON.stringify(object));
}
// returns copy of an object, doing a deep clone of any objects with that object.
// this is used for eg creating copies of Column Definitions, where we want to
// deep copy all objects, but do not want to deep copy functions (eg when user provides
// a function or class for colDef.cellRenderer)
function deepCloneDefinition(object, keysToSkip) {
if (!object) {
return;
}
var obj = object;
var res = {};
Object.keys(obj).forEach(function (key) {
if (keysToSkip && keysToSkip.indexOf(key) >= 0) {
return;
}
var value = obj[key];
// 'simple object' means a bunch of key/value pairs, eg {filter: 'myFilter'}. it does
// NOT include the following:
// 1) arrays
// 2) functions or classes (eg ColumnAPI instance)
var sourceIsSimpleObject = isNonNullObject(value) && value.constructor === Object;
if (sourceIsSimpleObject) {
res[key] = deepCloneDefinition(value);
}
else {
res[key] = value;
}
});
return res;
}
function getProperty(object, key) {
return object[key];
}
function setProperty(object, key, value) {
object[key] = value;
}
/**
* Will copy the specified properties from `source` into the equivalent properties on `target`, ignoring properties with
* a value of `undefined`.
*/
function copyPropertiesIfPresent(source, target) {
var properties = [];
for (var _i = 2; _i < arguments.length; _i++) {
properties[_i - 2] = arguments[_i];
}
Object(_array__WEBPACK_IMPORTED_MODULE_1__["forEach"])(properties, function (p) { return copyPropertyIfPresent(source, target, p); });
}
/**
* Will copy the specified property from `source` into the equivalent property on `target`, unless the property has a
* value of `undefined`. If a transformation is provided, it will be applied to the value before being set on `target`.
*/
function copyPropertyIfPresent(source, target, property, transform) {
var value = getProperty(source, property);
if (value !== undefined) {
setProperty(target, property, transform ? transform(value) : value);
}
}
function getAllKeysInObjects(objects) {
var allValues = {};
objects.filter(function (obj) { return obj != null; }).forEach(function (obj) {
Object(_array__WEBPACK_IMPORTED_MODULE_1__["forEach"])(Object.keys(obj), function (key) { return allValues[key] = null; });
});
return Object.keys(allValues);
}
function getAllValuesInObject(obj) {
if (!obj) {
return [];
}
if (typeof Object.values === 'function') {
return Object.values(obj);
}
var ret = [];
for (var key in obj) {
if (obj.hasOwnProperty(key) && obj.propertyIsEnumerable(key)) {
ret.push(obj[key]);
}
}
return ret;
}
function mergeDeep(dest, source, copyUndefined, makeCopyOfSimpleObjects) {
if (copyUndefined === void 0) { copyUndefined = true; }
if (makeCopyOfSimpleObjects === void 0) { makeCopyOfSimpleObjects = false; }
if (!Object(_generic__WEBPACK_IMPORTED_MODULE_0__["exists"])(source)) {
return;
}
iterateObject(source, function (key, sourceValue) {
var destValue = dest[key];
if (destValue === sourceValue) {
return;
}
// when creating params, we don't want to just copy objects over. otherwise merging ColDefs (eg DefaultColDef
// and Column Types) would result in params getting shared between objects.
// by putting an empty value into destValue first, it means we end up copying over values from
// the source object, rather than just copying in the source object in it's entirety.
if (makeCopyOfSimpleObjects) {
var objectIsDueToBeCopied = destValue == null && sourceValue != null;
if (objectIsDueToBeCopied) {
// 'simple object' means a bunch of key/value pairs, eg {filter: 'myFilter'}, as opposed
// to a Class instance (such as ColumnAPI instance).
var sourceIsSimpleObject = typeof sourceValue === 'object' && sourceValue.constructor === Object;
var dontCopy = sourceIsSimpleObject;
if (dontCopy) {
destValue = {};
dest[key] = destValue;
}
}
}
if (isNonNullObject(sourceValue) && isNonNullObject(destValue) && !Array.isArray(destValue)) {
mergeDeep(destValue, sourceValue, copyUndefined, makeCopyOfSimpleObjects);
}
else if (copyUndefined || sourceValue !== undefined) {
dest[key] = sourceValue;
}
});
}
function assign(object) {
var sources = [];
for (var _i = 1; _i < arguments.length; _i++) {
sources[_i - 1] = arguments[_i];
}
Object(_array__WEBPACK_IMPORTED_MODULE_1__["forEach"])(sources, function (source) { return iterateObject(source, function (key, value) { return object[key] = value; }); });
return object;
}
function missingOrEmptyObject(value) {
return Object(_generic__WEBPACK_IMPORTED_MODULE_0__["missing"])(value) || Object.keys(value).length === 0;
}
function get(source, expression, defaultValue) {
if (source == null) {
return defaultValue;
}
var keys = expression.split('.');
var objectToRead = source;
while (keys.length > 1) {
objectToRead = objectToRead[keys.shift()];
if (objectToRead == null) {
return defaultValue;
}
}
var value = objectToRead[keys[0]];
return value != null ? value : defaultValue;
}
function set(target, expression, value) {
if (target == null) {
return;
}
var keys = expression.split('.');
var objectToUpdate = target;
while (keys.length > 1) {
objectToUpdate = objectToUpdate[keys.shift()];
if (objectToUpdate == null) {
return;
}
}
objectToUpdate[keys[0]] = value;
}
function deepFreeze(object) {
Object.freeze(object);
Object(_array__WEBPACK_IMPORTED_MODULE_1__["forEach"])(Object(_generic__WEBPACK_IMPORTED_MODULE_0__["values"])(object), function (v) {
if (isNonNullObject(v) || typeof v === 'function') {
deepFreeze(v);
}
});
return object;
}
function getValueUsingField(data, field, fieldContainsDots) {
if (!field || !data) {
return;
}
// if no '.', then it's not a deep value
if (!fieldContainsDots) {
return data[field];
}
// 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++) {
if (currentObject == null) {
return undefined;
}
currentObject = currentObject[fields[i]];
}
return currentObject;
}
// used by ColumnAPI and GridAPI to remove all references, so keeping grid in memory resulting in a
// memory leak if user is not disposing of the GridAPI or ColumnApi references
function removeAllReferences(obj, objectName) {
Object.keys(obj).forEach(function (key) {
var value = obj[key];
// we want to replace all the @autowired services, which are objects. any simple types (boolean, string etc)
// we don't care about
if (typeof value === 'object') {
obj[key] = undefined;
}
});
var proto = Object.getPrototypeOf(obj);
var properties = {};
Object.keys(proto).forEach(function (key) {
var value = proto[key];
// leave all basic types - this is needed for GridAPI to leave the "destroyed: boolean" attribute alone
if (typeof value === 'function') {
var func = function () {
console.warn("ag-Grid: " + objectName + " function " + key + "() cannot be called as the grid has been \ndestroyed. Please don't call grid API functions on destroyed grids - as a matter of fact you \nshouldn't be keeping the API reference, your application has a memory leak! Remove the API reference \nwhen the grid is destroyed.");
};
properties[key] = { value: func, writable: true };
}
});
Object.defineProperties(obj, properties);
}
function isNonNullObject(value) {
return typeof value === 'object' && value !== null;
}
/***/ }),
/* 14 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "firstExistingValue", function() { return firstExistingValue; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "anyExists", function() { return anyExists; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "existsAndNotEmpty", function() { return existsAndNotEmpty; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "last", function() { return last; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "areEqual", function() { return areEqual; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compareArrays", function() { return compareArrays; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "shallowCompare", function() { return shallowCompare; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sortNumerically", function() { return sortNumerically; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeRepeatsFromArray", function() { return removeRepeatsFromArray; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeFromArray", function() { return removeFromArray; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeAllFromArray", function() { return removeAllFromArray; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertIntoArray", function() { return insertIntoArray; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertArrayIntoArray", function() { return insertArrayIntoArray; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "moveInArray", function() { return moveInArray; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "includes", function() { return includes; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "flatten", function() { return flatten; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pushAll", function() { return pushAll; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toStrings", function() { return toStrings; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findIndex", function() { return findIndex; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "every", function() { return every; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "some", function() { return some; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "forEach", function() { return forEach; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "forEachReverse", function() { return forEachReverse; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "map", function() { return map; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "filter", function() { return filter; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "reduce", function() { return reduce; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "forEachSnapshotFirst", function() { return forEachSnapshotFirst; });
/* harmony import */ var _generic__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
function firstExistingValue() {
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 (Object(_generic__WEBPACK_IMPORTED_MODULE_0__["exists"])(value)) {
return value;
}
}
return null;
}
/** @deprecated */
function anyExists(values) {
return values && firstExistingValue(values) != null;
}
function existsAndNotEmpty(value) {
return value != null && value.length > 0;
}
function last(arr) {
if (!arr || !arr.length) {
return undefined;
}
return arr[arr.length - 1];
}
function areEqual(a, b, comparator) {
if (a == null && b == null) {
return true;
}
return a != null &&
b != null &&
a.length === b.length &&
every(a, function (value, index) { return comparator ? comparator(value, b[index]) : b[index] === value; });
}
/** @deprecated */
function compareArrays(array1, array2) {
return areEqual(array1, array2);
}
/** @deprecated */
function shallowCompare(arr1, arr2) {
return areEqual(arr1, arr2);
}
function sortNumerically(array) {
return array.sort(function (a, b) { return a - b; });
}
function removeRepeatsFromArray(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);
}
}
}
function removeFromArray(array, object) {
var index = array.indexOf(object);
if (index >= 0) {
array.splice(index, 1);
}
}
function removeAllFromArray(array, toRemove) {
forEach(toRemove, function (item) { return removeFromArray(array, item); });
}
function insertIntoArray(array, object, toIndex) {
array.splice(toIndex, 0, object);
}
function insertArrayIntoArray(dest, src, toIndex) {
if (dest == null || src == null) {
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];
insertIntoArray(dest, item, toIndex);
}
}
function moveInArray(array, objectsToMove, toIndex) {
// first take out items from the array
removeAllFromArray(array, objectsToMove);
// 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
forEach(objectsToMove.slice().reverse(), function (obj) { return insertIntoArray(array, obj, toIndex); });
}
function includes(array, value) {
return array.indexOf(value) > -1;
}
function flatten(arrayOfArrays) {
return [].concat.apply([], arrayOfArrays);
}
function pushAll(target, source) {
if (source == null || target == null) {
return;
}
forEach(source, function (value) { return target.push(value); });
}
function toStrings(array) {
return map(array, _generic__WEBPACK_IMPORTED_MODULE_0__["toStringOrNull"]);
}
function findIndex(collection, predicate) {
for (var i = 0; i < collection.length; i++) {
if (predicate(collection[i], i, collection)) {
return i;
}
}
return -1;
}
/**
* The implementation of Array.prototype.every in browsers is always slower than just using a simple for loop, so
* use this for improved performance.
* https://jsbench.me/bek91dtit8/
*/
function every(list, predicate) {
if (list == null) {
return true;
}
for (var i = 0; i < list.length; i++) {
if (!predicate(list[i], i)) {
return false;
}
}
return true;
}
/**
* The implementation of Array.prototype.some in browsers is always slower than just using a simple for loop, so
* use this for improved performance.
* https://jsbench.me/5dk91e4tmt/
*/
function some(list, predicate) {
if (list == null) {
return false;
}
for (var i = 0; i < list.length; i++) {
if (predicate(list[i], i)) {
return true;
}
}
return false;
}
/**
* The implementation of Array.prototype.forEach in browsers is often slower than just using a simple for loop, so
* use this for improved performance.
* https://jsbench.me/apk91elt8a/
*/
function forEach(list, action) {
if (list == null) {
return;
}
for (var i = 0; i < list.length; i++) {
action(list[i], i);
}
}
function forEachReverse(list, action) {
if (list == null) {
return;
}
for (var i = list.length - 1; i >= 0; i--) {
action(list[i], i);
}
}
/**
* The implementation of Array.prototype.map in browsers is generally the same as just using a simple for loop. However,
* Firefox does exhibit some difference, and this performs no worse in other browsers, so use this if you want improved
* performance.
* https://jsbench.me/njk91ez8pc/
*/
function map(list, process) {
if (list == null) {
return null;
}
var mapped = [];
for (var i = 0; i < list.length; i++) {
mapped.push(process(list[i], i));
}
return mapped;
}
/**
* The implementation of Array.prototype.filter in browsers is always slower than just using a simple for loop, so
* use this for improved performance.
* https://jsbench.me/7bk91fk08c/
*/
function filter(list, predicate) {
if (list == null) {
return null;
}
var filtered = [];
for (var i = 0; i < list.length; i++) {
if (predicate(list[i], i)) {
filtered.push(list[i]);
}
}
return filtered;
}
/**
* The implementation of Array.prototype.reduce in browsers is generally the same as just using a simple for loop. However,
* Chrome does exhibit some difference, and this performs no worse in other browsers, so use this if you want improved
* performance.
* https://jsbench.me/7vk92n6u1f/
*/
function reduce(list, step, initial) {
if (list == null || initial == null) {
return null;
}
var result = initial;
for (var i = 0; i < list.length; i++) {
result = step(result, list[i], i);
}
return result;
}
/** @deprecated */
function forEachSnapshotFirst(list, callback) {
if (!list) {
return;
}
var arrayCopy = list.slice(0);
arrayCopy.forEach(callback);
}
/***/ }),
/* 15 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doOnce", function() { return doOnce; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getFunctionName", function() { return getFunctionName; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getFunctionParameters", function() { return getFunctionParameters; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFunction", function() { return isFunction; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "executeInAWhile", function() { return executeInAWhile; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "executeNextVMTurn", function() { return executeNextVMTurn; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "executeAfter", function() { return executeAfter; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "debounce", function() { return debounce; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compose", function() { return compose; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "callIfPresent", function() { return callIfPresent; });
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var FUNCTION_STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
var FUNCTION_ARGUMENT_NAMES = /([^\s,]+)/g;
var doOnceFlags = {};
/**
* If the key was passed before, then doesn't execute the func
* @param {Function} func
* @param {string} key
*/
function doOnce(func, key) {
if (doOnceFlags[key]) {
return;
}
func();
doOnceFlags[key] = true;
}
function getFunctionName(funcConstructor) {
// for every other browser in the world
if (funcConstructor.name) {
return funcConstructor.name;
}
// for the pestilence that is ie11
var matches = /function\s+([^\(]+)/.exec(funcConstructor.toString());
return matches && matches.length === 2 ? matches[1].trim() : null;
}
/** @deprecated */
function getFunctionParameters(func) {
var fnStr = func.toString().replace(FUNCTION_STRIP_COMMENTS, '');
return fnStr.slice(fnStr.indexOf('(') + 1, fnStr.indexOf(')')).match(FUNCTION_ARGUMENT_NAMES) || [];
}
function isFunction(val) {
return !!(val && val.constructor && val.call && val.apply);
}
function executeInAWhile(funcs) {
executeAfter(funcs, 400);
}
function executeNextVMTurn(funcs) {
executeAfter(funcs, 0);
}
function executeAfter(funcs, milliseconds) {
if (milliseconds === void 0) { milliseconds = 0; }
if (funcs.length > 0) {
window.setTimeout(function () { return funcs.forEach(function (func) { return func(); }); }, milliseconds);
}
}
/**
* from https://stackoverflow.com/questions/24004791/can-someone-explain-the-debounce-function-in-javascript
* @param {Function} func The function to be debounced
* @param {number} wait The time in ms to debounce
* @param {boolean} immediate If it should run immediately or wait for the initial debounce delay
* @return {Function} The debounced function
*/
function debounce(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 () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
// reference the context and args for the setTimeout function
var context = this;
// 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.
window.clearTimeout(timeout);
// Set the new timeout
timeout = window.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);
}
};
}
function compose() {
var fns = [];
for (var _i = 0; _i < arguments.length; _i++) {
fns[_i] = arguments[_i];
}
return function (arg) { return fns.reduce(function (composed, f) { return f(composed); }, arg); };
}
function callIfPresent(func) {
if (func) {
func();
}
}
/***/ }),
/* 16 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Constants", function() { return Constants; });
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var Constants = /** @class */ (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.BATCH_WAIT_MILLIS = 50;
Constants.EXPORT_TYPE_DRAG_COPY = 'dragCopy';
Constants.EXPORT_TYPE_CLIPBOARD = 'clipboard';
Constants.EXPORT_TYPE_EXCEL = 'excel';
Constants.EXPORT_TYPE_CSV = 'csv';
Constants.ROW_MODEL_TYPE_INFINITE = 'infinite';
Constants.ROW_MODEL_TYPE_VIEWPORT = 'viewport';
Constants.ROW_MODEL_TYPE_CLIENT_SIDE = 'clientSide';
Constants.ROW_MODEL_TYPE_SERVER_SIDE = 'serverSide';
Constants.ALWAYS = 'always';
Constants.ONLY_WHEN_GROUPING = 'onlyWhenGrouping';
Constants.PINNED_TOP = 'top';
Constants.PINNED_BOTTOM = 'bottom';
Constants.DOM_LAYOUT_NORMAL = 'normal';
Constants.DOM_LAYOUT_PRINT = 'print';
Constants.DOM_LAYOUT_AUTO_HEIGHT = 'autoHeight';
Constants.GROUP_AUTO_COLUMN_ID = 'ag-Grid-AutoColumn';
Constants.SOURCE_PASTE = 'paste';
Constants.PINNED_RIGHT = 'right';
Constants.PINNED_LEFT = 'left';
Constants.SORT_ASC = 'asc';
Constants.SORT_DESC = 'desc';
Constants.INPUT_SELECTOR = 'input, select, button, textarea';
Constants.FOCUSABLE_SELECTOR = '[tabindex], input, select, button, textarea';
Constants.FOCUSABLE_EXCLUDE = '.ag-hidden, .ag-hidden *, [disabled], .ag-disabled, .ag-disabled *';
return Constants;
}());
/***/ }),
/* 17 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ModuleNames", function() { return ModuleNames; });
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var ModuleNames;
(function (ModuleNames) {
// when using modules, user references this
ModuleNames["CommunityCoreModule"] = "@ag-grid-community/core";
// when not using modules, user references this
ModuleNames["CommunityAllModules"] = "@ag-grid-community/all";
// community modules
ModuleNames["InfiniteRowModelModule"] = "@ag-grid-community/infinite-row-model";
ModuleNames["ClientSideRowModelModule"] = "@ag-grid-community/client-side-row-model";
ModuleNames["CsvExportModule"] = "@ag-grid-community/csv-export";
ModuleNames["RowNodeCache"] = "@ag-grid-community/row-node-cache";
// enterprise core - users never import on this, but other enterprise modules do
ModuleNames["EnterpriseCoreModule"] = "@ag-grid-enterprise/core";
// when not using modules, user references this
ModuleNames["EnterpriseAllModules"] = "@ag-grid-enterprise/all";
// enterprise modules
ModuleNames["RowGroupingModule"] = "@ag-grid-enterprise/row-grouping";
ModuleNames["ColumnToolPanelModule"] = "@ag-grid-enterprise/column-tool-panel";
ModuleNames["FiltersToolPanelModule"] = "@ag-grid-enterprise/filter-tool-panel";
ModuleNames["MenuModule"] = "@ag-grid-enterprise/menu";
ModuleNames["SetFilterModule"] = "@ag-grid-enterprise/set-filter";
ModuleNames["MultiFilterModule"] = "@ag-grid-enterprise/multi-filter";
ModuleNames["StatusBarModule"] = "@ag-grid-enterprise/status-bar";
ModuleNames["SideBarModule"] = "@ag-grid-enterprise/side-bar";
ModuleNames["RangeSelectionModule"] = "@ag-grid-enterprise/range-selection";
ModuleNames["MasterDetailModule"] = "@ag-grid-enterprise/master-detail";
ModuleNames["RichSelectModule"] = "@ag-grid-enterprise/rich-select";
ModuleNames["GridChartsModule"] = "@ag-grid-enterprise/charts";
ModuleNames["ViewportRowModelModule"] = "@ag-grid-enterprise/viewport-row-model";
ModuleNames["ServerSideRowModelModule"] = "@ag-grid-enterprise/server-side-row-model";
ModuleNames["ExcelExportModule"] = "@ag-grid-enterprise/excel-export";
ModuleNames["ClipboardModule"] = "@ag-grid-enterprise/clipboard";
ModuleNames["DateTimeCellEditorModule"] = "@ag-grid-enterprise/date-time-cell-editor";
// framework wrappers currently don't provide beans, comps etc, so no need to be modules,
// however i argue they should be as in theory they 'could' provide beans etc
ModuleNames["AngularModule"] = "@ag-grid-community/angular";
ModuleNames["ReactModule"] = "@ag-grid-community/react";
ModuleNames["VueModule"] = "@ag-grid-community/vue";
ModuleNames["PolymerModule"] = "@ag-grid-community/polymer";
// and then this, which is definitely not a grid module, as it should not have any dependency
// on the grid (ie shouldn't even reference the Module interface)
// ChartsModule = "@ag-grid-community/charts-core",
})(ModuleNames || (ModuleNames = {}));
/***/ }),
/* 18 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ModuleRegistry", function() { return ModuleRegistry; });
/* harmony import */ var _utils_function__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15);
/* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var ModuleRegistry = /** @class */ (function () {
function ModuleRegistry() {
}
ModuleRegistry.register = function (module, moduleBased) {
if (moduleBased === void 0) { moduleBased = true; }
ModuleRegistry.modulesMap[module.moduleName] = module;
if (ModuleRegistry.moduleBased === undefined) {
ModuleRegistry.moduleBased = moduleBased;
}
else {
if (ModuleRegistry.moduleBased !== moduleBased) {
Object(_utils_function__WEBPACK_IMPORTED_MODULE_0__["doOnce"])(function () {
console.warn("ag-Grid: You are mixing modules (i.e. @ag-grid-community/core) and packages (ag-grid-community) - you can only use one or the other of these mechanisms.");
console.warn('Please see https://www.ag-grid.com/documentation/javascript/packages-modules/ for more information.');
}, 'ModulePackageCheck');
}
}
};
// noinspection JSUnusedGlobalSymbols
ModuleRegistry.registerModules = function (modules, moduleBased) {
if (moduleBased === void 0) { moduleBased = true; }
if (!modules) {
return;
}
modules.forEach(function (module) { return ModuleRegistry.register(module, moduleBased); });
};
ModuleRegistry.assertRegistered = function (moduleName, reason) {
if (this.isRegistered(moduleName)) {
return true;
}
var warningKey = reason + moduleName;
var warningMessage = "ag-Grid: unable to use " + reason + " as module " + moduleName + " is not present. Please see: https://www.ag-grid.com/documentation/javascript/modules/";
Object(_utils_function__WEBPACK_IMPORTED_MODULE_0__["doOnce"])(function () {
console.warn(warningMessage);
}, warningKey);
return false;
};
ModuleRegistry.isRegistered = function (moduleName) {
return !!ModuleRegistry.modulesMap[moduleName];
};
ModuleRegistry.getRegisteredModules = function () {
return Object(_utils_generic__WEBPACK_IMPORTED_MODULE_1__["values"])(ModuleRegistry.modulesMap);
};
ModuleRegistry.isPackageBased = function () {
return !ModuleRegistry.moduleBased;
};
// having in a map a) removes duplicates and b) allows fast lookup
ModuleRegistry.modulesMap = {};
return ModuleRegistry;
}());
/***/ }),
/* 19 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DefaultColumnTypes", function() { return DefaultColumnTypes; });
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var DefaultColumnTypes = {
numericColumn: {
headerClass: 'ag-right-aligned-header',
cellClass: 'ag-right-aligned-cell'
},
rightAligned: {
headerClass: 'ag-right-aligned-header',
cellClass: 'ag-right-aligned-cell'
}
};
/***/ }),
/* 20 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BeanStub", function() { return BeanStub; });
/* harmony import */ var _eventService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11);
/* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12);
/* harmony import */ var _utils_array__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(14);
/* harmony import */ var _utils_event__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(21);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (undefined && undefined.__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 BeanStub = /** @class */ (function () {
function BeanStub() {
var _this = this;
this.destroyFunctions = [];
this.destroyed = false;
// for vue 3 - prevents Vue from trying to make this (and obviously any sub classes) from being reactive
// prevents vue from creating proxies for created objects and prevents identity related issues
this.__v_skip = true;
this.getContext = function () { return _this.context; };
this.isAlive = function () { return !_this.destroyed; };
}
// this was a test constructor niall built, when active, it prints after 5 seconds all beans/components that are
// not destroyed. to use, create a new grid, then api.destroy() before 5 seconds. then anything that gets printed
// points to a bean or component that was not properly disposed of.
// constructor() {
// setTimeout(()=> {
// if (this.isAlive()) {
// let prototype: any = Object.getPrototypeOf(this);
// const constructor: any = prototype.constructor;
// const constructorString = constructor.toString();
// const beanName = constructorString.substring(9, constructorString.indexOf("("));
// console.log('is alive ' + beanName);
// }
// }, 5000);
// }
// CellComp and GridComp and override this because they get the FrameworkOverrides from the Beans bean
BeanStub.prototype.getFrameworkOverrides = function () {
return this.frameworkOverrides;
};
BeanStub.prototype.destroy = function () {
// let prototype: any = Object.getPrototypeOf(this);
// const constructor: any = prototype.constructor;
// const constructorString = constructor.toString();
// const beanName = constructorString.substring(9, constructorString.indexOf("("));
this.destroyFunctions.forEach(function (func) { return func(); });
this.destroyFunctions.length = 0;
this.destroyed = true;
this.dispatchEvent({ type: BeanStub.EVENT_DESTROYED });
};
BeanStub.prototype.addEventListener = function (eventType, listener) {
if (!this.localEventService) {
this.localEventService = new _eventService__WEBPACK_IMPORTED_MODULE_0__["EventService"]();
}
this.localEventService.addEventListener(eventType, listener);
};
BeanStub.prototype.removeEventListener = function (eventType, listener) {
if (this.localEventService) {
this.localEventService.removeEventListener(eventType, listener);
}
};
BeanStub.prototype.dispatchEventAsync = function (event) {
var _this = this;
window.setTimeout(function () { return _this.dispatchEvent(event); }, 0);
};
BeanStub.prototype.dispatchEvent = function (event) {
if (this.localEventService) {
this.localEventService.dispatchEvent(event);
}
};
BeanStub.prototype.addManagedListener = function (object, event, listener) {
var _this = this;
if (this.destroyed) {
return;
}
if (object instanceof HTMLElement) {
Object(_utils_event__WEBPACK_IMPORTED_MODULE_3__["addSafePassiveEventListener"])(this.getFrameworkOverrides(), object, event, listener);
}
else {
object.addEventListener(event, listener);
}
var destroyFunc = function () {
object.removeEventListener(event, listener);
_this.destroyFunctions = _this.destroyFunctions.filter(function (fn) { return fn !== destroyFunc; });
return null;
};
this.destroyFunctions.push(destroyFunc);
return destroyFunc;
};
BeanStub.prototype.addDestroyFunc = function (func) {
// if we are already destroyed, we execute the func now
if (this.isAlive()) {
this.destroyFunctions.push(func);
}
else {
func();
}
};
BeanStub.prototype.createManagedBean = function (bean, context) {
var res = this.createBean(bean, context);
this.addDestroyFunc(this.destroyBean.bind(this, bean, context));
return res;
};
BeanStub.prototype.createBean = function (bean, context, afterPreCreateCallback) {
return (context || this.getContext()).createBean(bean, afterPreCreateCallback);
};
BeanStub.prototype.destroyBean = function (bean, context) {
return (context || this.getContext()).destroyBean(bean);
};
BeanStub.prototype.destroyBeans = function (beans, context) {
var _this = this;
if (beans) {
Object(_utils_array__WEBPACK_IMPORTED_MODULE_2__["forEach"])(beans, function (bean) { return _this.destroyBean(bean, context); });
}
return [];
};
BeanStub.EVENT_DESTROYED = 'destroyed';
__decorate([
Object(_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('frameworkOverrides')
], BeanStub.prototype, "frameworkOverrides", void 0);
__decorate([
Object(_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('context')
], BeanStub.prototype, "context", void 0);
__decorate([
Object(_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('eventService')
], BeanStub.prototype, "eventService", void 0);
__decorate([
Object(_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('gridOptionsWrapper')
], BeanStub.prototype, "gridOptionsWrapper", void 0);
__decorate([
_context__WEBPACK_IMPORTED_MODULE_1__["PreDestroy"]
], BeanStub.prototype, "destroy", null);
return BeanStub;
}());
/***/ }),
/* 21 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stopPropagationForAgGrid", function() { return stopPropagationForAgGrid; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isStopPropagationForAgGrid", function() { return isStopPropagationForAgGrid; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEventSupported", function() { return isEventSupported; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCellCompForEvent", function() { return getCellCompForEvent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addChangeListener", function() { return addChangeListener; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTarget", function() { return getTarget; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isElementInEventPath", function() { return isElementInEventPath; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createEventPath", function() { return createEventPath; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addAgGridEventPath", function() { return addAgGridEventPath; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getEventPath", function() { return getEventPath; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addSafePassiveEventListener", function() { return addSafePassiveEventListener; });
/* harmony import */ var _array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var AG_GRID_STOP_PROPAGATION = '__ag_Grid_Stop_Propagation';
var PASSIVE_EVENTS = ['touchstart', 'touchend', 'touchmove', 'touchcancel'];
var supports = {};
/**
* 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 the body.
* @param {Event} event
*/
function stopPropagationForAgGrid(event) {
event[AG_GRID_STOP_PROPAGATION] = true;
}
function isStopPropagationForAgGrid(event) {
return event[AG_GRID_STOP_PROPAGATION] === true;
}
var isEventSupported = (function () {
var tags = {
select: 'input',
change: 'input',
submit: 'form',
reset: 'form',
error: 'img',
load: 'img',
abort: 'img'
};
var isEventSupported = function (eventName) {
if (typeof supports[eventName] === 'boolean') {
return supports[eventName];
}
var el = document.createElement(tags[eventName] || 'div');
eventName = 'on' + eventName;
var isSupported = (eventName in el);
if (!isSupported) {
el.setAttribute(eventName, 'return;');
isSupported = typeof el[eventName] == 'function';
}
el = null;
return supports[eventName] = isSupported;
};
return isEventSupported;
})();
function getCellCompForEvent(gridOptionsWrapper, event) {
var sourceElement = getTarget(event);
while (sourceElement) {
var renderedCell = gridOptionsWrapper.getDomData(sourceElement, 'cellComp');
if (renderedCell) {
return renderedCell;
}
sourceElement = sourceElement.parentElement;
}
return null;
}
/**
* @deprecated
* Adds all type of change listeners to an element, intended to be a text field
* @param {HTMLElement} element
* @param {EventListener} listener
*/
function addChangeListener(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);
}
/**
* 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
* @param {Event} event
* @returns {Element}
*/
function getTarget(event) {
var eventNoType = event;
return eventNoType.target || eventNoType.srcElement;
}
function isElementInEventPath(element, event) {
if (!event || !element) {
return false;
}
return getEventPath(event).indexOf(element) >= 0;
}
function createEventPath(event) {
var res = [];
var pointer = 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).
* @param {Event} event
*/
function addAgGridEventPath(event) {
event.__agGridEventPath = getEventPath(event);
}
/**
* Gets the path for an Event.
* https://stackoverflow.com/questions/39245488/event-path-undefined-with-firefox-and-vue-js
* https://developer.mozilla.org/en-US/docs/Web/API/Event
* @param {Event} event
* @returns {EventTarget[]}
*/
function getEventPath(event) {
var eventNoType = event;
if (eventNoType.deepPath) {
// IE supports deep path
return eventNoType.deepPath();
}
if (eventNoType.path) {
// Chrome supports path
return eventNoType.path;
}
if (eventNoType.composedPath) {
// Firefox supports composePath
return eventNoType.composedPath();
}
if (eventNoType.__agGridEventPath) {
// Firefox supports composePath
return eventNoType.__agGridEventPath;
}
// and finally, if none of the above worked,
// we create the path ourselves
return createEventPath(event);
}
function addSafePassiveEventListener(frameworkOverrides, eElement, event, listener) {
var isPassive = Object(_array__WEBPACK_IMPORTED_MODULE_0__["includes"])(PASSIVE_EVENTS, event);
var options = isPassive ? { passive: true } : undefined;
// this check is here for certain scenarios where I believe the user must be destroying
// the grid somehow but continuing for it to be used
if (frameworkOverrides && frameworkOverrides.addEventListener) {
frameworkOverrides.addEventListener(eElement, event, listener, options);
}
}
/***/ }),
/* 22 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColumnController", function() { return ColumnController; });
/* harmony import */ var _entities_columnGroup__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9);
/* harmony import */ var _entities_column__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(10);
/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(23);
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(20);
/* harmony import */ var _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8);
/* harmony import */ var _groupInstanceIdCreator__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(25);
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(12);
/* harmony import */ var _constants_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(16);
/* harmony import */ var _utils_array__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(14);
/* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(7);
/* harmony import */ var _utils_string__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(26);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 __param = (undefined && undefined.__param) || function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
var ColumnController = /** @class */ (function (_super) {
__extends(ColumnController, _super);
function ColumnController() {
var _this = _super !== null && _super.apply(this, arguments) || this;
// 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.forceRecreateAutoGroups = false;
_this.pivotMode = false;
_this.bodyWidth = 0;
_this.leftWidth = 0;
_this.rightWidth = 0;
_this.bodyWidthDirty = true;
_this.colDefVersion = 0;
_this.flexColsCalculatedAtLestOnce = false;
return _this;
}
ColumnController.prototype.init = function () {
this.suppressColumnVirtualisation = this.gridOptionsWrapper.isSuppressColumnVirtualisation();
var pivotMode = this.gridOptionsWrapper.isPivotMode();
if (this.isPivotSettingAllowed(pivotMode)) {
this.pivotMode = pivotMode;
}
this.usingTreeData = this.gridOptionsWrapper.isTreeData();
this.addManagedListener(this.gridOptionsWrapper, 'autoGroupColumnDef', this.onAutoGroupColumnDefChanged.bind(this));
};
ColumnController.prototype.onAutoGroupColumnDefChanged = function () {
this.autoGroupsNeedBuilding = true;
this.forceRecreateAutoGroups = true;
this.updateGridColumns();
this.updateDisplayedColumns('gridOptionsChanged');
};
ColumnController.prototype.getColDefVersion = function () {
return this.colDefVersion;
};
ColumnController.prototype.setColumnDefs = function (columnDefs, source) {
var _this = this;
if (source === void 0) { source = 'api'; }
var colsPreviouslyExisted = !!this.columnDefs;
this.colDefVersion++;
var raiseEventsFunc = this.compareColumnStatesAndRaiseEvents(source);
this.columnDefs = columnDefs;
// 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 oldPrimaryColumns = this.primaryColumns;
var balancedTreeResult = this.columnFactory.createColumnTree(columnDefs, true, oldPrimaryColumns);
this.primaryColumnTree = balancedTreeResult.columnTree;
this.primaryHeaderRowCount = balancedTreeResult.treeDept + 1;
this.primaryColumns = this.getColumnsFromTree(this.primaryColumnTree);
this.primaryColumnsMap = {};
this.primaryColumns.forEach(function (col) { return _this.primaryColumnsMap[col.getId()] = col; });
this.extractRowGroupColumns(source, oldPrimaryColumns);
this.extractPivotColumns(source, oldPrimaryColumns);
this.extractValueColumns(source, oldPrimaryColumns);
this.ready = true;
this.updateGridColumns();
if (colsPreviouslyExisted && this.gridColsArePrimary && this.gridOptionsWrapper.isApplyColumnDefOrder()) {
this.orderGridColumnsLikePrimary();
}
this.updateDisplayedColumns(source);
this.checkDisplayedVirtualColumns();
// this event is not used by ag-Grid, but left here for backwards compatibility,
// in case applications use it
this.dispatchEverythingChanged(source);
raiseEventsFunc();
this.dispatchNewColumnsLoaded();
};
ColumnController.prototype.dispatchNewColumnsLoaded = function () {
var newColumnsLoadedEvent = {
type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_NEW_COLUMNS_LOADED,
api: this.gridApi,
columnApi: this.columnApi
};
this.eventService.dispatchEvent(newColumnsLoadedEvent);
};
// this event is legacy, no grid code listens to it. instead the grid listens to New Columns Loaded
ColumnController.prototype.dispatchEverythingChanged = function (source) {
if (source === void 0) { source = 'api'; }
var eventEverythingChanged = {
type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_EVERYTHING_CHANGED,
api: this.gridApi,
columnApi: this.columnApi,
source: source
};
this.eventService.dispatchEvent(eventEverythingChanged);
};
ColumnController.prototype.orderGridColumnsLikePrimary = function () {
var _this = this;
this.gridColumns.sort(function (colA, colB) {
var primaryIndexA = _this.primaryColumns.indexOf(colA);
var primaryIndexB = _this.primaryColumns.indexOf(colB);
// if both cols are present in primary, then we just return the position,
// so position is maintained.
var indexAPresent = primaryIndexA >= 0;
var indexBPresent = primaryIndexB >= 0;
if (indexAPresent && indexBPresent) {
return primaryIndexA - primaryIndexB;
}
if (indexAPresent) {
// B is auto group column, so put B first
return 1;
}
if (indexBPresent) {
// A is auto group column, so put A first
return -1;
}
// otherwise both A and B are auto-group columns. so we just keep the order
// as they were already in.
var gridIndexA = _this.gridColumns.indexOf(colA);
var gridIndexB = _this.gridColumns.indexOf(colB);
return gridIndexA - gridIndexB;
});
};
ColumnController.prototype.isAutoRowHeightActive = function () {
return this.autoRowHeightColumns && this.autoRowHeightColumns.length > 0;
};
ColumnController.prototype.getAllAutoRowHeightCols = function () {
return this.autoRowHeightColumns;
};
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 columns = [];
while (currentColumn != null) {
columns.push(currentColumn);
currentColumn = this.getDisplayedColAfter(currentColumn);
}
return columns;
};
// 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 (this.displayedCenterColumns == null) {
return;
}
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__WEBPACK_IMPORTED_MODULE_2__["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 && this.gridOptionsWrapper.isTreeData()) {
console.warn("ag-Grid: Pivot mode not available in conjunction Tree Data i.e. 'gridOptions.treeData: true'");
return false;
}
return true;
};
ColumnController.prototype.setPivotMode = function (pivotMode, source) {
if (source === void 0) { source = 'api'; }
if (pivotMode === this.pivotMode || !this.isPivotSettingAllowed(this.pivotMode)) {
return;
}
this.pivotMode = pivotMode;
// we need to update grid columns to cover the scenario where user has groupSuppressAutoColumn=true, as
// this means we don't use auto group column UNLESS we are in pivot mode (it's mandatory in pivot mode),
// so need to updateGridColumn() to check it autoGroupCol needs to be added / removed
this.autoGroupsNeedBuilding = true;
this.updateGridColumns();
this.updateDisplayedColumns(source);
var event = {
type: _events__WEBPACK_IMPORTED_MODULE_2__["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 || !this.secondaryColumns) {
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 = Object(_utils_array__WEBPACK_IMPORTED_MODULE_8__["areEqual"])(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 ? Object(_utils_array__WEBPACK_IMPORTED_MODULE_8__["last"])(this.displayedRightColumns) : null;
}
else {
lastLeft = this.displayedLeftColumns ? Object(_utils_array__WEBPACK_IMPORTED_MODULE_8__["last"])(this.displayedLeftColumns) : 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, skipHeader, 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 the visible columns until
// no more cols are available (rendered) to be resized
var _this = this;
if (source === void 0) { source = "api"; }
// we autosize after animation frames finish in case any cell renderers need to complete first. this can
// happen eg if client code is calling api.autoSizeAllColumns() straight after grid is initialised, but grid
// hasn't fully drawn out all the cells yet (due to cell renderers in animation frames).
this.animationFrameService.flushAllFrames();
// keep track of which cols we have resized in here
var columnsAutosized = [];
// initialise with anything except 0 so that while loop executes at least once
var changesThisTimeAround = -1;
if (skipHeader == null) {
skipHeader = this.gridOptionsWrapper.isSkipHeaderOnAutoSize();
}
while (changesThisTimeAround !== 0) {
changesThisTimeAround = 0;
this.actionOnGridColumns(keys, function (column) {
// if already autosized, skip it
if (columnsAutosized.indexOf(column) >= 0) {
return false;
}
// get how wide this col should be
var preferredWidth = _this.autoWidthCalculator.getPreferredWidthForColumn(column, skipHeader);
// 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);
}
this.fireColumnResizedEvent(columnsAutosized, true, 'autosizeColumns');
};
ColumnController.prototype.fireColumnResizedEvent = function (columns, finished, source, flexColumns) {
if (flexColumns === void 0) { flexColumns = null; }
if (columns && columns.length) {
var event_2 = {
type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_RESIZED,
columns: columns,
column: columns.length === 1 ? columns[0] : null,
flexColumns: flexColumns,
finished: finished,
api: this.gridApi,
columnApi: this.columnApi,
source: source
};
this.eventService.dispatchEvent(event_2);
}
};
ColumnController.prototype.autoSizeColumn = function (key, skipHeader, source) {
if (source === void 0) { source = "api"; }
if (key) {
this.autoSizeColumns([key], skipHeader, source);
}
};
ColumnController.prototype.autoSizeAllColumns = function (skipHeader, source) {
if (source === void 0) { source = "api"; }
var allDisplayedColumns = this.getAllDisplayedColumns();
this.autoSizeColumns(allDisplayedColumns, skipHeader, source);
};
ColumnController.prototype.getColumnsFromTree = function (rootColumns) {
var result = [];
var recursiveFindColumns = function (childColumns) {
for (var i = 0; i < childColumns.length; i++) {
var child = childColumns[i];
if (child instanceof _entities_column__WEBPACK_IMPORTED_MODULE_1__["Column"]) {
result.push(child);
}
else if (child instanceof _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_4__["OriginalColumnGroup"]) {
recursiveFindColumns(child.getChildren());
}
}
};
recursiveFindColumns(rootColumns);
return result;
};
ColumnController.prototype.getAllDisplayedColumnGroups = function () {
if (this.displayedLeftColumnTree && this.displayedRightColumnTree && this.displayedCentreColumnTree) {
return this.displayedLeftColumnTree
.concat(this.displayedCentreColumnTree)
.concat(this.displayedRightColumnTree);
}
return null;
};
// + columnSelectPanel
ColumnController.prototype.getPrimaryColumnTree = function () {
return this.primaryColumnTree;
};
// + 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 _constants_constants__WEBPACK_IMPORTED_MODULE_7__["Constants"].PINNED_LEFT:
return this.getLeftDisplayedColumnGroups();
case _constants_constants__WEBPACK_IMPORTED_MODULE_7__["Constants"].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;
}
return this.getDisplayedColumnsForRow(rowNode, this.displayedLeftColumns);
};
ColumnController.prototype.getDisplayedRightColumnsForRow = function (rowNode) {
if (!this.colSpanActive) {
return this.displayedRightColumns;
}
return this.getDisplayedColumnsForRow(rowNode, this.displayedRightColumns);
};
ColumnController.prototype.getDisplayedColumnsForRow = function (rowNode, displayedColumns, filterCallback, emptySpaceBeforeColumn) {
var result = [];
var lastConsideredCol = null;
var _loop_1 = function (i) {
var col = displayedColumns[i];
var maxAllowedColSpan = displayedColumns.length - i;
var colSpan = Math.min(col.getColSpan(rowNode), maxAllowedColSpan);
var columnsToCheckFilter = [col];
if (colSpan > 1) {
var colsToRemove = colSpan - 1;
for (var j = 1; j <= colsToRemove; j++) {
columnsToCheckFilter.push(displayedColumns[i + j]);
}
i += colsToRemove;
}
// see which cols we should take out for column virtualisation
var filterPasses;
if (filterCallback) {
// if user provided a callback, means some columns may not be in the viewport.
// the user will NOT provide a callback if we are talking about pinned areas,
// as pinned areas have no horizontal scroll and do not virtualise the columns.
// if lots of columns, that means column spanning, and we set filterPasses = true
// if one or more of the columns spanned pass the filter.
filterPasses = false;
columnsToCheckFilter.forEach(function (colForFilter) {
if (filterCallback(colForFilter)) {
filterPasses = true;
}
});
}
else {
filterPasses = true;
}
if (filterPasses) {
if (result.length === 0 && lastConsideredCol) {
var gapBeforeColumn = emptySpaceBeforeColumn ? emptySpaceBeforeColumn(col) : false;
if (gapBeforeColumn) {
result.push(lastConsideredCol);
}
}
result.push(col);
}
lastConsideredCol = col;
out_i_1 = i;
};
var out_i_1;
for (var i = 0; i < displayedColumns.length; i++) {
_loop_1(i);
i = out_i_1;
}
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 emptySpaceBeforeColumn = function (col) { return col.getLeft() > _this.viewportLeft; };
// if doing column virtualisation, then we filter based on the viewport.
var filterCallback = this.suppressColumnVirtualisation ? null : this.isColumnInViewport.bind(this);
return this.getDisplayedColumnsForRow(rowNode, this.displayedCenterColumns, filterCallback, emptySpaceBeforeColumn);
};
ColumnController.prototype.getAriaColumnIndex = function (col) {
return this.getAllGridColumns().indexOf(col) + 1;
};
ColumnController.prototype.isColumnInViewport = function (col) {
var columnLeft = col.getLeft();
var columnRight = col.getLeft() + col.getActualWidth();
// adding 200 for buffer size, so some cols off viewport are rendered.
// this helps horizontal scrolling so user rarely sees white space (unless
// they scroll horizontally fast). however we are conservative, as the more
// buffer the slower the vertical redraw speed
var leftBounds = this.viewportLeft - 200;
var rightBounds = this.viewportRight + 200;
var columnToMuchLeft = columnLeft < leftBounds && columnRight < leftBounds;
var columnToMuchRight = columnLeft > rightBounds && columnRight > rightBounds;
return !columnToMuchLeft && !columnToMuchRight;
};
// used by:
// + angularGrid -> setting pinned body width
// note: this should be cached
ColumnController.prototype.getPinnedLeftContainerWidth = function () {
return this.getWidthOfColsInList(this.displayedLeftColumns);
};
// note: this should 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 (!keys || Object(_utils_generic__WEBPACK_IMPORTED_MODULE_9__["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;
}
Object(_utils_array__WEBPACK_IMPORTED_MODULE_8__["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__WEBPACK_IMPORTED_MODULE_2__["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 && !this.gridOptionsWrapper.isSuppressMakeColumnVisibleAfterUnGroup()) {
column.setVisible(true, source);
}
};
ColumnController.prototype.addRowGroupColumn = function (key, source) {
if (source === void 0) { source = "api"; }
if (key) {
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__WEBPACK_IMPORTED_MODULE_2__["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__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_ROW_GROUP_CHANGED, source);
};
ColumnController.prototype.removeRowGroupColumn = function (key, source) {
if (source === void 0) { source = "api"; }
if (key) {
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__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_PIVOT_CHANGED, source);
};
ColumnController.prototype.setPivotColumns = function (colKeys, source) {
if (source === void 0) { source = "api"; }
this.setPrimaryColumnList(colKeys, this.pivotColumns, _events__WEBPACK_IMPORTED_MODULE_2__["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__WEBPACK_IMPORTED_MODULE_2__["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 (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_9__["exists"])(colKeys)) {
colKeys.forEach(function (key) {
var column = _this.getPrimaryColumn(key);
if (column) {
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__WEBPACK_IMPORTED_MODULE_2__["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 initialAggFunc = this.aggFuncService.getDefaultAggFunc(column);
column.setAggFunc(initialAggFunc);
}
};
ColumnController.prototype.addValueColumns = function (keys, source) {
if (source === void 0) { source = "api"; }
this.updatePrimaryColumnList(keys, this.valueColumns, true, this.setValueActive.bind(this, true), _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_VALUE_CHANGED, source);
};
ColumnController.prototype.addValueColumn = function (colKey, source) {
if (source === void 0) { source = "api"; }
if (colKey) {
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__WEBPACK_IMPORTED_MODULE_2__["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);
return column || this.getGridColumn(key);
};
ColumnController.prototype.setColumnWidths = function (columnWidths, shiftKey, // @takeFromAdjacent - if user has 'shift' pressed, then pixels are taken from adjacent column
finished, // @finished - ends up in the event, tells the user if more events are to come
source) {
var _this = this;
if (source === void 0) { source = "api"; }
var sets = [];
columnWidths.forEach(function (columnWidth) {
var col = _this.getPrimaryOrGridColumn(columnWidth.key);
if (!col) {
return;
}
sets.push({
width: columnWidth.newWidth,
ratios: [1],
columns: [col]
});
// if user wants to do shift resize by default, then we invert the shift operation
var defaultIsShift = _this.gridOptionsWrapper.getColResizeDefault() === 'shift';
if (defaultIsShift) {
shiftKey = !shiftKey;
}
if (shiftKey) {
var otherCol = _this.getDisplayedColAfter(col);
if (!otherCol) {
return;
}
var widthDiff = col.getActualWidth() - columnWidth.newWidth;
var otherColWidth = otherCol.getActualWidth() + widthDiff;
sets.push({
width: otherColWidth,
ratios: [1],
columns: [otherCol]
});
}
});
if (sets.length === 0) {
return;
}
this.resizeColumnSets(sets, finished, source);
};
ColumnController.prototype.checkMinAndMaxWidthsForSet = function (columnResizeSet) {
var columns = columnResizeSet.columns, width = columnResizeSet.width;
// every col has a min width, so sum them all up and see if we have enough room
// for all the min widths
var minWidthAccumulated = 0;
var maxWidthAccumulated = 0;
var maxWidthActive = true;
columns.forEach(function (col) {
minWidthAccumulated += col.getMinWidth();
if (col.getMaxWidth() > 0) {
maxWidthAccumulated += col.getMaxWidth();
}
else {
// if at least one columns has no max width, it means the group of columns
// then has no max width, as at least one column can take as much width as possible
maxWidthActive = false;
}
});
var minWidthPasses = width >= minWidthAccumulated;
var maxWidthPasses = !maxWidthActive || (width <= maxWidthAccumulated);
return minWidthPasses && maxWidthPasses;
};
// method takes sets of columns and resizes them. either all sets will be resized, or nothing
// be resized. this is used for example when user tries to resize a group and holds shift key,
// then both the current group (grows), and the adjacent group (shrinks), will get resized,
// so that's two sets for this method.
ColumnController.prototype.resizeColumnSets = function (resizeSets, finished, source) {
var passMinMaxCheck = !resizeSets || resizeSets.every(this.checkMinAndMaxWidthsForSet.bind(this));
if (!passMinMaxCheck) {
// even though we are not going to resize beyond min/max size, we still need to raise event when finished
if (finished) {
var columns = resizeSets && resizeSets.length > 0 ? resizeSets[0].columns : null;
this.fireColumnResizedEvent(columns, finished, source);
}
return; // don't resize!
}
var changedCols = [];
var allResizedCols = [];
resizeSets.forEach(function (set) {
var width = set.width, columns = set.columns, ratios = set.ratios;
// keep track of pixels used, and last column gets the remaining,
// to cater for rounding errors, and min width adjustments
var newWidths = {};
var finishedCols = {};
columns.forEach(function (col) { return allResizedCols.push(col); });
// the loop below goes through each col. if a col exceeds it's min/max width,
// it then gets set to its min/max width and the column is removed marked as 'finished'
// and the calculation is done again leaving this column out. take for example columns
// {A, width: 50, maxWidth: 100}
// {B, width: 50}
// {C, width: 50}
// and then the set is set to width 600 - on the first pass the grid tries to set each column
// to 200. it checks A and sees 200 > 100 and so sets the width to 100. col A is then marked
// as 'finished' and the calculation is done again with the remaining cols B and C, which end up
// splitting the remaining 500 pixels.
var finishedColsGrew = true;
var loopCount = 0;
var _loop_2 = function () {
loopCount++;
if (loopCount > 1000) {
// this should never happen, but in the future, someone might introduce a bug here,
// so we stop the browser from hanging and report bug properly
console.error('ag-Grid: infinite loop in resizeColumnSets');
return "break";
}
finishedColsGrew = false;
var subsetCols = [];
var subsetRatios = [];
var subsetRatioTotal = 0;
var pixelsToDistribute = width;
columns.forEach(function (col, index) {
var thisColFinished = finishedCols[col.getId()];
if (thisColFinished) {
pixelsToDistribute -= newWidths[col.getId()];
}
else {
subsetCols.push(col);
var ratioThisCol = ratios[index];
subsetRatioTotal += ratioThisCol;
subsetRatios.push(ratioThisCol);
}
});
// because we are not using all of the ratios (cols can be missing),
// we scale the ratio. if all columns are included, then subsetRatioTotal=1,
// and so the ratioScale will be 1.
var ratioScale = 1 / subsetRatioTotal;
subsetCols.forEach(function (col, index) {
var lastCol = index === (subsetCols.length - 1);
var colNewWidth;
if (lastCol) {
colNewWidth = pixelsToDistribute;
}
else {
colNewWidth = Math.round(ratios[index] * width * ratioScale);
pixelsToDistribute -= colNewWidth;
}
if (colNewWidth < col.getMinWidth()) {
colNewWidth = col.getMinWidth();
finishedCols[col.getId()] = true;
finishedColsGrew = true;
}
else if (col.getMaxWidth() > 0 && colNewWidth > col.getMaxWidth()) {
colNewWidth = col.getMaxWidth();
finishedCols[col.getId()] = true;
finishedColsGrew = true;
}
newWidths[col.getId()] = colNewWidth;
});
};
while (finishedColsGrew) {
var state_1 = _loop_2();
if (state_1 === "break")
break;
}
columns.forEach(function (col) {
var newWidth = newWidths[col.getId()];
if (col.getActualWidth() !== newWidth) {
col.setActualWidth(newWidth, source);
changedCols.push(col);
}
});
});
// if no cols changed, then no need to update more or send event.
var atLeastOneColChanged = changedCols.length > 0;
var flexedCols = this.refreshFlexedColumns({ resizingCols: allResizedCols, skipSetLeft: true });
if (atLeastOneColChanged) {
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.
var colsForEvent = allResizedCols.concat(flexedCols);
if (atLeastOneColChanged || finished) {
this.fireColumnResizedEvent(colsForEvent, finished, source, flexedCols);
}
};
ColumnController.prototype.setColumnAggFunc = function (key, aggFunc, source) {
if (source === void 0) { source = "api"; }
if (!key) {
return;
}
var column = this.getPrimaryColumn(key);
if (!column) {
return;
}
column.setAggFunc(aggFunc);
var event = {
type: _events__WEBPACK_IMPORTED_MODULE_2__["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__WEBPACK_IMPORTED_MODULE_2__["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;
}
Object(_utils_array__WEBPACK_IMPORTED_MODULE_8__["moveInArray"])(this.gridColumns, columnsToMove, toIndex);
this.updateDisplayedColumns(source);
var event = {
type: _events__WEBPACK_IMPORTED_MODULE_2__["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();
Object(_utils_array__WEBPACK_IMPORTED_MODULE_8__["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;
};
// returns the provided cols sorted in same order as they appear in grid columns. eg if grid columns
// contains [a,b,c,d,e] and col passed is [e,a] then the passed cols are sorted into [a,e]
ColumnController.prototype.sortColumnsLikeGridColumns = function (cols) {
var _this = this;
if (!cols || cols.length <= 1) {
return;
}
var notAllColsInGridColumns = cols.filter(function (c) { return _this.gridColumns.indexOf(c) < 0; }).length > 0;
if (notAllColsInGridColumns) {
return;
}
cols.sort(function (a, b) {
var indexA = _this.gridColumns.indexOf(a);
var indexB = _this.gridColumns.indexOf(b);
return indexA - indexB;
});
};
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.getColDef().lockPosition) {
if (foundNonLocked) {
rulePassed = false;
}
}
else {
foundNonLocked = true;
}
});
return rulePassed;
};
ColumnController.prototype.doesMovePassMarryChildren = function (allColumnsCopy) {
var rulePassed = true;
this.columnUtils.depthFirstOriginalTreeSearch(null, this.gridBalancedTree, function (child) {
if (!(child instanceof _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_4__["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);
};
ColumnController.prototype.getColumnDefs = function () {
var _this = this;
var cols = this.primaryColumns.slice();
if (this.gridColsArePrimary) {
cols.sort(function (a, b) { return _this.gridColumns.indexOf(a) - _this.gridColumns.indexOf(b); });
}
else if (this.lastPrimaryOrder) {
cols.sort(function (a, b) { return _this.lastPrimaryOrder.indexOf(a) - _this.lastPrimaryOrder.indexOf(b); });
}
return this.columnDefFactory.buildColumnDefs(cols, this.rowGroupColumns, this.pivotColumns);
};
// 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 _constants_constants__WEBPACK_IMPORTED_MODULE_7__["Constants"].PINNED_LEFT:
return this.leftWidth;
case _constants_constants__WEBPACK_IMPORTED_MODULE_7__["Constants"].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_3 = {
type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,
api: this.gridApi,
columnApi: this.columnApi
};
this.eventService.dispatchEvent(event_3);
}
};
// + rowController
ColumnController.prototype.getValueColumns = function () {
return this.valueColumns ? this.valueColumns : [];
};
// + rowController
ColumnController.prototype.getPivotColumns = function () {
return this.pivotColumns ? this.pivotColumns : [];
};
// + clientSideRowModel
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 _constants_constants__WEBPACK_IMPORTED_MODULE_7__["Constants"].PINNED_LEFT:
return this.getDisplayedLeftColumns();
case _constants_constants__WEBPACK_IMPORTED_MODULE_7__["Constants"].PINNED_RIGHT:
return this.getDisplayedRightColumns();
default:
return this.getDisplayedCenterColumns();
}
};
// used by:
// + clientSideRowController -> sorting, building quick filter text
// + headerRenderer -> sorting (clearing icon)
ColumnController.prototype.getAllPrimaryColumns = function () {
return this.primaryColumns ? this.primaryColumns.slice() : null;
};
ColumnController.prototype.getSecondaryColumns = function () {
return this.secondaryColumns ? this.secondaryColumns.slice() : null;
};
ColumnController.prototype.getAllColumnsForQuickFilter = function () {
return this.columnsForQuickFilter;
};
// + moveColumnController
ColumnController.prototype.getAllGridColumns = function () {
return this.gridColumns;
};
ColumnController.prototype.isEmpty = function () {
return Object(_utils_generic__WEBPACK_IMPORTED_MODULE_9__["missingOrEmpty"])(this.gridColumns);
};
ColumnController.prototype.isRowGroupEmpty = function () {
return Object(_utils_generic__WEBPACK_IMPORTED_MODULE_9__["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;
}
return false;
}, source, function () {
var event = {
type: _events__WEBPACK_IMPORTED_MODULE_2__["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"; }
if (key) {
this.setColumnsPinned([key], pinned, source);
}
};
ColumnController.prototype.setColumnsPinned = function (keys, pinned, source) {
var _this = this;
if (source === void 0) { source = "api"; }
if (this.gridOptionsWrapper.getDomLayout() === 'print') {
console.warn("Changing the column pinning status is not allowed with domLayout='print'");
return;
}
this.columnAnimationService.start();
var actualPinned;
if (pinned === true || pinned === _constants_constants__WEBPACK_IMPORTED_MODULE_7__["Constants"].PINNED_LEFT) {
actualPinned = _constants_constants__WEBPACK_IMPORTED_MODULE_7__["Constants"].PINNED_LEFT;
}
else if (pinned === _constants_constants__WEBPACK_IMPORTED_MODULE_7__["Constants"].PINNED_RIGHT) {
actualPinned = _constants_constants__WEBPACK_IMPORTED_MODULE_7__["Constants"].PINNED_RIGHT;
}
else {
actualPinned = null;
}
this.actionOnGridColumns(keys, function (col) {
if (col.getPinned() !== actualPinned) {
col.setPinned(actualPinned);
return true;
}
return false;
}, source, function () {
var event = {
type: _events__WEBPACK_IMPORTED_MODULE_2__["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 (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_9__["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) {
return;
}
this.updateDisplayedColumns(source);
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_9__["exists"])(createEvent) && createEvent) {
var event_4 = createEvent();
event_4.columns = updatedColumns;
event_4.column = updatedColumns.length === 1 ? updatedColumns[0] : null;
this.eventService.dispatchEvent(event_4);
}
};
ColumnController.prototype.getDisplayedColBefore = function (col) {
var allDisplayedColumns = this.getAllDisplayedColumns();
var oldIndex = allDisplayedColumns.indexOf(col);
if (oldIndex > 0) {
return allDisplayedColumns[oldIndex - 1];
}
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];
}
return null;
};
ColumnController.prototype.getDisplayedGroupAfter = function (columnGroup) {
return this.getDisplayedGroupAtDirection(columnGroup, 'After');
};
ColumnController.prototype.getDisplayedGroupBefore = function (columnGroup) {
return this.getDisplayedGroupAtDirection(columnGroup, 'Before');
};
ColumnController.prototype.getDisplayedGroupAtDirection = function (columnGroup, direction) {
// pick the last displayed column in this group
var requiredLevel = columnGroup.getOriginalColumnGroup().getLevel() + columnGroup.getPaddingLevel();
var colGroupLeafColumns = columnGroup.getDisplayedLeafColumns();
var col = direction === 'After' ? Object(_utils_array__WEBPACK_IMPORTED_MODULE_8__["last"])(colGroupLeafColumns) : colGroupLeafColumns[0];
var getDisplayColMethod = "getDisplayedCol" + direction;
while (true) {
// keep moving to the next col, until we get to another group
var column = this[getDisplayColMethod](col);
if (!column) {
return null;
}
var groupPointer = this.getColumnGroupAtLevel(column, requiredLevel);
if (groupPointer !== columnGroup) {
return groupPointer;
}
}
};
ColumnController.prototype.getColumnGroupAtLevel = function (column, level) {
// get group at same level as the one we are looking for
var groupPointer = column.getParent();
var originalGroupLevel;
var groupPointerLevel;
while (true) {
var groupPointerOriginalColumnGroup = groupPointer.getOriginalColumnGroup();
originalGroupLevel = groupPointerOriginalColumnGroup.getLevel();
groupPointerLevel = groupPointer.getPaddingLevel();
if (originalGroupLevel + groupPointerLevel <= level) {
break;
}
groupPointer = groupPointer.getParent();
}
return groupPointer;
};
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 (this.groupAutoColumns && Object(_utils_generic__WEBPACK_IMPORTED_MODULE_9__["exists"])(this.groupAutoColumns)) {
this.groupAutoColumns.forEach(function (col) { return result.push(col); });
}
if (this.secondaryColumnsPresent && this.secondaryColumns) {
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 sort = column.getSort() != null ? column.getSort() : null;
var sortIndex = column.getSortIndex() != null ? column.getSortIndex() : null;
var flex = column.getFlex() != null && column.getFlex() > 0 ? column.getFlex() : null;
var res = {
colId: column.getColId(),
width: column.getActualWidth(),
hide: !column.isVisible(),
pinned: column.getPinned(),
sort: sort,
sortIndex: sortIndex,
aggFunc: aggFunc,
rowGroup: column.isRowGroupActive(),
rowGroupIndex: rowGroupIndex,
pivot: column.isPivotActive(),
pivotIndex: pivotIndex,
flex: flex
};
return res;
};
ColumnController.prototype.getColumnState = function () {
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_9__["missing"])(this.primaryColumns) || !this.isAlive()) {
return [];
}
var primaryColumnState = this.primaryColumns.map(this.createStateItemFromColumn.bind(this));
var groupAutoColumnState = this.groupAutoColumns
// if groupAutoCols, then include them
? this.groupAutoColumns.map(this.createStateItemFromColumn.bind(this))
// otherwise no
: [];
var columnStateList = groupAutoColumnState.concat(primaryColumnState);
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 (suppressEverythingEvent, source) {
// NOTE = there is one bug here that no customer has noticed - if a column has colDef.lockPosition,
// this is ignored below when ordering the cols. to work, we should always put lockPosition cols first.
// As a work around, developers should just put lockPosition columns first in their colDef list.
if (suppressEverythingEvent === void 0) { suppressEverythingEvent = false; }
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.primaryColumnTree);
var columnStates = [];
// we start at 1000, so if user has mix of rowGroup and group specified, it will work with both.
// eg IF user has ColA.rowGroupIndex=0, ColB.rowGroupIndex=1, ColC.rowGroup=true,
// THEN result will be ColA.rowGroupIndex=0, ColB.rowGroupIndex=1, ColC.rowGroup=1000
var letRowGroupIndex = 1000;
var letPivotIndex = 1000;
var colsToProcess = [];
if (this.groupAutoColumns) {
colsToProcess = colsToProcess.concat(this.groupAutoColumns);
}
if (primaryColumns) {
colsToProcess = colsToProcess.concat(primaryColumns);
}
colsToProcess.forEach(function (column) {
var colDef = column.getColDef();
var sort = colDef.sort != null ? colDef.sort : null;
var sortIndex = colDef.sortIndex;
var hide = colDef.hide ? true : false;
var pinned = colDef.pinned ? colDef.pinned : null;
var width = colDef.width;
var flex = colDef.flex != null ? colDef.flex : null;
var rowGroupIndex = colDef.rowGroupIndex;
var rowGroup = colDef.rowGroup;
if (rowGroupIndex == null && (rowGroup == null || rowGroup == false)) {
rowGroupIndex = null;
rowGroup = null;
}
var pivotIndex = colDef.pivotIndex;
var pivot = colDef.pivot;
if (pivotIndex == null && (pivot == null || pivot == false)) {
pivotIndex = null;
pivot = null;
}
var aggFunc = colDef.aggFunc != null ? colDef.aggFunc : null;
var stateItem = {
colId: column.getColId(),
sort: sort,
sortIndex: sortIndex,
hide: hide,
pinned: pinned,
width: width,
flex: flex,
rowGroup: rowGroup,
rowGroupIndex: rowGroupIndex,
pivot: pivot,
pivotIndex: pivotIndex,
aggFunc: aggFunc,
};
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_9__["missing"])(rowGroupIndex) && rowGroup) {
stateItem.rowGroupIndex = letRowGroupIndex++;
}
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_9__["missing"])(pivotIndex) && pivot) {
stateItem.pivotIndex = letPivotIndex++;
}
columnStates.push(stateItem);
});
this.applyColumnState({ state: columnStates, applyOrder: true }, source);
};
ColumnController.prototype.applyColumnState = function (params, source) {
var _this = this;
if (source === void 0) { source = "api"; }
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_9__["missingOrEmpty"])(this.primaryColumns)) {
return false;
}
if (params && params.state && !params.state.forEach) {
console.warn('ag-Grid: applyColumnState() - the state attribute should be an array, however an array was not found. Please provide an array of items (one for each col you want to change) for state.');
return;
}
this.columnAnimationService.start();
var raiseEventsFunc = this.compareColumnStatesAndRaiseEvents(source);
this.autoGroupsNeedBuilding = true;
// at the end below, this list will have all columns we got no state for
var columnsWithNoState = this.primaryColumns.slice();
var success = true;
var rowGroupIndexes = {};
var pivotIndexes = {};
var autoGroupColumnStates = [];
var previousRowGroupCols = this.rowGroupColumns.slice();
var previousPivotCols = this.pivotColumns.slice();
if (params.state) {
params.state.forEach(function (state) {
var groupAutoColumnId = _constants_constants__WEBPACK_IMPORTED_MODULE_7__["Constants"].GROUP_AUTO_COLUMN_ID;
var colId = state.colId;
// auto group columns are re-created so deferring syncing with ColumnState
var isAutoGroupColumn = Object(_utils_string__WEBPACK_IMPORTED_MODULE_10__["startsWith"])(colId, groupAutoColumnId);
if (isAutoGroupColumn) {
autoGroupColumnStates.push(state);
return;
}
var column = _this.getPrimaryColumn(colId);
if (!column) {
// we don't log the failure, as it's possible the user is applying that has extra
// cols in it. for example they could of save while row-grouping (so state includes
// auto-group column) and then applied state when not grouping (so the auto-group
// column would be in the state but no used).
success = false;
}
else {
_this.syncColumnWithStateItem(column, state, params.defaultState, rowGroupIndexes, pivotIndexes, false, source);
Object(_utils_array__WEBPACK_IMPORTED_MODULE_8__["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(function (col) {
_this.syncColumnWithStateItem(col, null, params.defaultState, rowGroupIndexes, pivotIndexes, false, source);
});
// sort the lists according to the indexes that were provided
var comparator = function (indexes, oldList, colA, colB) {
var indexA = indexes[colA.getId()];
var indexB = indexes[colB.getId()];
var aHasIndex = indexA != null;
var bHasIndex = indexB != null;
if (aHasIndex && bHasIndex) {
// both a and b are new cols with index, so sort on index
return indexA - indexB;
}
else if (aHasIndex) {
// a has an index, so it should be before a
return -1;
}
else if (bHasIndex) {
// b has an index, so it should be before a
return 1;
}
else {
var oldIndexA = oldList.indexOf(colA);
var oldIndexB = oldList.indexOf(colB);
var aHasOldIndex = oldIndexA >= 0;
var bHasOldIndex = oldIndexB >= 0;
if (aHasOldIndex && bHasOldIndex) {
// both a and b are old cols, so sort based on last order
return oldIndexA - oldIndexB;
}
else if (aHasOldIndex) {
// a is old, b is new, so b is first
return -1;
}
else if (bHasOldIndex) {
// b is old, a is new, a is first
return 1;
}
else {
// this bit does matter, means both are new cols but without index
return 1;
}
}
};
this.rowGroupColumns.sort(comparator.bind(this, rowGroupIndexes, previousRowGroupCols));
this.pivotColumns.sort(comparator.bind(this, pivotIndexes, previousPivotCols));
this.updateGridColumns();
// sync newly created auto group columns with ColumnState
autoGroupColumnStates.forEach(function (stateItem) {
var autoCol = _this.getAutoColumn(stateItem.colId);
_this.syncColumnWithStateItem(autoCol, stateItem, params.defaultState, null, null, true, source);
});
if (this.gridColsArePrimary && params.applyOrder && params.state) {
var orderOfColIds_1 = params.state.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 is already done in updateGridColumns, however we changed the order above (to match the order of the state
// columns) so we need to do it again. we could of put logic into the order above to take into account fixed
// columns, however if we did then we would have logic for updating fixed columns twice. reusing the logic here
// is less sexy for the code here, but it keeps consistency.
this.putFixedColumnsFirst();
}
this.updateDisplayedColumns(source);
this.dispatchEverythingChanged(source);
raiseEventsFunc();
this.columnAnimationService.finish();
return success;
};
ColumnController.prototype.compareColumnStatesAndRaiseEvents = function (source) {
var _this = this;
// if no columns to begin with, then it means we are setting columns for the first time, so
// there should be no events fired to show differences in columns.
var colsPreviouslyExisted = !!this.columnDefs;
if (!colsPreviouslyExisted) {
return function () { };
}
var startState = {
rowGroupColumns: this.rowGroupColumns.slice(),
pivotColumns: this.pivotColumns.slice(),
valueColumns: this.valueColumns.slice()
};
var columnStateBefore = this.getColumnState();
var columnStateBeforeMap = {};
columnStateBefore.forEach(function (col) {
columnStateBeforeMap[col.colId] = col;
});
return function () {
if (_this.gridOptionsWrapper.isSuppressColumnStateEvents()) {
return;
}
// raises generic ColumnEvents where all columns are returned rather than what has changed
var raiseWhenListsDifferent = function (eventType, colsBefore, colsAfter, idMapper) {
var beforeList = colsBefore.map(idMapper).sort();
var afterList = colsAfter.map(idMapper).sort();
var unchanged = Object(_utils_array__WEBPACK_IMPORTED_MODULE_8__["areEqual"])(beforeList, afterList);
if (unchanged) {
return;
}
// returning all columns rather than what has changed!
var event = {
type: eventType,
columns: colsAfter,
column: colsAfter.length === 1 ? colsAfter[0] : null,
api: _this.gridApi,
columnApi: _this.columnApi,
source: source
};
_this.eventService.dispatchEvent(event);
};
// determines which columns have changed according to supplied predicate
var getChangedColumns = function (changedPredicate) {
var changedColumns = [];
_this.gridColumns.forEach(function (column) {
var colStateBefore = columnStateBeforeMap[column.getColId()];
if (colStateBefore && changedPredicate(colStateBefore, column)) {
changedColumns.push(column);
}
});
return changedColumns;
};
var columnIdMapper = function (c) { return c.getColId(); };
raiseWhenListsDifferent(_events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_ROW_GROUP_CHANGED, startState.rowGroupColumns, _this.rowGroupColumns, columnIdMapper);
raiseWhenListsDifferent(_events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_PIVOT_CHANGED, startState.pivotColumns, _this.pivotColumns, columnIdMapper);
raiseWhenListsDifferent(_events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_VALUE_CHANGED, startState.valueColumns, _this.valueColumns, columnIdMapper);
var resizeChangePredicate = function (cs, c) { return cs.width != c.getActualWidth(); };
_this.fireColumnResizedEvent(getChangedColumns(resizeChangePredicate), true, source);
var pinnedChangePredicate = function (cs, c) { return cs.pinned != c.getPinned(); };
_this.raiseColumnPinnedEvent(getChangedColumns(pinnedChangePredicate), source);
var visibilityChangePredicate = function (cs, c) { return cs.hide == c.isVisible(); };
_this.raiseColumnVisibleEvent(getChangedColumns(visibilityChangePredicate), source);
var sortChangePredicate = function (cs, c) { return cs.sort != c.getSort() || cs.sortIndex != c.getSortIndex(); };
if (getChangedColumns(sortChangePredicate).length > 0) {
_this.sortController.dispatchSortChangedEvents();
}
// special handling for moved column events
_this.raiseColumnMovedEvent(columnStateBefore, source);
};
};
ColumnController.prototype.raiseColumnPinnedEvent = function (changedColumns, source) {
if (!changedColumns.length) {
return;
}
var event = {
type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_PINNED,
pinned: null,
columns: changedColumns,
column: null,
api: this.gridApi,
columnApi: this.columnApi,
source: source
};
this.eventService.dispatchEvent(event);
};
ColumnController.prototype.raiseColumnVisibleEvent = function (changedColumns, source) {
if (!changedColumns.length) {
return;
}
var event = {
type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_VISIBLE,
visible: undefined,
columns: changedColumns,
column: null,
api: this.gridApi,
columnApi: this.columnApi,
source: source
};
this.eventService.dispatchEvent(event);
};
ColumnController.prototype.raiseColumnMovedEvent = function (colStateBefore, source) {
// we are only interested in columns that were both present and visible before and after
var _this = this;
var colStateAfter = this.getColumnState();
var colStateAfterMapped = {};
colStateAfter.forEach(function (s) { return colStateAfterMapped[s.colId] = s; });
// get id's of cols in both before and after lists
var colsIntersectIds = {};
colStateBefore.forEach(function (s) {
if (colStateAfterMapped[s.colId]) {
colsIntersectIds[s.colId] = true;
}
});
// filter state lists, so we only have cols that were present before and after
var beforeFiltered = Object(_utils_array__WEBPACK_IMPORTED_MODULE_8__["filter"])(colStateBefore, function (c) { return colsIntersectIds[c.colId]; });
var afterFiltered = Object(_utils_array__WEBPACK_IMPORTED_MODULE_8__["filter"])(colStateAfter, function (c) { return colsIntersectIds[c.colId]; });
// see if any cols are in a different location
var movedColumns = [];
afterFiltered.forEach(function (csAfter, index) {
var csBefore = beforeFiltered[index];
if (csBefore.colId !== csAfter.colId) {
movedColumns.push(_this.getGridColumn(csBefore.colId));
}
});
if (!movedColumns.length) {
return;
}
var event = {
type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_MOVED,
columns: movedColumns,
column: null,
toIndex: undefined,
api: this.gridApi,
columnApi: this.columnApi,
source: source
};
this.eventService.dispatchEvent(event);
};
ColumnController.prototype.syncColumnWithStateItem = function (column, stateItem, defaultState, rowGroupIndexes, pivotIndexes, autoCol, source) {
if (!column) {
return;
}
var getValue = function (key1, key2) {
var stateAny = stateItem;
var defaultAny = defaultState;
if (stateAny && (stateAny[key1] !== undefined || stateAny[key2] !== undefined)) {
return { value1: stateAny[key1], value2: stateAny[key2] };
}
else if (defaultAny && (defaultAny[key1] !== undefined || defaultAny[key2] !== undefined)) {
return { value1: defaultAny[key1], value2: defaultAny[key2] };
}
else {
return { value1: undefined, value2: undefined };
}
};
// following ensures we are left with boolean true or false, eg converts (null, undefined, 0) all to true
var hide = getValue('hide').value1;
if (hide !== undefined) {
column.setVisible(!hide, source);
}
// sets pinned to 'left' or 'right'
var pinned = getValue('pinned').value1;
if (pinned !== undefined) {
column.setPinned(pinned);
}
// if width provided and valid, use it, otherwise stick with the old width
var minColWidth = this.gridOptionsWrapper.getMinColWidth();
// flex
var flex = getValue('flex').value1;
if (flex !== undefined) {
column.setFlex(flex);
}
// width - we only set width if column is not flexing
var noFlexThisCol = column.getFlex() <= 0;
if (noFlexThisCol) {
// both null and undefined means we skip, as it's not possible to 'clear' width (a column must have a width)
var width = getValue('width').value1;
if (width != null) {
if (minColWidth &&
(width >= minColWidth)) {
column.setActualWidth(width, source);
}
}
}
var sort = getValue('sort').value1;
if (sort !== undefined) {
if (sort === _constants_constants__WEBPACK_IMPORTED_MODULE_7__["Constants"].SORT_DESC || sort === _constants_constants__WEBPACK_IMPORTED_MODULE_7__["Constants"].SORT_ASC) {
column.setSort(sort);
}
else {
column.setSort(undefined);
}
}
var sortIndex = getValue('sortIndex').value1;
if (sortIndex !== undefined) {
column.setSortIndex(sortIndex);
}
// we do not do aggFunc, rowGroup or pivot for auto cols, as you can't do these with auto col
if (autoCol) {
return;
}
var aggFunc = getValue('aggFunc').value1;
if (aggFunc !== undefined) {
if (typeof aggFunc === 'string') {
column.setAggFunc(aggFunc);
if (!column.isValueActive()) {
column.setValueActive(true, source);
this.valueColumns.push(column);
}
}
else {
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_9__["exists"])(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);
if (column.isValueActive()) {
column.setValueActive(false, source);
Object(_utils_array__WEBPACK_IMPORTED_MODULE_8__["removeFromArray"])(this.valueColumns, column);
}
}
}
var _a = getValue('rowGroup', 'rowGroupIndex'), rowGroup = _a.value1, rowGroupIndex = _a.value2;
if (rowGroup !== undefined || rowGroupIndex !== undefined) {
if (typeof rowGroupIndex === 'number' || rowGroup) {
if (!column.isRowGroupActive()) {
column.setRowGroupActive(true, source);
this.rowGroupColumns.push(column);
}
if (typeof rowGroupIndex === 'number') {
rowGroupIndexes[column.getId()] = rowGroupIndex;
}
}
else {
if (column.isRowGroupActive()) {
column.setRowGroupActive(false, source);
Object(_utils_array__WEBPACK_IMPORTED_MODULE_8__["removeFromArray"])(this.rowGroupColumns, column);
}
}
}
var _b = getValue('pivot', 'pivotIndex'), pivot = _b.value1, pivotIndex = _b.value2;
if (pivot !== undefined || pivotIndex !== undefined) {
if (typeof pivotIndex === 'number' || pivot) {
if (!column.isPivotActive()) {
column.setPivotActive(true, source);
this.pivotColumns.push(column);
}
if (typeof pivotIndex === 'number') {
pivotIndexes[column.getId()] = pivotIndex;
}
}
else {
if (column.isPivotActive()) {
column.setPivotActive(false, source);
Object(_utils_array__WEBPACK_IMPORTED_MODULE_8__["removeFromArray"])(this.pivotColumns, column);
}
}
}
};
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) {
if (key == null) {
return null;
}
var column = this.getGridColumn(key);
if (!column) {
console.warn('ag-Grid: could not find column ' + key);
}
return column;
};
ColumnController.prototype.getPrimaryColumn = function (key) {
return this.getColumn(key, this.primaryColumns, this.primaryColumnsMap);
};
ColumnController.prototype.getGridColumn = function (key) {
return this.getColumn(key, this.gridColumns, this.gridColumnsMap);
};
ColumnController.prototype.getColumn = function (key, columnList, columnMap) {
if (!key) {
return null;
}
// most of the time this method gets called the key is a string, so we put this shortcut in
// for performance reasons, to see if we can match for ID (it doesn't do auto columns, that's done below)
if (typeof key == 'string' && columnMap[key]) {
return columnMap[key];
}
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 (!this.groupAutoColumns ||
!Object(_utils_generic__WEBPACK_IMPORTED_MODULE_9__["exists"])(this.groupAutoColumns) ||
Object(_utils_generic__WEBPACK_IMPORTED_MODULE_9__["missing"])(this.groupAutoColumns)) {
return null;
}
return Object(_utils_generic__WEBPACK_IMPORTED_MODULE_9__["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; }
if (!column) {
return null;
}
var headerName = this.getHeaderName(column.getColDef(), column, null, null, location);
if (includeAggFunc) {
return this.wrapHeaderNameWithAggFunc(column, headerName);
}
return headerName;
};
ColumnController.prototype.getDisplayNameForOriginalColumnGroup = function (columnGroup, originalColumnGroup, location) {
var colGroupDef = originalColumnGroup ? originalColumnGroup.getColGroupDef() : null;
if (colGroupDef) {
return this.getHeaderName(colGroupDef, null, columnGroup, originalColumnGroup, location);
}
return null;
};
ColumnController.prototype.getDisplayNameForColumnGroup = function (columnGroup, location) {
return this.getDisplayNameForOriginalColumnGroup(columnGroup, columnGroup.getOriginalColumnGroup(), location);
};
// location is where the column is going to appear, ie who is calling us
ColumnController.prototype.getHeaderName = function (colDef, column, columnGroup, originalColumnGroup, location) {
var headerValueGetter = colDef.headerValueGetter;
if (headerValueGetter) {
var params = {
colDef: colDef,
column: column,
columnGroup: columnGroup,
originalColumnGroup: originalColumnGroup,
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);
}
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 Object(_utils_string__WEBPACK_IMPORTED_MODULE_10__["camelCaseToHumanText"])(colDef.field);
}
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 = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_9__["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 ? pivotValueColumn.getAggFunc() : null;
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 + ")";
}
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 _entities_columnGroup__WEBPACK_IMPORTED_MODULE_0__["ColumnGroup"]) {
return colId;
}
var allColumnGroups = this.getAllDisplayedColumnGroups();
var checkInstanceId = typeof instanceId === 'number';
var result = null;
this.columnUtils.depthFirstAllColumnTreeSearch(allColumnGroups, function (child) {
if (child instanceof _entities_columnGroup__WEBPACK_IMPORTED_MODULE_0__["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.isReady = function () {
return this.ready;
};
ColumnController.prototype.extractValueColumns = function (source, oldPrimaryColumns) {
this.valueColumns = this.extractColumns(oldPrimaryColumns, this.valueColumns, function (col, flag) { return col.setValueActive(flag, source); },
// aggFunc doesn't have index variant, cos order of value cols doesn't matter, so always return null
function () { return undefined; }, function () { return undefined; },
// aggFunc is a string, so return it's existence
function (colDef) {
var aggFunc = colDef.aggFunc;
// null or empty string means clear
if (aggFunc === null || aggFunc === '') {
return null;
}
else if (aggFunc === undefined) {
return undefined;
}
else {
return aggFunc != '';
}
}, function (colDef) {
// return false if any of the following: null, undefined, empty string
return colDef.initialAggFunc != null && colDef.initialAggFunc != '';
});
// all new columns added will have aggFunc missing, so set it to what is in the colDef
this.valueColumns.forEach(function (col) {
var colDef = col.getColDef();
// if aggFunc provided, we always override, as reactive property
if (colDef.aggFunc != null && colDef.aggFunc != '') {
col.setAggFunc(colDef.aggFunc);
}
else {
// otherwise we use initialAggFunc only if no agg func set - which happens when new column only
if (!col.getAggFunc()) {
col.setAggFunc(colDef.initialAggFunc);
}
}
});
};
ColumnController.prototype.extractRowGroupColumns = function (source, oldPrimaryColumns) {
this.rowGroupColumns = this.extractColumns(oldPrimaryColumns, this.rowGroupColumns, function (col, flag) { return col.setRowGroupActive(flag, source); }, function (colDef) { return colDef.rowGroupIndex; }, function (colDef) { return colDef.initialRowGroupIndex; }, function (colDef) { return colDef.rowGroup; }, function (colDef) { return colDef.initialRowGroup; });
};
ColumnController.prototype.extractColumns = function (oldPrimaryColumns, previousCols, setFlagFunc, getIndexFunc, getInitialIndexFunc, getValueFunc, getInitialValueFunc) {
if (oldPrimaryColumns === void 0) { oldPrimaryColumns = []; }
if (previousCols === void 0) { previousCols = []; }
var colsWithIndex = [];
var colsWithValue = [];
// go though all cols.
// if value, change
// if default only, change only if new
this.primaryColumns.forEach(function (col) {
var colIsNew = oldPrimaryColumns.indexOf(col) < 0;
var colDef = col.getColDef();
var value = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_9__["attrToBoolean"])(getValueFunc(colDef));
var initialValue = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_9__["attrToBoolean"])(getInitialValueFunc(colDef));
var index = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_9__["attrToNumber"])(getIndexFunc(colDef));
var initialIndex = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_9__["attrToNumber"])(getInitialIndexFunc(colDef));
var include;
if (colIsNew) {
// col is new, use values if present, otherwise use default values if present
var valuePresent = value !== undefined || index !== undefined;
if (valuePresent) {
if (value !== undefined) {
// if boolean value present, we take it's value, even if 'false'
include = value;
}
else {
// otherwise we based on number value. note that 'null' resets, however 'undefined' doesn't
// go through this code path (undefined means 'ignore').
include = index >= 0;
}
}
else {
include = initialValue == true || initialIndex >= 0;
}
}
else {
// col is not new, we ignore the default values, just use the values if provided
if (value !== undefined) { // value is never null, as attrToBoolean converts null to false
include = value;
}
else if (index !== undefined) {
if (index === null) {
include = false;
}
else {
include = index >= 0;
}
}
else {
// no values provided, we include if it was included last time
include = previousCols.indexOf(col) >= 0;
}
}
if (include) {
var useIndex = colIsNew ? (index != null || initialIndex != null) : index != null;
if (useIndex) {
colsWithIndex.push(col);
}
else {
colsWithValue.push(col);
}
}
});
var getIndexForCol = function (col) {
var index = getIndexFunc(col.getColDef());
var defaultIndex = getInitialIndexFunc(col.getColDef());
return index != null ? index : defaultIndex;
};
// sort cols with index, and add these first
colsWithIndex.sort(function (colA, colB) {
var indexA = getIndexForCol(colA);
var indexB = getIndexForCol(colB);
if (indexA === indexB) {
return 0;
}
else if (indexA < indexB) {
return -1;
}
else {
return 1;
}
});
var res = [].concat(colsWithIndex);
// second add columns that were there before and in the same order as they were before,
// so we are preserving order of current grouping of columns that simply have rowGroup=true
previousCols.forEach(function (col) {
if (colsWithValue.indexOf(col) >= 0) {
res.push(col);
}
});
// lastly put in all remaining cols
colsWithValue.forEach(function (col) {
if (res.indexOf(col) < 0) {
res.push(col);
}
});
// set flag=false for removed cols
previousCols.forEach(function (col) {
if (res.indexOf(col) < 0) {
setFlagFunc(col, false);
}
});
// set flag=true for newly added cols
res.forEach(function (col) {
if (previousCols.indexOf(col) < 0) {
setFlagFunc(col, true);
}
});
return res;
};
ColumnController.prototype.extractPivotColumns = function (source, oldPrimaryColumns) {
this.pivotColumns = this.extractColumns(oldPrimaryColumns, this.pivotColumns, function (col, flag) { return col.setPivotActive(flag, source); }, function (colDef) { return colDef.pivotIndex; }, function (colDef) { return colDef.initialPivotIndex; }, function (colDef) { return colDef.pivot; }, function (colDef) { return colDef.initialPivot; });
};
ColumnController.prototype.resetColumnGroupState = function (source) {
if (source === void 0) { source = "api"; }
var stateItems = [];
this.columnUtils.depthFirstOriginalTreeSearch(null, this.primaryColumnTree, function (child) {
if (child instanceof _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_4__["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(null, this.gridBalancedTree, function (node) {
if (node instanceof _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_4__["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);
this.setFirstRightAndLastLeftPinned(source);
impactedGroups.forEach(function (originalColumnGroup) {
var event = {
type: _events__WEBPACK_IMPORTED_MODULE_2__["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 _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_4__["OriginalColumnGroup"]) {
keyAsString = key.getId();
}
else {
keyAsString = key;
}
this.setColumnGroupState([{ groupId: keyAsString, open: newValue }], source);
};
ColumnController.prototype.getOriginalColumnGroup = function (key) {
if (key instanceof _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_4__["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(null, this.gridBalancedTree, function (node) {
if (node instanceof _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_4__["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 = this.gridColumns.filter(function (column) {
var isAutoGroupCol = _this.groupAutoColumns && Object(_utils_array__WEBPACK_IMPORTED_MODULE_8__["includes"])(_this.groupAutoColumns, column);
var isValueCol = _this.valueColumns && Object(_utils_array__WEBPACK_IMPORTED_MODULE_8__["includes"])(_this.valueColumns, column);
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 = this.gridColumns.filter(function (column) {
// keep col if a) it's auto-group or b) it's visible
var isAutoGroupCol = _this.groupAutoColumns && Object(_utils_array__WEBPACK_IMPORTED_MODULE_8__["includes"])(_this.groupAutoColumns, column);
return isAutoGroupCol || column.isVisible();
});
}
return columnsForDisplay;
};
ColumnController.prototype.checkColSpanActiveInCols = function (columns) {
var result = false;
columns.forEach(function (col) {
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_9__["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 && Object(_utils_generic__WEBPACK_IMPORTED_MODULE_9__["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();
// also called when group opened/closed
this.updateGroupsAndDisplayedColumns(source);
// also called when group opened/closed
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.columnFactory.createColumnTree(colDefs, false);
this.secondaryBalancedTree = balancedTreeResult.columnTree;
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 undefined;
}
var searchForColDefs = function (colDefs2) {
colDefs2.forEach(function (abstractColDef) {
var isGroup = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_9__["exists"])(abstractColDef.children);
if (isGroup) {
var colGroupDef = abstractColDef;
if (groupCallback) {
groupCallback(colGroupDef);
}
searchForColDefs(colGroupDef.children);
}
else {
var colDef = abstractColDef;
if (columnCallback) {
columnCallback(colDef);
}
}
});
};
if (colDefs) {
searchForColDefs(colDefs);
}
};
// called from: setColumnState, setColumnDefs, setSecondaryColumns
ColumnController.prototype.updateGridColumns = function () {
var _this = this;
if (this.gridColsArePrimary) {
this.lastPrimaryOrder = this.gridColumns;
}
if (this.secondaryColumns && this.secondaryBalancedTree) {
this.gridBalancedTree = this.secondaryBalancedTree.slice();
this.gridHeaderRowCount = this.secondaryHeaderRowCount;
this.gridColumns = this.secondaryColumns.slice();
this.gridColsArePrimary = false;
}
else {
this.gridBalancedTree = this.primaryColumnTree.slice();
this.gridHeaderRowCount = this.primaryHeaderRowCount;
this.gridColumns = this.primaryColumns.slice();
this.gridColsArePrimary = true;
// updateGridColumns gets called after user adds a row group. we want to maintain the order of the columns
// when this happens (eg if user moved a column) rather than revert back to the original column order.
// likewise if changing in/out of pivot mode, we want to maintain the order of the primary cols
this.orderGridColsLikeLastPrimary();
}
this.addAutoGroupToGridColumns();
this.autoRowHeightColumns = this.gridColumns.filter(function (col) { return col.getColDef().autoHeight; });
this.putFixedColumnsFirst();
this.setupQuickFilterColumns();
this.clearDisplayedColumns();
this.colSpanActive = this.checkColSpanActiveInCols(this.gridColumns);
this.gridColumnsMap = {};
this.gridColumns.forEach(function (col) { return _this.gridColumnsMap[col.getId()] = col; });
var event = {
type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_GRID_COLUMNS_CHANGED,
api: this.gridApi,
columnApi: this.columnApi
};
this.eventService.dispatchEvent(event);
};
ColumnController.prototype.orderGridColsLikeLastPrimary = function () {
var _this = this;
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_9__["missing"])(this.lastPrimaryOrder)) {
return;
}
// only do the sort if at least one column is accounted for. columns will be not accounted for
// if changing from secondary to primary columns
var noColsFound = true;
this.gridColumns.forEach(function (col) {
if (_this.lastPrimaryOrder.indexOf(col) >= 0) {
noColsFound = false;
}
});
if (noColsFound) {
return;
}
// order cols in the same order as before. we need to make sure that all
// cols still exists, so filter out any that no longer exist.
var oldColsOrdered = this.lastPrimaryOrder.filter(function (col) { return _this.gridColumns.indexOf(col) >= 0; });
var newColsOrdered = this.gridColumns.filter(function (col) { return oldColsOrdered.indexOf(col) < 0; });
// add in the new columns, at the end (if no group), or at the end of the group (if a group)
var newGridColumns = oldColsOrdered.slice();
newColsOrdered.forEach(function (newCol) {
var parent = newCol.getOriginalParent();
// if no parent, means we are not grouping, so just add the column to the end
if (!parent) {
newGridColumns.push(newCol);
return;
}
// find the group the column belongs to. if no siblings at the current level (eg col in group on it's
// own) then go up one level and look for siblings there.
var siblings = [];
while (!siblings.length && parent) {
var leafCols = parent.getLeafColumns();
leafCols.forEach(function (leafCol) {
var presentInNewGriColumns = newGridColumns.indexOf(leafCol) >= 0;
var noYetInSiblings = siblings.indexOf(leafCol) < 0;
if (presentInNewGriColumns && noYetInSiblings) {
siblings.push(leafCol);
}
});
parent = parent.getOriginalParent();
}
// if no siblings exist at any level, this means the col is in a group (or parent groups) on it's own
if (!siblings.length) {
newGridColumns.push(newCol);
return;
}
// find index of last column in the group
var indexes = siblings.map(function (col) { return newGridColumns.indexOf(col); });
var lastIndex = Math.max.apply(Math, indexes);
Object(_utils_array__WEBPACK_IMPORTED_MODULE_8__["insertIntoArray"])(newGridColumns, newCol, lastIndex + 1);
});
this.gridColumns = newGridColumns;
};
ColumnController.prototype.isPrimaryColumnGroupsPresent = function () {
return this.primaryHeaderRowCount > 1;
};
// 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.getColDef().lockPosition; });
var unlocked = this.gridColumns.filter(function (c) { return !c.getColDef().lockPosition; });
this.gridColumns = locked.concat(unlocked);
};
ColumnController.prototype.addAutoGroupToGridColumns = function () {
// add in auto-group here
this.createGroupAutoColumnsIfNeeded();
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_9__["missing"])(this.groupAutoColumns)) {
return;
}
this.gridColumns = this.groupAutoColumns ? this.groupAutoColumns.concat(this.gridColumns) : this.gridColumns;
var autoColBalancedTree = this.columnFactory.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.refreshFlexedColumns();
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__WEBPACK_IMPORTED_MODULE_2__["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();
});
}
Object(_utils_array__WEBPACK_IMPORTED_MODULE_8__["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 _entities_columnGroup__WEBPACK_IMPORTED_MODULE_0__["ColumnGroup"]) {
var columnGroup = column;
columnGroup.checkLeft();
}
});
});
};
ColumnController.prototype.addToDisplayedColumns = function (displayedColumnTree, displayedColumns) {
displayedColumns.length = 0;
this.columnUtils.depthFirstDisplayedColumnTreeSearch(displayedColumnTree, function (child) {
if (child instanceof _entities_column__WEBPACK_IMPORTED_MODULE_1__["Column"]) {
displayedColumns.push(child);
}
});
};
ColumnController.prototype.updateDisplayedCenterVirtualColumns = function () {
if (this.suppressColumnVirtualisation) {
// 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 _constants_constants__WEBPACK_IMPORTED_MODULE_7__["Constants"].PINNED_LEFT:
result = this.displayedLeftHeaderRows[dept];
break;
case _constants_constants__WEBPACK_IMPORTED_MODULE_7__["Constants"].PINNED_RIGHT:
result = this.displayedRightHeaderRows[dept];
break;
default:
result = this.displayedCentreHeaderRows[dept];
break;
}
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_9__["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 = {};
var testGroup = function (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 _entities_column__WEBPACK_IMPORTED_MODULE_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;
};
testGroup(this.displayedLeftColumnTree, this.displayedLeftHeaderRows, 0);
testGroup(this.displayedRightColumnTree, this.displayedRightHeaderRows, 0);
testGroup(this.displayedCentreColumnTree, this.displayedCentreHeaderRows, 0);
};
ColumnController.prototype.updateVirtualSets = function () {
var virtualColIds = this.updateDisplayedCenterVirtualColumns();
this.updateDisplayedVirtualGroups(virtualColIds);
};
ColumnController.prototype.filterOutColumnsWithinViewport = function () {
return this.displayedCenterColumns.filter(this.isColumnInViewport.bind(this));
};
ColumnController.prototype.refreshFlexedColumns = function (params) {
var _this = this;
if (params === void 0) { params = {}; }
var source = params.source ? params.source : 'flex';
if (params.viewportWidth != null) {
this.flexViewportWidth = params.viewportWidth;
}
if (!this.flexViewportWidth) {
return;
}
// If the grid has left-over space, divide it between flexing columns in proportion to their flex value.
// A "flexing column" is one that has a 'flex' value set and is not currently being constrained by its
// minWidth or maxWidth rules.
var flexAfterDisplayIndex = -1;
if (params.resizingCols) {
params.resizingCols.forEach(function (col) {
var indexOfCol = _this.displayedCenterColumns.indexOf(col);
if (flexAfterDisplayIndex < indexOfCol) {
flexAfterDisplayIndex = indexOfCol;
}
});
}
var isColFlex = function (col) {
var afterResizingCols = _this.displayedCenterColumns.indexOf(col) > flexAfterDisplayIndex;
return col.getFlex() && afterResizingCols;
};
var knownWidthColumns = this.displayedCenterColumns.filter(function (col) { return !isColFlex(col); });
var flexingColumns = this.displayedCenterColumns.filter(function (col) { return isColFlex(col); });
var changedColumns = [];
if (!flexingColumns.length) {
return [];
}
var flexingColumnSizes = [];
var spaceForFlexingColumns;
outer: while (true) {
var totalFlex = flexingColumns.reduce(function (count, col) { return count + col.getFlex(); }, 0);
spaceForFlexingColumns = this.flexViewportWidth - this.getWidthOfColsInList(knownWidthColumns);
for (var i = 0; i < flexingColumns.length; i++) {
var col = flexingColumns[i];
var widthByFlexRule = spaceForFlexingColumns * col.getFlex() / totalFlex;
var constrainedWidth = void 0;
if (widthByFlexRule < col.getMinWidth()) {
constrainedWidth = col.getMinWidth();
}
else if (col.getMaxWidth() != null && widthByFlexRule > col.getMaxWidth()) {
constrainedWidth = col.getMaxWidth();
}
if (constrainedWidth) {
// This column is not in fact flexing as it is being constrained to a specific size
// so remove it from the list of flexing columns and start again
col.setActualWidth(constrainedWidth, source);
Object(_utils_array__WEBPACK_IMPORTED_MODULE_8__["removeFromArray"])(flexingColumns, col);
changedColumns.push(col);
knownWidthColumns.push(col);
continue outer;
}
flexingColumnSizes[i] = Math.round(widthByFlexRule);
}
break;
}
var remainingSpace = spaceForFlexingColumns;
flexingColumns.forEach(function (col, i) {
col.setActualWidth(Math.min(flexingColumnSizes[i], remainingSpace), source);
changedColumns.push(col);
remainingSpace -= flexingColumnSizes[i];
});
if (!params.skipSetLeft) {
this.setLeftValues(source);
}
if (params.updateBodyWidths) {
this.updateBodyWidths();
}
if (params.fireResizedEvent) {
this.fireColumnResizedEvent(changedColumns, true, source, flexingColumns);
}
// if the user sets rowData directly into GridOptions, then the row data is set before
// grid is attached to the DOM. this means the columns are not flexed, and then the rows
// have the wrong height (as they depend on column widths). so once the columns have
// been flexed for the first time (only happens once grid is attached to DOM, as dependency
// on getting the grid width, which only happens after attached after ResizeObserver fires)
// we get get rows to re-calc their heights.
if (!this.flexColsCalculatedAtLestOnce) {
if (this.gridOptionsWrapper.isRowModelDefault()) {
this.rowModel.resetRowHeights();
}
this.flexColsCalculatedAtLestOnce = true;
}
return flexingColumns;
};
// called from api
ColumnController.prototype.sizeColumnsToFit = function (gridWidth, source, silent) {
if (source === void 0) { source = "sizeColumnsToFit"; }
// avoid divide by zero
var allDisplayedColumns = this.getAllDisplayedColumns();
if (gridWidth <= 0 || !allDisplayedColumns.length) {
return;
}
var colsToSpread = [];
var colsToNotSpread = [];
allDisplayedColumns.forEach(function (column) {
if (column.getColDef().suppressSizeToFit === true) {
colsToNotSpread.push(column);
}
else {
colsToSpread.push(column);
}
});
// make a copy of the cols that are going to be resized
var colsToFireEventFor = colsToSpread.slice(0);
var finishedResizing = false;
var moveToNotSpread = function (column) {
Object(_utils_array__WEBPACK_IMPORTED_MODULE_8__["removeFromArray"])(colsToSpread, column);
colsToNotSpread.push(column);
};
// resetting cols to their original width makes the sizeColumnsToFit more deterministic,
// rather than depending on the current size of the columns. most users call sizeColumnsToFit
// immediately after grid is created, so will make no difference. however if application is calling
// sizeColumnsToFit repeatedly (eg after column group is opened / closed repeatedly) we don't want
// the columns to start shrinking / growing over time.
//
// NOTE: the process below will assign values to `this.actualWidth` of each column without firing events
// for this reason we need to manually fire resize events after the resize has been done for each column.
colsToSpread.forEach(function (column) { return column.resetActualWidth(source); });
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 minWidth = column.getMinWidth();
var maxWidth = column.getMaxWidth();
var newWidth = Math.round(column.getActualWidth() * scale);
if (newWidth < minWidth) {
newWidth = column.getMinWidth();
moveToNotSpread(column);
finishedResizing = false;
}
else if (column.isGreaterThanMax(newWidth)) {
newWidth = maxWidth;
moveToNotSpread(column);
finishedResizing = false;
}
else if (i === 0) { // if this is the last column
newWidth = pixelsForLastCol;
}
column.setActualWidth(newWidth, source, true);
pixelsForLastCol -= newWidth;
}
}
}
// see notes above
colsToFireEventFor.forEach(function (col) {
col.fireColumnWidthChangedEvent(source);
});
this.setLeftValues(source);
this.updateBodyWidths();
if (silent) {
return;
}
this.fireColumnResizedEvent(colsToFireEventFor, true, source);
};
ColumnController.prototype.buildDisplayedTrees = function (visibleColumns) {
var leftVisibleColumns = [];
var rightVisibleColumns = [];
var centerVisibleColumns = [];
visibleColumns.forEach(function (column) {
switch (column.getPinned()) {
case "left":
leftVisibleColumns.push(column);
break;
case "right":
rightVisibleColumns.push(column);
break;
default:
centerVisibleColumns.push(column);
break;
}
});
var groupInstanceIdCreator = new _groupInstanceIdCreator__WEBPACK_IMPORTED_MODULE_5__["GroupInstanceIdCreator"]();
this.displayedLeftColumnTree = this.displayedGroupCreator.createDisplayedGroups(leftVisibleColumns, this.gridBalancedTree, groupInstanceIdCreator, _constants_constants__WEBPACK_IMPORTED_MODULE_7__["Constants"].PINNED_LEFT, this.displayedLeftColumnTree);
this.displayedRightColumnTree = this.displayedGroupCreator.createDisplayedGroups(rightVisibleColumns, this.gridBalancedTree, groupInstanceIdCreator, _constants_constants__WEBPACK_IMPORTED_MODULE_7__["Constants"].PINNED_RIGHT, this.displayedRightColumnTree);
this.displayedCentreColumnTree = this.displayedGroupCreator.createDisplayedGroups(centerVisibleColumns, this.gridBalancedTree, groupInstanceIdCreator, null, this.displayedCentreColumnTree);
};
ColumnController.prototype.updateOpenClosedVisibilityInColumnGroups = function () {
var allColumnGroups = this.getAllDisplayedColumnGroups();
this.columnUtils.depthFirstAllColumnTreeSearch(allColumnGroups, function (child) {
if (child instanceof _entities_columnGroup__WEBPACK_IMPORTED_MODULE_0__["ColumnGroup"]) {
var columnGroup = child;
columnGroup.calculateDisplayedColumns();
}
});
};
ColumnController.prototype.getGroupAutoColumns = function () {
return this.groupAutoColumns;
};
ColumnController.prototype.createGroupAutoColumnsIfNeeded = function () {
if (!this.autoGroupsNeedBuilding) {
return;
}
this.autoGroupsNeedBuilding = false;
var groupFullWidthRow = this.gridOptionsWrapper.isGroupUseEntireRow(this.pivotMode);
// we need to allow suppressing auto-column separately for group and pivot as the normal situation
// is CSRM and user provides group column themselves for normal view, but when they go into pivot the
// columns are generated by the grid so no opportunity for user to provide group column. so need a way
// to suppress auto-col for grouping only, and not pivot.
// however if using Viewport RM or SSRM and user is providing the columns, the user may wish full control
// of the group column in this instance.
var suppressAutoColumn = this.pivotMode ?
this.gridOptionsWrapper.isPivotSuppressAutoColumn() : this.gridOptionsWrapper.isGroupSuppressAutoColumn();
var groupingActive = this.rowGroupColumns.length > 0 || this.usingTreeData;
var needAutoColumns = groupingActive && !suppressAutoColumn && !groupFullWidthRow;
if (needAutoColumns) {
var newAutoGroupCols = this.autoGroupColService.createAutoGroupColumns(this.rowGroupColumns);
var autoColsDifferent = !this.autoColsEqual(newAutoGroupCols, this.groupAutoColumns);
// we force recreate when suppressColumnStateEvents changes, so new group cols pick up the new
// definitions. otherwise we could ignore the new cols because they appear to be the same.
if (autoColsDifferent || this.forceRecreateAutoGroups) {
this.groupAutoColumns = newAutoGroupCols;
}
}
else {
this.groupAutoColumns = null;
}
};
ColumnController.prototype.autoColsEqual = function (colsA, colsB) {
return Object(_utils_array__WEBPACK_IMPORTED_MODULE_8__["areEqual"])(colsA, colsB, function (a, b) { return a.getColId() === b.getColId(); });
};
ColumnController.prototype.getWidthOfColsInList = function (columnList) {
return columnList.reduce(function (width, col) { return width + col.getActualWidth(); }, 0);
};
ColumnController.prototype.getGridBalancedTree = function () {
return this.gridBalancedTree;
};
ColumnController.prototype.hasFloatingFilters = function () {
var defaultColDef = this.gridOptionsWrapper.getDefaultColDef();
return (defaultColDef != null && defaultColDef.floatingFilter === true) ||
(this.columnDefs != null && this.columnDefs.some(function (c) { return c.floatingFilter === true; }));
};
ColumnController.prototype.getFirstDisplayedColumn = function () {
var isRtl = this.gridOptionsWrapper.isEnableRtl();
var queryOrder = [
'getDisplayedLeftColumns',
'getDisplayedCenterColumns',
'getDisplayedRightColumns'
];
if (isRtl) {
queryOrder.reverse();
}
for (var i = 0; i < queryOrder.length; i++) {
var container = this[queryOrder[i]]();
if (container.length) {
return isRtl ? Object(_utils_array__WEBPACK_IMPORTED_MODULE_8__["last"])(container) : container[0];
}
}
return null;
};
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])('expressionService')
], ColumnController.prototype, "expressionService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])('columnFactory')
], ColumnController.prototype, "columnFactory", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])('displayedGroupCreator')
], ColumnController.prototype, "displayedGroupCreator", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])('autoWidthCalculator')
], ColumnController.prototype, "autoWidthCalculator", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])('columnUtils')
], ColumnController.prototype, "columnUtils", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])('columnAnimationService')
], ColumnController.prototype, "columnAnimationService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])('autoGroupColService')
], ColumnController.prototype, "autoGroupColService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Optional"])('aggFuncService')
], ColumnController.prototype, "aggFuncService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Optional"])('valueCache')
], ColumnController.prototype, "valueCache", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Optional"])('animationFrameService')
], ColumnController.prototype, "animationFrameService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])('rowModel')
], ColumnController.prototype, "rowModel", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])('columnApi')
], ColumnController.prototype, "columnApi", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])('gridApi')
], ColumnController.prototype, "gridApi", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])('sortController')
], ColumnController.prototype, "sortController", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])('columnDefFactory')
], ColumnController.prototype, "columnDefFactory", void 0);
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_6__["PostConstruct"]
], ColumnController.prototype, "init", null);
__decorate([
__param(0, Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Qualifier"])('loggerFactory'))
], ColumnController.prototype, "setBeans", null);
ColumnController = __decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Bean"])('columnController')
], ColumnController);
return ColumnController;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_3__["BeanStub"]));
/***/ }),
/* 23 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _eventKeys__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(24);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Events", function() { return _eventKeys__WEBPACK_IMPORTED_MODULE_0__["Events"]; });
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
/***/ }),
/* 24 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Events", function() { return Events; });
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var Events = /** @class */ (function () {
function Events() {
}
/** Everything has changed with the columns. Either complete new set of columns set, or user called setState() */
/** @deprecated - grid no longer uses this, and setSate() also fires individual events */
Events.EVENT_COLUMN_EVERYTHING_CHANGED = 'columnEverythingChanged';
/** User has set in new columns. */
Events.EVENT_NEW_COLUMNS_LOADED = 'newColumnsLoaded';
/** The pivot mode flag was changed */
Events.EVENT_COLUMN_PIVOT_MODE_CHANGED = 'columnPivotModeChanged';
/** A row group column was added, removed or order changed. */
Events.EVENT_COLUMN_ROW_GROUP_CHANGED = 'columnRowGroupChanged';
/** expandAll / collapseAll was called from the api. */
Events.EVENT_EXPAND_COLLAPSE_ALL = 'expandOrCollapseAll';
/** A pivot column was added, removed or order changed. */
Events.EVENT_COLUMN_PIVOT_CHANGED = 'columnPivotChanged';
/** The list of grid columns has changed. */
Events.EVENT_GRID_COLUMNS_CHANGED = 'gridColumnsChanged';
/** A value column was added, removed or agg function was changed. */
Events.EVENT_COLUMN_VALUE_CHANGED = 'columnValueChanged';
/** A column was moved */
Events.EVENT_COLUMN_MOVED = 'columnMoved';
/** One or more columns was shown / hidden */
Events.EVENT_COLUMN_VISIBLE = 'columnVisible';
/** One or more columns was pinned / unpinned*/
Events.EVENT_COLUMN_PINNED = 'columnPinned';
/** A column group was opened / closed */
Events.EVENT_COLUMN_GROUP_OPENED = 'columnGroupOpened';
/** One or more columns was resized. If just one, the column in the event is set. */
Events.EVENT_COLUMN_RESIZED = 'columnResized';
/** The list of displayed columns has changed, can result from columns open / close, column move, pivot, group, etc */
Events.EVENT_DISPLAYED_COLUMNS_CHANGED = 'displayedColumnsChanged';
/** The list of virtual columns has changed, results from viewport changing */
Events.EVENT_VIRTUAL_COLUMNS_CHANGED = 'virtualColumnsChanged';
/** Async Transactions Executed */
Events.EVENT_ASYNC_TRANSACTIONS_FLUSHED = 'asyncTransactionsFlushed';
/** A row group was opened / closed */
Events.EVENT_ROW_GROUP_OPENED = 'rowGroupOpened';
/** The client has set new data into the grid */
Events.EVENT_ROW_DATA_CHANGED = 'rowDataChanged';
/** The client has updated data for the grid */
Events.EVENT_ROW_DATA_UPDATED = 'rowDataUpdated';
/** The client has set new floating data into the grid */
Events.EVENT_PINNED_ROW_DATA_CHANGED = 'pinnedRowDataChanged';
/** Range selection has changed */
Events.EVENT_RANGE_SELECTION_CHANGED = 'rangeSelectionChanged';
/** Chart was created */
Events.EVENT_CHART_CREATED = 'chartCreated';
/** Chart Range selection has changed */
Events.EVENT_CHART_RANGE_SELECTION_CHANGED = 'chartRangeSelectionChanged';
/** Chart Options have changed */
Events.EVENT_CHART_OPTIONS_CHANGED = 'chartOptionsChanged';
/** Chart was destroyed */
Events.EVENT_CHART_DESTROYED = 'chartDestroyed';
/** For when the tool panel is shown / hidden */
Events.EVENT_TOOL_PANEL_VISIBLE_CHANGED = 'toolPanelVisibleChanged';
/** Model was updated - grid updates the drawn rows when this happens */
Events.EVENT_MODEL_UPDATED = 'modelUpdated';
Events.EVENT_PASTE_START = 'pasteStart';
Events.EVENT_PASTE_END = 'pasteEnd';
Events.EVENT_FILL_START = 'fillStart';
Events.EVENT_FILL_END = 'fillEnd';
Events.EVENT_CELL_CLICKED = 'cellClicked';
Events.EVENT_CELL_DOUBLE_CLICKED = 'cellDoubleClicked';
Events.EVENT_CELL_MOUSE_DOWN = 'cellMouseDown';
Events.EVENT_CELL_CONTEXT_MENU = 'cellContextMenu';
Events.EVENT_CELL_VALUE_CHANGED = 'cellValueChanged';
Events.EVENT_ROW_VALUE_CHANGED = 'rowValueChanged';
Events.EVENT_CELL_FOCUSED = 'cellFocused';
Events.EVENT_ROW_SELECTED = 'rowSelected';
Events.EVENT_SELECTION_CHANGED = 'selectionChanged';
Events.EVENT_CELL_KEY_DOWN = 'cellKeyDown';
Events.EVENT_CELL_KEY_PRESS = 'cellKeyPress';
Events.EVENT_CELL_MOUSE_OVER = 'cellMouseOver';
Events.EVENT_CELL_MOUSE_OUT = 'cellMouseOut';
/** 2 events for filtering. The grid LISTENS for filterChanged and afterFilterChanged */
Events.EVENT_FILTER_CHANGED = 'filterChanged';
/** Filter was change but not applied. Only useful if apply buttons are used in filters. */
Events.EVENT_FILTER_MODIFIED = 'filterModified';
Events.EVENT_FILTER_OPENED = 'filterOpened';
Events.EVENT_SORT_CHANGED = 'sortChanged';
/** A row was removed from the dom, for any reason. Use to clean up resources (if any) used by the row. */
Events.EVENT_VIRTUAL_ROW_REMOVED = 'virtualRowRemoved';
Events.EVENT_ROW_CLICKED = 'rowClicked';
Events.EVENT_ROW_DOUBLE_CLICKED = 'rowDoubleClicked';
/** Gets called once after the grid has finished initialising. */
Events.EVENT_GRID_READY = 'gridReady';
/** Width of height of the main grid div has changed. Grid listens for this and does layout of grid if it's
* changed, so always filling the space it was given. */
Events.EVENT_GRID_SIZE_CHANGED = 'gridSizeChanged';
/** The indexes of the rows rendered has changed, eg user has scrolled to a new vertical position. */
Events.EVENT_VIEWPORT_CHANGED = 'viewportChanged';
/* The width of the scrollbar has been calculated */
Events.EVENT_SCROLLBAR_WIDTH_CHANGED = 'scrollbarWidthChanged';
/** Rows were rendered for the first time (ie on async data load). */
Events.EVENT_FIRST_DATA_RENDERED = 'firstDataRendered';
/** A column drag has started, either resizing a column or moving a column. */
Events.EVENT_DRAG_STARTED = 'dragStarted';
/** A column drag has stopped */
Events.EVENT_DRAG_STOPPED = 'dragStopped';
Events.EVENT_CHECKBOX_CHANGED = 'checkboxChanged';
Events.EVENT_ROW_EDITING_STARTED = 'rowEditingStarted';
Events.EVENT_ROW_EDITING_STOPPED = 'rowEditingStopped';
Events.EVENT_CELL_EDITING_STARTED = 'cellEditingStarted';
Events.EVENT_CELL_EDITING_STOPPED = 'cellEditingStopped';
/** Main body of grid has scrolled, either horizontally or vertically */
Events.EVENT_BODY_SCROLL = 'bodyScroll';
Events.EVENT_ANIMATION_QUEUE_EMPTY = 'animationQueueEmpty';
Events.EVENT_HEIGHT_SCALE_CHANGED = 'heightScaleChanged';
/** The displayed page for pagination has changed. For example the data was filtered or sorted,
* or the user has moved to a different page. */
Events.EVENT_PAGINATION_CHANGED = 'paginationChanged';
/** Only used by React, Angular 2+, Web Components and VueJS ag-Grid components
* (not used if doing plain JavaScript or Angular 1.x). If the grid receives changes due
* to bound properties, this event fires after the grid has finished processing the change. */
Events.EVENT_COMPONENT_STATE_CHANGED = 'componentStateChanged';
/** All items from here down are used internally by the grid, not intended for external use. */
// not documented, either experimental, or we just don't want users using an depending on them
Events.EVENT_BODY_HEIGHT_CHANGED = 'bodyHeightChanged';
Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED = 'displayedColumnsWidthChanged';
Events.EVENT_SCROLL_VISIBILITY_CHANGED = 'scrollVisibilityChanged';
Events.EVENT_COLUMN_HOVER_CHANGED = 'columnHoverChanged';
Events.EVENT_FLASH_CELLS = 'flashCells';
Events.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED = 'paginationPixelOffsetChanged';
Events.EVENT_ROW_DRAG_ENTER = 'rowDragEnter';
Events.EVENT_ROW_DRAG_MOVE = 'rowDragMove';
Events.EVENT_ROW_DRAG_LEAVE = 'rowDragLeave';
Events.EVENT_ROW_DRAG_END = 'rowDragEnd';
// primarily for charts
Events.EVENT_POPUP_TO_FRONT = 'popupToFront';
// these are used for server side group and agg - only used by CS with Viewport Row Model - intention is
// to design these better around server side functions and then release to general public when fully working with
// all the row models.
Events.EVENT_COLUMN_ROW_GROUP_CHANGE_REQUEST = 'columnRowGroupChangeRequest';
Events.EVENT_COLUMN_PIVOT_CHANGE_REQUEST = 'columnPivotChangeRequest';
Events.EVENT_COLUMN_VALUE_CHANGE_REQUEST = 'columnValueChangeRequest';
Events.EVENT_COLUMN_AGG_FUNC_CHANGE_REQUEST = 'columnAggFuncChangeRequest';
Events.EVENT_KEYBOARD_FOCUS = 'keyboardFocus';
Events.EVENT_MOUSE_FOCUS = 'mouseFocus';
return Events;
}());
/***/ }),
/* 25 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GroupInstanceIdCreator", function() { return GroupInstanceIdCreator; });
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
// class returns unique instance id's for columns.
// eg, the following calls (in this order) will result in:
//
// getInstanceIdForKey('country') => 0
// getInstanceIdForKey('country') => 1
// getInstanceIdForKey('country') => 2
// getInstanceIdForKey('country') => 3
// getInstanceIdForKey('age') => 0
// getInstanceIdForKey('age') => 1
// getInstanceIdForKey('country') => 4
var GroupInstanceIdCreator = /** @class */ (function () {
function GroupInstanceIdCreator() {
// this map contains keys to numbers, so we remember what the last call was
this.existingIds = {};
}
GroupInstanceIdCreator.prototype.getInstanceIdForKey = function (key) {
var lastResult = this.existingIds[key];
var result;
if (typeof lastResult !== 'number') {
// first time this key
result = 0;
}
else {
result = lastResult + 1;
}
this.existingIds[key] = result;
return result;
};
return GroupInstanceIdCreator;
}());
/***/ }),
/* 26 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "utf8_encode", function() { return utf8_encode; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "camelCaseToHyphen", function() { return camelCaseToHyphen; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hyphenToCamelCase", function() { return hyphenToCamelCase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "capitalise", function() { return capitalise; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "escapeString", function() { return escapeString; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "camelCaseToHumanText", function() { return camelCaseToHumanText; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startsWith", function() { return startsWith; });
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var reUnescapedHtml = /[&<>"']/g;
/**
* HTML Escapes.
*/
var HTML_ESCAPES = {
'&': '&',
'<': '<',
'>': '>',
'"': '"',
"'": '''
};
/**
* It encodes any string in UTF-8 format
* taken from https://github.com/mathiasbynens/utf8.js
* @param {string} s
* @returns {string}
*/
function utf8_encode(s) {
var stringFromCharCode = String.fromCharCode;
function ucs2decode(string) {
var output = [];
var counter = 0;
var length = string.length;
var value;
var extra;
while (counter < length) {
value = string.charCodeAt(counter++);
if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
// high surrogate, and there is a next character
extra = string.charCodeAt(counter++);
if ((extra & 0xFC00) == 0xDC00) { // low surrogate
output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
}
else {
// unmatched surrogate; only append this code unit, in case the next
// code unit is the high surrogate of a surrogate pair
output.push(value);
counter--;
}
}
else {
output.push(value);
}
}
return output;
}
function checkScalarValue(codePoint) {
if (codePoint >= 0xD800 && codePoint <= 0xDFFF) {
throw Error('Lone surrogate U+' + codePoint.toString(16).toUpperCase() +
' is not a scalar value');
}
}
function createByte(codePoint, shift) {
return stringFromCharCode(((codePoint >> shift) & 0x3F) | 0x80);
}
function encodeCodePoint(codePoint) {
if ((codePoint & 0xFFFFFF80) == 0) { // 1-byte sequence
return stringFromCharCode(codePoint);
}
var symbol = '';
if ((codePoint & 0xFFFFF800) == 0) { // 2-byte sequence
symbol = stringFromCharCode(((codePoint >> 6) & 0x1F) | 0xC0);
}
else if ((codePoint & 0xFFFF0000) == 0) { // 3-byte sequence
checkScalarValue(codePoint);
symbol = stringFromCharCode(((codePoint >> 12) & 0x0F) | 0xE0);
symbol += createByte(codePoint, 6);
}
else if ((codePoint & 0xFFE00000) == 0) { // 4-byte sequence
symbol = stringFromCharCode(((codePoint >> 18) & 0x07) | 0xF0);
symbol += createByte(codePoint, 12);
symbol += createByte(codePoint, 6);
}
symbol += stringFromCharCode((codePoint & 0x3F) | 0x80);
return symbol;
}
var codePoints = ucs2decode(s);
var length = codePoints.length;
var index = -1;
var codePoint;
var byteString = '';
while (++index < length) {
codePoint = codePoints[index];
byteString += encodeCodePoint(codePoint);
}
return byteString;
}
/**
* Converts a camelCase string into hyphenated string
* from https://gist.github.com/youssman/745578062609e8acac9f
* @param {string} str
* @return {string}
*/
function camelCaseToHyphen(str) {
if (str === null || str === undefined) {
return null;
}
return str.replace(/([A-Z])/g, function (g) { return '-' + g[0].toLowerCase(); });
}
/**
* Converts a hyphenated string into camelCase string
* from https://stackoverflow.com/questions/6660977/convert-hyphens-to-camel-case-camelcase
* @param {string} str
* @return {string}
*/
function hyphenToCamelCase(str) {
if (str === null || str === undefined) {
return null;
}
return str.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); });
}
function capitalise(str) {
return str[0].toUpperCase() + str.substr(1).toLowerCase();
}
function escapeString(toEscape) {
return toEscape == null || !toEscape.replace ? toEscape : toEscape.replace(reUnescapedHtml, function (chr) { return HTML_ESCAPES[chr]; });
}
/**
* Converts a camelCase string into regular text
* from: https://stackoverflow.com/questions/15369566/putting-space-in-camel-case-string-using-regular-expression
* @param {string} camelCase
* @return {string}
*/
function camelCaseToHumanText(camelCase) {
if (!camelCase || camelCase == null) {
return null;
}
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(' ');
}
function startsWith(str, matchStart) {
if (str === matchStart) {
return true;
}
return str != null && str.slice(0, matchStart.length) === matchStart;
}
/***/ }),
/* 27 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColumnUtils", function() { return ColumnUtils; });
/* harmony import */ var _entities_columnGroup__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9);
/* harmony import */ var _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8);
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12);
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(20);
/* harmony import */ var _utils_number__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(28);
/* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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;
};
// takes in a list of columns, as specified by the column definitions, and returns column groups
var ColumnUtils = /** @class */ (function (_super) {
__extends(ColumnUtils, _super);
function ColumnUtils() {
return _super !== null && _super.apply(this, arguments) || this;
}
ColumnUtils.prototype.calculateColInitialWidth = function (colDef) {
var optionsWrapper = this.gridOptionsWrapper;
var minColWidth = colDef.minWidth != null ? colDef.minWidth : optionsWrapper.getMinColWidth();
var maxColWidth = colDef.maxWidth != null ? colDef.maxWidth : (optionsWrapper.getMaxColWidth() || Object(_utils_number__WEBPACK_IMPORTED_MODULE_4__["getMaxSafeInteger"])());
var width;
var colDefWidth = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_5__["attrToNumber"])(colDef.width);
var colDefInitialWidth = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_5__["attrToNumber"])(colDef.initialWidth);
if (colDefWidth != null) {
width = colDefWidth;
}
else if (colDefInitialWidth != null) {
width = colDefInitialWidth;
}
else {
width = optionsWrapper.getColWidth();
}
return Math.max(Math.min(width, maxColWidth), minColWidth);
};
ColumnUtils.prototype.getOriginalPathForColumn = function (column, originalBalancedTree) {
var result = [];
var found = false;
var recursePath = function (balancedColumnTree, dept) {
for (var i = 0; i < balancedColumnTree.length; i++) {
if (found) {
return;
}
// quit the search, so 'result' is kept with the found result
var node = balancedColumnTree[i];
if (node instanceof _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_1__["OriginalColumnGroup"]) {
var nextNode = node;
recursePath(nextNode.getChildren(), dept + 1);
result[dept] = node;
}
else if (node === column) {
found = true;
}
}
};
recursePath(originalBalancedTree, 0);
// we should always find the path, but in case there is a bug somewhere, returning null
// will make it fail rather than provide a 'hard to track down' bug
return found ? result : null;
};
ColumnUtils.prototype.depthFirstOriginalTreeSearch = function (parent, tree, callback) {
var _this = this;
if (!tree) {
return;
}
tree.forEach(function (child) {
if (child instanceof _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_1__["OriginalColumnGroup"]) {
_this.depthFirstOriginalTreeSearch(child, child.getChildren(), callback);
}
callback(child, parent);
});
};
ColumnUtils.prototype.depthFirstAllColumnTreeSearch = function (tree, callback) {
var _this = this;
if (!tree) {
return;
}
tree.forEach(function (child) {
if (child instanceof _entities_columnGroup__WEBPACK_IMPORTED_MODULE_0__["ColumnGroup"]) {
_this.depthFirstAllColumnTreeSearch(child.getChildren(), callback);
}
callback(child);
});
};
ColumnUtils.prototype.depthFirstDisplayedColumnTreeSearch = function (tree, callback) {
var _this = this;
if (!tree) {
return;
}
tree.forEach(function (child) {
if (child instanceof _entities_columnGroup__WEBPACK_IMPORTED_MODULE_0__["ColumnGroup"]) {
_this.depthFirstDisplayedColumnTreeSearch(child.getDisplayedChildren(), callback);
}
callback(child);
});
};
ColumnUtils = __decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Bean"])('columnUtils')
], ColumnUtils);
return ColumnUtils;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_3__["BeanStub"]));
/***/ }),
/* 28 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "padStart", function() { return padStart; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createArrayOfNumbers", function() { return createArrayOfNumbers; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNumeric", function() { return isNumeric; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMaxSafeInteger", function() { return getMaxSafeInteger; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cleanNumber", function() { return cleanNumber; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "decToHex", function() { return decToHex; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "formatNumberTwoDecimalPlacesAndCommas", function() { return formatNumberTwoDecimalPlacesAndCommas; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "formatNumberCommas", function() { return formatNumberCommas; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sum", function() { return sum; });
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
function padStart(value, totalStringSize) {
var asString = "" + value;
while (asString.length < totalStringSize) {
asString = "0" + asString;
}
return asString;
}
function createArrayOfNumbers(first, last) {
var result = [];
for (var i = first; i <= last; i++) {
result.push(i);
}
return result;
}
/**
* Check if a value is numeric
* from http://stackoverflow.com/questions/9716468/is-there-any-function-like-isnumeric-in-javascript-to-validate-numbers
* @param {any} value
* @return {boolean}
*/
function isNumeric(value) {
return value !== '' && !isNaN(parseFloat(value)) && isFinite(value);
}
function getMaxSafeInteger() {
// eslint-disable-next-line
return Number.MAX_SAFE_INTEGER || 9007199254740991;
}
function cleanNumber(value) {
if (typeof value === 'string') {
value = parseInt(value, 10);
}
if (typeof value === 'number') {
return Math.floor(value);
}
else {
return null;
}
}
function decToHex(number, bytes) {
var hex = '';
for (var i = 0; i < bytes; i++) {
hex += String.fromCharCode(number & 0xff);
number >>>= 8;
}
return hex;
}
function formatNumberTwoDecimalPlacesAndCommas(value) {
if (typeof value !== 'number') {
return '';
}
return formatNumberCommas(Math.round(value * 100) / 100);
}
/**
* the native method number.toLocaleString(undefined, {minimumFractionDigits: 0})
* puts in decimal places in IE, so we use this method instead
* from: http://blog.tompawlak.org/number-currency-formatting-javascript
* @param {number} value
* @returns {string}
*/
function formatNumberCommas(value) {
if (typeof value !== 'number') {
return '';
}
return value.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1,");
}
function sum(values) {
return values == null ? null : values.reduce(function (total, value) { return total + value; }, 0);
}
/***/ }),
/* 29 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DisplayedGroupCreator", function() { return DisplayedGroupCreator; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _entities_columnGroup__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9);
/* harmony import */ var _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8);
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(20);
/* harmony import */ var _utils_array__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(14);
/* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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;
};
// takes in a list of columns, as specified by the column definitions, and returns column groups
var DisplayedGroupCreator = /** @class */ (function (_super) {
__extends(DisplayedGroupCreator, _super);
function DisplayedGroupCreator() {
return _super !== null && _super.apply(this, arguments) || this;
}
DisplayedGroupCreator.prototype.createDisplayedGroups = function (
// all displayed columns sorted - this is the columns the grid should show
sortedVisibleColumns,
// the tree of columns, as provided by the users, used to know what groups columns roll up into
balancedColumnTree,
// creates unique id's for the group
groupInstanceIdCreator,
// whether it's left, right or center col
pinned,
// we try to reuse old groups if we can, to allow gui to do animation
oldDisplayedGroups) {
var _this = this;
var result = [];
var previousRealPath;
var previousOriginalPath;
var oldColumnsMapped = this.mapOldGroupsById(oldDisplayedGroups);
// go through each column, then do a bottom up comparison to the previous column, and start
// to share groups if they converge at any point.
sortedVisibleColumns.forEach(function (currentColumn) {
var currentOriginalPath = _this.getOriginalPathForColumn(balancedColumnTree, currentColumn);
var currentRealPath = [];
var firstColumn = !previousOriginalPath;
for (var i = 0; i < currentOriginalPath.length; i++) {
if (firstColumn || currentOriginalPath[i] !== previousOriginalPath[i]) {
// new group needed
var newGroup = _this.createColumnGroup(currentOriginalPath[i], groupInstanceIdCreator, oldColumnsMapped, pinned);
currentRealPath[i] = newGroup;
// if top level, add to result, otherwise add to parent
if (i == 0) {
result.push(newGroup);
}
else {
currentRealPath[i - 1].addChild(newGroup);
}
}
else {
// reuse old group
currentRealPath[i] = previousRealPath[i];
}
}
var noColumnGroups = currentRealPath.length === 0;
if (noColumnGroups) {
// if we are not grouping, then the result of the above is an empty
// path (no groups), and we just add the column to the root list.
result.push(currentColumn);
}
else {
var leafGroup = Object(_utils_array__WEBPACK_IMPORTED_MODULE_4__["last"])(currentRealPath);
leafGroup.addChild(currentColumn);
}
previousRealPath = currentRealPath;
previousOriginalPath = currentOriginalPath;
});
this.setupParentsIntoColumns(result, null);
return result;
};
DisplayedGroupCreator.prototype.createColumnGroup = function (originalGroup, groupInstanceIdCreator, oldColumnsMapped, pinned) {
var groupId = originalGroup.getGroupId();
var instanceId = groupInstanceIdCreator.getInstanceIdForKey(groupId);
var uniqueId = _entities_columnGroup__WEBPACK_IMPORTED_MODULE_1__["ColumnGroup"].createUniqueId(groupId, instanceId);
var columnGroup = oldColumnsMapped[uniqueId];
// if the user is setting new colDefs, it is possible that the id's overlap, and we
// would have a false match from above. so we double check we are talking about the
// same original column group.
if (columnGroup && columnGroup.getOriginalColumnGroup() !== originalGroup) {
columnGroup = null;
}
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_5__["exists"])(columnGroup)) {
// clean out the old column group here, as we will be adding children into it again
columnGroup.reset();
}
else {
columnGroup = new _entities_columnGroup__WEBPACK_IMPORTED_MODULE_1__["ColumnGroup"](originalGroup, groupId, instanceId, pinned);
this.context.createBean(columnGroup);
}
return columnGroup;
};
// returns back a 2d map of ColumnGroup as follows: groupId -> instanceId -> ColumnGroup
DisplayedGroupCreator.prototype.mapOldGroupsById = function (displayedGroups) {
var result = {};
var recursive = function (columnsOrGroups) {
columnsOrGroups.forEach(function (columnOrGroup) {
if (columnOrGroup instanceof _entities_columnGroup__WEBPACK_IMPORTED_MODULE_1__["ColumnGroup"]) {
var columnGroup = columnOrGroup;
result[columnOrGroup.getUniqueId()] = columnGroup;
recursive(columnGroup.getChildren());
}
});
};
if (displayedGroups) {
recursive(displayedGroups);
}
return result;
};
DisplayedGroupCreator.prototype.setupParentsIntoColumns = function (columnsOrGroups, parent) {
var _this = this;
columnsOrGroups.forEach(function (columnsOrGroup) {
columnsOrGroup.setParent(parent);
if (columnsOrGroup instanceof _entities_columnGroup__WEBPACK_IMPORTED_MODULE_1__["ColumnGroup"]) {
var columnGroup = columnsOrGroup;
_this.setupParentsIntoColumns(columnGroup.getChildren(), columnGroup);
}
});
};
DisplayedGroupCreator.prototype.getOriginalPathForColumn = function (balancedColumnTree, column) {
var result = [];
var found = false;
var recursePath = function (balancedColumnTree, dept) {
for (var i = 0; i < balancedColumnTree.length; i++) {
// quit the search, so 'result' is kept with the found result
if (found) {
return;
}
var node = balancedColumnTree[i];
if (node instanceof _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_2__["OriginalColumnGroup"]) {
var nextNode = node;
recursePath(nextNode.getChildren(), dept + 1);
result[dept] = node;
}
else if (node === column) {
found = true;
}
}
};
recursePath(balancedColumnTree, 0);
// it's possible we didn't find a path. this happens if the column is generated
// by the grid (auto-group), in that the definition didn't come from the client. in this case,
// we create a fake original path.
if (found) {
return result;
}
console.warn('could not get path');
return null;
};
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnUtils')
], DisplayedGroupCreator.prototype, "columnUtils", void 0);
DisplayedGroupCreator = __decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('displayedGroupCreator')
], DisplayedGroupCreator);
return DisplayedGroupCreator;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_3__["BeanStub"]));
/***/ }),
/* 30 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ComponentUtil", function() { return ComponentUtil; });
/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23);
/* harmony import */ var _propertyKeys__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31);
/* harmony import */ var _utils_object__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(13);
/* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __spreadArrays = (undefined && undefined.__spreadArrays) || function () {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
};
var ComponentUtil = /** @class */ (function () {
function ComponentUtil() {
}
ComponentUtil.getEventCallbacks = function () {
if (!ComponentUtil.EVENT_CALLBACKS) {
ComponentUtil.EVENT_CALLBACKS = ComponentUtil.EVENTS.map(function (event) { return ComponentUtil.getCallbackForEvent(event); });
}
return ComponentUtil.EVENT_CALLBACKS;
};
ComponentUtil.copyAttributesToGridOptions = function (gridOptions, component, skipEventDeprecationCheck) {
if (skipEventDeprecationCheck === void 0) { skipEventDeprecationCheck = false; }
// create empty grid options if none were passed
if (typeof gridOptions !== 'object') {
gridOptions = {};
}
// to allow array style lookup in TypeScript, take type away from 'this' and 'gridOptions'
var pGridOptions = gridOptions;
var keyExists = function (key) { return typeof component[key] !== 'undefined'; };
// add in all the simple properties
__spreadArrays(ComponentUtil.ARRAY_PROPERTIES, ComponentUtil.STRING_PROPERTIES, ComponentUtil.OBJECT_PROPERTIES, ComponentUtil.FUNCTION_PROPERTIES, ComponentUtil.getEventCallbacks()).filter(keyExists)
.forEach(function (key) { return pGridOptions[key] = component[key]; });
ComponentUtil.BOOLEAN_PROPERTIES
.filter(keyExists)
.forEach(function (key) { return pGridOptions[key] = ComponentUtil.toBoolean(component[key]); });
ComponentUtil.NUMBER_PROPERTIES
.filter(keyExists)
.forEach(function (key) { return pGridOptions[key] = ComponentUtil.toNumber(component[key]); });
return gridOptions;
};
ComponentUtil.getCallbackForEvent = function (eventName) {
if (!eventName || eventName.length < 2) {
return eventName;
}
else {
return 'on' + eventName[0].toUpperCase() + eventName.substr(1);
}
};
ComponentUtil.processOnChange = function (changes, gridOptions, api, columnApi) {
if (!changes) {
return;
}
// to allow array style lookup in TypeScript, take type away from 'this' and 'gridOptions'
var pGridOptions = gridOptions;
var keyExists = function (key) { return changes[key]; };
// check if any change for the simple types, and if so, then just copy in the new value
__spreadArrays(ComponentUtil.ARRAY_PROPERTIES, ComponentUtil.OBJECT_PROPERTIES, ComponentUtil.STRING_PROPERTIES, ComponentUtil.getEventCallbacks()).filter(keyExists)
.forEach(function (key) { return pGridOptions[key] = changes[key].currentValue; });
ComponentUtil.BOOLEAN_PROPERTIES
.filter(keyExists)
.forEach(function (key) { return pGridOptions[key] = ComponentUtil.toBoolean(changes[key].currentValue); });
ComponentUtil.NUMBER_PROPERTIES
.filter(keyExists)
.forEach(function (key) { return pGridOptions[key] = ComponentUtil.toNumber(changes[key].currentValue); });
if (changes.enableCellTextSelection) {
api.setEnableCellTextSelection(ComponentUtil.toBoolean(changes.enableCellTextSelection.currentValue));
}
if (changes.quickFilterText) {
api.setQuickFilter(changes.quickFilterText.currentValue);
}
if (changes.rowData) {
api.setRowData(changes.rowData.currentValue);
}
if (changes.pinnedTopRowData) {
api.setPinnedTopRowData(changes.pinnedTopRowData.currentValue);
}
if (changes.pinnedBottomRowData) {
api.setPinnedBottomRowData(changes.pinnedBottomRowData.currentValue);
}
if (changes.autoGroupColumnDef) {
api.setAutoGroupColumnDef(changes.autoGroupColumnDef.currentValue, "gridOptionsChanged");
}
if (changes.columnDefs) {
api.setColumnDefs(changes.columnDefs.currentValue, "gridOptionsChanged");
}
if (changes.datasource) {
api.setDatasource(changes.datasource.currentValue);
}
if (changes.headerHeight) {
api.setHeaderHeight(ComponentUtil.toNumber(changes.headerHeight.currentValue));
}
if (changes.paginationPageSize) {
api.paginationSetPageSize(ComponentUtil.toNumber(changes.paginationPageSize.currentValue));
}
if (changes.pivotMode) {
columnApi.setPivotMode(ComponentUtil.toBoolean(changes.pivotMode.currentValue));
}
if (changes.groupRemoveSingleChildren) {
api.setGroupRemoveSingleChildren(ComponentUtil.toBoolean(changes.groupRemoveSingleChildren.currentValue));
}
if (changes.suppressRowDrag) {
api.setSuppressRowDrag(ComponentUtil.toBoolean(changes.suppressRowDrag.currentValue));
}
if (changes.suppressMoveWhenRowDragging) {
api.setSuppressMoveWhenRowDragging(ComponentUtil.toBoolean(changes.suppressMoveWhenRowDragging.currentValue));
}
if (changes.suppressRowClickSelection) {
api.setSuppressRowClickSelection(ComponentUtil.toBoolean(changes.suppressRowClickSelection.currentValue));
}
if (changes.suppressClipboardPaste) {
api.setSuppressClipboardPaste(ComponentUtil.toBoolean(changes.suppressClipboardPaste.currentValue));
}
if (changes.sideBar) {
api.setSideBar(changes.sideBar.currentValue);
}
// copy changes into an event for dispatch
var event = {
type: _events__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_COMPONENT_STATE_CHANGED,
api: gridOptions.api,
columnApi: gridOptions.columnApi
};
Object(_utils_object__WEBPACK_IMPORTED_MODULE_2__["iterateObject"])(changes, function (key, value) {
event[key] = value;
});
api.dispatchEvent(event);
};
ComponentUtil.toBoolean = function (value) {
if (typeof value === 'boolean') {
return value;
}
else if (typeof value === 'string') {
// for boolean, compare to empty String to allow attributes appearing with
// no value to be treated as 'true'
return value.toUpperCase() === 'TRUE' || value == '';
}
else {
return false;
}
};
ComponentUtil.toNumber = function (value) {
if (typeof value === 'number') {
return value;
}
else if (typeof value === 'string') {
return Number(value);
}
else {
return undefined;
}
};
// all the events are populated in here AFTER this class (at the bottom of the file).
ComponentUtil.EVENTS = [];
ComponentUtil.STRING_PROPERTIES = _propertyKeys__WEBPACK_IMPORTED_MODULE_1__["PropertyKeys"].STRING_PROPERTIES;
ComponentUtil.OBJECT_PROPERTIES = _propertyKeys__WEBPACK_IMPORTED_MODULE_1__["PropertyKeys"].OBJECT_PROPERTIES;
ComponentUtil.ARRAY_PROPERTIES = _propertyKeys__WEBPACK_IMPORTED_MODULE_1__["PropertyKeys"].ARRAY_PROPERTIES;
ComponentUtil.NUMBER_PROPERTIES = _propertyKeys__WEBPACK_IMPORTED_MODULE_1__["PropertyKeys"].NUMBER_PROPERTIES;
ComponentUtil.BOOLEAN_PROPERTIES = _propertyKeys__WEBPACK_IMPORTED_MODULE_1__["PropertyKeys"].BOOLEAN_PROPERTIES;
ComponentUtil.FUNCTION_PROPERTIES = _propertyKeys__WEBPACK_IMPORTED_MODULE_1__["PropertyKeys"].FUNCTION_PROPERTIES;
ComponentUtil.ALL_PROPERTIES = _propertyKeys__WEBPACK_IMPORTED_MODULE_1__["PropertyKeys"].ALL_PROPERTIES;
return ComponentUtil;
}());
ComponentUtil.EVENTS = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_3__["values"])(_events__WEBPACK_IMPORTED_MODULE_0__["Events"]);
/***/ }),
/* 31 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PropertyKeys", function() { return PropertyKeys; });
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __spreadArrays = (undefined && undefined.__spreadArrays) || function () {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
};
/**
* These keys are used for validating properties supplied on a gridOptions object, and for code generation.
* If you change the properties on the gridOptions interface, you *must* update this file as well to be consistent.
*/
var PropertyKeys = /** @class */ (function () {
function PropertyKeys() {
}
PropertyKeys.STRING_PROPERTIES = [
'sortingOrder', 'rowClass', 'rowSelection', 'overlayLoadingTemplate', 'overlayNoRowsTemplate',
'quickFilterText', 'rowModelType', 'editType', 'domLayout', 'clipboardDeliminator', 'rowGroupPanelShow',
'multiSortKey', 'pivotColumnGroupTotals', 'pivotRowTotals', 'pivotPanelShow', 'fillHandleDirection',
'serverSideStoreType'
];
PropertyKeys.OBJECT_PROPERTIES = [
'components', 'frameworkComponents', 'rowStyle', 'context', 'autoGroupColumnDef', 'localeText', 'icons',
'datasource', 'serverSideDatasource', 'viewportDatasource', 'groupRowRendererParams', 'aggFuncs',
'fullWidthCellRendererParams', 'defaultColGroupDef', 'defaultColDef', 'defaultExportParams', 'columnTypes',
'rowClassRules', 'detailGridOptions', 'detailCellRendererParams', 'loadingCellRendererParams',
'loadingOverlayComponentParams', 'noRowsOverlayComponentParams', 'popupParent', 'colResizeDefault',
'reduxStore', 'statusBar', 'sideBar', 'chartThemeOverrides', 'customChartThemes'
];
PropertyKeys.ARRAY_PROPERTIES = [
'alignedGrids', 'rowData', 'columnDefs', 'excelStyles', 'pinnedTopRowData', 'pinnedBottomRowData', 'chartThemes'
];
PropertyKeys.NUMBER_PROPERTIES = [
'rowHeight', 'detailRowHeight', 'rowBuffer', 'colWidth', 'headerHeight', 'groupHeaderHeight', 'floatingFiltersHeight',
'pivotHeaderHeight', 'pivotGroupHeaderHeight', 'groupDefaultExpanded', 'minColWidth', 'maxColWidth', 'viewportRowModelPageSize',
'viewportRowModelBufferSize', 'autoSizePadding', 'maxBlocksInCache', 'maxConcurrentDatasourceRequests', 'tooltipShowDelay',
'cacheOverflowSize', 'paginationPageSize', 'cacheBlockSize', 'infiniteInitialRowCount', 'scrollbarWidth',
'batchUpdateWaitMillis', 'asyncTransactionWaitMillis', 'blockLoadDebounceMillis', 'keepDetailRowsCount',
'undoRedoCellEditingLimit', 'cellFlashDelay', 'cellFadeDelay'
];
PropertyKeys.BOOLEAN_PROPERTIES = [
'suppressMakeColumnVisibleAfterUnGroup', 'suppressRowClickSelection', 'suppressCellSelection', 'suppressHorizontalScroll',
'alwaysShowVerticalScroll', 'debug', 'enableBrowserTooltips', 'enableCellExpressions',
'angularCompileRows', 'angularCompileFilters', 'groupSuppressAutoColumn', 'groupSelectsChildren', 'groupIncludeFooter',
'groupIncludeTotalFooter', 'groupUseEntireRow', 'groupSuppressBlankHeader', 'suppressMenuHide', 'suppressRowDeselection',
'unSortIcon', 'suppressMultiSort', 'singleClickEdit', 'suppressLoadingOverlay', 'suppressNoRowsOverlay', 'suppressAutoSize',
'skipHeaderOnAutoSize', 'suppressParentsInRowNodes', 'suppressColumnMoveAnimation', 'suppressMovableColumns',
'suppressFieldDotNotation', 'enableRangeSelection', 'enableRangeHandle', 'enableFillHandle', 'suppressClearOnFillReduction',
'deltaSort', 'suppressTouch', 'suppressAsyncEvents', 'allowContextMenuWithControlKey', 'suppressContextMenu',
'rememberGroupStateWhenNewData', 'enableCellChangeFlash', 'suppressDragLeaveHidesColumns', 'suppressMiddleClickScrolls',
'suppressPreventDefaultOnMouseWheel', 'suppressCopyRowsToClipboard', 'copyHeadersToClipboard', 'pivotMode',
'suppressAggFuncInHeader', 'suppressColumnVirtualisation', 'suppressAggAtRootLevel', 'suppressFocusAfterRefresh',
'functionsPassive', 'functionsReadOnly', 'animateRows', 'groupSelectsFiltered', 'groupRemoveSingleChildren',
'groupRemoveLowestSingleChildren', 'enableRtl', 'suppressClickEdit', 'rowDragManaged', 'suppressRowDrag',
'suppressMoveWhenRowDragging', 'enableMultiRowDragging', 'enableGroupEdit', 'embedFullWidthRows', 'deprecatedEmbedFullWidthRows',
'suppressPaginationPanel', 'floatingFilter', 'groupHideOpenParents', 'groupMultiAutoColumn', 'pagination',
'stopEditingWhenGridLosesFocus', 'paginationAutoPageSize', 'suppressScrollOnNewData', 'purgeClosedRowNodes', 'cacheQuickFilter',
'deltaRowDataMode', 'ensureDomOrder', 'accentedSort', 'suppressChangeDetection', 'valueCache', 'valueCacheNeverExpires',
'aggregateOnlyChangedColumns', 'suppressAnimationFrame', 'suppressExcelExport', 'suppressCsvExport', 'treeData',
'masterDetail', 'suppressMultiRangeSelection', 'enterMovesDownAfterEdit', 'enterMovesDown', 'suppressPropertyNamesCheck',
'rowMultiSelectWithClick', 'suppressEnterpriseResetOnNewColumns', 'enableOldSetFilterModel', 'suppressRowHoverHighlight',
'suppressRowTransform', 'suppressClipboardPaste', 'suppressLastEmptyLineOnPaste', 'serverSideSortingAlwaysResets',
'reactNext', 'suppressSetColumnStateEvents', 'suppressColumnStateEvents', 'enableCharts', 'deltaColumnMode', 'suppressMaintainUnsortedOrder',
'enableCellTextSelection', 'suppressBrowserResizeObserver', 'suppressMaxRenderedRowRestriction',
'excludeChildrenWhenTreeDataFiltering', 'tooltipMouseTrack', 'keepDetailRows', 'paginateChildRows', 'preventDefaultOnContextMenu',
'undoRedoCellEditing', 'allowDragFromColumnsToolPanel', 'immutableData', 'immutableColumns', 'pivotSuppressAutoColumn',
'suppressExpandablePivotGroups', 'applyColumnDefOrder', 'debounceVerticalScrollbar', 'detailRowAutoHeight',
'serverSideFilteringAlwaysResets', 'suppressAggFilteredOnly', 'showOpenedGroup', 'suppressClipboardApi'
];
/** You do not need to include event callbacks in this list, as they are generated automatically. */
PropertyKeys.FUNCTION_PROPERTIES = [
'localeTextFunc', 'groupRowInnerRenderer', 'groupRowInnerRendererFramework', 'dateComponent', 'dateComponentFramework', 'groupRowRenderer',
'groupRowRendererFramework', 'isExternalFilterPresent', 'getRowHeight', 'doesExternalFilterPass', 'getRowClass', 'getRowStyle',
'getRowClassRules', 'traverseNode', 'getContextMenuItems', 'getMainMenuItems', 'processRowPostCreate', 'processCellForClipboard',
'groupRowAggNodes', 'getRowNodeId', 'isFullWidthCell', 'fullWidthCellRenderer', 'fullWidthCellRendererFramework', 'processSecondaryColDef',
'processSecondaryColGroupDef', 'getBusinessKeyForNode', 'sendToClipboard', 'navigateToNextHeader', 'tabToNextHeader', 'navigateToNextCell',
'tabToNextCell', 'getDetailRowData', 'processCellFromClipboard', 'getDocument', 'postProcessPopup', 'getChildCount', 'getDataPath',
'loadingCellRenderer', 'loadingCellRendererFramework', 'loadingOverlayComponent', 'loadingOverlayComponentFramework', 'noRowsOverlayComponent',
'noRowsOverlayComponentFramework', 'detailCellRenderer', 'detailCellRendererFramework', 'defaultGroupSortComparator', 'isRowMaster',
'isRowSelectable', 'postSort', 'processHeaderForClipboard', 'paginationNumberFormatter', 'processDataFromClipboard', 'getServerSideGroupKey',
'isServerSideGroup', 'suppressKeyboardEvent', 'createChartContainer', 'processChartOptions', 'getChartToolbarItems', 'fillOperation',
'isApplyServerSideTransaction', 'getServerSideStoreParams', 'isServerSideGroupOpenByDefault'
];
PropertyKeys.ALL_PROPERTIES = __spreadArrays(PropertyKeys.ARRAY_PROPERTIES, PropertyKeys.OBJECT_PROPERTIES, PropertyKeys.STRING_PROPERTIES, PropertyKeys.NUMBER_PROPERTIES, PropertyKeys.FUNCTION_PROPERTIES, PropertyKeys.BOOLEAN_PROPERTIES);
/**
* Used when performing property checks. This avoids noise caused when using frameworks, which can add their own
* framework-specific properties to colDefs, gridOptions etc.
*/
PropertyKeys.FRAMEWORK_PROPERTIES = [
'__ob__', '__v_skip', '__metadata__', 'mappedColumnProperties', 'hasChildColumns', 'toColDef', 'createColDefFromGridColumn'
];
return PropertyKeys;
}());
/***/ }),
/* 32 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColDefUtil", function() { return ColDefUtil; });
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __spreadArrays = (undefined && undefined.__spreadArrays) || function () {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
};
var ColDefUtil = /** @class */ (function () {
function ColDefUtil() {
}
ColDefUtil.STRING_PROPERTIES = [
'headerName',
'columnGroupShow',
'headerClass',
'toolPanelClass',
'headerValueGetter',
'pivotKeys',
'groupId',
'colId',
'sort',
'initialSort',
'field',
'type',
'tooltipComponent',
'tooltipField',
'headerTooltip',
'cellClass',
'showRowGroup',
'template',
'templateUrl',
'filter',
'initialAggFunc',
'aggFunc',
'cellRenderer',
'cellEditor',
'pinned',
'initialPinned',
'chartDataType'
];
ColDefUtil.OBJECT_PROPERTIES = [
'headerGroupComponent',
'headerGroupComponentFramework',
'headerGroupComponentParams',
'cellStyle',
'cellRendererParams',
'cellEditorFramework',
'cellEditorParams',
'pinnedRowCellRendererFramework',
'pinnedRowCellRendererParams',
'filterFramework',
'filterParams',
'pivotValueColumn',
'headerComponent',
'headerComponentFramework',
'headerComponentParams',
'floatingFilterComponent',
'floatingFilterComponentParams',
'floatingFilterComponentFramework',
'tooltipComponent',
'tooltipComponentParams',
'tooltipComponentFramework',
'refData',
'columnsMenuParams'
];
ColDefUtil.ARRAY_PROPERTIES = [
'children',
'sortingOrder',
'allowedAggFuncs',
'menuTabs',
'pivotTotalColumnIds',
'cellClassRules',
'icons'
];
ColDefUtil.NUMBER_PROPERTIES = [
'sortedAt',
'sortIndex',
'initialSortIndex',
'flex',
'initialFlex',
'width',
'initialWidth',
'minWidth',
'maxWidth',
'rowGroupIndex',
'initialRowGroupIndex',
'pivotIndex',
'initialPivotIndex'
];
ColDefUtil.BOOLEAN_PROPERTIES = [
'suppressCellFlash',
'suppressColumnsToolPanel',
'suppressFiltersToolPanel',
'openByDefault',
'marryChildren',
'hide',
'initialHide',
'rowGroup',
'initialRowGroup',
'pivot',
'initialPivot',
'checkboxSelection',
'headerCheckboxSelection',
'headerCheckboxSelectionFilteredOnly',
'suppressMenu',
'suppressMovable',
'lockPosition',
'lockVisible',
'lockPinned',
'unSortIcon',
'suppressSizeToFit',
'suppressAutoSize',
'enableRowGroup',
'enablePivot',
'enableValue',
'editable',
'suppressPaste',
'suppressNavigable',
'enableCellChangeFlash',
'rowDrag',
'dndSource',
'autoHeight',
'wrapText',
'sortable',
'resizable',
'singleClickEdit',
'floatingFilter',
];
ColDefUtil.FUNCTION_PROPERTIES = [
'dndSourceOnRowDrag',
'valueGetter',
'valueSetter',
'filterValueGetter',
'keyCreator',
'cellRenderer',
'cellRendererFramework',
'pinnedRowCellRenderer',
'valueFormatter',
'pinnedRowValueFormatter',
'valueParser',
'comparator',
'equals',
'pivotComparator',
'suppressKeyboardEvent',
'suppressHeaderKeyboardEvent',
'colSpan',
'rowSpan',
'getQuickFilterText',
'newValueHandler',
'onCellValueChanged',
'onCellClicked',
'onCellDoubleClicked',
'onCellContextMenu',
'rowDragText',
'tooltipValueGetter',
'tooltipComponent',
'tooltipComponentFramework',
'cellRendererSelector',
'cellEditorSelector'
];
ColDefUtil.ALL_PROPERTIES = __spreadArrays(ColDefUtil.ARRAY_PROPERTIES, ColDefUtil.OBJECT_PROPERTIES, ColDefUtil.STRING_PROPERTIES, ColDefUtil.NUMBER_PROPERTIES, ColDefUtil.FUNCTION_PROPERTIES, ColDefUtil.BOOLEAN_PROPERTIES);
// used when doing property checks - this causes noise when using frameworks which can add their own fw specific
// properties to colDefs, gridOptions etc
ColDefUtil.FRAMEWORK_PROPERTIES = ['__ob__', '__v_skip', '__metadata__', 'mappedColumnProperties', 'hasChildColumns',
'toColDef', 'createColDefFromGridColumn'];
return ColDefUtil;
}());
/***/ }),
/* 33 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RegisteredComponentSource", function() { return RegisteredComponentSource; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UserComponentRegistry", function() { return UserComponentRegistry; });
/* harmony import */ var _rendering_cellEditors_textCellEditor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(34);
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12);
/* harmony import */ var _filter_provided_date_dateFilter__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(59);
/* harmony import */ var _headerRendering_header_headerComp__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(67);
/* harmony import */ var _headerRendering_headerGroup_headerGroupComp__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(69);
/* harmony import */ var _rendering_cellRenderers_groupCellRenderer__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(70);
/* harmony import */ var _rendering_cellRenderers_animateShowChangeCellRenderer__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(75);
/* harmony import */ var _rendering_cellRenderers_animateSlideCellRenderer__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(76);
/* harmony import */ var _rendering_cellRenderers_loadingCellRenderer__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(77);
/* harmony import */ var _rendering_cellEditors_selectCellEditor__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(78);
/* harmony import */ var _rendering_cellEditors_popupTextCellEditor__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(79);
/* harmony import */ var _rendering_cellEditors_popupSelectCellEditor__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(80);
/* harmony import */ var _rendering_cellEditors_largeTextCellEditor__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(81);
/* harmony import */ var _filter_provided_number_numberFilter__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(82);
/* harmony import */ var _rendering_overlays_loadingOverlayComponent__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(83);
/* harmony import */ var _rendering_overlays_noRowsOverlayComponent__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(84);
/* harmony import */ var _rendering_tooltipComponent__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(85);
/* harmony import */ var _filter_provided_date_defaultDateComponent__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(86);
/* harmony import */ var _filter_provided_date_dateFloatingFilter__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(87);
/* harmony import */ var _filter_provided_text_textFilter__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(89);
/* harmony import */ var _filter_provided_number_numberFloatingFilter__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(90);
/* harmony import */ var _filter_provided_text_textFloatingFilter__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(92);
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(20);
/* harmony import */ var _utils_object__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(13);
/* harmony import */ var _utils_function__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(15);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 RegisteredComponentSource;
(function (RegisteredComponentSource) {
RegisteredComponentSource[RegisteredComponentSource["DEFAULT"] = 0] = "DEFAULT";
RegisteredComponentSource[RegisteredComponentSource["REGISTERED"] = 1] = "REGISTERED";
})(RegisteredComponentSource || (RegisteredComponentSource = {}));
var UserComponentRegistry = /** @class */ (function (_super) {
__extends(UserComponentRegistry, _super);
function UserComponentRegistry() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.agGridDefaults = {
//date
agDateInput: _filter_provided_date_defaultDateComponent__WEBPACK_IMPORTED_MODULE_17__["DefaultDateComponent"],
//header
agColumnHeader: _headerRendering_header_headerComp__WEBPACK_IMPORTED_MODULE_3__["HeaderComp"],
agColumnGroupHeader: _headerRendering_headerGroup_headerGroupComp__WEBPACK_IMPORTED_MODULE_4__["HeaderGroupComp"],
//floating filters
agTextColumnFloatingFilter: _filter_provided_text_textFloatingFilter__WEBPACK_IMPORTED_MODULE_21__["TextFloatingFilter"],
agNumberColumnFloatingFilter: _filter_provided_number_numberFloatingFilter__WEBPACK_IMPORTED_MODULE_20__["NumberFloatingFilter"],
agDateColumnFloatingFilter: _filter_provided_date_dateFloatingFilter__WEBPACK_IMPORTED_MODULE_18__["DateFloatingFilter"],
// renderers
agAnimateShowChangeCellRenderer: _rendering_cellRenderers_animateShowChangeCellRenderer__WEBPACK_IMPORTED_MODULE_6__["AnimateShowChangeCellRenderer"],
agAnimateSlideCellRenderer: _rendering_cellRenderers_animateSlideCellRenderer__WEBPACK_IMPORTED_MODULE_7__["AnimateSlideCellRenderer"],
agGroupCellRenderer: _rendering_cellRenderers_groupCellRenderer__WEBPACK_IMPORTED_MODULE_5__["GroupCellRenderer"],
agGroupRowRenderer: _rendering_cellRenderers_groupCellRenderer__WEBPACK_IMPORTED_MODULE_5__["GroupCellRenderer"],
agLoadingCellRenderer: _rendering_cellRenderers_loadingCellRenderer__WEBPACK_IMPORTED_MODULE_8__["LoadingCellRenderer"],
//editors
agCellEditor: _rendering_cellEditors_textCellEditor__WEBPACK_IMPORTED_MODULE_0__["TextCellEditor"],
agTextCellEditor: _rendering_cellEditors_textCellEditor__WEBPACK_IMPORTED_MODULE_0__["TextCellEditor"],
agSelectCellEditor: _rendering_cellEditors_selectCellEditor__WEBPACK_IMPORTED_MODULE_9__["SelectCellEditor"],
agPopupTextCellEditor: _rendering_cellEditors_popupTextCellEditor__WEBPACK_IMPORTED_MODULE_10__["PopupTextCellEditor"],
agPopupSelectCellEditor: _rendering_cellEditors_popupSelectCellEditor__WEBPACK_IMPORTED_MODULE_11__["PopupSelectCellEditor"],
agLargeTextCellEditor: _rendering_cellEditors_largeTextCellEditor__WEBPACK_IMPORTED_MODULE_12__["LargeTextCellEditor"],
//filter
agTextColumnFilter: _filter_provided_text_textFilter__WEBPACK_IMPORTED_MODULE_19__["TextFilter"],
agNumberColumnFilter: _filter_provided_number_numberFilter__WEBPACK_IMPORTED_MODULE_13__["NumberFilter"],
agDateColumnFilter: _filter_provided_date_dateFilter__WEBPACK_IMPORTED_MODULE_2__["DateFilter"],
//overlays
agLoadingOverlay: _rendering_overlays_loadingOverlayComponent__WEBPACK_IMPORTED_MODULE_14__["LoadingOverlayComponent"],
agNoRowsOverlay: _rendering_overlays_noRowsOverlayComponent__WEBPACK_IMPORTED_MODULE_15__["NoRowsOverlayComponent"],
// tooltips
agTooltipComponent: _rendering_tooltipComponent__WEBPACK_IMPORTED_MODULE_16__["TooltipComponent"]
};
_this.agDeprecatedNames = {
set: {
newComponentName: 'agSetColumnFilter',
propertyHolder: 'filter'
},
text: {
newComponentName: 'agTextColumnFilter',
propertyHolder: 'filter'
},
number: {
newComponentName: 'agNumberColumnFilter',
propertyHolder: 'filter'
},
date: {
newComponentName: 'agDateColumnFilter',
propertyHolder: 'filter'
},
group: {
newComponentName: 'agGroupCellRenderer',
propertyHolder: 'cellRenderer'
},
animateShowChange: {
newComponentName: 'agAnimateShowChangeCellRenderer',
propertyHolder: 'cellRenderer'
},
animateSlide: {
newComponentName: 'agAnimateSlideCellRenderer',
propertyHolder: 'cellRenderer'
},
select: {
newComponentName: 'agSelectCellEditor',
propertyHolder: 'cellEditor'
},
largeText: {
newComponentName: 'agLargeTextCellEditor',
propertyHolder: 'cellEditor'
},
popupSelect: {
newComponentName: 'agPopupSelectCellEditor',
propertyHolder: 'cellEditor'
},
popupText: {
newComponentName: 'agPopupTextCellEditor',
propertyHolder: 'cellEditor'
},
richSelect: {
newComponentName: 'agRichSelectCellEditor',
propertyHolder: 'cellEditor'
},
headerComponent: {
newComponentName: 'agColumnHeader',
propertyHolder: 'headerComponent'
}
};
_this.jsComponents = {};
_this.frameworkComponents = {};
return _this;
}
UserComponentRegistry.prototype.init = function () {
var _this = this;
if (this.gridOptions.components != null) {
Object(_utils_object__WEBPACK_IMPORTED_MODULE_23__["iterateObject"])(this.gridOptions.components, function (key, component) { return _this.registerComponent(key, component); });
}
if (this.gridOptions.frameworkComponents != null) {
Object(_utils_object__WEBPACK_IMPORTED_MODULE_23__["iterateObject"])(this.gridOptions.frameworkComponents, function (key, component) { return _this.registerFwComponent(key, component); });
}
};
UserComponentRegistry.prototype.registerDefaultComponent = function (rawName, component) {
var name = this.translateIfDeprecated(rawName);
if (this.agGridDefaults[name]) {
console.error("Trying to overwrite a default component. You should call registerComponent");
return;
}
this.agGridDefaults[name] = component;
};
UserComponentRegistry.prototype.registerComponent = function (rawName, component) {
var name = this.translateIfDeprecated(rawName);
if (this.frameworkComponents[name]) {
console.error("Trying to register a component that you have already registered for frameworks: " + name);
return;
}
this.jsComponents[name] = component;
};
/**
* B the business interface (ie IHeader)
* A the agGridComponent interface (ie IHeaderComp). The final object acceptable by ag-grid
*/
UserComponentRegistry.prototype.registerFwComponent = function (rawName, component) {
var name = this.translateIfDeprecated(rawName);
if (this.jsComponents[name]) {
console.error("Trying to register a component that you have already registered for plain javascript: " + name);
return;
}
this.frameworkComponents[name] = component;
};
/**
* B the business interface (ie IHeader)
* A the agGridComponent interface (ie IHeaderComp). The final object acceptable by ag-grid
*/
UserComponentRegistry.prototype.retrieve = function (rawName) {
var name = this.translateIfDeprecated(rawName);
var frameworkComponent = this.frameworkComponents[name];
if (frameworkComponent) {
return {
componentFromFramework: true,
component: frameworkComponent,
source: RegisteredComponentSource.REGISTERED
};
}
var jsComponent = this.jsComponents[name];
if (jsComponent) {
return {
componentFromFramework: false,
component: jsComponent,
source: RegisteredComponentSource.REGISTERED
};
}
var defaultComponent = this.agGridDefaults[name];
if (defaultComponent) {
return {
componentFromFramework: false,
component: defaultComponent,
source: RegisteredComponentSource.DEFAULT
};
}
if (Object.keys(this.agGridDefaults).indexOf(name) < 0) {
console.warn("ag-Grid: Looking for component [" + name + "] but it wasn't found.");
}
return null;
};
UserComponentRegistry.prototype.translateIfDeprecated = function (raw) {
var deprecatedInfo = this.agDeprecatedNames[raw];
if (deprecatedInfo != null) {
Object(_utils_function__WEBPACK_IMPORTED_MODULE_24__["doOnce"])(function () {
console.warn("ag-grid. Since v15.0 component names have been renamed to be namespaced. You should rename " + deprecatedInfo.propertyHolder + ":" + raw + " to " + deprecatedInfo.propertyHolder + ":" + deprecatedInfo.newComponentName);
}, 'DEPRECATE_COMPONENT_' + raw);
return deprecatedInfo.newComponentName;
}
return raw;
};
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('gridOptions')
], UserComponentRegistry.prototype, "gridOptions", void 0);
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_1__["PostConstruct"]
], UserComponentRegistry.prototype, "init", null);
UserComponentRegistry = __decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Bean"])('userComponentRegistry')
], UserComponentRegistry);
return UserComponentRegistry;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_22__["BeanStub"]));
/***/ }),
/* 34 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextCellEditor", function() { return TextCellEditor; });
/* harmony import */ var _widgets_popupComponent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(35);
/* harmony import */ var _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(57);
/* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7);
/* harmony import */ var _utils_browser__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(43);
/* harmony import */ var _constants_keyCode__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(58);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 TextCellEditor = /** @class */ (function (_super) {
__extends(TextCellEditor, _super);
function TextCellEditor() {
return _super.call(this, TextCellEditor.TEMPLATE) || this;
}
TextCellEditor.prototype.init = function (params) {
this.params = params;
var eInput = this.eInput;
var startValue;
// cellStartedEdit is only false if we are doing fullRow editing
if (params.cellStartedEdit) {
this.focusAfterAttached = true;
if (params.keyPress === _constants_keyCode__WEBPACK_IMPORTED_MODULE_4__["KeyCode"].BACKSPACE || params.keyPress === _constants_keyCode__WEBPACK_IMPORTED_MODULE_4__["KeyCode"].DELETE) {
startValue = '';
}
else if (params.charPress) {
startValue = params.charPress;
}
else {
startValue = this.getStartValue(params);
if (params.keyPress !== _constants_keyCode__WEBPACK_IMPORTED_MODULE_4__["KeyCode"].F2) {
this.highlightAllOnFocus = true;
}
}
}
else {
this.focusAfterAttached = false;
startValue = this.getStartValue(params);
}
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_2__["exists"])(startValue)) {
eInput.setValue(startValue, true);
}
this.addManagedListener(eInput.getGui(), 'keydown', function (event) {
var keyCode = event.keyCode;
if (keyCode === _constants_keyCode__WEBPACK_IMPORTED_MODULE_4__["KeyCode"].PAGE_UP || keyCode === _constants_keyCode__WEBPACK_IMPORTED_MODULE_4__["KeyCode"].PAGE_DOWN) {
event.preventDefault();
}
});
};
TextCellEditor.prototype.afterGuiAttached = function () {
var translate = this.gridOptionsWrapper.getLocaleTextFunc();
var eInput = this.eInput;
eInput.setInputAriaLabel(translate('ariaInputEditor', 'Input Editor'));
if (!this.focusAfterAttached) {
return;
}
// Added for AG-3238. We can't remove this explicit focus() because Chrome requires an input
// to be focused before setSelectionRange will work. But it triggers a bug in Safari where
// explicitly focusing then blurring an empty field will cause the parent container to scroll.
if (!Object(_utils_browser__WEBPACK_IMPORTED_MODULE_3__["isBrowserSafari"])()) {
eInput.getFocusableElement().focus();
}
var inputEl = eInput.getInputElement();
if (this.highlightAllOnFocus) {
inputEl.select();
}
else {
// when we started editing, we want the caret at the end, not the start.
// this comes into play in two scenarios: a) when user hits F2 and b)
// when user hits a printable character, then on IE (and only IE) the caret
// was placed after the first character, thus 'apply' would end up as 'pplea'
var value = eInput.getValue();
var len = (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_2__["exists"])(value) && value.length) || 0;
if (len) {
inputEl.setSelectionRange(len, len);
}
}
};
// gets called when tabbing trough cells and in full row edit mode
TextCellEditor.prototype.focusIn = function () {
var eInput = this.eInput;
var focusEl = eInput.getFocusableElement();
var inputEl = eInput.getInputElement();
focusEl.focus();
inputEl.select();
};
TextCellEditor.prototype.focusOut = function () {
var inputEl = this.eInput.getInputElement();
if (Object(_utils_browser__WEBPACK_IMPORTED_MODULE_3__["isBrowserIE"])()) {
inputEl.setSelectionRange(0, 0);
}
};
TextCellEditor.prototype.getValue = function () {
var eInput = this.eInput;
return this.params.parseValue(eInput.getValue());
};
TextCellEditor.prototype.getStartValue = function (params) {
var formatValue = params.useFormatter || params.column.getColDef().refData;
return formatValue ? params.formatValue(params.value) : params.value;
};
TextCellEditor.prototype.isPopup = function () {
return false;
};
TextCellEditor.TEMPLATE = '
';
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_1__["RefSelector"])('eInput')
], TextCellEditor.prototype, "eInput", void 0);
return TextCellEditor;
}(_widgets_popupComponent__WEBPACK_IMPORTED_MODULE_0__["PopupComponent"]));
/***/ }),
/* 35 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PopupComponent", function() { return PopupComponent; });
/* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(36);
/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(42);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var PopupComponent = /** @class */ (function (_super) {
__extends(PopupComponent, _super);
function PopupComponent() {
return _super !== null && _super.apply(this, arguments) || this;
}
PopupComponent.prototype.isPopup = function () {
return true;
};
PopupComponent.prototype.setParentComponent = function (container) {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_1__["addCssClass"])(container.getGui(), 'ag-has-popup');
_super.prototype.setParentComponent.call(this, container);
};
PopupComponent.prototype.destroy = function () {
var parentComp = this.parentComponent;
var hasParent = parentComp && parentComp.isAlive();
if (hasParent) {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_1__["removeCssClass"])(parentComp.getGui(), 'ag-has-popup');
}
_super.prototype.destroy.call(this);
};
return PopupComponent;
}(_component__WEBPACK_IMPORTED_MODULE_0__["Component"]));
/***/ }),
/* 36 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Component", function() { return Component; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20);
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(37);
/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(42);
/* harmony import */ var _utils_array__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(14);
/* harmony import */ var _utils_function__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(15);
/* harmony import */ var _tooltipFeature__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(56);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 compIdSequence = new _utils__WEBPACK_IMPORTED_MODULE_2__["NumberSequence"]();
var Component = /** @class */ (function (_super) {
__extends(Component, _super);
function Component(template) {
var _this = _super.call(this) || this;
_this.annotatedGuiListeners = [];
// if false, then CSS class "ag-hidden" is applied, which sets "display: none"
_this.displayed = true;
// if false, then CSS class "ag-invisible" is applied, which sets "visibility: hidden"
_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();
// to minimise DOM hits, we only apply CSS classes if they have changed. as addding a CSS class that is already
// there, or removing one that wasn't present, all takes CPU.
_this.cssClassStates = {};
if (template) {
_this.setTemplate(template);
}
return _this;
}
Component.prototype.postConstructOnComponent = function () {
this.usingBrowserTooltips = this.gridOptionsWrapper.isEnableBrowserTooltips();
};
Component.prototype.getCompId = function () {
return this.compId;
};
Component.prototype.getTooltipParams = function () {
return {
value: this.tooltipText,
location: 'UNKNOWN'
};
};
Component.prototype.setTooltip = function (newTooltipText) {
var _this = this;
var removeTooltip = function () {
if (_this.usingBrowserTooltips) {
_this.getGui().removeAttribute('title');
}
else {
_this.tooltipFeature = _this.destroyBean(_this.tooltipFeature);
}
};
var addTooltip = function () {
if (_this.usingBrowserTooltips) {
_this.getGui().setAttribute('title', _this.tooltipText);
}
else {
_this.tooltipFeature = _this.createBean(new _tooltipFeature__WEBPACK_IMPORTED_MODULE_6__["TooltipFeature"](_this));
}
};
if (this.tooltipText != newTooltipText) {
if (this.tooltipText) {
removeTooltip();
}
this.tooltipText = newTooltipText;
if (this.tooltipText) {
addTooltip();
}
}
};
// for registered components only, eg creates AgCheckbox instance from ag-checkbox HTML tag
Component.prototype.createChildComponentsFromTags = function (parentNode, paramsMap) {
var _this = this;
// we MUST take a copy of the list first, as the 'swapComponentForNode' adds comments into the DOM
// which messes up the traversal order of the children.
var childNodeList = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["copyNodeList"])(parentNode.childNodes);
Object(_utils_array__WEBPACK_IMPORTED_MODULE_4__["forEach"])(childNodeList, function (childNode) {
if (!(childNode instanceof HTMLElement)) {
return;
}
var childComp = _this.createComponentFromElement(childNode, function (childComp) {
// copy over all attributes, including css classes, so any attributes user put on the tag
// wll be carried across
_this.copyAttributesFromNode(childNode, childComp.getGui());
}, paramsMap);
if (childComp) {
if (childComp.addItems && childNode.children.length) {
_this.createChildComponentsFromTags(childNode, paramsMap);
// converting from HTMLCollection to Array
var items = Array.prototype.slice.call(childNode.children);
childComp.addItems(items);
}
// replace the tag (eg ag-checkbox) with the proper HTMLElement (eg 'div') in the dom
_this.swapComponentForNode(childComp, parentNode, childNode);
}
else if (childNode.childNodes) {
_this.createChildComponentsFromTags(childNode, paramsMap);
}
});
};
Component.prototype.createComponentFromElement = function (element, afterPreCreateCallback, paramsMap) {
var key = element.nodeName;
var componentParams = paramsMap ? paramsMap[element.getAttribute('ref')] : undefined;
var ComponentClass = this.agStackComponentsRegistry.getComponentClass(key);
if (ComponentClass) {
var newComponent = new ComponentClass(componentParams);
this.createBean(newComponent, null, afterPreCreateCallback);
return newComponent;
}
return null;
};
Component.prototype.copyAttributesFromNode = function (source, dest) {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["iterateNamedNodeMap"])(source.attributes, function (name, value) { return dest.setAttribute(name, value); });
};
Component.prototype.swapComponentForNode = function (newComponent, parentNode, childNode) {
var eComponent = newComponent.getGui();
parentNode.replaceChild(eComponent, childNode);
parentNode.insertBefore(document.createComment(childNode.nodeName), eComponent);
this.addDestroyFunc(this.destroyBean.bind(this, newComponent));
this.swapInComponentForQuerySelectors(newComponent, childNode);
};
Component.prototype.swapInComponentForQuerySelectors = function (newComponent, childNode) {
var thisNoType = this;
this.iterateOverQuerySelectors(function (querySelector) {
if (thisNoType[querySelector.attributeName] === childNode) {
thisNoType[querySelector.attributeName] = newComponent;
}
});
};
Component.prototype.iterateOverQuerySelectors = function (action) {
var thisPrototype = Object.getPrototypeOf(this);
while (thisPrototype != null) {
var metaData = thisPrototype.__agComponentMetaData;
var currentProtoName = Object(_utils_function__WEBPACK_IMPORTED_MODULE_5__["getFunctionName"])(thisPrototype.constructor);
if (metaData && metaData[currentProtoName] && metaData[currentProtoName].querySelectors) {
Object(_utils_array__WEBPACK_IMPORTED_MODULE_4__["forEach"])(metaData[currentProtoName].querySelectors, function (querySelector) { return action(querySelector); });
}
thisPrototype = Object.getPrototypeOf(thisPrototype);
}
};
Component.prototype.setTemplate = function (template, paramsMap) {
var eGui = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["loadTemplate"])(template);
this.setTemplateFromElement(eGui, paramsMap);
};
Component.prototype.setTemplateFromElement = function (element, paramsMap) {
this.eGui = element;
this.eGui.__agComponent = this;
this.addAnnotatedGuiEventListeners();
this.wireQuerySelectors();
// context will not be available when user sets template in constructor
if (!!this.getContext()) {
this.createChildComponentsFromTags(this.getGui(), paramsMap);
}
};
Component.prototype.createChildComponentsPreConstruct = function () {
// ui exists if user sets template in constructor. when this happens, we have to wait for the context
// to be autoWired first before we can create child components.
if (!!this.getGui()) {
this.createChildComponentsFromTags(this.getGui());
}
};
Component.prototype.wireQuerySelectors = function () {
var _this = this;
if (!this.eGui) {
return;
}
var thisNoType = this;
this.iterateOverQuerySelectors(function (querySelector) {
var resultOfQuery = _this.eGui.querySelector(querySelector.querySelector);
if (resultOfQuery) {
thisNoType[querySelector.attributeName] = resultOfQuery.__agComponent || resultOfQuery;
}
else {
// put debug msg in here if query selector fails???
}
});
};
Component.prototype.addAnnotatedGuiEventListeners = function () {
var _this = this;
this.removeAnnotatedGuiEventListeners();
if (!this.eGui) {
return;
}
var listenerMethods = this.getAgComponentMetaData('guiListenerMethods');
if (!listenerMethods) {
return;
}
if (!this.annotatedGuiListeners) {
this.annotatedGuiListeners = [];
}
listenerMethods.forEach(function (meta) {
var element = _this.getRefElement(meta.ref);
if (!element) {
return;
}
var listener = _this[meta.methodName].bind(_this);
element.addEventListener(meta.eventName, listener);
_this.annotatedGuiListeners.push({ eventName: meta.eventName, listener: listener, element: element });
});
};
Component.prototype.addAnnotatedGridEventListeners = function () {
var _this = this;
var listenerMetas = this.getAgComponentMetaData('gridListenerMethods');
if (!listenerMetas) {
return;
}
listenerMetas.forEach(function (meta) {
var listener = _this[meta.methodName].bind(_this);
_this.addManagedListener(_this.eventService, meta.eventName, listener);
});
};
Component.prototype.getAgComponentMetaData = function (key) {
var res = [];
var thisProto = Object.getPrototypeOf(this);
while (thisProto != null) {
var metaData = thisProto.__agComponentMetaData;
var currentProtoName = Object(_utils_function__WEBPACK_IMPORTED_MODULE_5__["getFunctionName"])(thisProto.constructor);
if (metaData && metaData[currentProtoName] && metaData[currentProtoName][key]) {
res = res.concat(metaData[currentProtoName][key]);
}
thisProto = Object.getPrototypeOf(thisProto);
}
return res;
};
Component.prototype.removeAnnotatedGuiEventListeners = function () {
if (!this.annotatedGuiListeners) {
return;
}
Object(_utils_array__WEBPACK_IMPORTED_MODULE_4__["forEach"])(this.annotatedGuiListeners, function (e) {
e.element.removeEventListener(e.eventName, e.listener);
});
this.annotatedGuiListeners = [];
};
Component.prototype.getGui = function () {
return this.eGui;
};
Component.prototype.getFocusableElement = function () {
return this.eGui;
};
Component.prototype.setParentComponent = function (component) {
this.parentComponent = component;
};
Component.prototype.getParentComponent = function () {
return this.parentComponent;
};
// 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, container) {
if (!container) {
container = this.eGui;
}
if (newChild == null) {
return;
}
if (Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["isNodeOrElement"])(newChild)) {
container.appendChild(newChild);
}
else {
var childComponent = newChild;
container.appendChild(childComponent.getGui());
this.addDestroyFunc(this.destroyBean.bind(this, childComponent));
}
};
Component.prototype.isDisplayed = function () {
return this.displayed;
};
Component.prototype.setVisible = function (visible) {
if (visible !== this.visible) {
this.visible = visible;
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["setVisible"])(this.eGui, visible);
}
};
Component.prototype.setDisplayed = function (displayed) {
if (displayed !== this.displayed) {
this.displayed = displayed;
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["setDisplayed"])(this.eGui, displayed);
var event_1 = {
type: Component.EVENT_DISPLAYED_CHANGED,
visible: this.displayed
};
this.dispatchEvent(event_1);
}
};
Component.prototype.destroy = function () {
this.removeAnnotatedGuiEventListeners();
if (this.tooltipFeature) {
this.tooltipFeature = this.destroyBean(this.tooltipFeature);
}
_super.prototype.destroy.call(this);
};
Component.prototype.addGuiEventListener = function (event, listener) {
var _this = this;
this.eGui.addEventListener(event, listener);
this.addDestroyFunc(function () { return _this.eGui.removeEventListener(event, listener); });
};
Component.prototype.addCssClass = function (className) {
var updateNeeded = this.cssClassStates[className] !== true;
if (updateNeeded) {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["addCssClass"])(this.eGui, className);
this.cssClassStates[className] = true;
}
};
Component.prototype.removeCssClass = function (className) {
var updateNeeded = this.cssClassStates[className] !== false;
if (updateNeeded) {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["removeCssClass"])(this.eGui, className);
this.cssClassStates[className] = false;
}
};
Component.prototype.addOrRemoveCssClass = function (className, addOrRemove) {
var updateNeeded = this.cssClassStates[className] !== addOrRemove;
if (updateNeeded) {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["addOrRemoveCssClass"])(this.eGui, className, addOrRemove);
this.cssClassStates[className] = addOrRemove;
}
};
Component.prototype.getAttribute = function (key) {
var eGui = this.eGui;
return eGui ? eGui.getAttribute(key) : null;
};
Component.prototype.getRefElement = function (refName) {
return this.queryForHtmlElement("[ref=\"" + refName + "\"]");
};
Component.EVENT_DISPLAYED_CHANGED = 'displayedChanged';
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('agStackComponentsRegistry')
], Component.prototype, "agStackComponentsRegistry", void 0);
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_0__["PostConstruct"]
], Component.prototype, "postConstructOnComponent", null);
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_0__["PreConstruct"]
], Component.prototype, "createChildComponentsPreConstruct", null);
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_0__["PostConstruct"]
], Component.prototype, "addAnnotatedGridEventListeners", null);
return Component;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
/***/ }),
/* 37 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(38);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Color", function() { return _color__WEBPACK_IMPORTED_MODULE_0__["Color"]; });
/* harmony import */ var _csv__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(39);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stringToArray", function() { return _csv__WEBPACK_IMPORTED_MODULE_1__["stringToArray"]; });
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(40);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_", function() { return _utils__WEBPACK_IMPORTED_MODULE_2__["_"]; });
/* harmony import */ var _numberSequence__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(53);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NumberSequence", function() { return _numberSequence__WEBPACK_IMPORTED_MODULE_3__["NumberSequence"]; });
/* harmony import */ var _promise__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(54);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgPromiseStatus", function() { return _promise__WEBPACK_IMPORTED_MODULE_4__["AgPromiseStatus"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgPromise", function() { return _promise__WEBPACK_IMPORTED_MODULE_4__["AgPromise"]; });
/* harmony import */ var _timer__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(55);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Timer", function() { return _timer__WEBPACK_IMPORTED_MODULE_5__["Timer"]; });
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
/***/ }),
/* 38 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Color", function() { return Color; });
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var Color = /** @class */ (function () {
/**
* Every color component should be in the [0, 1] range.
* Some easing functions (such as elastic easing) can overshoot the target value by some amount.
* So, when animating colors, if the source or target color components are already near
* or at the edge of the allowed [0, 1] range, it is possible for the intermediate color
* component value to end up outside of that range mid-animation. For this reason the constructor
* performs range checking/constraining.
* @param r Red component.
* @param g Green component.
* @param b Blue component.
* @param a Alpha (opacity) component.
*/
function Color(r, g, b, a) {
if (a === void 0) { a = 1; }
// NaN is treated as 0.
this.r = Math.min(1, Math.max(0, r || 0));
this.g = Math.min(1, Math.max(0, g || 0));
this.b = Math.min(1, Math.max(0, b || 0));
this.a = Math.min(1, Math.max(0, a || 0));
}
/**
* The given string can be in one of the following formats:
* - #rgb
* - #rrggbb
* - rgb(r, g, b)
* - rgba(r, g, b, a)
* - CSS color name such as 'white', 'orange', 'cyan', etc.
* @param str
*/
Color.fromString = function (str) {
// hexadecimal notation
if (str.indexOf('#') >= 0) { // there can be some leading whitespace
return Color.fromHexString(str);
}
// color name
var hex = Color.nameToHex[str];
if (hex) {
return Color.fromHexString(hex);
}
// rgb(a) notation
if (str.indexOf('rgb') >= 0) {
return Color.fromRgbaString(str);
}
throw new Error("Invalid color string: '" + str + "'");
};
// Using separate RegExp for the short hex notation because strings like `#abcd`
// are matched as ['#abcd', 'ab', 'c', 'd', undefined] when the `{1,2}` quantifier is used.
Color.fromHexString = function (str) {
var values = str.match(Color.hexRe);
if (values) {
var r = parseInt(values[1], 16);
var g = parseInt(values[2], 16);
var b = parseInt(values[3], 16);
var a = values[4] !== undefined ? parseInt(values[4], 16) : 255;
return new Color(r / 255, g / 255, b / 255, a / 255);
}
values = str.match(Color.shortHexRe);
if (values) {
var r = parseInt(values[1], 16);
var g = parseInt(values[2], 16);
var b = parseInt(values[3], 16);
var a = values[4] !== undefined ? parseInt(values[4], 16) : 15;
r += r * 16;
g += g * 16;
b += b * 16;
a += a * 16;
return new Color(r / 255, g / 255, b / 255, a / 255);
}
throw new Error("Malformed hexadecimal color string: '" + str + "'");
};
Color.fromRgbaString = function (str) {
var values = str.match(Color.rgbRe);
if (values) {
return new Color(+values[1] / 255, +values[2] / 255, +values[3] / 255);
}
values = str.match(Color.rgbaRe);
if (values) {
return new Color(+values[1] / 255, +values[2] / 255, +values[3] / 255, +values[4]);
}
throw new Error("Malformed rgb/rgba color string: '" + str + "'");
};
Color.fromArray = function (arr) {
if (arr.length === 4) {
return new Color(arr[0], arr[1], arr[2], arr[3]);
}
if (arr.length === 3) {
return new Color(arr[0], arr[1], arr[2]);
}
throw new Error('The given array should contain 3 or 4 color components (numbers).');
};
/**
* Creates an instance of the Color class from the given HSB(A) components.
* @param h Hue in the [0, 360) range.
* @param s Saturation in the [0, 1] range.
* @param b Brightness in the [0, 1] range.
* @param alpha Opacity in the [0, 1] range. Defaults to 1 (completely opaque).
*/
Color.fromHSB = function (h, s, b, alpha) {
if (alpha === void 0) { alpha = 1; }
var rgb = Color.HSBtoRGB(h, s, b);
return new Color(rgb[0], rgb[1], rgb[2], alpha);
};
Color.padHex = function (str) {
// Can't use `padStart(2, '0')` here because of IE.
return str.length === 1 ? '0' + str : str;
};
Color.prototype.toHexString = function () {
var hex = '#'
+ Color.padHex(Math.round(this.r * 255).toString(16))
+ Color.padHex(Math.round(this.g * 255).toString(16))
+ Color.padHex(Math.round(this.b * 255).toString(16));
if (this.a < 1) {
hex += Color.padHex(Math.round(this.a * 255).toString(16));
}
return hex;
};
Color.prototype.toRgbaString = function (fractionDigits) {
if (fractionDigits === void 0) { fractionDigits = 3; }
var components = [
Math.round(this.r * 255),
Math.round(this.g * 255),
Math.round(this.b * 255)
];
var k = Math.pow(10, fractionDigits);
if (this.a !== 1) {
components.push(Math.round(this.a * k) / k);
return "rgba(" + components.join(', ') + ")";
}
return "rgb(" + components.join(', ') + ")";
};
Color.prototype.toString = function () {
if (this.a === 1) {
return this.toHexString();
}
return this.toRgbaString();
};
Color.prototype.toHSB = function () {
return Color.RGBtoHSB(this.r, this.g, this.b);
};
/**
* Converts the given RGB triple to an array of HSB (HSV) components.
* The hue component will be `NaN` for achromatic colors.
*/
Color.RGBtoHSB = function (r, g, b) {
var min = Math.min(r, g, b);
var max = Math.max(r, g, b);
var S = max !== 0 ? (max - min) / max : 0;
var H = NaN;
// min == max, means all components are the same
// and the color is a shade of gray with no hue (H is NaN)
if (min !== max) {
var delta = max - min;
var rc = (max - r) / delta;
var gc = (max - g) / delta;
var bc = (max - b) / delta;
if (r === max) {
H = bc - gc;
}
else if (g === max) {
H = 2.0 + rc - bc;
}
else {
H = 4.0 + gc - rc;
}
H /= 6.0;
if (H < 0) {
H = H + 1.0;
}
}
return [H * 360, S, max];
};
/**
* Converts the given HSB (HSV) triple to an array of RGB components.
*/
Color.HSBtoRGB = function (H, S, B) {
if (isNaN(H)) {
H = 0;
}
H = (((H % 360) + 360) % 360) / 360; // normalize hue to [0, 360] interval, then scale to [0, 1]
var r = 0;
var g = 0;
var b = 0;
if (S === 0) {
r = g = b = B;
}
else {
var h = (H - Math.floor(H)) * 6;
var f = h - Math.floor(h);
var p = B * (1 - S);
var q = B * (1 - S * f);
var t = B * (1 - (S * (1 - f)));
switch (h >> 0) { // discard the floating point part of the number
case 0:
r = B;
g = t;
b = p;
break;
case 1:
r = q;
g = B;
b = p;
break;
case 2:
r = p;
g = B;
b = t;
break;
case 3:
r = p;
g = q;
b = B;
break;
case 4:
r = t;
g = p;
b = B;
break;
case 5:
r = B;
g = p;
b = q;
break;
}
}
return [r, g, b];
};
Color.prototype.derive = function (hueShift, saturationFactor, brightnessFactor, opacityFactor) {
var hsb = Color.RGBtoHSB(this.r, this.g, this.b);
var b = hsb[2];
if (b == 0 && brightnessFactor > 1.0) {
b = 0.05;
}
var h = (((hsb[0] + hueShift) % 360) + 360) % 360;
var s = Math.max(Math.min(hsb[1] * saturationFactor, 1.0), 0.0);
b = Math.max(Math.min(b * brightnessFactor, 1.0), 0.0);
var a = Math.max(Math.min(this.a * opacityFactor, 1.0), 0.0);
var rgba = Color.HSBtoRGB(h, s, b);
rgba.push(a);
return Color.fromArray(rgba);
};
Color.prototype.brighter = function () {
return this.derive(0, 1.0, 1.0 / 0.7, 1.0);
};
Color.prototype.darker = function () {
return this.derive(0, 1.0, 0.7, 1.0);
};
// See https://drafts.csswg.org/css-color/#hex-notation
Color.hexRe = /\s*#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})?\s*$/;
Color.shortHexRe = /\s*#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])?\s*$/;
Color.rgbRe = /\s*rgb\((\d+),\s*(\d+),\s*(\d+)\)\s*/;
Color.rgbaRe = /\s*rgba\((\d+),\s*(\d+),\s*(\d+),\s*([.\d]+)\)\s*/;
/**
* CSS Color Module Level 4:
* https://drafts.csswg.org/css-color/#named-colors
*/
Color.nameToHex = Object.freeze({
aliceblue: '#F0F8FF',
antiquewhite: '#FAEBD7',
aqua: '#00FFFF',
aquamarine: '#7FFFD4',
azure: '#F0FFFF',
beige: '#F5F5DC',
bisque: '#FFE4C4',
black: '#000000',
blanchedalmond: '#FFEBCD',
blue: '#0000FF',
blueviolet: '#8A2BE2',
brown: '#A52A2A',
burlywood: '#DEB887',
cadetblue: '#5F9EA0',
chartreuse: '#7FFF00',
chocolate: '#D2691E',
coral: '#FF7F50',
cornflowerblue: '#6495ED',
cornsilk: '#FFF8DC',
crimson: '#DC143C',
cyan: '#00FFFF',
darkblue: '#00008B',
darkcyan: '#008B8B',
darkgoldenrod: '#B8860B',
darkgray: '#A9A9A9',
darkgreen: '#006400',
darkgrey: '#A9A9A9',
darkkhaki: '#BDB76B',
darkmagenta: '#8B008B',
darkolivegreen: '#556B2F',
darkorange: '#FF8C00',
darkorchid: '#9932CC',
darkred: '#8B0000',
darksalmon: '#E9967A',
darkseagreen: '#8FBC8F',
darkslateblue: '#483D8B',
darkslategray: '#2F4F4F',
darkslategrey: '#2F4F4F',
darkturquoise: '#00CED1',
darkviolet: '#9400D3',
deeppink: '#FF1493',
deepskyblue: '#00BFFF',
dimgray: '#696969',
dimgrey: '#696969',
dodgerblue: '#1E90FF',
firebrick: '#B22222',
floralwhite: '#FFFAF0',
forestgreen: '#228B22',
fuchsia: '#FF00FF',
gainsboro: '#DCDCDC',
ghostwhite: '#F8F8FF',
gold: '#FFD700',
goldenrod: '#DAA520',
gray: '#808080',
green: '#008000',
greenyellow: '#ADFF2F',
grey: '#808080',
honeydew: '#F0FFF0',
hotpink: '#FF69B4',
indianred: '#CD5C5C',
indigo: '#4B0082',
ivory: '#FFFFF0',
khaki: '#F0E68C',
lavender: '#E6E6FA',
lavenderblush: '#FFF0F5',
lawngreen: '#7CFC00',
lemonchiffon: '#FFFACD',
lightblue: '#ADD8E6',
lightcoral: '#F08080',
lightcyan: '#E0FFFF',
lightgoldenrodyellow: '#FAFAD2',
lightgray: '#D3D3D3',
lightgreen: '#90EE90',
lightgrey: '#D3D3D3',
lightpink: '#FFB6C1',
lightsalmon: '#FFA07A',
lightseagreen: '#20B2AA',
lightskyblue: '#87CEFA',
lightslategray: '#778899',
lightslategrey: '#778899',
lightsteelblue: '#B0C4DE',
lightyellow: '#FFFFE0',
lime: '#00FF00',
limegreen: '#32CD32',
linen: '#FAF0E6',
magenta: '#FF00FF',
maroon: '#800000',
mediumaquamarine: '#66CDAA',
mediumblue: '#0000CD',
mediumorchid: '#BA55D3',
mediumpurple: '#9370DB',
mediumseagreen: '#3CB371',
mediumslateblue: '#7B68EE',
mediumspringgreen: '#00FA9A',
mediumturquoise: '#48D1CC',
mediumvioletred: '#C71585',
midnightblue: '#191970',
mintcream: '#F5FFFA',
mistyrose: '#FFE4E1',
moccasin: '#FFE4B5',
navajowhite: '#FFDEAD',
navy: '#000080',
oldlace: '#FDF5E6',
olive: '#808000',
olivedrab: '#6B8E23',
orange: '#FFA500',
orangered: '#FF4500',
orchid: '#DA70D6',
palegoldenrod: '#EEE8AA',
palegreen: '#98FB98',
paleturquoise: '#AFEEEE',
palevioletred: '#DB7093',
papayawhip: '#FFEFD5',
peachpuff: '#FFDAB9',
peru: '#CD853F',
pink: '#FFC0CB',
plum: '#DDA0DD',
powderblue: '#B0E0E6',
purple: '#800080',
rebeccapurple: '#663399',
red: '#FF0000',
rosybrown: '#BC8F8F',
royalblue: '#4169E1',
saddlebrown: '#8B4513',
salmon: '#FA8072',
sandybrown: '#F4A460',
seagreen: '#2E8B57',
seashell: '#FFF5EE',
sienna: '#A0522D',
silver: '#C0C0C0',
skyblue: '#87CEEB',
slateblue: '#6A5ACD',
slategray: '#708090',
slategrey: '#708090',
snow: '#FFFAFA',
springgreen: '#00FF7F',
steelblue: '#4682B4',
tan: '#D2B48C',
teal: '#008080',
thistle: '#D8BFD8',
tomato: '#FF6347',
turquoise: '#40E0D0',
violet: '#EE82EE',
wheat: '#F5DEB3',
white: '#FFFFFF',
whitesmoke: '#F5F5F5',
yellow: '#FFFF00',
yellowgreen: '#9ACD32'
});
return Color;
}());
/***/ }),
/* 39 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stringToArray", function() { return stringToArray; });
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
// Based on https://stackoverflow.com/a/14991797
// This will parse a delimited string into an array of arrays.
function stringToArray(strData, delimiter) {
if (delimiter === void 0) { delimiter = ','; }
var data = [];
var isNewline = function (char) { return char === '\r' || char === '\n'; };
var insideQuotedField = false;
var _loop_1 = function (row, column, position) {
var previousChar = strData[position - 1];
var currentChar = strData[position];
var nextChar = strData[position + 1];
var ensureDataExists = function () {
if (!data[row]) {
// create row if it doesn't exist
data[row] = [];
}
if (!data[row][column]) {
// create column if it doesn't exist
data[row][column] = '';
}
};
ensureDataExists();
if (currentChar === '"') {
if (insideQuotedField) {
if (nextChar === '"') {
// unescape double quote
data[row][column] += '"';
position++;
}
else {
// exit quoted field
insideQuotedField = false;
}
return out_row_1 = row, out_column_1 = column, out_position_1 = position, "continue";
}
else if (previousChar === undefined || previousChar === delimiter || isNewline(previousChar)) {
// enter quoted field
insideQuotedField = true;
return out_row_1 = row, out_column_1 = column, out_position_1 = position, "continue";
}
}
if (!insideQuotedField) {
if (currentChar === delimiter) {
// move to next column
column++;
ensureDataExists();
return out_row_1 = row, out_column_1 = column, out_position_1 = position, "continue";
}
else if (isNewline(currentChar)) {
// move to next row
column = 0;
row++;
ensureDataExists();
if (currentChar === '\r' && nextChar === '\n') {
// skip over second newline character if it exists
position++;
}
return out_row_1 = row, out_column_1 = column, out_position_1 = position, "continue";
}
}
// add current character to current column
data[row][column] += currentChar;
out_row_1 = row;
out_column_1 = column;
out_position_1 = position;
};
var out_row_1, out_column_1, out_position_1;
// iterate over each character, keep track of current row and column (of the returned array)
for (var row = 0, column = 0, position = 0; position < strData.length; position++) {
_loop_1(row, column, position);
row = out_row_1;
column = out_column_1;
position = out_position_1;
}
return data;
}
/***/ }),
/* 40 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_", function() { return _; });
/* harmony import */ var _general__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(41);
/* harmony import */ var _aria__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(44);
/* harmony import */ var _array__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(14);
/* harmony import */ var _browser__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(43);
/* harmony import */ var _csv__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(39);
/* harmony import */ var _date__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(45);
/* harmony import */ var _dom__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(42);
/* harmony import */ var _event__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(21);
/* harmony import */ var _function__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(15);
/* harmony import */ var _fuzzyMatch__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46);
/* harmony import */ var _generic__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(7);
/* harmony import */ var _icon__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(47);
/* harmony import */ var _keyboard__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(48);
/* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(49);
/* harmony import */ var _mouse__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(50);
/* harmony import */ var _number__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(28);
/* harmony import */ var _object__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(13);
/* harmony import */ var _rowNode__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(51);
/* harmony import */ var _set__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(52);
/* harmony import */ var _string__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(26);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __assign = (undefined && undefined.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var utils = __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, _general__WEBPACK_IMPORTED_MODULE_0__), _aria__WEBPACK_IMPORTED_MODULE_1__), _array__WEBPACK_IMPORTED_MODULE_2__), _browser__WEBPACK_IMPORTED_MODULE_3__), _csv__WEBPACK_IMPORTED_MODULE_4__), _date__WEBPACK_IMPORTED_MODULE_5__), _dom__WEBPACK_IMPORTED_MODULE_6__), _event__WEBPACK_IMPORTED_MODULE_7__), _function__WEBPACK_IMPORTED_MODULE_8__), _fuzzyMatch__WEBPACK_IMPORTED_MODULE_9__), _generic__WEBPACK_IMPORTED_MODULE_10__), _icon__WEBPACK_IMPORTED_MODULE_11__), _keyboard__WEBPACK_IMPORTED_MODULE_12__), _map__WEBPACK_IMPORTED_MODULE_13__), _mouse__WEBPACK_IMPORTED_MODULE_14__), _number__WEBPACK_IMPORTED_MODULE_15__), _object__WEBPACK_IMPORTED_MODULE_16__), _rowNode__WEBPACK_IMPORTED_MODULE_17__), _set__WEBPACK_IMPORTED_MODULE_18__), _string__WEBPACK_IMPORTED_MODULE_19__);
var _ = utils;
/***/ }),
/* 41 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNameOfClass", function() { return getNameOfClass; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findLineByLeastSquares", function() { return findLineByLeastSquares; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cssStyleObjectToMarkup", function() { return cssStyleObjectToMarkup; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "message", function() { return message; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bindCellRendererToHtmlElement", function() { return bindCellRendererToHtmlElement; });
/* harmony import */ var _dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(42);
/* harmony import */ var _string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26);
/* harmony import */ var _object__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(13);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
/** @deprecated */
function getNameOfClass(theClass) {
var funcNameRegex = /function (.{1,})\(/;
var funcAsString = theClass.toString();
var results = funcNameRegex.exec(funcAsString);
return results && results.length > 1 ? results[1] : "";
}
function findLineByLeastSquares(values) {
var len = values.length;
var maxDecimals = 0;
if (len <= 1) {
return values;
}
for (var i = 0; i < values.length; i++) {
var value = values[i];
if (Math.floor(value) === value) {
continue;
}
maxDecimals = Math.max(maxDecimals, value.toString().split('.')[1].length);
}
var sum_x = 0;
var sum_y = 0;
var sum_xy = 0;
var sum_xx = 0;
var y = 0;
for (var x = 0; x < len; x++) {
y = values[x];
sum_x += x;
sum_y += y;
sum_xx += x * x;
sum_xy += x * y;
}
var m = (len * sum_xy - sum_x * sum_y) / (len * sum_xx - sum_x * sum_x);
var b = (sum_y / len) - (m * sum_x) / len;
var result = [];
for (var x = 0; x <= len; x++) {
result.push(parseFloat((x * m + b).toFixed(maxDecimals)));
}
return result;
}
/**
* Converts a CSS object into string
* @param {Object} stylesToUse an object eg: {color: 'black', top: '25px'}
* @return {string} A string like "color: black; top: 25px;" for html
*/
function cssStyleObjectToMarkup(stylesToUse) {
if (!stylesToUse) {
return '';
}
var resParts = [];
Object(_object__WEBPACK_IMPORTED_MODULE_2__["iterateObject"])(stylesToUse, function (styleKey, styleValue) {
var styleKeyDashed = Object(_string__WEBPACK_IMPORTED_MODULE_1__["camelCaseToHyphen"])(styleKey);
resParts.push(styleKeyDashed + ": " + styleValue + ";");
});
return resParts.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.
* @param {string} msg
*/
function message(msg) {
var eMessage = document.createElement('div');
var eBox = document.querySelector('#__ag__message');
eMessage.innerHTML = msg;
if (!eBox) {
var template = "";
eBox = Object(_dom__WEBPACK_IMPORTED_MODULE_0__["loadTemplate"])(template);
if (document.body) {
document.body.appendChild(eBox);
}
}
eBox.insertBefore(eMessage, eBox.children[0]);
}
/**
* cell renderers are used in a few places. they bind to dom slightly differently to other cell renderes as they
* can return back strings (instead of html elemnt) in the getGui() method. common code placed here to handle that.
* @param {AgPromise} cellRendererPromise
* @param {HTMLElement} eTarget
*/
function bindCellRendererToHtmlElement(cellRendererPromise, eTarget) {
cellRendererPromise.then(function (cellRenderer) {
var gui = cellRenderer.getGui();
if (gui != null) {
if (typeof gui === 'object') {
eTarget.appendChild(gui);
}
else {
eTarget.innerHTML = gui;
}
}
});
}
/***/ }),
/* 42 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addCssClass", function() { return addCssClass; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeCssClass", function() { return removeCssClass; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addOrRemoveCssClass", function() { return addOrRemoveCssClass; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "radioCssClass", function() { return radioCssClass; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "containsClass", function() { return containsClass; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFocusableFormField", function() { return isFocusableFormField; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setDisplayed", function() { return setDisplayed; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setVisible", function() { return setVisible; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setDisabled", function() { return setDisabled; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isElementChildOfClass", function() { return isElementChildOfClass; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getElementSize", function() { return getElementSize; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getInnerHeight", function() { return getInnerHeight; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getInnerWidth", function() { return getInnerWidth; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAbsoluteHeight", function() { return getAbsoluteHeight; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAbsoluteWidth", function() { return getAbsoluteWidth; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isRtlNegativeScroll", function() { return isRtlNegativeScroll; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getScrollLeft", function() { return getScrollLeft; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setScrollLeft", function() { return setScrollLeft; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clearElement", function() { return clearElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeElement", function() { return removeElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeFromParent", function() { return removeFromParent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isVisible", function() { return isVisible; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "loadTemplate", function() { return loadTemplate; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "appendHtml", function() { return appendHtml; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getElementAttribute", function() { return getElementAttribute; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "offsetHeight", function() { return offsetHeight; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "offsetWidth", function() { return offsetWidth; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ensureDomOrder", function() { return ensureDomOrder; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setDomChildOrder", function() { return setDomChildOrder; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertTemplateWithDomOrder", function() { return insertTemplateWithDomOrder; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prependDC", function() { return prependDC; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addStylesToElement", function() { return addStylesToElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isHorizontalScrollShowing", function() { return isHorizontalScrollShowing; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isVerticalScrollShowing", function() { return isVerticalScrollShowing; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setElementWidth", function() { return setElementWidth; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setFixedWidth", function() { return setFixedWidth; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setElementHeight", function() { return setElementHeight; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setFixedHeight", function() { return setFixedHeight; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "formatSize", function() { return formatSize; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNode", function() { return isNode; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isElement", function() { return isElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNodeOrElement", function() { return isNodeOrElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copyNodeList", function() { return copyNodeList; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "iterateNamedNodeMap", function() { return iterateNamedNodeMap; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setCheckboxState", function() { return setCheckboxState; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addOrRemoveAttribute", function() { return addOrRemoveAttribute; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "nodeListForEach", function() { return nodeListForEach; });
/* harmony import */ var _browser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(43);
/* harmony import */ var _generic__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7);
/* harmony import */ var _object__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(13);
/* harmony import */ var _string__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(26);
/* harmony import */ var _constants_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(16);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var rtlNegativeScroll;
function addCssClass(element, className) {
if (!element || !className || className.length === 0) {
return;
}
if (className.indexOf(' ') >= 0) {
className.split(' ').forEach(function (value) { return addCssClass(element, value); });
return;
}
if (element.classList) {
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.setAttribute('class', cssClasses.join(' '));
}
}
else {
// do not use element.classList = className here, it will cause
// a read-only assignment error on some browsers (IE/Edge).
element.setAttribute('class', className);
}
return element;
}
function removeCssClass(element, className) {
if (!element || !className || className.length === 0) {
return;
}
if (className.indexOf(' ') >= 0) {
className.split(' ').forEach(function (value) { return removeCssClass(element, value); });
return;
}
if (element.classList) {
element.classList.remove(className);
}
else if (element.className && element.className.length > 0) {
var newClassName = element.className.split(' ').filter(function (c) { return c !== className; }).join(' ');
element.setAttribute('class', newClassName);
}
}
function addOrRemoveCssClass(element, className, addOrRemove) {
if (addOrRemove) {
addCssClass(element, className);
}
else {
removeCssClass(element, className);
}
}
/**
* This method adds a class to an element and remove that class from all siblings.
* Useful for toggling state.
* @param {HTMLElement} element The element to receive the class
* @param {string} elementClass The class to be assigned to the element
* @param {boolean} otherElementClass The class to be assigned to siblings of the element, but not the element itself
*/
function radioCssClass(element, elementClass, otherElementClass) {
var parent = element.parentElement;
var sibling = parent.firstChild;
while (sibling) {
if (elementClass) {
addOrRemoveCssClass(sibling, elementClass, sibling === element);
}
if (otherElementClass) {
addOrRemoveCssClass(sibling, otherElementClass, sibling !== element);
}
sibling = sibling.nextSibling;
}
}
function containsClass(element, className) {
if (element.classList) {
// for modern browsers
return element.classList.contains(className);
}
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;
}
// if item is not a node
return false;
}
function isFocusableFormField(element) {
var matches = Element.prototype.matches || Element.prototype.msMatchesSelector;
var isFocusable = matches.call(element, _constants_constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].INPUT_SELECTOR);
var isNotFocusable = matches.call(element, _constants_constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].FOCUSABLE_EXCLUDE);
var isElementVisible = isVisible(element);
var focusable = isFocusable && !isNotFocusable && isElementVisible;
return focusable;
}
function setDisplayed(element, displayed) {
addOrRemoveCssClass(element, 'ag-hidden', !displayed);
}
function setVisible(element, visible) {
addOrRemoveCssClass(element, 'ag-invisible', !visible);
}
function setDisabled(element, disabled) {
var attributeName = 'disabled';
var addOrRemoveDisabledAttribute = disabled ?
function (e) { return e.setAttribute(attributeName, ''); } :
function (e) { return e.removeAttribute(attributeName); };
addOrRemoveDisabledAttribute(element);
nodeListForEach(element.querySelectorAll('input'), function (input) { return addOrRemoveDisabledAttribute(input); });
}
function isElementChildOfClass(element, cls, maxNest) {
var counter = 0;
while (element) {
if (containsClass(element, cls)) {
return true;
}
element = element.parentElement;
if (maxNest && ++counter > maxNest) {
break;
}
}
return false;
}
function getElementSize(el) {
var _a = window.getComputedStyle(el), height = _a.height, width = _a.width, paddingTop = _a.paddingTop, paddingRight = _a.paddingRight, paddingBottom = _a.paddingBottom, paddingLeft = _a.paddingLeft, marginTop = _a.marginTop, marginRight = _a.marginRight, marginBottom = _a.marginBottom, marginLeft = _a.marginLeft, boxSizing = _a.boxSizing;
return {
height: parseFloat(height),
width: parseFloat(width),
paddingTop: parseFloat(paddingTop),
paddingRight: parseFloat(paddingRight),
paddingBottom: parseFloat(paddingBottom),
paddingLeft: parseFloat(paddingLeft),
marginTop: parseFloat(marginTop),
marginRight: parseFloat(marginRight),
marginBottom: parseFloat(marginBottom),
marginLeft: parseFloat(marginLeft),
boxSizing: boxSizing
};
}
function getInnerHeight(el) {
var size = getElementSize(el);
if (size.boxSizing === 'border-box') {
return size.height - size.paddingTop - size.paddingBottom;
}
return size.height;
}
function getInnerWidth(el) {
var size = getElementSize(el);
if (size.boxSizing === 'border-box') {
return size.width - size.paddingLeft - size.paddingRight;
}
return size.width;
}
function getAbsoluteHeight(el) {
var size = getElementSize(el);
var marginRight = size.marginBottom + size.marginTop;
return Math.ceil(el.offsetHeight + marginRight);
}
function getAbsoluteWidth(el) {
var size = getElementSize(el);
var marginWidth = size.marginLeft + size.marginRight;
return Math.ceil(el.offsetWidth + marginWidth);
}
function isRtlNegativeScroll() {
if (typeof rtlNegativeScroll === "boolean") {
return rtlNegativeScroll;
}
var template = document.createElement('div');
template.style.direction = 'rtl';
template.style.width = '1px';
template.style.height = '1px';
template.style.position = 'fixed';
template.style.top = '0px';
template.style.overflow = 'hidden';
template.dir = 'rtl';
template.innerHTML = /* html */
"
\n \n \n
";
document.body.appendChild(template);
template.scrollLeft = 1;
rtlNegativeScroll = template.scrollLeft === 0;
document.body.removeChild(template);
return rtlNegativeScroll;
}
function getScrollLeft(element, rtl) {
var scrollLeft = element.scrollLeft;
if (rtl) {
// Absolute value - for FF that reports RTL scrolls in negative numbers
scrollLeft = Math.abs(scrollLeft);
if (Object(_browser__WEBPACK_IMPORTED_MODULE_0__["isBrowserChrome"])() && !isRtlNegativeScroll()) {
scrollLeft = element.scrollWidth - element.clientWidth - scrollLeft;
}
}
return scrollLeft;
}
function setScrollLeft(element, value, rtl) {
if (rtl) {
// Chrome and Safari when doing RTL have the END position of the scroll as zero, not the start
if (isRtlNegativeScroll()) {
value *= -1;
}
else if (Object(_browser__WEBPACK_IMPORTED_MODULE_0__["isBrowserSafari"])() || Object(_browser__WEBPACK_IMPORTED_MODULE_0__["isBrowserChrome"])()) {
value = element.scrollWidth - element.clientWidth - value;
}
}
element.scrollLeft = value;
}
function clearElement(el) {
while (el && el.firstChild) {
el.removeChild(el.firstChild);
}
}
/** @deprecated */
function removeElement(parent, cssSelector) {
removeFromParent(parent.querySelector(cssSelector));
}
function removeFromParent(node) {
if (node && node.parentNode) {
node.parentNode.removeChild(node);
}
}
function isVisible(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)
* @param {string} template
* @returns {HTMLElement}
*/
function loadTemplate(template) {
var tempDiv = document.createElement('div');
tempDiv.innerHTML = (template || '').trim();
return tempDiv.firstChild;
}
function appendHtml(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;
}
}
/** @deprecated */
function getElementAttribute(element, attributeName) {
if (element.attributes && element.attributes[attributeName]) {
var attribute = element.attributes[attributeName];
return attribute.value;
}
return null;
}
function offsetHeight(element) {
return element && element.clientHeight ? element.clientHeight : 0;
}
function offsetWidth(element) {
return element && element.clientWidth ? element.clientWidth : 0;
}
function ensureDomOrder(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 && eContainer.firstChild !== eChild) {
// insert it at the first location
eContainer.insertAdjacentElement('afterbegin', eChild);
}
}
}
function setDomChildOrder(eContainer, orderedChildren) {
for (var i = 0; i < orderedChildren.length; i++) {
var correctCellAtIndex = orderedChildren[i];
var actualCellAtIndex = eContainer.children[i];
if (actualCellAtIndex !== correctCellAtIndex) {
eContainer.insertBefore(correctCellAtIndex, actualCellAtIndex);
}
}
}
function insertTemplateWithDomOrder(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;
}
/** @deprecated */
function prependDC(parent, documentFragment) {
if (Object(_generic__WEBPACK_IMPORTED_MODULE_1__["exists"])(parent.firstChild)) {
parent.insertBefore(documentFragment, parent.firstChild);
}
else {
parent.appendChild(documentFragment);
}
}
function addStylesToElement(eElement, styles) {
if (!styles) {
return;
}
Object.keys(styles).forEach(function (key) {
var keyCamelCase = Object(_string__WEBPACK_IMPORTED_MODULE_3__["hyphenToCamelCase"])(key);
if (keyCamelCase) {
eElement.style[keyCamelCase] = styles[key];
}
});
}
function isHorizontalScrollShowing(element) {
return element.clientWidth < element.scrollWidth;
}
function isVerticalScrollShowing(element) {
return element.clientHeight < element.scrollHeight;
}
function setElementWidth(element, width) {
if (width === 'flex') {
element.style.width = null;
element.style.minWidth = null;
element.style.maxWidth = null;
element.style.flex = '1 1 auto';
}
else {
setFixedWidth(element, width);
}
}
function setFixedWidth(element, width) {
width = formatSize(width);
element.style.width = width.toString();
element.style.maxWidth = width.toString();
element.style.minWidth = width.toString();
}
function setElementHeight(element, height) {
if (height === 'flex') {
element.style.height = null;
element.style.minHeight = null;
element.style.maxHeight = null;
element.style.flex = '1 1 auto';
}
else {
setFixedHeight(element, height);
}
}
function setFixedHeight(element, height) {
height = formatSize(height);
element.style.height = height.toString();
element.style.maxHeight = height.toString();
element.style.minHeight = height.toString();
}
function formatSize(size) {
if (typeof size === 'number') {
return size + "px";
}
return size;
}
/**
* 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
* @param {any} o
* @return {boolean}
*/
function isNode(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
* @param {any} o
* @returns {boolean}
*/
function isElement(o) {
return (typeof HTMLElement === 'function'
? o instanceof HTMLElement //DOM2
: o && Object(_object__WEBPACK_IMPORTED_MODULE_2__["isNonNullObject"])(o) && o.nodeType === 1 && typeof o.nodeName === 'string');
}
function isNodeOrElement(o) {
return isNode(o) || isElement(o);
}
/**
* Makes a copy of a node list into a list
* @param {NodeList} nodeList
* @returns {Node[]}
*/
function copyNodeList(nodeList) {
if (nodeList == null) {
return [];
}
var result = [];
nodeListForEach(nodeList, function (node) { return result.push(node); });
return result;
}
function iterateNamedNodeMap(map, callback) {
if (!map) {
return;
}
for (var i = 0; i < map.length; i++) {
var attr = map[i];
callback(attr.name, attr.value);
}
}
/** @deprecated */
function setCheckboxState(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;
}
}
function addOrRemoveAttribute(element, name, value) {
if (value == null) {
element.removeAttribute(name);
}
else {
element.setAttribute(name, value.toString());
}
}
function nodeListForEach(nodeList, action) {
if (nodeList == null) {
return;
}
for (var i = 0; i < nodeList.length; i++) {
action(nodeList[i]);
}
}
/***/ }),
/* 43 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBrowserIE", function() { return isBrowserIE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBrowserEdge", function() { return isBrowserEdge; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBrowserSafari", function() { return isBrowserSafari; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBrowserChrome", function() { return isBrowserChrome; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBrowserFirefox", function() { return isBrowserFirefox; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isIOSUserAgent", function() { return isIOSUserAgent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTabIndex", function() { return getTabIndex; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMaxDivHeight", function() { return getMaxDivHeight; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getScrollbarWidth", function() { return getScrollbarWidth; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasOverflowScrolling", function() { return hasOverflowScrolling; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBodyWidth", function() { return getBodyWidth; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBodyHeight", function() { return getBodyHeight; });
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
/**
* These variables are lazy loaded, as otherwise they try and get initialised when we are loading
* unit tests and we don't have references to window or document in the unit tests
* from http://stackoverflow.com/questions/9847580/how-to-detect-safari-chrome-ie-firefox-and-opera-browser
*/
var isSafari;
var isIE;
var isEdge;
var isChrome;
var isFirefox;
var isIOS;
function isBrowserIE() {
if (isIE === undefined) {
isIE = /*@cc_on!@*/ false || !!document.documentMode; // At least IE6
}
return isIE;
}
function isBrowserEdge() {
if (isEdge === undefined) {
isEdge = !isBrowserIE() && !!window.StyleMedia;
}
return isEdge;
}
function isBrowserSafari() {
if (isSafari === undefined) {
// taken from https://stackoverflow.com/a/23522755/1388233
isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
}
return isSafari;
}
function isBrowserChrome() {
if (isChrome === undefined) {
var win = window;
isChrome = (!!win.chrome && (!!win.chrome.webstore || !!win.chrome.runtime)) ||
(/Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor));
}
return isChrome;
}
function isBrowserFirefox() {
if (isFirefox === undefined) {
var win = window;
isFirefox = typeof win.InstallTrigger !== 'undefined';
}
return isFirefox;
}
function isIOSUserAgent() {
if (isIOS === undefined) {
// taken from https://stackoverflow.com/a/58064481/1388233
isIOS = (/iPad|iPhone|iPod/.test(navigator.platform) ||
// eslint-disable-next-line
(navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)) &&
!window.MSStream;
}
return isIOS;
}
function getTabIndex(el) {
if (!el) {
return null;
}
var numberTabIndex = el.tabIndex;
var tabIndex = el.getAttribute('tabIndex');
if (isBrowserIE() && numberTabIndex === 0 && tabIndex === null) {
var map = {
a: true,
body: true,
button: true,
frame: true,
iframe: true,
img: true,
input: true,
isindex: true,
object: true,
select: true,
textarea: true
};
return map[el.nodeName.toLowerCase()] === true ? '0' : null;
}
if (numberTabIndex === -1 && (tabIndex === null || (tabIndex === '' && !isBrowserFirefox()))) {
return null;
}
return numberTabIndex.toString();
}
function getMaxDivHeight() {
if (!document.body) {
return -1;
}
var res = 1000000;
// FF reports the height back but still renders blank after ~6M px
var testUpTo = navigator.userAgent.toLowerCase().match(/firefox/) ? 6000000 : 1000000000;
var div = document.createElement('div');
document.body.appendChild(div);
while (true) {
var test_1 = res * 2;
div.style.height = test_1 + 'px';
if (test_1 > testUpTo || div.clientHeight !== test_1) {
break;
}
else {
res = test_1;
}
}
document.body.removeChild(div);
return res;
}
function getScrollbarWidth() {
var body = document.body;
var div = document.createElement('div');
div.style.width = div.style.height = '100px';
div.style.opacity = '0';
div.style.overflow = 'scroll';
div.style.msOverflowStyle = 'scrollbar'; // needed for WinJS apps
div.style.position = 'absolute';
body.appendChild(div);
var width = div.offsetWidth - div.clientWidth;
// if width is 0 and client width is 0, means the DOM isn't ready
if (width === 0 && div.clientWidth === 0) {
return null;
}
// remove divs
if (div.parentNode) {
div.parentNode.removeChild(div);
}
return width;
}
/** @deprecated */
function hasOverflowScrolling() {
var prefixes = ['webkit', 'moz', 'o', 'ms'];
var div = document.createElement('div');
var body = document.getElementsByTagName('body')[0];
var found = false;
var p;
body.appendChild(div);
div.setAttribute('style', prefixes.map(function (prefix) { return "-" + prefix + "-overflow-scrolling: touch"; }).concat('overflow-scrolling: touch').join(';'));
var computedStyle = window.getComputedStyle(div);
if (computedStyle.overflowScrolling === 'touch') {
found = true;
}
if (!found) {
for (var _i = 0, prefixes_1 = prefixes; _i < prefixes_1.length; _i++) {
p = prefixes_1[_i];
if (computedStyle[p + "OverflowScrolling"] === 'touch') {
found = true;
break;
}
}
}
if (div.parentNode) {
div.parentNode.removeChild(div);
}
return found;
}
/**
* Gets the document body width
* from: http://stackoverflow.com/questions/1038727/how-to-get-browser-width-using-javascript-code
* @returns {number}
*/
function getBodyWidth() {
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;
}
/**
* Gets the body height
* from: http://stackoverflow.com/questions/1038727/how-to-get-browser-width-using-javascript-code
* @returns {number}
*/
function getBodyHeight() {
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;
}
/***/ }),
/* 44 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAriaSortState", function() { return getAriaSortState; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAriaLevel", function() { return getAriaLevel; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAriaPosInSet", function() { return getAriaPosInSet; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setAriaLabel", function() { return setAriaLabel; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setAriaLabelledBy", function() { return setAriaLabelledBy; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setAriaDescribedBy", function() { return setAriaDescribedBy; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setAriaLevel", function() { return setAriaLevel; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setAriaDisabled", function() { return setAriaDisabled; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setAriaExpanded", function() { return setAriaExpanded; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeAriaExpanded", function() { return removeAriaExpanded; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setAriaSetSize", function() { return setAriaSetSize; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setAriaPosInSet", function() { return setAriaPosInSet; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setAriaMultiSelectable", function() { return setAriaMultiSelectable; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setAriaRowCount", function() { return setAriaRowCount; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setAriaRowIndex", function() { return setAriaRowIndex; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setAriaColCount", function() { return setAriaColCount; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setAriaColIndex", function() { return setAriaColIndex; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setAriaColSpan", function() { return setAriaColSpan; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setAriaSort", function() { return setAriaSort; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeAriaSort", function() { return removeAriaSort; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setAriaSelected", function() { return setAriaSelected; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setAriaChecked", function() { return setAriaChecked; });
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
// ARIA HELPER FUNCTIONS
function setAriaAttribute(element, attribute, value) {
element.setAttribute(ariaAttributeName(attribute), value.toString());
}
function removeAriaAttribute(element, attribute) {
element.removeAttribute(ariaAttributeName(attribute));
}
function ariaAttributeName(attribute) {
return "aria-" + attribute;
}
function getAriaSortState(column) {
var sort;
if (column.isSortAscending()) {
sort = 'ascending';
}
else if (column.isSortDescending()) {
sort = 'descending';
}
else {
sort = 'none';
}
return sort;
}
// ARIA ATTRIBUTE GETTERS
function getAriaLevel(element) {
return parseInt(element.getAttribute('aria-level'), 10);
}
function getAriaPosInSet(element) {
return parseInt(element.getAttribute('aria-posinset'), 10);
}
// ARIA ATTRIBUTE SETTERS
function setAriaLabel(element, label) {
setAriaAttribute(element, 'label', label);
}
function setAriaLabelledBy(element, labelledBy) {
setAriaAttribute(element, 'labelledby', labelledBy);
}
function setAriaDescribedBy(element, describedby) {
setAriaAttribute(element, 'describedby', describedby);
}
function setAriaLevel(element, level) {
setAriaAttribute(element, 'level', level);
}
function setAriaDisabled(element, disabled) {
setAriaAttribute(element, 'disabled', disabled);
}
function setAriaExpanded(element, expanded) {
setAriaAttribute(element, 'expanded', expanded);
}
function removeAriaExpanded(element) {
removeAriaAttribute(element, 'expanded');
}
function setAriaSetSize(element, setsize) {
setAriaAttribute(element, 'setsize', setsize);
}
function setAriaPosInSet(element, position) {
setAriaAttribute(element, 'posinset', position);
}
function setAriaMultiSelectable(element, multiSelectable) {
setAriaAttribute(element, 'multiselectable', multiSelectable);
}
function setAriaRowCount(element, rowCount) {
setAriaAttribute(element, 'rowcount', rowCount);
}
function setAriaRowIndex(element, rowIndex) {
setAriaAttribute(element, 'rowindex', rowIndex);
}
function setAriaColCount(element, colCount) {
setAriaAttribute(element, 'colcount', colCount);
}
function setAriaColIndex(element, colIndex) {
setAriaAttribute(element, 'colindex', colIndex);
}
function setAriaColSpan(element, colSpan) {
setAriaAttribute(element, 'colspan', colSpan);
}
function setAriaSort(element, sort) {
setAriaAttribute(element, 'sort', sort);
}
function removeAriaSort(element) {
removeAriaAttribute(element, 'sort');
}
function setAriaSelected(element, selected) {
var attributeName = 'selected';
if (selected) {
setAriaAttribute(element, attributeName, selected);
}
else {
removeAriaAttribute(element, attributeName);
}
}
function setAriaChecked(element, checked) {
setAriaAttribute(element, 'checked', checked === undefined ? 'mixed' : checked);
}
/***/ }),
/* 45 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "serialiseDate", function() { return serialiseDate; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseDateTimeFromString", function() { return parseDateTimeFromString; });
/* harmony import */ var _number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(28);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
/**
* Serialises a Date to a string of format `yyyy-MM-dd HH:mm:ss`.
* An alternative separator can be provided to be used instead of hyphens.
* @param date The date to serialise
* @param includeTime Whether to include the time in the serialised string
* @param separator The separator to use between date parts
*/
function serialiseDate(date, includeTime, separator) {
if (includeTime === void 0) { includeTime = true; }
if (separator === void 0) { separator = '-'; }
if (!date) {
return null;
}
var serialised = [date.getFullYear(), date.getMonth() + 1, date.getDate()].map(function (part) { return Object(_number__WEBPACK_IMPORTED_MODULE_0__["padStart"])(part, 2); }).join(separator);
if (includeTime) {
serialised += ' ' + [date.getHours(), date.getMinutes(), date.getSeconds()].map(function (part) { return Object(_number__WEBPACK_IMPORTED_MODULE_0__["padStart"])(part, 2); }).join(':');
}
return serialised;
}
/**
* Parses a date and time from a string in the format `yyyy-MM-dd HH:mm:ss`
*/
function parseDateTimeFromString(value) {
if (!value) {
return null;
}
var _a = value.split(' '), dateStr = _a[0], timeStr = _a[1];
if (!dateStr) {
return null;
}
var fields = dateStr.split('-').map(function (f) { return parseInt(f, 10); });
if (fields.filter(function (f) { return !isNaN(f); }).length !== 3) {
return null;
}
var year = fields[0], month = fields[1], day = fields[2];
var date = new Date(year, month - 1, day);
if (date.getFullYear() !== year ||
date.getMonth() !== month - 1 ||
date.getDate() !== day) {
// date was not parsed as expected so must have been invalid
return null;
}
if (!timeStr || timeStr === '00:00:00') {
return date;
}
var _b = timeStr.split(':').map(function (part) { return parseInt(part, 10); }), hours = _b[0], minutes = _b[1], seconds = _b[2];
if (hours >= 0 && hours < 24) {
date.setHours(hours);
}
if (minutes >= 0 && minutes < 60) {
date.setMinutes(minutes);
}
if (seconds >= 0 && seconds < 60) {
date.setSeconds(seconds);
}
return date;
}
/***/ }),
/* 46 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fuzzyCheckStrings", function() { return fuzzyCheckStrings; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fuzzySuggestions", function() { return fuzzySuggestions; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "get_bigrams", function() { return get_bigrams; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "string_distances", function() { return string_distances; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "string_weighted_distances", function() { return string_weighted_distances; });
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
function fuzzyCheckStrings(inputValues, validValues, allSuggestions) {
var fuzzyMatches = {};
var invalidInputs = inputValues.filter(function (inputValue) {
return !validValues.some(function (validValue) { return validValue === inputValue; });
});
if (invalidInputs.length > 0) {
invalidInputs.forEach(function (invalidInput) {
return fuzzyMatches[invalidInput] = fuzzySuggestions(invalidInput, allSuggestions);
});
}
return fuzzyMatches;
}
/**
*
* @param {String} inputValue The value to be compared against a list of strings
* @param allSuggestions The list of strings to be compared against
* @param hideIrrelevant By default, fuzzy suggestions will just sort the allSuggestions list, set this to true
* to filter out the irrelevant values
* @param weighted Set this to true, to make letters matched in the order they were typed have priority in the results.
*/
function fuzzySuggestions(inputValue, allSuggestions, hideIrrelevant, weighted) {
var search = weighted ? string_weighted_distances : string_distances;
var thisSuggestions = allSuggestions.map(function (text) { return ({
value: text,
relevance: search(inputValue.toLowerCase(), text.toLocaleLowerCase())
}); });
thisSuggestions.sort(function (a, b) { return b.relevance - a.relevance; });
if (hideIrrelevant) {
thisSuggestions = thisSuggestions.filter(function (suggestion) { return suggestion.relevance !== 0; });
}
return thisSuggestions.map(function (suggestion) { return suggestion.value; });
}
/**
* Algorithm to do fuzzy search
* from https://stackoverflow.com/questions/23305000/javascript-fuzzy-search-that-makes-sense
* @param {string} from
* @return {[]}
*/
function get_bigrams(from) {
var s = from.toLowerCase();
var v = new Array(s.length - 1);
var i;
var j;
var ref;
for (i = j = 0, ref = v.length; j <= ref; i = j += 1) {
v[i] = s.slice(i, i + 2);
}
return v;
}
function string_distances(str1, str2) {
if (str1.length === 0 && str2.length === 0) {
return 0;
}
var pairs1 = get_bigrams(str1);
var pairs2 = get_bigrams(str2);
var union = pairs1.length + pairs2.length;
var hit_count = 0;
var j;
var len;
for (j = 0, len = pairs1.length; j < len; j++) {
var x = pairs1[j];
var k = void 0;
var len1 = void 0;
for (k = 0, len1 = pairs2.length; k < len1; k++) {
var y = pairs2[k];
if (x === y) {
hit_count++;
}
}
}
return hit_count > 0 ? (2 * hit_count) / union : 0;
}
function string_weighted_distances(str1, str2) {
var a = str1.replace(/\s/g, '');
var b = str2.replace(/\s/g, '');
var weight = 0;
var lastIndex = 0;
for (var i = 0; i < a.length; i++) {
var idx = b.indexOf(a[i]);
if (idx === -1) {
continue;
}
lastIndex = idx;
weight += ((b.length - lastIndex) * 100) / b.length;
weight *= weight;
}
return weight;
}
/***/ }),
/* 47 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "iconNameClassMap", function() { return iconNameClassMap; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createIcon", function() { return createIcon; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createIconNoSpan", function() { return createIconNoSpan; });
/* harmony import */ var _dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(42);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
//
// IMPORTANT NOTE!
//
// If you change the list below, copy/paste the new content into the docs page javascript-grid-icons
//
var iconNameClassMap = {
// header column group shown when expanded (click to contract)
columnGroupOpened: 'expanded',
// header column group shown when contracted (click to expand)
columnGroupClosed: 'contracted',
// tool panel column group contracted (click to expand)
columnSelectClosed: 'tree-closed',
// tool panel column group expanded (click to contract)
columnSelectOpen: 'tree-open',
// column tool panel header expand/collapse all button, shown when some children are expanded and
// others are collapsed
columnSelectIndeterminate: 'tree-indeterminate',
// shown on ghost icon while dragging column to the side of the grid to pin
columnMovePin: 'pin',
// shown on ghost icon while dragging over part of the page that is not a drop zone
columnMoveHide: 'eye-slash',
// shown on ghost icon while dragging columns to reorder
columnMoveMove: 'arrows',
// animating icon shown when dragging a column to the right of the grid causes horizontal scrolling
columnMoveLeft: 'left',
// animating icon shown when dragging a column to the left of the grid causes horizontal scrolling
columnMoveRight: 'right',
// shown on ghost icon while dragging over Row Groups drop zone
columnMoveGroup: 'group',
// shown on ghost icon while dragging over Values drop zone
columnMoveValue: 'aggregation',
// shown on ghost icon while dragging over pivot drop zone
columnMovePivot: 'pivot',
// shown on ghost icon while dragging over drop zone that doesn't support it, e.g.
// string column over aggregation drop zone
dropNotAllowed: 'not-allowed',
// shown on row group when contracted (click to expand)
groupContracted: 'tree-closed',
// shown on row group when expanded (click to contract)
groupExpanded: 'tree-open',
// context menu chart item
chart: 'chart',
// chart window title bar
close: 'cross',
// X (remove) on column 'pill' after adding it to a drop zone list
cancel: 'cancel',
// indicates the currently active pin state in the "Pin column" sub-menu of the column menu
check: 'tick',
// "go to first" button in pagination controls
first: 'first',
// "go to previous" button in pagination controls
previous: 'previous',
// "go to next" button in pagination controls
next: 'next',
// "go to last" button in pagination controls
last: 'last',
// shown on top right of chart when chart is linked to range data (click to unlink)
linked: 'linked',
// shown on top right of chart when chart is not linked to range data (click to link)
unlinked: 'unlinked',
// "Choose colour" button on chart settings tab
colorPicker: 'color-picker',
// rotating spinner shown by the loading cell renderer
groupLoading: 'loading',
// button to launch enterprise column menu
menu: 'menu',
// filter tool panel tab
filter: 'filter',
// column tool panel tab
columns: 'columns',
// button in chart regular size window title bar (click to maximise)
maximize: 'maximize',
// button in chart maximised window title bar (click to make regular size)
minimize: 'minimize',
// "Pin column" item in column header menu
menuPin: 'pin',
// "Value aggregation" column menu item (shown on numeric columns when grouping is active)"
menuValue: 'aggregation',
// "Group by {column-name}" item in column header menu
menuAddRowGroup: 'group',
// "Un-Group by {column-name}" item in column header menu
menuRemoveRowGroup: 'group',
// context menu copy item
clipboardCopy: 'copy',
// context menu paste item
clipboardPaste: 'paste',
// identifies the pivot drop zone
pivotPanel: 'pivot',
// "Row groups" drop zone in column tool panel
rowGroupPanel: 'group',
// columns tool panel Values drop zone
valuePanel: 'aggregation',
// drag handle used to pick up draggable columns
columnDrag: 'grip',
// drag handle used to pick up draggable rows
rowDrag: 'grip',
// context menu export item
save: 'save',
// icon on dropdown editors
smallDown: 'small-down',
// version of small-right used in RTL mode
smallLeft: 'small-left',
// separater between column 'pills' when you add multiple columns to the header drop zone
smallRight: 'small-right',
smallUp: 'small-up',
// show on column header when column is sorted ascending
sortAscending: 'asc',
// show on column header when column is sorted descending
sortDescending: 'desc',
// show on column header when column has no sort, only when enabled with gridOptions.unSortIcon=true
sortUnSort: 'none'
};
/**
* If icon provided, use this (either a string, or a function callback).
* if not, then use the default icon from the theme
* @param {string} iconName
* @param {GridOptionsWrapper} gridOptionsWrapper
* @param {Column | null} [column]
* @returns {HTMLElement}
*/
function createIcon(iconName, gridOptionsWrapper, column) {
var iconContents = createIconNoSpan(iconName, gridOptionsWrapper, column);
if (iconContents.className.indexOf('ag-icon') > -1) {
return iconContents;
}
var eResult = document.createElement('span');
eResult.appendChild(iconContents);
return eResult;
}
function createIconNoSpan(iconName, gridOptionsWrapper, column, forceCreate) {
var userProvidedIcon = null;
// check col for icon first
var icons = column && column.getColDef().icons;
if (icons) {
userProvidedIcon = icons[iconName];
}
// if not in col, try grid options
if (gridOptionsWrapper && !userProvidedIcon) {
var optionsIcons = gridOptionsWrapper.getIcons();
if (optionsIcons) {
userProvidedIcon = optionsIcons[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 new Error('icon from grid options needs to be a string or a function');
}
if (typeof rendererResult === 'string') {
return Object(_dom__WEBPACK_IMPORTED_MODULE_0__["loadTemplate"])(rendererResult);
}
if (Object(_dom__WEBPACK_IMPORTED_MODULE_0__["isNodeOrElement"])(rendererResult)) {
return rendererResult;
}
console.warn('ag-Grid: iconRenderer should return back a string or a dom object');
}
else {
var span = document.createElement('span');
var cssClass = iconNameClassMap[iconName];
if (!cssClass) {
if (!forceCreate) {
console.warn("ag-Grid: Did not find icon " + iconName);
cssClass = '';
}
else {
cssClass = iconName;
}
}
span.setAttribute('class', "ag-icon ag-icon-" + cssClass);
span.setAttribute('unselectable', 'on');
span.setAttribute('role', 'presentation');
return span;
}
}
/***/ }),
/* 48 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isKeyPressed", function() { return isKeyPressed; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEventFromPrintableCharacter", function() { return isEventFromPrintableCharacter; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isUserSuppressingKeyboardEvent", function() { return isUserSuppressingKeyboardEvent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isUserSuppressingHeaderKeyboardEvent", function() { return isUserSuppressingHeaderKeyboardEvent; });
/* harmony import */ var _browser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(43);
/* harmony import */ var _generic__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var NUMPAD_DEL_NUMLOCK_ON_KEY = 'Del';
var NUMPAD_DEL_NUMLOCK_ON_CHARCODE = 46;
function isKeyPressed(event, keyToCheck) {
return (event.which || event.keyCode) === keyToCheck;
}
function isEventFromPrintableCharacter(event) {
// no allowed printable chars have alt or ctrl key combinations
if (event.altKey || event.ctrlKey || event.metaKey) {
return false;
}
// 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'.
var printableCharacter = event.key.length === 1;
// IE11 & Edge treat the numpad del key differently - with numlock on we get "Del" for key,
// so this addition checks if its IE11/Edge and handles that specific case the same was as all other browsers
var numpadDelWithNumlockOnForEdgeOrIe = isNumpadDelWithNumlockOnForEdgeOrIe(event);
return printableCharacter || numpadDelWithNumlockOnForEdgeOrIe;
}
/**
* Allows user to tell the grid to skip specific keyboard events
* @param {GridOptionsWrapper} gridOptionsWrapper
* @param {KeyboardEvent} keyboardEvent
* @param {RowNode} rowNode
* @param {Column} column
* @param {boolean} editing
* @returns {boolean}
*/
function isUserSuppressingKeyboardEvent(gridOptionsWrapper, keyboardEvent, rowNode, column, editing) {
var gridOptionsFunc = gridOptionsWrapper.getSuppressKeyboardEventFunc();
var colDefFunc = column.getColDef().suppressKeyboardEvent;
// if no callbacks provided by user, then do nothing
if (!gridOptionsFunc && !colDefFunc) {
return false;
}
var params = {
event: keyboardEvent,
editing: editing,
column: column,
api: gridOptionsWrapper.getApi(),
node: rowNode,
data: rowNode.data,
colDef: column.getColDef(),
context: gridOptionsWrapper.getContext(),
columnApi: gridOptionsWrapper.getColumnApi()
};
// colDef get first preference on suppressing events
if (colDefFunc) {
var colDefFuncResult = colDefFunc(params);
// if colDef func suppressed, then return now, no need to call gridOption func
if (colDefFuncResult) {
return true;
}
}
if (gridOptionsFunc) {
// if gridOption func, return the result
return gridOptionsFunc(params);
}
// otherwise return false, don't suppress, as colDef didn't suppress and no func on gridOptions
return false;
}
function isUserSuppressingHeaderKeyboardEvent(gridOptionsWrapper, keyboardEvent, headerRowIndex, column) {
var colDef = column.getDefinition();
var colDefFunc = colDef && colDef.suppressHeaderKeyboardEvent;
if (!Object(_generic__WEBPACK_IMPORTED_MODULE_1__["exists"])(colDefFunc)) {
return false;
}
var params = {
api: gridOptionsWrapper.getApi(),
columnApi: gridOptionsWrapper.getColumnApi(),
context: gridOptionsWrapper.getContext(),
colDef: colDef,
column: column,
headerRowIndex: headerRowIndex,
event: keyboardEvent
};
return !!colDefFunc(params);
}
function isNumpadDelWithNumlockOnForEdgeOrIe(event) {
return (Object(_browser__WEBPACK_IMPORTED_MODULE_0__["isBrowserEdge"])() || Object(_browser__WEBPACK_IMPORTED_MODULE_0__["isBrowserIE"])()) &&
event.key === NUMPAD_DEL_NUMLOCK_ON_KEY &&
event.charCode === NUMPAD_DEL_NUMLOCK_ON_CHARCODE;
}
/***/ }),
/* 49 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "keys", function() { return keys; });
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
function keys(map) {
var keys = [];
map.forEach(function (_, key) { return keys.push(key); });
return keys;
}
/***/ }),
/* 50 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeWheel", function() { return normalizeWheel; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLeftClick", function() { return isLeftClick; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "areEventsNear", function() { return areEventsNear; });
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
/**
* @deprecated
* 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
*
* from: https://github.com/facebook/fixed-data-table/blob/master/src/vendor_upstream/dom/normalizeWheel.js
* @param {any} event
* @return {any}
*/
function normalizeWheel(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) { // delta in LINE units
pX *= LINE_HEIGHT;
pY *= LINE_HEIGHT;
}
else { // delta in PAGE units
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
};
}
/**
* @deprecated
* Checks if event was issued by a left click
* from https://stackoverflow.com/questions/3944122/detect-left-mouse-button-press
* @param {MouseEvent} mouseEvent
* @returns {boolean}
*/
function isLeftClick(mouseEvent) {
if ('buttons' in mouseEvent) {
return mouseEvent.buttons == 1;
}
var button = mouseEvent.which || mouseEvent.button;
return button == 1;
}
/**
* `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.
* @param {MouseEvent | TouchEvent} e1
* @param {MouseEvent | TouchEvent} e2
* @param {number} pixelCount
* @returns {boolean}
*/
function areEventsNear(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;
}
/***/ }),
/* 51 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sortRowNodesByOrder", function() { return sortRowNodesByOrder; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "traverseNodesWithKey", function() { return traverseNodesWithKey; });
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
/**
* Gets called by: a) ClientSideNodeManager and b) GroupStage to do sorting.
* when in ClientSideNodeManager 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
* @param {RowNode[]} rowNodes
* @param {Object} rowNodeOrder
*/
function sortRowNodesByOrder(rowNodes, rowNodeOrder) {
if (!rowNodes) {
return;
}
var comparator = 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;
}
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 __objectId - 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.
// note: previously here we used nodeId, however this gave a strange order
// as string ordering of numbers is wrong, so using id based on creation order
// as least gives better looking order.
return nodeA.__objectId - nodeB.__objectId;
}
if (aHasIndex) {
return 1;
}
return -1;
};
// check if the list first needs sorting
var rowNodeA;
var rowNodeB;
var atLeastOneOutOfOrder = false;
for (var i = 0; i < rowNodes.length - 1; i++) {
rowNodeA = rowNodes[i];
rowNodeB = rowNodes[i + 1];
if (comparator(rowNodeA, rowNodeB) > 0) {
atLeastOneOutOfOrder = true;
break;
}
}
if (atLeastOneOutOfOrder) {
rowNodes.sort(comparator);
}
}
function traverseNodesWithKey(nodes, callback) {
var keyParts = [];
recursiveSearchNodes(nodes);
function recursiveSearchNodes(currentNodes) {
currentNodes.forEach(function (node) {
// also checking for children for tree data
if (node.group || node.hasChildren()) {
keyParts.push(node.key);
var key = keyParts.join('|');
callback(node, key);
recursiveSearchNodes(node.childrenAfterGroup);
keyParts.pop();
}
});
}
}
/***/ }),
/* 52 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertToSet", function() { return convertToSet; });
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
function convertToSet(list) {
var set = new Set();
list.forEach(function (x) { return set.add(x); });
return set;
}
/***/ }),
/* 53 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NumberSequence", function() { return NumberSequence; });
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var NumberSequence = /** @class */ (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;
}());
/***/ }),
/* 54 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgPromiseStatus", function() { return AgPromiseStatus; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgPromise", function() { return AgPromise; });
/* harmony import */ var _array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var AgPromiseStatus;
(function (AgPromiseStatus) {
AgPromiseStatus[AgPromiseStatus["IN_PROGRESS"] = 0] = "IN_PROGRESS";
AgPromiseStatus[AgPromiseStatus["RESOLVED"] = 1] = "RESOLVED";
})(AgPromiseStatus || (AgPromiseStatus = {}));
var AgPromise = /** @class */ (function () {
function AgPromise(callback) {
var _this = this;
this.status = AgPromiseStatus.IN_PROGRESS;
this.resolution = null;
this.waiters = [];
callback(function (value) { return _this.onDone(value); }, function (params) { return _this.onReject(params); });
}
AgPromise.all = function (promises) {
return new AgPromise(function (resolve) {
var remainingToResolve = promises.length;
var combinedValues = new Array(remainingToResolve);
Object(_array__WEBPACK_IMPORTED_MODULE_0__["forEach"])(promises, function (promise, index) {
promise.then(function (value) {
combinedValues[index] = value;
remainingToResolve--;
if (remainingToResolve === 0) {
resolve(combinedValues);
}
});
});
});
};
AgPromise.resolve = function (value) {
if (value === void 0) { value = null; }
return new AgPromise(function (resolve) { return resolve(value); });
};
AgPromise.prototype.then = function (func) {
var _this = this;
return new AgPromise(function (resolve) {
if (_this.status === AgPromiseStatus.RESOLVED) {
resolve(func(_this.resolution));
}
else {
_this.waiters.push(function (value) { return resolve(func(value)); });
}
});
};
AgPromise.prototype.resolveNow = function (ifNotResolvedValue, ifResolved) {
return this.status === AgPromiseStatus.RESOLVED ? ifResolved(this.resolution) : ifNotResolvedValue;
};
AgPromise.prototype.onDone = function (value) {
this.status = AgPromiseStatus.RESOLVED;
this.resolution = value;
Object(_array__WEBPACK_IMPORTED_MODULE_0__["forEach"])(this.waiters, function (waiter) { return waiter(value); });
};
AgPromise.prototype.onReject = function (params) {
console.warn('TBI');
};
return AgPromise;
}());
/***/ }),
/* 55 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Timer", function() { return Timer; });
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
/**
* A Util Class only used when debugging for printing time to console
*/
var Timer = /** @class */ (function () {
function Timer() {
this.timestamp = new Date().getTime();
}
Timer.prototype.print = function (msg) {
var duration = (new Date().getTime()) - this.timestamp;
console.info(msg + " = " + duration);
this.timestamp = new Date().getTime();
};
return Timer;
}());
/***/ }),
/* 56 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TooltipFeature", function() { return TooltipFeature; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20);
/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(42);
/* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __assign = (undefined && undefined.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __decorate = (undefined && undefined.__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 TooltipStates;
(function (TooltipStates) {
TooltipStates[TooltipStates["NOTHING"] = 0] = "NOTHING";
TooltipStates[TooltipStates["WAITING_TO_SHOW"] = 1] = "WAITING_TO_SHOW";
TooltipStates[TooltipStates["SHOWING"] = 2] = "SHOWING";
})(TooltipStates || (TooltipStates = {}));
var TooltipFeature = /** @class */ (function (_super) {
__extends(TooltipFeature, _super);
function TooltipFeature(parentComp) {
var _this = _super.call(this) || this;
_this.DEFAULT_HIDE_TOOLTIP_TIMEOUT = 10000;
_this.SHOW_QUICK_TOOLTIP_DIFF = 1000;
_this.FADE_OUT_TOOLTIP_TIMEOUT = 1000;
_this.state = TooltipStates.NOTHING;
// when showing the tooltip, we need to make sure it's the most recent instance we request, as due to
// async we could request two tooltips before the first instance returns, in which case we should
// disregard the second instance.
_this.tooltipInstanceCount = 0;
_this.tooltipMouseTrack = false;
_this.parentComp = parentComp;
return _this;
}
TooltipFeature.prototype.postConstruct = function () {
this.tooltipShowDelay = this.gridOptionsWrapper.getTooltipShowDelay() || 2000;
this.tooltipMouseTrack = this.gridOptionsWrapper.isTooltipMouseTrack();
var el = this.parentComp.getGui();
this.addManagedListener(el, 'mouseenter', this.onMouseEnter.bind(this));
this.addManagedListener(el, 'mouseleave', this.onMouseLeave.bind(this));
this.addManagedListener(el, 'mousemove', this.onMouseMove.bind(this));
this.addManagedListener(el, 'mousedown', this.onMouseDown.bind(this));
this.addManagedListener(el, 'keydown', this.onKeyDown.bind(this));
};
TooltipFeature.prototype.destroy = function () {
// if this component gets destroyed while tooltip is showing, need to make sure
// we don't end with no mouseLeave event resulting in zombie tooltip
this.setToDoNothing();
_super.prototype.destroy.call(this);
};
TooltipFeature.prototype.onMouseEnter = function (e) {
// every mouseenter should be following by a mouseleave, however for some unkonwn, it's possible for
// mouseenter to be called twice in a row, which can happen if editing the cell. this was reported
// in https://ag-grid.atlassian.net/browse/AG-4422. to get around this, we check the state, and if
// state is !=nothing, then we know mouseenter was already received.
if (this.state != TooltipStates.NOTHING) {
return;
}
// if another tooltip was hidden very recently, we only wait 200ms to show, not the normal waiting time
var delay = this.isLastTooltipHiddenRecently() ? 200 : this.tooltipShowDelay;
this.showTooltipTimeoutId = window.setTimeout(this.showTooltip.bind(this), delay);
this.lastMouseEvent = e;
this.state = TooltipStates.WAITING_TO_SHOW;
};
TooltipFeature.prototype.onMouseLeave = function () {
this.setToDoNothing();
};
TooltipFeature.prototype.onKeyDown = function () {
this.setToDoNothing();
};
TooltipFeature.prototype.setToDoNothing = function () {
if (this.state === TooltipStates.SHOWING) {
this.hideTooltip();
}
this.clearTimeouts();
this.state = TooltipStates.NOTHING;
};
TooltipFeature.prototype.onMouseMove = function (e) {
// there is a delay from the time we mouseOver a component and the time the
// tooltip is displayed, so we need to track mousemove to be able to correctly
// position the tooltip when showTooltip is called.
this.lastMouseEvent = e;
if (this.tooltipMouseTrack &&
this.state === TooltipStates.SHOWING &&
this.tooltipComp) {
this.positionTooltipUnderLastMouseEvent();
}
};
TooltipFeature.prototype.onMouseDown = function () {
this.setToDoNothing();
};
TooltipFeature.prototype.hideTooltip = function () {
// check if comp exists - due to async, although we asked for
// one, the instance may not be back yet
if (this.tooltipComp) {
this.destroyTooltipComp();
TooltipFeature.lastTooltipHideTime = new Date().getTime();
}
this.state = TooltipStates.NOTHING;
};
TooltipFeature.prototype.destroyTooltipComp = function () {
var _this = this;
// add class to fade out the tooltip
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_2__["addCssClass"])(this.tooltipComp.getGui(), 'ag-tooltip-hiding');
// make local copies of these variables, as we use them in the async function below,
// and we clear then to 'undefined' later, so need to take a copy before they are undefined.
var tooltipPopupDestroyFunc = this.tooltipPopupDestroyFunc;
var tooltipComp = this.tooltipComp;
window.setTimeout(function () {
tooltipPopupDestroyFunc();
_this.getContext().destroyBean(tooltipComp);
}, this.FADE_OUT_TOOLTIP_TIMEOUT);
this.tooltipPopupDestroyFunc = undefined;
this.tooltipComp = undefined;
};
TooltipFeature.prototype.isLastTooltipHiddenRecently = function () {
// return true if <1000ms since last time we hid a tooltip
var now = new Date().getTime();
var then = TooltipFeature.lastTooltipHideTime;
return (now - then) < this.SHOW_QUICK_TOOLTIP_DIFF;
};
TooltipFeature.prototype.showTooltip = function () {
var params = __assign({ api: this.gridApi, columnApi: this.columnApi, context: this.gridOptionsWrapper.getContext() }, this.parentComp.getTooltipParams());
if (!Object(_utils_generic__WEBPACK_IMPORTED_MODULE_3__["exists"])(params.value)) {
this.setToDoNothing();
return;
}
this.state = TooltipStates.SHOWING;
this.tooltipInstanceCount++;
// we pass in tooltipInstanceCount so the callback knows what the count was when
// we requested the tooltip, so if another tooltip was requested in the mean time
// we disregard it
var callback = this.newTooltipComponentCallback.bind(this, this.tooltipInstanceCount);
this.userComponentFactory.newTooltipComponent(params).then(callback);
};
TooltipFeature.prototype.newTooltipComponentCallback = function (tooltipInstanceCopy, tooltipComp) {
var compNoLongerNeeded = this.state !== TooltipStates.SHOWING || this.tooltipInstanceCount !== tooltipInstanceCopy;
if (compNoLongerNeeded) {
this.getContext().destroyBean(tooltipComp);
return;
}
var eGui = tooltipComp.getGui();
this.tooltipComp = tooltipComp;
if (!Object(_utils_dom__WEBPACK_IMPORTED_MODULE_2__["containsClass"])(eGui, 'ag-tooltip')) {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_2__["addCssClass"])(eGui, 'ag-tooltip-custom');
}
var addPopupRes = this.popupService.addPopup({
eChild: eGui
});
if (addPopupRes) {
this.tooltipPopupDestroyFunc = addPopupRes.hideFunc;
}
// this.tooltipPopupDestroyFunc = this.popupService.addPopup(false, eGui, false);
this.positionTooltipUnderLastMouseEvent();
this.hideTooltipTimeoutId = window.setTimeout(this.hideTooltip.bind(this), this.DEFAULT_HIDE_TOOLTIP_TIMEOUT);
};
TooltipFeature.prototype.positionTooltipUnderLastMouseEvent = function () {
this.popupService.positionPopupUnderMouseEvent({
type: 'tooltip',
mouseEvent: this.lastMouseEvent,
ePopup: this.tooltipComp.getGui(),
nudgeY: 18
});
};
TooltipFeature.prototype.clearTimeouts = function () {
if (this.showTooltipTimeoutId) {
window.clearTimeout(this.showTooltipTimeoutId);
this.showTooltipTimeoutId = undefined;
}
if (this.hideTooltipTimeoutId) {
window.clearTimeout(this.hideTooltipTimeoutId);
this.hideTooltipTimeoutId = undefined;
}
};
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('popupService')
], TooltipFeature.prototype, "popupService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('userComponentFactory')
], TooltipFeature.prototype, "userComponentFactory", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnApi')
], TooltipFeature.prototype, "columnApi", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridApi')
], TooltipFeature.prototype, "gridApi", void 0);
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_0__["PostConstruct"]
], TooltipFeature.prototype, "postConstruct", null);
return TooltipFeature;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
/***/ }),
/* 57 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QuerySelector", function() { return QuerySelector; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RefSelector", function() { return RefSelector; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GridListener", function() { return GridListener; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GuiListener", function() { return GuiListener; });
/* harmony import */ var _utils_function__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
function QuerySelector(selector) {
return querySelectorFunc.bind(this, selector);
}
function RefSelector(ref) {
return querySelectorFunc.bind(this, "[ref=" + ref + "]");
}
function querySelectorFunc(selector, classPrototype, methodOrAttributeName, index) {
if (selector === null) {
console.error('ag-Grid: QuerySelector selector should not be null');
return;
}
if (typeof index === 'number') {
console.error('ag-Grid: QuerySelector should be on an attribute');
return;
}
addToObjectProps(classPrototype, 'querySelectors', {
attributeName: methodOrAttributeName,
querySelector: selector
});
}
// think we should take this out, put property bindings on the
function GridListener(eventName) {
return gridListenerFunc.bind(this, eventName);
}
function gridListenerFunc(eventName, target, methodName) {
if (eventName == null) {
console.error('ag-Grid: GridListener eventName is missing');
return;
}
addToObjectProps(target, 'gridListenerMethods', {
methodName: methodName,
eventName: eventName
});
}
// think we should take this out, put property bindings on the
function GuiListener(ref, eventName) {
return guiListenerFunc.bind(this, ref, eventName);
}
function guiListenerFunc(ref, eventName, target, methodName) {
if (eventName == null) {
console.error('ag-Grid: GuiListener eventName is missing');
return;
}
addToObjectProps(target, 'guiListenerMethods', {
methodName: methodName,
eventName: eventName,
ref: ref
});
}
// // think we should take this out, put property bindings on the
// export function Method(eventName?: string): Function {
// return methodFunc.bind(this, eventName);
// }
//
// function methodFunc(alias: string, target: Object, methodName: string) {
// if (alias === null) {
// console.error("ag-Grid: EventListener eventName should not be null");
// return;
// }
//
// addToObjectProps(target, 'methods', {
// methodName: methodName,
// alias: alias
// });
// }
function addToObjectProps(target, key, value) {
// it's an attribute on the class
var props = getOrCreateProps(target, Object(_utils_function__WEBPACK_IMPORTED_MODULE_0__["getFunctionName"])(target.constructor));
if (!props[key]) {
props[key] = [];
}
props[key].push(value);
}
function getOrCreateProps(target, instanceName) {
if (!target.__agComponentMetaData) {
target.__agComponentMetaData = {};
}
if (!target.__agComponentMetaData[instanceName]) {
target.__agComponentMetaData[instanceName] = {};
}
return target.__agComponentMetaData[instanceName];
}
/***/ }),
/* 58 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyCode", function() { return KeyCode; });
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var KeyCode = /** @class */ (function () {
function KeyCode() {
}
KeyCode.BACKSPACE = 8;
KeyCode.TAB = 9;
KeyCode.ENTER = 13;
KeyCode.SHIFT = 16;
KeyCode.ESCAPE = 27;
KeyCode.SPACE = 32;
KeyCode.LEFT = 37;
KeyCode.UP = 38;
KeyCode.RIGHT = 39;
KeyCode.DOWN = 40;
KeyCode.DELETE = 46;
KeyCode.A = 65;
KeyCode.C = 67;
KeyCode.V = 86;
KeyCode.D = 68;
KeyCode.Z = 90;
KeyCode.Y = 89;
KeyCode.F2 = 113;
KeyCode.PAGE_UP = 33;
KeyCode.PAGE_DOWN = 34;
KeyCode.PAGE_HOME = 36;
KeyCode.PAGE_END = 35;
return KeyCode;
}());
/***/ }),
/* 59 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DateFilter", function() { return DateFilter; });
/* harmony import */ var _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57);
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12);
/* harmony import */ var _dateCompWrapper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(60);
/* harmony import */ var _simpleFilter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(61);
/* harmony import */ var _scalarFilter__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(66);
/* harmony import */ var _utils_date__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(45);
/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(42);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 DateFilter = /** @class */ (function (_super) {
__extends(DateFilter, _super);
function DateFilter() {
return _super.call(this, 'dateFilter') || this;
}
DateFilter.prototype.afterGuiAttached = function (params) {
_super.prototype.afterGuiAttached.call(this, params);
this.dateCondition1FromComp.afterGuiAttached(params);
};
DateFilter.prototype.mapRangeFromModel = function (filterModel) {
// unlike the other filters, we do two things here:
// 1) allow for different attribute names (same as done for other filters) (eg the 'from' and 'to'
// are in different locations in Date and Number filter models)
// 2) convert the type (because Date filter uses Dates, however model is 'string')
//
// NOTE: The conversion of string to date also removes the timezone - i.e. when user picks
// a date from the UI, it will have timezone info in it. This is lost when creating
// the model. When we recreate the date again here, it's without a timezone.
return {
from: Object(_utils_date__WEBPACK_IMPORTED_MODULE_5__["parseDateTimeFromString"])(filterModel.dateFrom),
to: Object(_utils_date__WEBPACK_IMPORTED_MODULE_5__["parseDateTimeFromString"])(filterModel.dateTo)
};
};
DateFilter.prototype.setValueFromFloatingFilter = function (value) {
this.dateCondition1FromComp.setDate(value == null ? null : Object(_utils_date__WEBPACK_IMPORTED_MODULE_5__["parseDateTimeFromString"])(value));
this.dateCondition1ToComp.setDate(null);
this.dateCondition2FromComp.setDate(null);
this.dateCondition2ToComp.setDate(null);
};
DateFilter.prototype.setConditionIntoUi = function (model, position) {
var _a = model ?
[Object(_utils_date__WEBPACK_IMPORTED_MODULE_5__["parseDateTimeFromString"])(model.dateFrom), Object(_utils_date__WEBPACK_IMPORTED_MODULE_5__["parseDateTimeFromString"])(model.dateTo)] :
[null, null], dateFrom = _a[0], dateTo = _a[1];
var _b = this.getFromToComponents(position), compFrom = _b[0], compTo = _b[1];
compFrom.setDate(dateFrom);
compTo.setDate(dateTo);
};
DateFilter.prototype.resetUiToDefaults = function (silent) {
var _this = this;
return _super.prototype.resetUiToDefaults.call(this, silent).then(function () {
_this.dateCondition1FromComp.setDate(null);
_this.dateCondition1ToComp.setDate(null);
_this.dateCondition2FromComp.setDate(null);
_this.dateCondition2ToComp.setDate(null);
});
};
DateFilter.prototype.comparator = function () {
return this.dateFilterParams.comparator ? this.dateFilterParams.comparator : this.defaultComparator.bind(this);
};
DateFilter.prototype.defaultComparator = function (filterDate, cellValue) {
// The default comparator assumes that the cellValue is a date
var cellAsDate = cellValue;
if (cellValue == null || cellAsDate < filterDate) {
return -1;
}
if (cellAsDate > filterDate) {
return 1;
}
return 0;
};
DateFilter.prototype.setParams = function (params) {
_super.prototype.setParams.call(this, params);
this.dateFilterParams = params;
this.createDateComponents();
};
DateFilter.prototype.createDateComponents = function () {
var _this = this;
var createDateCompWrapper = function (element) {
return new _dateCompWrapper__WEBPACK_IMPORTED_MODULE_2__["DateCompWrapper"](_this.getContext(), _this.userComponentFactory, {
onDateChanged: function () { return _this.onUiChanged(); },
filterParams: _this.dateFilterParams
}, element);
};
this.dateCondition1FromComp = createDateCompWrapper(this.eCondition1PanelFrom);
this.dateCondition1ToComp = createDateCompWrapper(this.eCondition1PanelTo);
this.dateCondition2FromComp = createDateCompWrapper(this.eCondition2PanelFrom);
this.dateCondition2ToComp = createDateCompWrapper(this.eCondition2PanelTo);
this.addDestroyFunc(function () {
_this.dateCondition1FromComp.destroy();
_this.dateCondition1ToComp.destroy();
_this.dateCondition2FromComp.destroy();
_this.dateCondition2ToComp.destroy();
});
};
DateFilter.prototype.getDefaultFilterOptions = function () {
return DateFilter.DEFAULT_FILTER_OPTIONS;
};
DateFilter.prototype.createValueTemplate = function (position) {
var pos = position === _simpleFilter__WEBPACK_IMPORTED_MODULE_3__["ConditionPosition"].One ? '1' : '2';
return /* html */ "\n
\n \n \n
";
};
DateFilter.prototype.isConditionUiComplete = function (position) {
var positionOne = position === _simpleFilter__WEBPACK_IMPORTED_MODULE_3__["ConditionPosition"].One;
var option = positionOne ? this.getCondition1Type() : this.getCondition2Type();
if (option === _simpleFilter__WEBPACK_IMPORTED_MODULE_3__["SimpleFilter"].EMPTY) {
return false;
}
if (this.doesFilterHaveHiddenInput(option)) {
return true;
}
var _a = this.getFromToComponents(position), compFrom = _a[0], compTo = _a[1];
var minValidYear = this.dateFilterParams.minValidYear == null ? 1000 : this.dateFilterParams.minValidYear;
var isValidDate = function (value) { return value != null && value.getUTCFullYear() > minValidYear; };
return isValidDate(compFrom.getDate()) && (!this.showValueTo(option) || isValidDate(compTo.getDate()));
};
DateFilter.prototype.areSimpleModelsEqual = function (aSimple, bSimple) {
return aSimple.dateFrom === bSimple.dateFrom
&& aSimple.dateTo === bSimple.dateTo
&& aSimple.type === bSimple.type;
};
DateFilter.prototype.getFilterType = function () {
return 'date';
};
DateFilter.prototype.createCondition = function (position) {
var positionOne = position === _simpleFilter__WEBPACK_IMPORTED_MODULE_3__["ConditionPosition"].One;
var type = positionOne ? this.getCondition1Type() : this.getCondition2Type();
var _a = this.getFromToComponents(position), compFrom = _a[0], compTo = _a[1];
return {
dateFrom: Object(_utils_date__WEBPACK_IMPORTED_MODULE_5__["serialiseDate"])(compFrom.getDate()),
dateTo: Object(_utils_date__WEBPACK_IMPORTED_MODULE_5__["serialiseDate"])(compTo.getDate()),
type: type,
filterType: this.getFilterType()
};
};
DateFilter.prototype.resetPlaceholder = function () {
var globalTranslate = this.gridOptionsWrapper.getLocaleTextFunc();
var placeholder = this.translate('dateFormatOoo');
var ariaLabel = globalTranslate('ariaFilterValue', 'Filter Value');
this.dateCondition1FromComp.setInputPlaceholder(placeholder);
this.dateCondition1FromComp.setInputAriaLabel(ariaLabel);
this.dateCondition1ToComp.setInputPlaceholder(placeholder);
this.dateCondition1ToComp.setInputAriaLabel(ariaLabel);
this.dateCondition2FromComp.setInputPlaceholder(placeholder);
this.dateCondition2FromComp.setInputAriaLabel(ariaLabel);
this.dateCondition2ToComp.setInputPlaceholder(placeholder);
this.dateCondition2ToComp.setInputAriaLabel(ariaLabel);
};
DateFilter.prototype.updateUiVisibility = function () {
_super.prototype.updateUiVisibility.call(this);
this.resetPlaceholder();
var condition1Type = this.getCondition1Type();
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_6__["setDisplayed"])(this.eCondition1PanelFrom, this.showValueFrom(condition1Type));
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_6__["setDisplayed"])(this.eCondition1PanelTo, this.showValueTo(condition1Type));
var condition2Type = this.getCondition2Type();
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_6__["setDisplayed"])(this.eCondition2PanelFrom, this.showValueFrom(condition2Type));
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_6__["setDisplayed"])(this.eCondition2PanelTo, this.showValueTo(condition2Type));
};
DateFilter.prototype.getFromToComponents = function (position) {
return position === _simpleFilter__WEBPACK_IMPORTED_MODULE_3__["ConditionPosition"].One ?
[this.dateCondition1FromComp, this.dateCondition1ToComp] :
[this.dateCondition2FromComp, this.dateCondition2ToComp];
};
DateFilter.DEFAULT_FILTER_OPTIONS = [
_scalarFilter__WEBPACK_IMPORTED_MODULE_4__["ScalarFilter"].EQUALS,
_scalarFilter__WEBPACK_IMPORTED_MODULE_4__["ScalarFilter"].GREATER_THAN,
_scalarFilter__WEBPACK_IMPORTED_MODULE_4__["ScalarFilter"].LESS_THAN,
_scalarFilter__WEBPACK_IMPORTED_MODULE_4__["ScalarFilter"].NOT_EQUAL,
_scalarFilter__WEBPACK_IMPORTED_MODULE_4__["ScalarFilter"].IN_RANGE
];
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__["RefSelector"])('eCondition1PanelFrom')
], DateFilter.prototype, "eCondition1PanelFrom", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__["RefSelector"])('eCondition1PanelTo')
], DateFilter.prototype, "eCondition1PanelTo", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__["RefSelector"])('eCondition2PanelFrom')
], DateFilter.prototype, "eCondition2PanelFrom", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__["RefSelector"])('eCondition2PanelTo')
], DateFilter.prototype, "eCondition2PanelTo", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('userComponentFactory')
], DateFilter.prototype, "userComponentFactory", void 0);
return DateFilter;
}(_scalarFilter__WEBPACK_IMPORTED_MODULE_4__["ScalarFilter"]));
/***/ }),
/* 60 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DateCompWrapper", function() { return DateCompWrapper; });
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
/** Provides sync access to async component. Date component can be lazy created - this class encapsulates
* this by keeping value locally until DateComp has loaded, then passing DateComp the value. */
var DateCompWrapper = /** @class */ (function () {
function DateCompWrapper(context, userComponentFactory, dateComponentParams, eParent) {
var _this = this;
this.alive = true;
this.context = context;
userComponentFactory.newDateComponent(dateComponentParams).then(function (dateComp) {
// because async, check the filter still exists after component comes back
if (!_this.alive) {
context.destroyBean(dateComp);
return;
}
_this.dateComp = dateComp;
eParent.appendChild(dateComp.getGui());
if (dateComp.afterGuiAttached) {
dateComp.afterGuiAttached();
}
if (_this.tempValue) {
dateComp.setDate(_this.tempValue);
}
});
}
DateCompWrapper.prototype.destroy = function () {
this.alive = false;
this.dateComp = this.context.destroyBean(this.dateComp);
};
DateCompWrapper.prototype.getDate = function () {
return this.dateComp ? this.dateComp.getDate() : this.tempValue;
};
DateCompWrapper.prototype.setDate = function (value) {
if (this.dateComp) {
this.dateComp.setDate(value);
}
else {
this.tempValue = value;
}
};
DateCompWrapper.prototype.setInputPlaceholder = function (placeholder) {
if (this.dateComp && this.dateComp.setInputPlaceholder) {
this.dateComp.setInputPlaceholder(placeholder);
}
};
DateCompWrapper.prototype.setInputAriaLabel = function (label) {
if (this.dateComp && this.dateComp.setInputAriaLabel) {
this.dateComp.setInputAriaLabel(label);
}
};
DateCompWrapper.prototype.afterGuiAttached = function (params) {
if (this.dateComp && typeof this.dateComp.afterGuiAttached === 'function') {
this.dateComp.afterGuiAttached(params);
}
};
return DateCompWrapper;
}());
/***/ }),
/* 61 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ConditionPosition", function() { return ConditionPosition; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleFilter", function() { return SimpleFilter; });
/* harmony import */ var _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57);
/* harmony import */ var _optionsFactory__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(62);
/* harmony import */ var _providedFilter__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(63);
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37);
/* harmony import */ var _utils_array__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(14);
/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(42);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 ConditionPosition;
(function (ConditionPosition) {
ConditionPosition[ConditionPosition["One"] = 0] = "One";
ConditionPosition[ConditionPosition["Two"] = 1] = "Two";
})(ConditionPosition || (ConditionPosition = {}));
/**
* Every filter with a dropdown where the user can specify a comparing type against the filter values
*/
var SimpleFilter = /** @class */ (function (_super) {
__extends(SimpleFilter, _super);
function SimpleFilter() {
return _super !== null && _super.apply(this, arguments) || this;
}
// returns true if this type requires a 'from' field, eg any filter that requires at least one text value
SimpleFilter.prototype.showValueFrom = function (type) {
return !this.doesFilterHaveHiddenInput(type) && type !== SimpleFilter.EMPTY;
};
// returns true if this type requires a 'to' field, currently only 'range' returns true
SimpleFilter.prototype.showValueTo = function (type) {
return type === SimpleFilter.IN_RANGE;
};
// floating filter calls this when user applies filter from floating filter
SimpleFilter.prototype.onFloatingFilterChanged = function (type, value) {
this.setTypeFromFloatingFilter(type);
this.setValueFromFloatingFilter(value);
this.onUiChanged(true);
};
SimpleFilter.prototype.setTypeFromFloatingFilter = function (type) {
this.eType1.setValue(type);
this.eType2.setValue(this.optionsFactory.getDefaultOption());
(this.isDefaultOperator('AND') ? this.eJoinOperatorAnd : this.eJoinOperatorOr).setValue(true);
};
SimpleFilter.prototype.getModelFromUi = function () {
if (!this.isConditionUiComplete(ConditionPosition.One)) {
return null;
}
if (this.isAllowTwoConditions() && this.isConditionUiComplete(ConditionPosition.Two)) {
return {
filterType: this.getFilterType(),
operator: this.getJoinOperator(),
condition1: this.createCondition(ConditionPosition.One),
condition2: this.createCondition(ConditionPosition.Two)
};
}
return this.createCondition(ConditionPosition.One);
};
SimpleFilter.prototype.getCondition1Type = function () {
return this.eType1.getValue();
};
SimpleFilter.prototype.getCondition2Type = function () {
return this.eType2.getValue();
};
SimpleFilter.prototype.getJoinOperator = function () {
return this.eJoinOperatorOr.getValue() === true ? 'OR' : 'AND';
};
SimpleFilter.prototype.areModelsEqual = function (a, b) {
// both are missing
if (!a && !b) {
return true;
}
// one is missing, other present
if ((!a && b) || (a && !b)) {
return false;
}
// one is combined, the other is not
var aIsSimple = !a.operator;
var bIsSimple = !b.operator;
var oneSimpleOneCombined = (!aIsSimple && bIsSimple) || (aIsSimple && !bIsSimple);
if (oneSimpleOneCombined) {
return false;
}
var res;
// otherwise both present, so compare
if (aIsSimple) {
var aSimple = a;
var bSimple = b;
res = this.areSimpleModelsEqual(aSimple, bSimple);
}
else {
var aCombined = a;
var bCombined = b;
res = aCombined.operator === bCombined.operator
&& this.areSimpleModelsEqual(aCombined.condition1, bCombined.condition1)
&& this.areSimpleModelsEqual(aCombined.condition2, bCombined.condition2);
}
return res;
};
SimpleFilter.prototype.setModelIntoUi = function (model) {
var isCombined = model.operator;
if (isCombined) {
var combinedModel = model;
var orChecked = combinedModel.operator === 'OR';
this.eJoinOperatorAnd.setValue(!orChecked);
this.eJoinOperatorOr.setValue(orChecked);
this.eType1.setValue(combinedModel.condition1.type);
this.eType2.setValue(combinedModel.condition2.type);
this.setConditionIntoUi(combinedModel.condition1, ConditionPosition.One);
this.setConditionIntoUi(combinedModel.condition2, ConditionPosition.Two);
}
else {
var simpleModel = model;
this.eJoinOperatorAnd.setValue(this.isDefaultOperator('AND'));
this.eJoinOperatorOr.setValue(this.isDefaultOperator('OR'));
this.eType1.setValue(simpleModel.type);
this.eType2.setValue(this.optionsFactory.getDefaultOption());
this.setConditionIntoUi(simpleModel, ConditionPosition.One);
this.setConditionIntoUi(null, ConditionPosition.Two);
}
return _utils__WEBPACK_IMPORTED_MODULE_3__["AgPromise"].resolve();
};
SimpleFilter.prototype.doesFilterPass = function (params) {
var _this = this;
var model = this.getModel();
if (model == null) {
return true;
}
var operator = model.operator;
var models = [];
if (operator) {
var combinedModel = model;
models.push(combinedModel.condition1, combinedModel.condition2);
}
else {
models.push(model);
}
var combineFunction = operator && operator === 'OR' ? _utils_array__WEBPACK_IMPORTED_MODULE_4__["some"] : _utils_array__WEBPACK_IMPORTED_MODULE_4__["every"];
return combineFunction(models, function (m) { return _this.individualConditionPasses(params, m); });
};
SimpleFilter.prototype.setParams = function (params) {
_super.prototype.setParams.call(this, params);
this.optionsFactory = new _optionsFactory__WEBPACK_IMPORTED_MODULE_1__["OptionsFactory"]();
this.optionsFactory.init(params, this.getDefaultFilterOptions());
this.allowTwoConditions = !params.suppressAndOrCondition;
this.alwaysShowBothConditions = !!params.alwaysShowBothConditions;
this.defaultJoinOperator = this.getDefaultJoinOperator(params.defaultJoinOperator);
this.putOptionsIntoDropdown();
this.addChangedListeners();
};
SimpleFilter.prototype.getDefaultJoinOperator = function (defaultJoinOperator) {
return Object(_utils_array__WEBPACK_IMPORTED_MODULE_4__["includes"])(['AND', 'OR'], defaultJoinOperator) ? defaultJoinOperator : 'AND';
};
SimpleFilter.prototype.putOptionsIntoDropdown = function () {
var _this = this;
var filterOptions = this.optionsFactory.getFilterOptions();
Object(_utils_array__WEBPACK_IMPORTED_MODULE_4__["forEach"])(filterOptions, function (option) {
var value;
var text;
if (typeof option === 'string') {
value = option;
text = _this.translate(value);
}
else {
value = option.displayKey;
var customOption = _this.optionsFactory.getCustomOption(value);
text = customOption ?
_this.gridOptionsWrapper.getLocaleTextFunc()(customOption.displayKey, customOption.displayName) :
_this.translate(value);
}
var createOption = function () { return ({ value: value, text: text }); };
_this.eType1.addOption(createOption());
_this.eType2.addOption(createOption());
});
var readOnly = filterOptions.length <= 1;
this.eType1.setDisabled(readOnly);
this.eType2.setDisabled(readOnly);
};
SimpleFilter.prototype.isAllowTwoConditions = function () {
return this.allowTwoConditions;
};
SimpleFilter.prototype.createBodyTemplate = function () {
return /* html */ "\n \n " + this.createValueTemplate(ConditionPosition.One) + "\n
\n \n \n
\n \n " + this.createValueTemplate(ConditionPosition.Two);
};
SimpleFilter.prototype.getCssIdentifier = function () {
return 'simple-filter';
};
SimpleFilter.prototype.updateUiVisibility = function () {
var isCondition2Enabled = this.isCondition2Enabled();
if (this.alwaysShowBothConditions) {
this.eJoinOperatorAnd.setDisabled(!isCondition2Enabled);
this.eJoinOperatorOr.setDisabled(!isCondition2Enabled);
this.eType2.setDisabled(!isCondition2Enabled);
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_5__["setDisabled"])(this.eCondition2Body, !isCondition2Enabled);
}
else {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_5__["setDisplayed"])(this.eJoinOperatorPanel, isCondition2Enabled);
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_5__["setDisplayed"])(this.eType2.getGui(), isCondition2Enabled);
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_5__["setDisplayed"])(this.eCondition2Body, isCondition2Enabled);
}
};
SimpleFilter.prototype.isCondition2Enabled = function () {
return this.allowTwoConditions && this.isConditionUiComplete(ConditionPosition.One);
};
SimpleFilter.prototype.resetUiToDefaults = function (silent) {
var translate = this.gridOptionsWrapper.getLocaleTextFunc();
var filteringLabel = translate('ariaFilteringOperator', 'Filtering operator');
var uniqueGroupId = 'ag-simple-filter-and-or-' + this.getCompId();
var defaultOption = this.optionsFactory.getDefaultOption();
this.eType1.setValue(defaultOption, silent).setAriaLabel(filteringLabel);
this.eType2.setValue(defaultOption, silent).setAriaLabel(filteringLabel);
this.eJoinOperatorAnd
.setValue(this.isDefaultOperator('AND'), silent)
.setName(uniqueGroupId)
.setLabel(this.translate('andCondition'));
this.eJoinOperatorOr
.setValue(this.isDefaultOperator('OR'), silent)
.setName(uniqueGroupId)
.setLabel(this.translate('orCondition'));
return _utils__WEBPACK_IMPORTED_MODULE_3__["AgPromise"].resolve();
};
SimpleFilter.prototype.isDefaultOperator = function (operator) {
return operator === this.defaultJoinOperator;
};
SimpleFilter.prototype.addChangedListeners = function () {
var _this = this;
var listener = function () { return _this.onUiChanged(); };
this.eType1.onValueChange(listener);
this.eType2.onValueChange(listener);
this.eJoinOperatorOr.onValueChange(listener);
this.eJoinOperatorAnd.onValueChange(listener);
};
SimpleFilter.prototype.doesFilterHaveHiddenInput = function (filterType) {
var customFilterOption = this.optionsFactory.getCustomOption(filterType);
return customFilterOption && customFilterOption.hideFilterInput;
};
SimpleFilter.EMPTY = 'empty';
SimpleFilter.EQUALS = 'equals';
SimpleFilter.NOT_EQUAL = 'notEqual';
SimpleFilter.LESS_THAN = 'lessThan';
SimpleFilter.LESS_THAN_OR_EQUAL = 'lessThanOrEqual';
SimpleFilter.GREATER_THAN = 'greaterThan';
SimpleFilter.GREATER_THAN_OR_EQUAL = 'greaterThanOrEqual';
SimpleFilter.IN_RANGE = 'inRange';
SimpleFilter.CONTAINS = 'contains';
SimpleFilter.NOT_CONTAINS = 'notContains';
SimpleFilter.STARTS_WITH = 'startsWith';
SimpleFilter.ENDS_WITH = 'endsWith';
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__["RefSelector"])('eOptions1')
], SimpleFilter.prototype, "eType1", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__["RefSelector"])('eOptions2')
], SimpleFilter.prototype, "eType2", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__["RefSelector"])('eJoinOperatorPanel')
], SimpleFilter.prototype, "eJoinOperatorPanel", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__["RefSelector"])('eJoinOperatorAnd')
], SimpleFilter.prototype, "eJoinOperatorAnd", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__["RefSelector"])('eJoinOperatorOr')
], SimpleFilter.prototype, "eJoinOperatorOr", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__["RefSelector"])('eCondition1Body')
], SimpleFilter.prototype, "eCondition1Body", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__["RefSelector"])('eCondition2Body')
], SimpleFilter.prototype, "eCondition2Body", void 0);
return SimpleFilter;
}(_providedFilter__WEBPACK_IMPORTED_MODULE_2__["ProvidedFilter"]));
/***/ }),
/* 62 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OptionsFactory", function() { return OptionsFactory; });
/* harmony import */ var _utils_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
/* Common logic for options, used by both filters and floating filters. */
var OptionsFactory = /** @class */ (function () {
function OptionsFactory() {
this.customFilterOptions = {};
}
OptionsFactory.prototype.init = function (params, defaultOptions) {
this.filterOptions = params.filterOptions || defaultOptions;
this.mapCustomOptions();
this.selectDefaultItem(params);
};
OptionsFactory.prototype.getFilterOptions = function () {
return this.filterOptions;
};
OptionsFactory.prototype.mapCustomOptions = function () {
var _this = this;
if (!this.filterOptions) {
return;
}
this.filterOptions.forEach(function (filterOption) {
if (typeof filterOption === 'string') {
return;
}
var requiredProperties = ['displayKey', 'displayName', 'test'];
if (Object(_utils_array__WEBPACK_IMPORTED_MODULE_0__["every"])(requiredProperties, function (key) {
if (!filterOption[key]) {
console.warn("ag-Grid: ignoring FilterOptionDef as it doesn't contain a '" + key + "'");
return false;
}
return true;
})) {
_this.customFilterOptions[filterOption.displayKey] = filterOption;
}
});
};
OptionsFactory.prototype.selectDefaultItem = function (params) {
if (params.defaultOption) {
this.defaultOption = params.defaultOption;
}
else if (this.filterOptions.length >= 1) {
var firstFilterOption = this.filterOptions[0];
if (typeof firstFilterOption === 'string') {
this.defaultOption = firstFilterOption;
}
else if (firstFilterOption.displayKey) {
this.defaultOption = firstFilterOption.displayKey;
}
else {
console.warn("ag-Grid: invalid FilterOptionDef supplied as it doesn't contain a 'displayKey'");
}
}
else {
console.warn('ag-Grid: no filter options for filter');
}
};
OptionsFactory.prototype.getDefaultOption = function () {
return this.defaultOption;
};
OptionsFactory.prototype.getCustomOption = function (name) {
return this.customFilterOptions[name];
};
return OptionsFactory;
}());
/***/ }),
/* 63 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ProvidedFilter", function() { return ProvidedFilter; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _constants_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16);
/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(42);
/* harmony import */ var _utils_function__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(15);
/* harmony import */ var _filterLocaleText__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(64);
/* harmony import */ var _widgets_managedFocusComponent__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(65);
/* harmony import */ var _utils_set__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(52);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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;
};
/**
* Contains common logic to all provided filters (apply button, clear button, etc).
* All the filters that come with ag-Grid extend this class. User filters do not
* extend this class.
*/
var ProvidedFilter = /** @class */ (function (_super) {
__extends(ProvidedFilter, _super);
function ProvidedFilter(filterNameKey) {
var _this = _super.call(this) || this;
_this.filterNameKey = filterNameKey;
_this.applyActive = false;
_this.hidePopup = null;
// after the user hits 'apply' the model gets copied to here. this is then the model that we use for
// all filtering. so if user changes UI but doesn't hit apply, then the UI will be out of sync with this model.
// this is what we want, as the UI should only become the 'active' filter once it's applied. when apply is
// inactive, this model will be in sync (following the debounce ms). if the UI is not a valid filter
// (eg the value is missing so nothing to filter on, or for set filter all checkboxes are checked so filter
// not active) then this appliedModel will be null/undefined.
_this.appliedModel = null;
return _this;
}
ProvidedFilter.prototype.getFilterTitle = function () {
return this.translate(this.filterNameKey);
};
/** @deprecated */
ProvidedFilter.prototype.onFilterChanged = function () {
console.warn("ag-Grid: you should not call onFilterChanged() directly on the filter, please call\n gridApi.onFilterChanged() instead. onFilterChanged is not part of the exposed filter interface (it was\n a method that existed on an old version of the filters that was not intended for public use.");
this.providedFilterParams.filterChangedCallback();
};
ProvidedFilter.prototype.isFilterActive = function () {
// filter is active if we have a valid applied model
return !!this.appliedModel;
};
ProvidedFilter.prototype.postConstruct = function () {
this.resetTemplate(); // do this first to create the DOM
_super.prototype.postConstruct.call(this);
};
ProvidedFilter.prototype.resetTemplate = function (paramsMap) {
var templateString = /* html */ "\n
\n
\n " + this.createBodyTemplate() + "\n
\n
";
this.setTemplate(templateString, paramsMap);
};
ProvidedFilter.prototype.init = function (params) {
var _this = this;
this.setParams(params);
this.resetUiToDefaults(true).then(function () {
_this.updateUiVisibility();
_this.setupOnBtApplyDebounce();
});
};
ProvidedFilter.prototype.setParams = function (params) {
ProvidedFilter.checkForDeprecatedParams(params);
this.providedFilterParams = params;
if (params.newRowsAction === 'keep') {
this.newRowsActionKeep = true;
}
else if (params.newRowsAction === 'clear') {
this.newRowsActionKeep = false;
}
else {
// the default for SSRM and IRM is 'keep', for CSRM and VRM the default is 'clear'
var modelsForKeep = [_constants_constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].ROW_MODEL_TYPE_SERVER_SIDE, _constants_constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].ROW_MODEL_TYPE_INFINITE];
this.newRowsActionKeep = modelsForKeep.indexOf(this.rowModel.getType()) >= 0;
}
this.applyActive = ProvidedFilter.isUseApplyButton(params);
this.createButtonPanel();
};
ProvidedFilter.prototype.createButtonPanel = function () {
var _this = this;
var buttons = this.providedFilterParams.buttons;
if (!buttons || buttons.length < 1) {
return;
}
var eButtonsPanel = document.createElement('div');
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_2__["addCssClass"])(eButtonsPanel, 'ag-filter-apply-panel');
var addButton = function (type) {
var text;
var clickListener;
switch (type) {
case 'apply':
text = _this.translate('applyFilter');
clickListener = function (e) { return _this.onBtApply(false, false, e); };
break;
case 'clear':
text = _this.translate('clearFilter');
clickListener = function () { return _this.onBtClear(); };
break;
case 'reset':
text = _this.translate('resetFilter');
clickListener = function () { return _this.onBtReset(); };
break;
case 'cancel':
text = _this.translate('cancelFilter');
clickListener = function (e) { _this.onBtCancel(e); };
break;
default:
console.warn('Unknown button type specified');
return;
}
var button = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_2__["loadTemplate"])(/* html */ "");
eButtonsPanel.appendChild(button);
_this.addManagedListener(button, 'click', clickListener);
};
Object(_utils_set__WEBPACK_IMPORTED_MODULE_6__["convertToSet"])(buttons).forEach(function (type) { return addButton(type); });
this.getGui().appendChild(eButtonsPanel);
};
ProvidedFilter.checkForDeprecatedParams = function (params) {
var buttons = params.buttons || [];
if (buttons.length > 0) {
return;
}
var applyButton = params.applyButton, resetButton = params.resetButton, clearButton = params.clearButton;
if (clearButton) {
console.warn('ag-Grid: as of ag-Grid v23.2, filterParams.clearButton is deprecated. Please use filterParams.buttons instead');
buttons.push('clear');
}
if (resetButton) {
console.warn('ag-Grid: as of ag-Grid v23.2, filterParams.resetButton is deprecated. Please use filterParams.buttons instead');
buttons.push('reset');
}
if (applyButton) {
console.warn('ag-Grid: as of ag-Grid v23.2, filterParams.applyButton is deprecated. Please use filterParams.buttons instead');
buttons.push('apply');
}
if (params.apply) {
console.warn('ag-Grid: as of ag-Grid v21, filterParams.apply is deprecated. Please use filterParams.buttons instead');
buttons.push('apply');
}
params.buttons = buttons;
};
// subclasses can override this to provide alternative debounce defaults
ProvidedFilter.prototype.getDefaultDebounceMs = function () {
return 0;
};
ProvidedFilter.prototype.setupOnBtApplyDebounce = function () {
var debounceMs = ProvidedFilter.getDebounceMs(this.providedFilterParams, this.getDefaultDebounceMs());
this.onBtApplyDebounce = Object(_utils_function__WEBPACK_IMPORTED_MODULE_3__["debounce"])(this.onBtApply.bind(this), debounceMs);
};
ProvidedFilter.prototype.getModel = function () {
return this.appliedModel;
};
ProvidedFilter.prototype.setModel = function (model) {
var _this = this;
var promise = model ? this.setModelIntoUi(model) : this.resetUiToDefaults();
return promise.then(function () {
_this.updateUiVisibility();
// we set the model from the GUI, rather than the provided model,
// so the model is consistent, e.g. handling of null/undefined will be the same,
// or if model is case insensitive, then casing is removed.
_this.applyModel();
});
};
ProvidedFilter.prototype.onBtCancel = function (e) {
var _this = this;
this.setModelIntoUi(this.getModel()).then(function () {
_this.onUiChanged(false, 'prevent');
if (_this.providedFilterParams.closeOnApply) {
_this.close(e);
}
});
};
ProvidedFilter.prototype.onBtClear = function () {
var _this = this;
this.resetUiToDefaults().then(function () { return _this.onUiChanged(); });
};
ProvidedFilter.prototype.onBtReset = function () {
this.onBtClear();
this.onBtApply();
};
/**
* Applies changes made in the UI to the filter, and returns true if the model has changed.
*/
ProvidedFilter.prototype.applyModel = function () {
var newModel = this.getModelFromUi();
if (!this.isModelValid(newModel)) {
return false;
}
var previousModel = this.appliedModel;
this.appliedModel = newModel;
// models can be same if user pasted same content into text field, or maybe just changed the case
// and it's a case insensitive filter
return !this.areModelsEqual(previousModel, newModel);
};
ProvidedFilter.prototype.isModelValid = function (model) {
return true;
};
ProvidedFilter.prototype.onBtApply = function (afterFloatingFilter, afterDataChange, e) {
if (afterFloatingFilter === void 0) { afterFloatingFilter = false; }
if (afterDataChange === void 0) { afterDataChange = false; }
if (this.applyModel()) {
// the floating filter uses 'afterFloatingFilter' info, so it doesn't refresh after filter changed if change
// came from floating filter
this.providedFilterParams.filterChangedCallback({ afterFloatingFilter: afterFloatingFilter, afterDataChange: afterDataChange });
}
var closeOnApply = this.providedFilterParams.closeOnApply;
// only close if an apply button is visible, otherwise we'd be closing every time a change was made!
if (closeOnApply && this.applyActive && !afterFloatingFilter && !afterDataChange) {
this.close(e);
}
};
ProvidedFilter.prototype.onNewRowsLoaded = function () {
var _this = this;
if (!this.newRowsActionKeep) {
this.resetUiToDefaults().then(function () { return _this.appliedModel = null; });
}
};
ProvidedFilter.prototype.close = function (e) {
if (!this.hidePopup) {
return;
}
var keyboardEvent = e;
var key = keyboardEvent && keyboardEvent.key;
var params;
if (key === 'Enter' || key === 'Space') {
params = { keyboardEvent: keyboardEvent };
}
this.hidePopup(params);
this.hidePopup = null;
};
// called by set filter
ProvidedFilter.prototype.isNewRowsActionKeep = function () {
return this.newRowsActionKeep;
};
/**
* By default, if the change came from a floating filter it will be applied immediately, otherwise if there is no
* apply button it will be applied after a debounce, otherwise it will not be applied at all. This behaviour can
* be adjusted by using the apply parameter.
*/
ProvidedFilter.prototype.onUiChanged = function (fromFloatingFilter, apply) {
if (fromFloatingFilter === void 0) { fromFloatingFilter = false; }
this.updateUiVisibility();
this.providedFilterParams.filterModifiedCallback();
if (this.applyActive) {
var isValid = this.isModelValid(this.getModelFromUi());
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_2__["setDisabled"])(this.getRefElement('applyFilterButton'), !isValid);
}
if ((fromFloatingFilter && !apply) || apply === 'immediately') {
this.onBtApply(fromFloatingFilter);
}
else if ((!this.applyActive && !apply) || apply === 'debounce') {
this.onBtApplyDebounce();
}
};
ProvidedFilter.prototype.afterGuiAttached = function (params) {
if (params == null) {
return;
}
this.hidePopup = params.hidePopup;
};
// static, as used by floating filter also
ProvidedFilter.getDebounceMs = function (params, debounceDefault) {
if (ProvidedFilter.isUseApplyButton(params)) {
if (params.debounceMs != null) {
console.warn('ag-Grid: debounceMs is ignored when apply button is present');
}
return 0;
}
return params.debounceMs != null ? params.debounceMs : debounceDefault;
};
// static, as used by floating filter also
ProvidedFilter.isUseApplyButton = function (params) {
ProvidedFilter.checkForDeprecatedParams(params);
return params.buttons && params.buttons.indexOf('apply') >= 0;
};
ProvidedFilter.prototype.destroy = function () {
this.hidePopup = null;
_super.prototype.destroy.call(this);
};
ProvidedFilter.prototype.translate = function (key) {
var translate = this.gridOptionsWrapper.getLocaleTextFunc();
return translate(key, _filterLocaleText__WEBPACK_IMPORTED_MODULE_4__["DEFAULT_FILTER_LOCALE_TEXT"][key]);
};
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('rowModel')
], ProvidedFilter.prototype, "rowModel", void 0);
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_0__["PostConstruct"]
], ProvidedFilter.prototype, "postConstruct", null);
return ProvidedFilter;
}(_widgets_managedFocusComponent__WEBPACK_IMPORTED_MODULE_5__["ManagedFocusComponent"]));
/***/ }),
/* 64 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_FILTER_LOCALE_TEXT", function() { return DEFAULT_FILTER_LOCALE_TEXT; });
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var DEFAULT_FILTER_LOCALE_TEXT = {
applyFilter: 'Apply',
clearFilter: 'Clear',
resetFilter: 'Reset',
cancelFilter: 'Cancel',
textFilter: 'Text Filter',
numberFilter: 'Number Filter',
dateFilter: 'Date Filter',
setFilter: 'Set Filter',
filterOoo: 'Filter...',
empty: 'Choose One',
equals: 'Equals',
notEqual: 'Not equal',
lessThan: 'Less than',
greaterThan: 'Greater than',
inRange: 'In range',
inRangeStart: 'From',
inRangeEnd: 'To',
lessThanOrEqual: 'Less than or equals',
greaterThanOrEqual: 'Greater than or equals',
contains: 'Contains',
notContains: 'Not contains',
startsWith: 'Starts with',
endsWith: 'Ends with',
andCondition: 'AND',
orCondition: 'OR',
dateFormatOoo: 'yyyy-mm-dd',
};
/***/ }),
/* 65 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ManagedFocusComponent", function() { return ManagedFocusComponent; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(36);
/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(42);
/* harmony import */ var _constants_keyCode__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(58);
/* harmony import */ var _utils_event__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(21);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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;
};
/**
* This provides logic to override the default browser focus logic.
*
* When the component gets focus, it uses the grid logic to find out what should be focused,
* and then focuses that instead.
*
* This is how we ensure when user tabs into the relevant section, we focus the correct item.
* For example GridCore extends ManagedFocusComponent, and it ensures when it receives focus
* that focus goes to the first cell of the first header row.
*/
var ManagedFocusComponent = /** @class */ (function (_super) {
__extends(ManagedFocusComponent, _super);
/*
* Set isFocusableContainer to true if this component will contain multiple focus-managed
* elements within. When set to true, this component will add tabGuards that will be responsible
* for receiving focus from outside and focusing an internal element using the focusInnerElementMethod
*/
function ManagedFocusComponent(template, isFocusableContainer) {
if (isFocusableContainer === void 0) { isFocusableContainer = false; }
var _this = _super.call(this, template) || this;
_this.isFocusableContainer = isFocusableContainer;
_this.skipTabGuardFocus = false;
return _this;
}
ManagedFocusComponent.prototype.postConstruct = function () {
var _this = this;
var focusableElement = this.getFocusableElement();
if (!focusableElement) {
return;
}
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_2__["addCssClass"])(focusableElement, ManagedFocusComponent.FOCUS_MANAGED_CLASS);
if (this.isFocusableContainer) {
this.topTabGuard = this.createTabGuard('top');
this.bottomTabGuard = this.createTabGuard('bottom');
this.addTabGuards();
this.activateTabGuards();
this.forEachTabGuard(function (guard) { return _this.addManagedListener(guard, 'focus', _this.onFocus.bind(_this)); });
}
this.addKeyDownListeners(focusableElement);
this.addManagedListener(focusableElement, 'focusin', this.onFocusIn.bind(this));
this.addManagedListener(focusableElement, 'focusout', this.onFocusOut.bind(this));
};
/*
* Override this method if focusing the default element requires special logic.
*/
ManagedFocusComponent.prototype.focusInnerElement = function (fromBottom) {
if (fromBottom === void 0) { fromBottom = false; }
var focusable = this.focusController.findFocusableElements(this.getFocusableElement());
if (this.isFocusableContainer && this.tabGuardsAreActive()) {
// remove tab guards from this component from list of focusable elements
focusable.splice(0, 1);
focusable.splice(focusable.length - 1, 1);
}
if (!focusable.length) {
return;
}
focusable[fromBottom ? focusable.length - 1 : 0].focus();
};
/**
* By default this will tab though the elements in the default order. Override if you require special logic.
*/
ManagedFocusComponent.prototype.onTabKeyDown = function (e) {
var _this = this;
if (e.defaultPrevented) {
return;
}
var tabGuardsAreActive = this.tabGuardsAreActive();
if (this.isFocusableContainer && tabGuardsAreActive) {
this.deactivateTabGuards();
}
var nextRoot = this.focusController.findNextFocusableElement(this.getFocusableElement(), false, e.shiftKey);
if (this.isFocusableContainer && tabGuardsAreActive) {
// ensure the tab guards are only re-instated once the event has finished processing, to avoid the browser
// tabbing to the tab guard from inside the component
setTimeout(function () { return _this.activateTabGuards(); }, 0);
}
if (!nextRoot) {
return;
}
nextRoot.focus();
e.preventDefault();
};
ManagedFocusComponent.prototype.onFocusIn = function (e) {
if (this.isFocusableContainer) {
this.deactivateTabGuards();
}
};
ManagedFocusComponent.prototype.onFocusOut = function (e) {
if (this.isFocusableContainer && !this.getFocusableElement().contains(e.relatedTarget)) {
this.activateTabGuards();
}
};
ManagedFocusComponent.prototype.forceFocusOutOfContainer = function (up) {
if (up === void 0) { up = false; }
if (!this.isFocusableContainer) {
return;
}
this.activateTabGuards();
this.skipTabGuardFocus = true;
var tabGuardToFocus = up ? this.topTabGuard : this.bottomTabGuard;
if (tabGuardToFocus) {
tabGuardToFocus.focus();
}
};
ManagedFocusComponent.prototype.appendChild = function (newChild, container) {
if (this.isFocusableContainer) {
if (!Object(_utils_dom__WEBPACK_IMPORTED_MODULE_2__["isNodeOrElement"])(newChild)) {
newChild = newChild.getGui();
}
var bottomTabGuard = this.bottomTabGuard;
if (bottomTabGuard) {
bottomTabGuard.insertAdjacentElement('beforebegin', newChild);
}
else {
_super.prototype.appendChild.call(this, newChild, container);
}
}
else {
_super.prototype.appendChild.call(this, newChild, container);
}
};
ManagedFocusComponent.prototype.createTabGuard = function (side) {
var tabGuard = document.createElement('div');
tabGuard.classList.add('ag-tab-guard');
tabGuard.classList.add("ag-tab-guard-" + side);
tabGuard.setAttribute('role', 'presentation');
return tabGuard;
};
ManagedFocusComponent.prototype.addTabGuards = function () {
var focusableEl = this.getFocusableElement();
focusableEl.insertAdjacentElement('afterbegin', this.topTabGuard);
focusableEl.insertAdjacentElement('beforeend', this.bottomTabGuard);
};
ManagedFocusComponent.prototype.forEachTabGuard = function (callback) {
if (this.topTabGuard) {
callback(this.topTabGuard);
}
if (this.bottomTabGuard) {
callback(this.bottomTabGuard);
}
};
ManagedFocusComponent.prototype.addKeyDownListeners = function (eGui) {
var _this = this;
this.addManagedListener(eGui, 'keydown', function (e) {
if (e.defaultPrevented || Object(_utils_event__WEBPACK_IMPORTED_MODULE_4__["isStopPropagationForAgGrid"])(e)) {
return;
}
if (_this.shouldStopEventPropagation(e)) {
Object(_utils_event__WEBPACK_IMPORTED_MODULE_4__["stopPropagationForAgGrid"])(e);
return;
}
if (e.keyCode === _constants_keyCode__WEBPACK_IMPORTED_MODULE_3__["KeyCode"].TAB) {
_this.onTabKeyDown(e);
}
else if (_this.handleKeyDown) {
_this.handleKeyDown(e);
}
});
};
ManagedFocusComponent.prototype.shouldStopEventPropagation = function (e) {
return false;
};
ManagedFocusComponent.prototype.onFocus = function (e) {
if (this.skipTabGuardFocus) {
this.skipTabGuardFocus = false;
return;
}
this.focusInnerElement(e.target === this.bottomTabGuard);
};
ManagedFocusComponent.prototype.activateTabGuards = function () {
this.forEachTabGuard(function (guard) { return guard.setAttribute('tabIndex', '0'); });
};
ManagedFocusComponent.prototype.deactivateTabGuards = function () {
this.forEachTabGuard(function (guard) { return guard.removeAttribute('tabIndex'); });
};
ManagedFocusComponent.prototype.tabGuardsAreActive = function () {
return !!this.topTabGuard && this.topTabGuard.hasAttribute('tabIndex');
};
ManagedFocusComponent.prototype.clearGui = function () {
var tabGuardsAreActive = this.tabGuardsAreActive();
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_2__["clearElement"])(this.getFocusableElement());
if (this.isFocusableContainer) {
this.addTabGuards();
if (tabGuardsAreActive) {
this.activateTabGuards();
}
}
};
ManagedFocusComponent.FOCUS_MANAGED_CLASS = 'ag-focus-managed';
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('focusController')
], ManagedFocusComponent.prototype, "focusController", void 0);
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_0__["PostConstruct"]
], ManagedFocusComponent.prototype, "postConstruct", null);
return ManagedFocusComponent;
}(_component__WEBPACK_IMPORTED_MODULE_1__["Component"]));
/***/ }),
/* 66 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScalarFilter", function() { return ScalarFilter; });
/* harmony import */ var _simpleFilter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(61);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var ScalarFilter = /** @class */ (function (_super) {
__extends(ScalarFilter, _super);
function ScalarFilter() {
return _super !== null && _super.apply(this, arguments) || this;
}
ScalarFilter.prototype.setParams = function (params) {
_super.prototype.setParams.call(this, params);
this.scalarFilterParams = params;
this.checkDeprecatedParams();
};
ScalarFilter.prototype.checkDeprecatedParams = function () {
if (this.scalarFilterParams.nullComparator) {
console.warn('ag-Grid: Since v21.0, the property filterParams.nullComparator is deprecated. ' +
'Please use filterParams.includeBlanksInEquals, filterParams.includeBlanksInLessThan and ' +
'filterParams.includeBlanksInGreaterThan instead.');
this.scalarFilterParams.includeBlanksInEquals = this.scalarFilterParams.nullComparator.equals;
this.scalarFilterParams.includeBlanksInLessThan = this.scalarFilterParams.nullComparator.lessThan;
this.scalarFilterParams.includeBlanksInGreaterThan = this.scalarFilterParams.nullComparator.greaterThan;
}
};
ScalarFilter.prototype.individualConditionPasses = function (params, filterModel) {
var cellValue = this.scalarFilterParams.valueGetter(params.node);
var range = this.mapRangeFromModel(filterModel);
var filterValue = range.from;
var filterValueTo = range.to;
var filterType = filterModel.type;
var customFilterOption = this.optionsFactory.getCustomOption(filterType);
if (customFilterOption) {
// only execute the custom filter if a value exists or a value isn't required, i.e. input is hidden
if (filterValue != null || customFilterOption.hideFilterInput) {
return customFilterOption.test(filterValue, cellValue);
}
}
if (cellValue == null) {
switch (filterType) {
case ScalarFilter.EQUALS:
case ScalarFilter.NOT_EQUAL:
if (this.scalarFilterParams.includeBlanksInEquals) {
return true;
}
break;
case ScalarFilter.GREATER_THAN:
case ScalarFilter.GREATER_THAN_OR_EQUAL:
if (this.scalarFilterParams.includeBlanksInGreaterThan) {
return true;
}
break;
case ScalarFilter.LESS_THAN:
case ScalarFilter.LESS_THAN_OR_EQUAL:
if (this.scalarFilterParams.includeBlanksInLessThan) {
return true;
}
break;
case ScalarFilter.IN_RANGE:
if (this.scalarFilterParams.includeBlanksInRange) {
return true;
}
break;
}
return false;
}
var comparator = this.comparator();
var compareResult = comparator(filterValue, cellValue);
switch (filterType) {
case ScalarFilter.EQUALS:
return compareResult === 0;
case ScalarFilter.NOT_EQUAL:
return compareResult !== 0;
case ScalarFilter.GREATER_THAN:
return compareResult > 0;
case ScalarFilter.GREATER_THAN_OR_EQUAL:
return compareResult >= 0;
case ScalarFilter.LESS_THAN:
return compareResult < 0;
case ScalarFilter.LESS_THAN_OR_EQUAL:
return compareResult <= 0;
case ScalarFilter.IN_RANGE: {
var compareToResult = comparator(filterValueTo, cellValue);
return this.scalarFilterParams.inRangeInclusive ?
compareResult >= 0 && compareToResult <= 0 :
compareResult > 0 && compareToResult < 0;
}
default:
throw new Error('Unexpected type of filter: ' + filterType);
}
};
return ScalarFilter;
}(_simpleFilter__WEBPACK_IMPORTED_MODULE_0__["SimpleFilter"]));
/***/ }),
/* 67 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HeaderComp", function() { return HeaderComp; });
/* harmony import */ var _widgets_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(36);
/* harmony import */ var _entities_column__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(10);
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12);
/* harmony import */ var _widgets_touchListener__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(68);
/* harmony import */ var _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(57);
/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(23);
/* harmony import */ var _utils_string__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(26);
/* harmony import */ var _utils_icon__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(47);
/* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(7);
/* harmony import */ var _utils_browser__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(43);
/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(42);
/* harmony import */ var _utils_array__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(14);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 HeaderComp = /** @class */ (function (_super) {
__extends(HeaderComp, _super);
function HeaderComp() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.lastMovingChanged = 0;
return _this;
}
// this is a user component, and IComponent has "public destroy()" as part of the interface.
// so we need to override destroy() just to make the method public.
HeaderComp.prototype.destroy = function () {
_super.prototype.destroy.call(this);
};
HeaderComp.prototype.refresh = function (params) {
this.params = params;
// if template changed, then recreate the whole comp, the code required to manage
// a changing template is to difficult for what it's worth.
if (this.workOutTemplate() != this.currentTemplate) {
return false;
}
if (this.workOutShowMenu() != this.currentShowMenu) {
return false;
}
if (this.workOutSort() != this.currentSort) {
return false;
}
this.setDisplayName(params);
return true;
};
HeaderComp.prototype.workOutTemplate = function () {
var template = Object(_utils_array__WEBPACK_IMPORTED_MODULE_11__["firstExistingValue"])(this.params.template, HeaderComp.TEMPLATE);
// take account of any newlines & whitespace before/after the actual template
template = template && template.trim ? template.trim() : template;
return template;
};
HeaderComp.prototype.init = function (params) {
this.params = params;
this.currentTemplate = this.workOutTemplate();
this.setTemplate(this.currentTemplate);
this.setupTap();
this.setupIcons(params.column);
this.setMenu();
this.setupSort();
this.setupFilterIcon();
this.setDisplayName(params);
};
HeaderComp.prototype.setDisplayName = function (params) {
if (this.currentDisplayName != params.displayName) {
this.currentDisplayName = params.displayName;
var displayNameSanitised = Object(_utils_string__WEBPACK_IMPORTED_MODULE_6__["escapeString"])(this.currentDisplayName);
if (this.eText) {
this.eText.innerHTML = displayNameSanitised;
}
}
};
HeaderComp.prototype.setupIcons = function (column) {
this.addInIcon('sortAscending', this.eSortAsc, column);
this.addInIcon('sortDescending', this.eSortDesc, column);
this.addInIcon('sortUnSort', this.eSortNone, column);
this.addInIcon('menu', this.eMenu, column);
this.addInIcon('filter', this.eFilter, column);
};
HeaderComp.prototype.addInIcon = function (iconName, eParent, column) {
if (eParent == null) {
return;
}
var eIcon = Object(_utils_icon__WEBPACK_IMPORTED_MODULE_7__["createIconNoSpan"])(iconName, this.gridOptionsWrapper, column);
eParent.appendChild(eIcon);
};
HeaderComp.prototype.setupTap = function () {
var _this = this;
var options = this.gridOptionsWrapper;
if (options.isSuppressTouch()) {
return;
}
var touchListener = new _widgets_touchListener__WEBPACK_IMPORTED_MODULE_3__["TouchListener"](this.getGui(), true);
var suppressMenuHide = options.isSuppressMenuHide();
var tapMenuButton = suppressMenuHide && Object(_utils_generic__WEBPACK_IMPORTED_MODULE_8__["exists"])(this.eMenu);
var menuTouchListener = tapMenuButton ? new _widgets_touchListener__WEBPACK_IMPORTED_MODULE_3__["TouchListener"](this.eMenu, true) : touchListener;
if (this.params.enableMenu) {
var eventType = tapMenuButton ? 'EVENT_TAP' : 'EVENT_LONG_TAP';
var showMenuFn = function (event) {
options.getApi().showColumnMenuAfterMouseClick(_this.params.column, event.touchStart);
};
this.addManagedListener(menuTouchListener, _widgets_touchListener__WEBPACK_IMPORTED_MODULE_3__["TouchListener"][eventType], showMenuFn);
}
if (this.params.enableSorting) {
var tapListener = function (event) {
var target = event.touchStart.target;
// When suppressMenuHide is true, a tap on the menu icon will bubble up
// to the header container, in that case we should not sort
if (suppressMenuHide && _this.eMenu.contains(target)) {
return;
}
_this.sortController.progressSort(_this.params.column, false, "uiColumnSorted");
};
this.addManagedListener(touchListener, _widgets_touchListener__WEBPACK_IMPORTED_MODULE_3__["TouchListener"].EVENT_TAP, tapListener);
}
// if tapMenuButton is true `touchListener` and `menuTouchListener` are different
// so we need to make sure to destroy both listeners here
this.addDestroyFunc(function () { return touchListener.destroy(); });
if (tapMenuButton) {
this.addDestroyFunc(function () { return menuTouchListener.destroy(); });
}
};
HeaderComp.prototype.workOutShowMenu = function () {
// we don't show the menu if on an iPad/iPhone, as the user cannot have a pointer device/
// However if suppressMenuHide is set to true the menu will be displayed alwasys, so it's ok
// to show it on iPad in this case (as hover isn't needed). If suppressMenuHide
// is false (default) user will need to use longpress to display the menu.
var menuHides = !this.gridOptionsWrapper.isSuppressMenuHide();
var onIpadAndMenuHides = Object(_utils_browser__WEBPACK_IMPORTED_MODULE_9__["isIOSUserAgent"])() && menuHides;
var showMenu = this.params.enableMenu && !onIpadAndMenuHides;
return showMenu;
};
HeaderComp.prototype.setMenu = function () {
var _this = this;
// if no menu provided in template, do nothing
if (!this.eMenu) {
return;
}
this.currentShowMenu = this.workOutShowMenu();
if (!this.currentShowMenu) {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_10__["removeFromParent"])(this.eMenu);
return;
}
var suppressMenuHide = this.gridOptionsWrapper.isSuppressMenuHide();
this.addManagedListener(this.eMenu, 'click', function () { return _this.showMenu(_this.eMenu); });
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_10__["addOrRemoveCssClass"])(this.eMenu, 'ag-header-menu-always-show', suppressMenuHide);
};
HeaderComp.prototype.showMenu = function (eventSource) {
if (!eventSource) {
eventSource = this.eMenu;
}
this.menuFactory.showMenuAfterButtonClick(this.params.column, eventSource);
};
HeaderComp.prototype.removeSortIcons = function () {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_10__["removeFromParent"])(this.eSortAsc);
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_10__["removeFromParent"])(this.eSortDesc);
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_10__["removeFromParent"])(this.eSortNone);
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_10__["removeFromParent"])(this.eSortOrder);
};
HeaderComp.prototype.workOutSort = function () {
return this.params.enableSorting;
};
HeaderComp.prototype.setupSort = function () {
var _this = this;
this.currentSort = this.params.enableSorting;
if (!this.currentSort) {
this.removeSortIcons();
return;
}
var sortUsingCtrl = this.gridOptionsWrapper.isMultiSortKeyCtrl();
// keep track of last time the moving changed flag was set
this.addManagedListener(this.params.column, _entities_column__WEBPACK_IMPORTED_MODULE_1__["Column"].EVENT_MOVING_CHANGED, function () {
_this.lastMovingChanged = new Date().getTime();
});
// add the event on the header, so when clicked, we do sorting
if (this.eLabel) {
this.addManagedListener(this.eLabel, 'click', function (event) {
// sometimes when moving a column via dragging, this was also firing a clicked event.
// here is issue raised by user: https://ag-grid.zendesk.com/agent/tickets/1076
// this check stops sort if a) column is moving or b) column moved less than 200ms ago (so caters for race condition)
var moving = _this.params.column.isMoving();
var nowTime = new Date().getTime();
// typically there is <2ms if moving flag was set recently, as it would be done in same VM turn
var movedRecently = (nowTime - _this.lastMovingChanged) < 50;
var columnMoving = moving || movedRecently;
if (!columnMoving) {
var multiSort = sortUsingCtrl ? (event.ctrlKey || event.metaKey) : event.shiftKey;
_this.params.progressSort(multiSort);
}
});
}
this.addManagedListener(this.params.column, _entities_column__WEBPACK_IMPORTED_MODULE_1__["Column"].EVENT_SORT_CHANGED, this.onSortChanged.bind(this));
this.onSortChanged();
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_5__["Events"].EVENT_SORT_CHANGED, this.setMultiSortOrder.bind(this));
this.setMultiSortOrder();
};
HeaderComp.prototype.onSortChanged = function () {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_10__["addOrRemoveCssClass"])(this.getGui(), 'ag-header-cell-sorted-asc', this.params.column.isSortAscending());
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_10__["addOrRemoveCssClass"])(this.getGui(), 'ag-header-cell-sorted-desc', this.params.column.isSortDescending());
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_10__["addOrRemoveCssClass"])(this.getGui(), 'ag-header-cell-sorted-none', this.params.column.isSortNone());
if (this.eSortAsc) {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_10__["addOrRemoveCssClass"])(this.eSortAsc, 'ag-hidden', !this.params.column.isSortAscending());
}
if (this.eSortDesc) {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_10__["addOrRemoveCssClass"])(this.eSortDesc, 'ag-hidden', !this.params.column.isSortDescending());
}
if (this.eSortNone) {
var alwaysHideNoSort = !this.params.column.getColDef().unSortIcon && !this.gridOptionsWrapper.isUnSortIcon();
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_10__["addOrRemoveCssClass"])(this.eSortNone, 'ag-hidden', alwaysHideNoSort || !this.params.column.isSortNone());
}
};
// we listen here for global sort events, NOT column sort events, as we want to do this
// when sorting has been set on all column (if we listened just for our col (where we
// set the asc / desc icons) then it's possible other cols are yet to get their sorting state.
HeaderComp.prototype.setMultiSortOrder = function () {
if (!this.eSortOrder) {
return;
}
var col = this.params.column;
var allColumnsWithSorting = this.sortController.getColumnsWithSortingOrdered();
var indexThisCol = allColumnsWithSorting.indexOf(col);
var moreThanOneColSorting = allColumnsWithSorting.length > 1;
var showIndex = col.isSorting() && moreThanOneColSorting;
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_10__["setDisplayed"])(this.eSortOrder, showIndex);
if (indexThisCol >= 0) {
this.eSortOrder.innerHTML = (indexThisCol + 1).toString();
}
else {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_10__["clearElement"])(this.eSortOrder);
}
};
HeaderComp.prototype.setupFilterIcon = function () {
if (!this.eFilter) {
return;
}
this.addManagedListener(this.params.column, _entities_column__WEBPACK_IMPORTED_MODULE_1__["Column"].EVENT_FILTER_CHANGED, this.onFilterChanged.bind(this));
this.onFilterChanged();
};
HeaderComp.prototype.onFilterChanged = function () {
var filterPresent = this.params.column.isFilterActive();
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_10__["addOrRemoveCssClass"])(this.eFilter, 'ag-hidden', !filterPresent);
};
HeaderComp.TEMPLATE = "
\n \n
\n \n \n \n \n \n \n
\n
";
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('sortController')
], HeaderComp.prototype, "sortController", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('menuFactory')
], HeaderComp.prototype, "menuFactory", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_4__["RefSelector"])('eFilter')
], HeaderComp.prototype, "eFilter", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_4__["RefSelector"])('eSortAsc')
], HeaderComp.prototype, "eSortAsc", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_4__["RefSelector"])('eSortDesc')
], HeaderComp.prototype, "eSortDesc", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_4__["RefSelector"])('eSortNone')
], HeaderComp.prototype, "eSortNone", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_4__["RefSelector"])('eSortOrder')
], HeaderComp.prototype, "eSortOrder", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_4__["RefSelector"])('eMenu')
], HeaderComp.prototype, "eMenu", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_4__["RefSelector"])('eLabel')
], HeaderComp.prototype, "eLabel", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_4__["RefSelector"])('eText')
], HeaderComp.prototype, "eText", void 0);
return HeaderComp;
}(_widgets_component__WEBPACK_IMPORTED_MODULE_0__["Component"]));
/***/ }),
/* 68 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TouchListener", function() { return TouchListener; });
/* harmony import */ var _eventService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11);
/* harmony import */ var _utils_mouse__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(50);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var TouchListener = /** @class */ (function () {
function TouchListener(eElement, preventMouseClick) {
var _this = this;
if (preventMouseClick === void 0) { preventMouseClick = false; }
this.destroyFuncs = [];
this.touching = false;
this.eventService = new _eventService__WEBPACK_IMPORTED_MODULE_0__["EventService"]();
this.eElement = eElement;
this.preventMouseClick = preventMouseClick;
var startListener = this.onTouchStart.bind(this);
var moveListener = this.onTouchMove.bind(this);
var endListener = this.onTouchEnd.bind(this);
this.eElement.addEventListener("touchstart", startListener, { passive: true });
this.eElement.addEventListener("touchmove", moveListener, { passive: true });
// we set passive=false, as we want to prevent default on this event
this.eElement.addEventListener("touchend", endListener, { passive: false });
this.destroyFuncs.push(function () {
_this.eElement.removeEventListener("touchstart", startListener, { passive: true });
_this.eElement.removeEventListener("touchmove", moveListener, { passive: true });
_this.eElement.removeEventListener("touchend", endListener, { passive: false });
});
}
TouchListener.prototype.getActiveTouch = function (touchList) {
for (var i = 0; i < touchList.length; i++) {
var matches = touchList[i].identifier === this.touchStart.identifier;
if (matches) {
return touchList[i];
}
}
return null;
};
TouchListener.prototype.addEventListener = function (eventType, listener) {
this.eventService.addEventListener(eventType, listener);
};
TouchListener.prototype.removeEventListener = function (eventType, listener) {
this.eventService.removeEventListener(eventType, listener);
};
TouchListener.prototype.onTouchStart = function (touchEvent) {
var _this = this;
// only looking at one touch point at any time
if (this.touching) {
return;
}
this.touchStart = touchEvent.touches[0];
this.touching = true;
this.moved = false;
var touchStartCopy = this.touchStart;
window.setTimeout(function () {
var touchesMatch = _this.touchStart === touchStartCopy;
if (_this.touching && touchesMatch && !_this.moved) {
_this.moved = true;
var event_1 = {
type: TouchListener.EVENT_LONG_TAP,
touchStart: _this.touchStart,
touchEvent: touchEvent
};
_this.eventService.dispatchEvent(event_1);
}
}, 500);
};
TouchListener.prototype.onTouchMove = function (touchEvent) {
if (!this.touching) {
return;
}
var touch = this.getActiveTouch(touchEvent.touches);
if (!touch) {
return;
}
var eventIsFarAway = !Object(_utils_mouse__WEBPACK_IMPORTED_MODULE_1__["areEventsNear"])(touch, this.touchStart, 4);
if (eventIsFarAway) {
this.moved = true;
}
};
TouchListener.prototype.onTouchEnd = function (touchEvent) {
if (!this.touching) {
return;
}
if (!this.moved) {
var event_2 = {
type: TouchListener.EVENT_TAP,
touchStart: this.touchStart
};
this.eventService.dispatchEvent(event_2);
this.checkForDoubleTap();
}
// stops the tap from also been processed as a mouse click
if (this.preventMouseClick) {
touchEvent.preventDefault();
}
this.touching = false;
};
TouchListener.prototype.checkForDoubleTap = function () {
var now = new Date().getTime();
if (this.lastTapTime && this.lastTapTime > 0) {
// if previous tap, see if duration is short enough to be considered double tap
var interval = now - this.lastTapTime;
if (interval > TouchListener.DOUBLE_TAP_MILLIS) {
// dispatch double tap event
var event_3 = {
type: TouchListener.EVENT_DOUBLE_TAP,
touchStart: this.touchStart
};
this.eventService.dispatchEvent(event_3);
// this stops a tripple tap ending up as two double taps
this.lastTapTime = null;
}
else {
this.lastTapTime = now;
}
}
else {
this.lastTapTime = now;
}
};
TouchListener.prototype.destroy = function () {
this.destroyFuncs.forEach(function (func) { return func(); });
};
TouchListener.EVENT_TAP = "tap";
TouchListener.EVENT_DOUBLE_TAP = "doubleTap";
TouchListener.EVENT_LONG_TAP = "longTap";
TouchListener.DOUBLE_TAP_MILLIS = 500;
return TouchListener;
}());
/***/ }),
/* 69 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HeaderGroupComp", function() { return HeaderGroupComp; });
/* harmony import */ var _widgets_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(36);
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12);
/* harmony import */ var _widgets_touchListener__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(68);
/* harmony import */ var _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(57);
/* harmony import */ var _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8);
/* harmony import */ var _utils_string__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(26);
/* harmony import */ var _utils_event__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(21);
/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(42);
/* harmony import */ var _utils_icon__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(47);
/* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(7);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 HeaderGroupComp = /** @class */ (function (_super) {
__extends(HeaderGroupComp, _super);
function HeaderGroupComp() {
return _super.call(this, HeaderGroupComp.TEMPLATE) || this;
}
// this is a user component, and IComponent has "public destroy()" as part of the interface.
// so we need to override destroy() just to make the method public.
HeaderGroupComp.prototype.destroy = function () {
_super.prototype.destroy.call(this);
};
HeaderGroupComp.prototype.init = function (params) {
this.params = params;
this.setupLabel();
this.addGroupExpandIcon();
this.setupExpandIcons();
};
HeaderGroupComp.prototype.setupExpandIcons = function () {
var _this = this;
this.addInIcon("columnGroupOpened", "agOpened");
this.addInIcon("columnGroupClosed", "agClosed");
var expandAction = function (event) {
if (Object(_utils_event__WEBPACK_IMPORTED_MODULE_6__["isStopPropagationForAgGrid"])(event)) {
return;
}
var newExpandedValue = !_this.params.columnGroup.isExpanded();
_this.columnController.setColumnGroupOpened(_this.params.columnGroup.getOriginalColumnGroup(), newExpandedValue, "uiColumnExpanded");
};
this.addTouchAndClickListeners(this.eCloseIcon, expandAction);
this.addTouchAndClickListeners(this.eOpenIcon, expandAction);
var stopPropagationAction = function (event) {
Object(_utils_event__WEBPACK_IMPORTED_MODULE_6__["stopPropagationForAgGrid"])(event);
};
// adding stopPropagation to the double click for the icons prevents double click action happening
// when the icons are clicked. if the icons are double clicked, then the groups should open and
// then close again straight away. if we also listened to double click, then the group would open,
// close, then open, which is not what we want. double click should only action if the user double
// clicks outside of the icons.
this.addManagedListener(this.eCloseIcon, "dblclick", stopPropagationAction);
this.addManagedListener(this.eOpenIcon, "dblclick", stopPropagationAction);
this.addManagedListener(this.getGui(), "dblclick", expandAction);
this.updateIconVisibility();
var originalColumnGroup = this.params.columnGroup.getOriginalColumnGroup();
this.addManagedListener(originalColumnGroup, _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_4__["OriginalColumnGroup"].EVENT_EXPANDED_CHANGED, this.updateIconVisibility.bind(this));
this.addManagedListener(originalColumnGroup, _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_4__["OriginalColumnGroup"].EVENT_EXPANDABLE_CHANGED, this.updateIconVisibility.bind(this));
};
HeaderGroupComp.prototype.addTouchAndClickListeners = function (eElement, action) {
var touchListener = new _widgets_touchListener__WEBPACK_IMPORTED_MODULE_2__["TouchListener"](eElement, true);
this.addManagedListener(touchListener, _widgets_touchListener__WEBPACK_IMPORTED_MODULE_2__["TouchListener"].EVENT_TAP, action);
this.addDestroyFunc(function () { return touchListener.destroy(); });
this.addManagedListener(eElement, "click", action);
};
HeaderGroupComp.prototype.updateIconVisibility = function () {
var columnGroup = this.params.columnGroup;
if (columnGroup.isExpandable()) {
var expanded = this.params.columnGroup.isExpanded();
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_7__["setDisplayed"])(this.eOpenIcon, expanded);
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_7__["setDisplayed"])(this.eCloseIcon, !expanded);
}
else {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_7__["setDisplayed"])(this.eOpenIcon, false);
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_7__["setDisplayed"])(this.eCloseIcon, false);
}
};
HeaderGroupComp.prototype.addInIcon = function (iconName, refName) {
var eIcon = Object(_utils_icon__WEBPACK_IMPORTED_MODULE_8__["createIconNoSpan"])(iconName, this.gridOptionsWrapper, null);
this.getRefElement(refName).appendChild(eIcon);
};
HeaderGroupComp.prototype.addGroupExpandIcon = function () {
if (!this.params.columnGroup.isExpandable()) {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_7__["setDisplayed"])(this.eOpenIcon, false);
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_7__["setDisplayed"])(this.eCloseIcon, false);
return;
}
};
HeaderGroupComp.prototype.setupLabel = function () {
// no renderer, default text render
var displayName = this.params.displayName;
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_9__["exists"])(displayName)) {
var displayNameSanitised = Object(_utils_string__WEBPACK_IMPORTED_MODULE_5__["escapeString"])(displayName);
this.getRefElement("agLabel").innerHTML = displayNameSanitised;
}
};
HeaderGroupComp.TEMPLATE = "
\n \n \n \n
";
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])("columnController")
], HeaderGroupComp.prototype, "columnController", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_3__["RefSelector"])("agOpened")
], HeaderGroupComp.prototype, "eOpenIcon", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_3__["RefSelector"])("agClosed")
], HeaderGroupComp.prototype, "eCloseIcon", void 0);
return HeaderGroupComp;
}(_widgets_component__WEBPACK_IMPORTED_MODULE_0__["Component"]));
/***/ }),
/* 70 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GroupCellRenderer", function() { return GroupCellRenderer; });
/* harmony import */ var _constants_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16);
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12);
/* harmony import */ var _widgets_component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(36);
/* harmony import */ var _entities_rowNode__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(71);
/* harmony import */ var _checkboxSelectionComponent__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(72);
/* harmony import */ var _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(57);
/* harmony import */ var _components_framework_userComponentFactory__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(73);
/* harmony import */ var _utils_function__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(15);
/* harmony import */ var _utils_object__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(13);
/* harmony import */ var _utils_general__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(41);
/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(42);
/* harmony import */ var _utils_icon__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(47);
/* harmony import */ var _utils_keyboard__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(48);
/* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(7);
/* harmony import */ var _utils_event__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(21);
/* harmony import */ var _utils_aria__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(44);
/* harmony import */ var _constants_keyCode__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(58);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 GroupCellRenderer = /** @class */ (function (_super) {
__extends(GroupCellRenderer, _super);
function GroupCellRenderer() {
return _super.call(this, GroupCellRenderer.TEMPLATE) || this;
}
GroupCellRenderer.prototype.init = function (params) {
this.params = params;
if (this.gridOptionsWrapper.isGroupIncludeTotalFooter()) {
this.assignBlankValueToGroupFooterCell(params);
}
var embeddedRowMismatch = this.isEmbeddedRowMismatch();
// This allows for empty strings to appear as groups since
// it will only return for null or undefined.
var nullValue = params.value == null;
var skipCell = false;
// if the groupCellRenderer is inside of a footer and groupHideOpenParents is true
// we should only display the groupCellRenderer if the current column is the rowGroupedColumn
if (this.gridOptionsWrapper.isGroupIncludeFooter() && this.gridOptionsWrapper.isGroupHideOpenParents()) {
var node = params.node;
if (node.footer) {
var showRowGroup = params.colDef && params.colDef.showRowGroup;
var rowGroupColumnId = node.rowGroupColumn && node.rowGroupColumn.getColId();
skipCell = showRowGroup !== rowGroupColumnId;
}
}
this.cellIsBlank = embeddedRowMismatch || nullValue || skipCell;
if (this.cellIsBlank) {
return;
}
this.setupDragOpenParents();
this.addExpandAndContract();
this.addCheckboxIfNeeded();
this.addValueElement();
this.setupIndent();
};
GroupCellRenderer.prototype.assignBlankValueToGroupFooterCell = function (params) {
// this is not ideal, but it was the only way we could get footer working for the root node
if (!params.value && params.node.level == -1) {
params.value = '';
}
};
// if we are doing embedded full width rows, we only show the renderer when
// in the body, or if pinning in the pinned section, or if pinning and RTL,
// in the right section. otherwise we would have the cell repeated in each section.
GroupCellRenderer.prototype.isEmbeddedRowMismatch = function () {
if (!this.params.fullWidth || !this.gridOptionsWrapper.isEmbedFullWidthRows()) {
return false;
}
var pinnedLeftCell = this.params.pinned === _constants_constants__WEBPACK_IMPORTED_MODULE_0__["Constants"].PINNED_LEFT;
var pinnedRightCell = this.params.pinned === _constants_constants__WEBPACK_IMPORTED_MODULE_0__["Constants"].PINNED_RIGHT;
var bodyCell = !pinnedLeftCell && !pinnedRightCell;
if (this.gridOptionsWrapper.isEnableRtl()) {
if (this.columnController.isPinningLeft()) {
return !pinnedRightCell;
}
return !bodyCell;
}
if (this.columnController.isPinningLeft()) {
return !pinnedLeftCell;
}
return !bodyCell;
};
GroupCellRenderer.prototype.setIndent = function () {
if (this.gridOptionsWrapper.isGroupHideOpenParents()) {
return;
}
var params = this.params;
var rowNode = params.node;
// if we are only showing one group column, we don't want to be indenting based on level
var fullWithRow = !!params.colDef;
var manyDimensionThisColumn = !fullWithRow || params.colDef.showRowGroup === true;
var paddingCount = manyDimensionThisColumn ? rowNode.uiLevel : 0;
var userProvidedPaddingPixelsTheDeprecatedWay = params.padding >= 0;
if (userProvidedPaddingPixelsTheDeprecatedWay) {
this.setPaddingDeprecatedWay(paddingCount, params.padding);
return;
}
if (this.indentClass) {
this.removeCssClass(this.indentClass);
}
this.indentClass = 'ag-row-group-indent-' + paddingCount;
this.addCssClass(this.indentClass);
};
GroupCellRenderer.prototype.setPaddingDeprecatedWay = function (paddingCount, padding) {
Object(_utils_function__WEBPACK_IMPORTED_MODULE_7__["doOnce"])(function () { return console.warn('ag-Grid: since v14.2, configuring padding for groupCellRenderer should be done with Sass variables and themes. Please see the ag-Grid documentation page for Themes, in particular the property $row-group-indent-size.'); }, 'groupCellRenderer->doDeprecatedWay');
var paddingPx = paddingCount * padding;
var eGui = this.getGui();
var paddingSide = this.gridOptionsWrapper.isEnableRtl() ? 'paddingRight' : 'paddingLeft';
eGui.style[paddingSide] = paddingPx + "px";
};
GroupCellRenderer.prototype.setupIndent = function () {
// only do this if an indent - as this overwrites the padding that
// the theme set, which will make things look 'not aligned' for the
// first group level.
var node = this.params.node;
var suppressPadding = this.params.suppressPadding;
if (!suppressPadding) {
this.addManagedListener(node, _entities_rowNode__WEBPACK_IMPORTED_MODULE_3__["RowNode"].EVENT_UI_LEVEL_CHANGED, this.setIndent.bind(this));
this.setIndent();
}
};
GroupCellRenderer.prototype.addValueElement = function () {
if (this.displayedGroup.footer) {
this.addFooterValue();
}
else {
this.addGroupValue();
this.addChildCount();
}
};
GroupCellRenderer.prototype.addFooterValue = function () {
var footerValueGetter = this.params.footerValueGetter;
var footerValue;
if (footerValueGetter) {
// params is same as we were given, except we set the value as the item to display
var paramsClone = Object(_utils_object__WEBPACK_IMPORTED_MODULE_8__["cloneObject"])(this.params);
paramsClone.value = this.params.value;
if (typeof footerValueGetter === 'function') {
footerValue = footerValueGetter(paramsClone);
}
else if (typeof footerValueGetter === 'string') {
footerValue = this.expressionService.evaluate(footerValueGetter, paramsClone);
}
else {
console.warn('ag-Grid: footerValueGetter should be either a function or a string (expression)');
}
}
else {
footerValue = 'Total ' + this.params.value;
}
this.eValue.innerHTML = footerValue;
};
GroupCellRenderer.prototype.addGroupValue = function () {
var _this = this;
var params = this.params;
var rowGroupColumn = this.displayedGroup.rowGroupColumn;
// we try and use the cellRenderer of the column used for the grouping if we can
var columnToUse = rowGroupColumn ? rowGroupColumn : params.column;
var groupName = this.params.value;
var valueFormatted = columnToUse ?
this.valueFormatterService.formatValue(columnToUse, params.node, params.scope, groupName) : null;
params.valueFormatted = valueFormatted;
var rendererPromise;
rendererPromise = params.fullWidth
? this.useFullWidth(params)
: this.useInnerRenderer(this.params.colDef.cellRendererParams, columnToUse.getColDef(), params);
// retain a reference to the created renderer - we'll use this later for cleanup (in destroy)
if (rendererPromise) {
rendererPromise.then(function (value) {
_this.innerCellRenderer = value;
});
}
};
GroupCellRenderer.prototype.useInnerRenderer = function (groupCellRendererParams, groupedColumnDef, // the column this group row is for, eg 'Country'
params) {
var _this = this;
// when grouping, the normal case is we use the cell renderer of the grouped column. eg if grouping by country
// and then rating, we will use the country cell renderer for each country group row and likewise the rating
// cell renderer for each rating group row.
//
// however if the user has innerCellRenderer defined, this gets preference and we don't use cell renderers
// of the grouped columns.
//
// so we check and use in the following order:
//
// 1) thisColDef.cellRendererParams.innerRenderer of the column showing the groups (eg auto group column)
// 2) groupedColDef.cellRenderer of the grouped column
// 3) groupedColDef.cellRendererParams.innerRenderer
var cellRendererPromise = null;
// we check if cell renderer provided for the group cell renderer, eg colDef.cellRendererParams.innerRenderer
var groupInnerRendererClass = this.userComponentFactory
.lookupComponentClassDef(groupCellRendererParams, "innerRenderer");
if (groupInnerRendererClass && groupInnerRendererClass.component != null
&& groupInnerRendererClass.source != _components_framework_userComponentFactory__WEBPACK_IMPORTED_MODULE_6__["ComponentSource"].DEFAULT) {
// use the renderer defined in cellRendererParams.innerRenderer
cellRendererPromise = this.userComponentFactory.newInnerCellRenderer(groupCellRendererParams, params);
}
else {
// otherwise see if we can use the cellRenderer of the column we are grouping by
var groupColumnRendererClass = this.userComponentFactory
.lookupComponentClassDef(groupedColumnDef, "cellRenderer");
if (groupColumnRendererClass &&
groupColumnRendererClass.source != _components_framework_userComponentFactory__WEBPACK_IMPORTED_MODULE_6__["ComponentSource"].DEFAULT) {
// Only if the original column is using a specific renderer, it it is a using a DEFAULT one ignore it
cellRendererPromise = this.userComponentFactory.newCellRenderer(groupedColumnDef, params);
}
else if (groupColumnRendererClass &&
groupColumnRendererClass.source == _components_framework_userComponentFactory__WEBPACK_IMPORTED_MODULE_6__["ComponentSource"].DEFAULT &&
(Object(_utils_object__WEBPACK_IMPORTED_MODULE_8__["get"])(groupedColumnDef, 'cellRendererParams.innerRenderer', null))) {
// EDGE CASE - THIS COMES FROM A COLUMN WHICH HAS BEEN GROUPED DYNAMICALLY, THAT HAS AS RENDERER 'group'
// AND HAS A INNER CELL RENDERER
cellRendererPromise = this.userComponentFactory.newInnerCellRenderer(groupedColumnDef.cellRendererParams, params);
}
else {
// This forces the retrieval of the default plain cellRenderer that just renders the values.
cellRendererPromise = this.userComponentFactory.newCellRenderer({}, params);
}
}
if (cellRendererPromise != null) {
cellRendererPromise.then(function (rendererToUse) {
if (rendererToUse == null) {
_this.eValue.innerText = params.valueFormatted != null ? params.valueFormatted : params.value;
return;
}
Object(_utils_general__WEBPACK_IMPORTED_MODULE_9__["bindCellRendererToHtmlElement"])(cellRendererPromise, _this.eValue);
});
}
else {
this.eValue.innerText = params.valueFormatted != null ? params.valueFormatted : params.value;
}
return cellRendererPromise;
};
GroupCellRenderer.prototype.useFullWidth = function (params) {
var cellRendererPromise = this.userComponentFactory.newFullWidthGroupRowInnerCellRenderer(params);
if (cellRendererPromise != null) {
Object(_utils_general__WEBPACK_IMPORTED_MODULE_9__["bindCellRendererToHtmlElement"])(cellRendererPromise, this.eValue);
}
else {
this.eValue.innerText = params.valueFormatted != null ? params.valueFormatted : params.value;
}
return cellRendererPromise;
};
GroupCellRenderer.prototype.addChildCount = function () {
// only include the child count if it's included, eg if user doing custom aggregation,
// then this could be left out, or set to -1, ie no child count
if (this.params.suppressCount) {
return;
}
this.addManagedListener(this.displayedGroup, _entities_rowNode__WEBPACK_IMPORTED_MODULE_3__["RowNode"].EVENT_ALL_CHILDREN_COUNT_CHANGED, this.updateChildCount.bind(this));
// filtering changes the child count, so need to cater for it
this.updateChildCount();
};
GroupCellRenderer.prototype.updateChildCount = function () {
var allChildrenCount = this.displayedGroup.allChildrenCount;
var showingGroupForThisNode = this.isShowRowGroupForThisRow();
var showCount = showingGroupForThisNode && allChildrenCount != null && allChildrenCount >= 0;
var countString = showCount ? "(" + allChildrenCount + ")" : "";
this.eChildCount.innerHTML = countString;
};
GroupCellRenderer.prototype.isUserWantsSelected = function () {
var paramsCheckbox = this.params.checkbox;
if (typeof paramsCheckbox === 'function') {
return paramsCheckbox(this.params);
}
return paramsCheckbox === true;
};
GroupCellRenderer.prototype.addCheckboxIfNeeded = function () {
var _this = this;
var rowNode = this.displayedGroup;
var checkboxNeeded = this.isUserWantsSelected() &&
// footers cannot be selected
!rowNode.footer &&
// pinned rows cannot be selected
!rowNode.rowPinned &&
// details cannot be selected
!rowNode.detail;
if (checkboxNeeded) {
var cbSelectionComponent_1 = new _checkboxSelectionComponent__WEBPACK_IMPORTED_MODULE_4__["CheckboxSelectionComponent"]();
this.getContext().createBean(cbSelectionComponent_1);
cbSelectionComponent_1.init({ rowNode: rowNode, column: this.params.column });
this.eCheckbox.appendChild(cbSelectionComponent_1.getGui());
this.addDestroyFunc(function () { return _this.getContext().destroyBean(cbSelectionComponent_1); });
}
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_10__["addOrRemoveCssClass"])(this.eCheckbox, 'ag-invisible', !checkboxNeeded);
};
GroupCellRenderer.prototype.addExpandAndContract = function () {
var params = this.params;
var eGroupCell = params.eGridCell;
var eExpandedIcon = Object(_utils_icon__WEBPACK_IMPORTED_MODULE_11__["createIconNoSpan"])('groupExpanded', this.gridOptionsWrapper, null);
var eContractedIcon = Object(_utils_icon__WEBPACK_IMPORTED_MODULE_11__["createIconNoSpan"])('groupContracted', this.gridOptionsWrapper, null);
Object(_utils_aria__WEBPACK_IMPORTED_MODULE_15__["setAriaExpanded"])(eGroupCell, !!params.node.expanded);
this.eExpanded.appendChild(eExpandedIcon);
this.eContracted.appendChild(eContractedIcon);
this.addManagedListener(this.eExpanded, 'click', this.onExpandClicked.bind(this));
this.addManagedListener(this.eContracted, 'click', this.onExpandClicked.bind(this));
// expand / contract as the user hits enter
this.addManagedListener(eGroupCell, 'keydown', this.onKeyDown.bind(this));
this.addManagedListener(params.node, _entities_rowNode__WEBPACK_IMPORTED_MODULE_3__["RowNode"].EVENT_EXPANDED_CHANGED, this.showExpandAndContractIcons.bind(this));
this.showExpandAndContractIcons();
// because we don't show the expand / contract when there are no children, we need to check every time
// the number of children change.
var expandableChangedListener = this.onRowNodeIsExpandableChanged.bind(this);
this.addManagedListener(this.displayedGroup, _entities_rowNode__WEBPACK_IMPORTED_MODULE_3__["RowNode"].EVENT_ALL_CHILDREN_COUNT_CHANGED, expandableChangedListener);
this.addManagedListener(this.displayedGroup, _entities_rowNode__WEBPACK_IMPORTED_MODULE_3__["RowNode"].EVENT_MASTER_CHANGED, expandableChangedListener);
this.addManagedListener(this.displayedGroup, _entities_rowNode__WEBPACK_IMPORTED_MODULE_3__["RowNode"].EVENT_HAS_CHILDREN_CHANGED, expandableChangedListener);
// if editing groups, then double click is to start editing
if (!this.gridOptionsWrapper.isEnableGroupEdit() && this.isExpandable() && !params.suppressDoubleClickExpand) {
this.addManagedListener(eGroupCell, 'dblclick', this.onCellDblClicked.bind(this));
}
};
GroupCellRenderer.prototype.onRowNodeIsExpandableChanged = function () {
// maybe if no children now, we should hide the expand / contract icons
this.showExpandAndContractIcons();
// if we have no children, this impacts the indent
this.setIndent();
};
GroupCellRenderer.prototype.onKeyDown = function (event) {
var enterKeyPressed = Object(_utils_keyboard__WEBPACK_IMPORTED_MODULE_12__["isKeyPressed"])(event, _constants_keyCode__WEBPACK_IMPORTED_MODULE_16__["KeyCode"].ENTER);
if (!enterKeyPressed || this.params.suppressEnterExpand) {
return;
}
var cellEditable = this.params.column && this.params.column.isCellEditable(this.params.node);
if (cellEditable) {
return;
}
this.onExpandOrContract();
};
GroupCellRenderer.prototype.setupDragOpenParents = function () {
var column = this.params.column;
var rowNode = this.params.node;
if (!this.gridOptionsWrapper.isGroupHideOpenParents()) {
this.draggedFromHideOpenParents = false;
}
else if (!rowNode.hasChildren()) {
// if we are here, and we are not a group, then we must of been dragged down,
// as otherwise the cell would be blank, and if cell is blank, this method is never called.
this.draggedFromHideOpenParents = true;
}
else {
var rowGroupColumn = rowNode.rowGroupColumn;
if (rowGroupColumn) {
// if the displayGroup column for this col matches the rowGroupColumn we grouped by for this node,
// then nothing was dragged down
this.draggedFromHideOpenParents = !column.isRowGroupDisplayed(rowGroupColumn.getId());
}
else {
// the only way we can end up here (no column, but a group) is if we are at the root node,
// which only happens when 'groupIncludeTotalFooter' is true. here, we are never dragging
this.draggedFromHideOpenParents = false;
}
}
if (this.draggedFromHideOpenParents) {
var pointer = rowNode.parent;
while (true) {
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_13__["missing"])(pointer)) {
break;
}
if (pointer.rowGroupColumn && column.isRowGroupDisplayed(pointer.rowGroupColumn.getId())) {
this.displayedGroup = pointer;
break;
}
pointer = pointer.parent;
}
}
// if we didn't find a displayed group, set it to the row node
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_13__["missing"])(this.displayedGroup)) {
this.displayedGroup = rowNode;
}
};
GroupCellRenderer.prototype.onExpandClicked = function (mouseEvent) {
if (Object(_utils_event__WEBPACK_IMPORTED_MODULE_14__["isStopPropagationForAgGrid"])(mouseEvent)) {
return;
}
// so if we expand a node, it does not also get selected.
Object(_utils_event__WEBPACK_IMPORTED_MODULE_14__["stopPropagationForAgGrid"])(mouseEvent);
this.onExpandOrContract();
};
GroupCellRenderer.prototype.onCellDblClicked = function (mouseEvent) {
if (Object(_utils_event__WEBPACK_IMPORTED_MODULE_14__["isStopPropagationForAgGrid"])(mouseEvent)) {
return;
}
// we want to avoid acting on double click events on the expand / contract icon,
// as that icons already has expand / collapse functionality on it. otherwise if
// the icon was double clicked, we would get 'click', 'click', 'dblclick' which
// is open->close->open, however double click should be open->close only.
var targetIsExpandIcon = Object(_utils_event__WEBPACK_IMPORTED_MODULE_14__["isElementInEventPath"])(this.eExpanded, mouseEvent)
|| Object(_utils_event__WEBPACK_IMPORTED_MODULE_14__["isElementInEventPath"])(this.eContracted, mouseEvent);
if (!targetIsExpandIcon) {
this.onExpandOrContract();
}
};
GroupCellRenderer.prototype.onExpandOrContract = function () {
// must use the displayedGroup, so if data was dragged down, we expand the parent, not this row
var rowNode = this.displayedGroup;
var params = this.params;
var nextExpandState = !rowNode.expanded;
rowNode.setExpanded(nextExpandState);
Object(_utils_aria__WEBPACK_IMPORTED_MODULE_15__["setAriaExpanded"])(params.eGridCell, nextExpandState);
};
GroupCellRenderer.prototype.isExpandable = function () {
if (this.draggedFromHideOpenParents) {
return true;
}
var rowNode = this.displayedGroup;
var reducedLeafNode = this.columnController.isPivotMode() && rowNode.leafGroup;
var expandableGroup = rowNode.isExpandable() && !rowNode.footer && !reducedLeafNode;
if (!expandableGroup) {
return false;
}
// column is null for fullWidthRows
var column = this.params.column;
var displayingForOneColumnOnly = column != null && typeof column.getColDef().showRowGroup === 'string';
if (displayingForOneColumnOnly) {
var showing = this.isShowRowGroupForThisRow();
return showing;
}
return true;
};
GroupCellRenderer.prototype.isShowRowGroupForThisRow = function () {
if (this.gridOptionsWrapper.isTreeData()) {
return true;
}
var rowGroupColumn = this.displayedGroup.rowGroupColumn;
if (!rowGroupColumn) {
return false;
}
// column is null for fullWidthRows
var column = this.params.column;
var thisColumnIsInterested = column == null || column.isRowGroupDisplayed(rowGroupColumn.getId());
return thisColumnIsInterested;
};
GroupCellRenderer.prototype.showExpandAndContractIcons = function () {
var _a = this, eContracted = _a.eContracted, eExpanded = _a.eExpanded, params = _a.params, displayedGroup = _a.displayedGroup, columnController = _a.columnController;
var eGridCell = params.eGridCell, node = params.node;
if (this.isExpandable()) {
// if expandable, show one based on expand state.
// if we were dragged down, means our parent is always expanded
var expanded = this.draggedFromHideOpenParents ? true : node.expanded;
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_10__["setDisplayed"])(eContracted, !expanded);
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_10__["setDisplayed"])(eExpanded, expanded);
}
else {
// it not expandable, show neither
Object(_utils_aria__WEBPACK_IMPORTED_MODULE_15__["removeAriaExpanded"])(eGridCell);
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_10__["setDisplayed"])(eExpanded, false);
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_10__["setDisplayed"])(eContracted, false);
}
// compensation padding for leaf nodes, so there is blank space instead of the expand icon
var pivotModeAndLeafGroup = columnController.isPivotMode() && displayedGroup.leafGroup;
var expandable = displayedGroup.isExpandable() && this.isShowRowGroupForThisRow();
var addExpandableCss = expandable && !displayedGroup.footer && !pivotModeAndLeafGroup;
this.addOrRemoveCssClass('ag-cell-expandable', addExpandableCss);
this.addOrRemoveCssClass('ag-row-group', addExpandableCss);
this.addOrRemoveCssClass('ag-row-group-leaf-indent', !addExpandableCss);
};
// this is a user component, and IComponent has "public destroy()" as part of the interface.
// so we need to have public here instead of private or protected
GroupCellRenderer.prototype.destroy = function () {
this.getContext().destroyBean(this.innerCellRenderer);
_super.prototype.destroy.call(this);
};
GroupCellRenderer.prototype.refresh = function () {
return false;
};
GroupCellRenderer.TEMPLATE = "\n \n \n \n \n \n ";
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('expressionService')
], GroupCellRenderer.prototype, "expressionService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('valueFormatterService')
], GroupCellRenderer.prototype, "valueFormatterService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('columnController')
], GroupCellRenderer.prototype, "columnController", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('userComponentFactory')
], GroupCellRenderer.prototype, "userComponentFactory", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_5__["RefSelector"])('eExpanded')
], GroupCellRenderer.prototype, "eExpanded", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_5__["RefSelector"])('eContracted')
], GroupCellRenderer.prototype, "eContracted", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_5__["RefSelector"])('eCheckbox')
], GroupCellRenderer.prototype, "eCheckbox", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_5__["RefSelector"])('eValue')
], GroupCellRenderer.prototype, "eValue", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_5__["RefSelector"])('eChildCount')
], GroupCellRenderer.prototype, "eChildCount", void 0);
return GroupCellRenderer;
}(_widgets_component__WEBPACK_IMPORTED_MODULE_2__["Component"]));
/***/ }),
/* 71 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RowNode", function() { return RowNode; });
/* harmony import */ var _eventService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11);
/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23);
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12);
/* harmony import */ var _constants_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(16);
/* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7);
/* harmony import */ var _utils_object__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(13);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (undefined && undefined.__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 RowNode = /** @class */ (function () {
function RowNode() {
/** Children mapped by the pivot columns */
this.childrenMapped = {};
/** True by default - can be overridden via gridOptions.isRowSelectable(rowNode) */
this.selectable = true;
/** Used by sorting service - to give deterministic sort to groups. Previously we
* just id for this, however id is a string and had slower sorting compared to numbers. */
this.__objectId = RowNode.OBJECT_ID_SEQUENCE++;
/** True when nodes with the same id are being removed and added as part of the same batch transaction */
this.alreadyRendered = false;
this.highlighted = null;
this.selected = false;
}
RowNode.prototype.setData = function (data) {
var oldData = this.data;
this.data = data;
this.valueCache.onDataChanged();
this.updateDataOnDetailNode();
this.checkRowSelectable();
var event = this.createDataChangedEvent(data, oldData, false);
this.dispatchLocalEvent(event);
};
// when we are doing master / detail, the detail node is lazy created, but then kept around.
// so if we show / hide the detail, the same detail rowNode is used. so we need to keep the data
// in sync, otherwise expand/collapse of the detail would still show the old values.
RowNode.prototype.updateDataOnDetailNode = function () {
if (this.detailNode) {
this.detailNode.data = this.data;
}
};
RowNode.prototype.createDataChangedEvent = function (newData, oldData, update) {
return {
type: RowNode.EVENT_DATA_CHANGED,
node: this,
oldData: oldData,
newData: newData,
update: update
};
};
RowNode.prototype.createLocalRowEvent = function (type) {
return {
type: type,
node: this
};
};
// similar to setRowData, however it is expected that the data is the same data item. this
// is intended to be used with Redux type stores, where the whole data can be changed. we are
// guaranteed that the data is the same entity (so grid doesn't need to worry about the id of the
// underlying data changing, hence doesn't need to worry about selection). the grid, upon receiving
// dataChanged event, will refresh the cells rather than rip them all out (so user can show transitions).
RowNode.prototype.updateData = function (data) {
var oldData = this.data;
this.data = data;
this.updateDataOnDetailNode();
this.checkRowSelectable();
this.updateDataOnDetailNode();
var event = this.createDataChangedEvent(data, oldData, true);
this.dispatchLocalEvent(event);
};
RowNode.prototype.getRowIndexString = function () {
if (this.rowPinned === _constants_constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].PINNED_TOP) {
return 't-' + this.rowIndex;
}
if (this.rowPinned === _constants_constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].PINNED_BOTTOM) {
return 'b-' + this.rowIndex;
}
return this.rowIndex.toString();
};
RowNode.prototype.createDaemonNode = function () {
var oldNode = new RowNode();
this.context.createBean(oldNode);
// just copy the id and data, this is enough for the node to be used
// in the selection controller (the selection controller is the only
// place where daemon nodes can live).
oldNode.id = this.id;
oldNode.data = this.data;
oldNode.daemon = true;
oldNode.selected = this.selected;
oldNode.level = this.level;
return oldNode;
};
RowNode.prototype.setDataAndId = function (data, id) {
var oldNode = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_4__["exists"])(this.id) ? this.createDaemonNode() : null;
var oldData = this.data;
this.data = data;
this.updateDataOnDetailNode();
this.setId(id);
this.selectionController.syncInRowNode(this, oldNode);
this.checkRowSelectable();
var event = this.createDataChangedEvent(data, oldData, false);
this.dispatchLocalEvent(event);
};
RowNode.prototype.checkRowSelectable = function () {
var isRowSelectableFunc = this.gridOptionsWrapper.getIsRowSelectableFunc();
var shouldInvokeIsRowSelectable = isRowSelectableFunc && Object(_utils_generic__WEBPACK_IMPORTED_MODULE_4__["exists"])(this);
this.setRowSelectable(shouldInvokeIsRowSelectable ? isRowSelectableFunc(this) : true);
};
RowNode.prototype.setRowSelectable = function (newVal) {
if (this.selectable !== newVal) {
this.selectable = newVal;
if (this.eventService) {
this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_SELECTABLE_CHANGED));
}
}
};
RowNode.prototype.setId = function (id) {
// see if user is providing the id's
var getRowNodeId = this.gridOptionsWrapper.getRowNodeIdFunc();
if (getRowNodeId) {
// if user is providing the id's, then we set the id only after the data has been set.
// this is important for virtual pagination and viewport, where empty rows exist.
if (this.data) {
this.id = getRowNodeId(this.data);
// make sure id provided doesn't start with 'row-group-' as this is reserved. also check that
// it has 'startsWith' in case the user provided a number.
if (this.id && this.id.startsWith && this.id.startsWith(RowNode.ID_PREFIX_ROW_GROUP)) {
console.error("ag-Grid: Row ID's cannot start with " + RowNode.ID_PREFIX_ROW_GROUP + ", this is a reserved prefix for ag-Grid's row grouping feature.");
}
}
else {
// this can happen if user has set blank into the rowNode after the row previously
// having data. this happens in virtual page row model, when data is delete and
// the page is refreshed.
this.id = undefined;
}
}
else {
this.id = id;
}
};
RowNode.prototype.isPixelInRange = function (pixel) {
return pixel >= this.rowTop && pixel < (this.rowTop + this.rowHeight);
};
RowNode.prototype.clearRowTop = function () {
this.oldRowTop = this.rowTop;
this.setRowTop(null);
};
RowNode.prototype.setFirstChild = function (firstChild) {
if (this.firstChild === firstChild) {
return;
}
this.firstChild = firstChild;
if (this.eventService) {
this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_FIRST_CHILD_CHANGED));
}
};
RowNode.prototype.setLastChild = function (lastChild) {
if (this.lastChild === lastChild) {
return;
}
this.lastChild = lastChild;
if (this.eventService) {
this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_LAST_CHILD_CHANGED));
}
};
RowNode.prototype.setChildIndex = function (childIndex) {
if (this.childIndex === childIndex) {
return;
}
this.childIndex = childIndex;
if (this.eventService) {
this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_CHILD_INDEX_CHANGED));
}
};
RowNode.prototype.setRowTop = function (rowTop) {
if (this.rowTop === rowTop) {
return;
}
this.rowTop = rowTop;
if (this.eventService) {
this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_TOP_CHANGED));
}
};
RowNode.prototype.setDragging = function (dragging) {
if (this.dragging === dragging) {
return;
}
this.dragging = dragging;
if (this.eventService) {
this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_DRAGGING_CHANGED));
}
};
RowNode.prototype.setHighlighted = function (highlighted) {
if (highlighted === this.highlighted) {
return;
}
this.highlighted = highlighted;
if (this.eventService) {
this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_HIGHLIGHT_CHANGED));
}
};
RowNode.prototype.setAllChildrenCount = function (allChildrenCount) {
if (this.allChildrenCount === allChildrenCount) {
return;
}
this.allChildrenCount = allChildrenCount;
if (this.eventService) {
this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_ALL_CHILDREN_COUNT_CHANGED));
}
};
RowNode.prototype.setMaster = function (master) {
if (this.master === master) {
return;
}
// if changing AWAY from master, then unexpand, otherwise
// next time it's shown it is expanded again
if (this.master && !master) {
this.expanded = false;
}
this.master = master;
if (this.eventService) {
this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_MASTER_CHANGED));
}
};
RowNode.prototype.setRowHeight = function (rowHeight, estimated) {
if (estimated === void 0) { estimated = false; }
this.rowHeight = rowHeight;
this.rowHeightEstimated = estimated;
if (this.eventService) {
this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_HEIGHT_CHANGED));
}
};
RowNode.prototype.setRowIndex = function (rowIndex) {
this.rowIndex = rowIndex;
if (this.eventService) {
this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_ROW_INDEX_CHANGED));
}
};
RowNode.prototype.setUiLevel = function (uiLevel) {
if (this.uiLevel === uiLevel) {
return;
}
this.uiLevel = uiLevel;
if (this.eventService) {
this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_UI_LEVEL_CHANGED));
}
};
RowNode.prototype.setExpanded = function (expanded) {
if (this.expanded === expanded) {
return;
}
this.expanded = expanded;
if (this.eventService) {
this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_EXPANDED_CHANGED));
}
var event = Object(_utils_object__WEBPACK_IMPORTED_MODULE_5__["assign"])({}, this.createGlobalRowEvent(_events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_ROW_GROUP_OPENED), {
expanded: expanded
});
this.mainEventService.dispatchEvent(event);
if (this.gridOptionsWrapper.isGroupIncludeFooter()) {
this.gridApi.redrawRows({ rowNodes: [this] });
}
};
RowNode.prototype.createGlobalRowEvent = function (type) {
return {
type: type,
node: this,
data: this.data,
rowIndex: this.rowIndex,
rowPinned: this.rowPinned,
context: this.gridOptionsWrapper.getContext(),
api: this.gridOptionsWrapper.getApi(),
columnApi: this.gridOptionsWrapper.getColumnApi()
};
};
RowNode.prototype.dispatchLocalEvent = function (event) {
if (this.eventService) {
this.eventService.dispatchEvent(event);
}
};
// we also allow editing the value via the editors. when it is done via
// the editors, no 'cell changed' event gets fired, as it's assumed that
// the cell knows about the change given it's in charge of the editing.
// this method is for the client to call, so the cell listens for the change
// event, and also flashes the cell when the change occurs.
RowNode.prototype.setDataValue = function (colKey, newValue) {
var column = this.columnController.getPrimaryColumn(colKey);
var oldValue = this.valueService.getValue(column, this);
this.valueService.setValue(this, column, newValue);
this.dispatchCellChangedEvent(column, newValue, oldValue);
};
RowNode.prototype.setGroupValue = function (colKey, newValue) {
var column = this.columnController.getGridColumn(colKey);
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_4__["missing"])(this.groupData)) {
this.groupData = {};
}
var columnId = column.getColId();
var oldValue = this.groupData[columnId];
if (oldValue === newValue) {
return;
}
this.groupData[columnId] = newValue;
this.dispatchCellChangedEvent(column, newValue, oldValue);
};
// sets the data for an aggregation
RowNode.prototype.setAggData = function (newAggData) {
var _this = this;
// find out all keys that could potentially change
var colIds = Object(_utils_object__WEBPACK_IMPORTED_MODULE_5__["getAllKeysInObjects"])([this.aggData, newAggData]);
var oldAggData = this.aggData;
this.aggData = newAggData;
// if no event service, nobody has registered for events, so no need fire event
if (this.eventService) {
colIds.forEach(function (colId) {
var column = _this.columnController.getGridColumn(colId);
var value = _this.aggData ? _this.aggData[colId] : undefined;
var oldValue = oldAggData ? oldAggData[colId] : undefined;
_this.dispatchCellChangedEvent(column, value, oldValue);
});
}
};
RowNode.prototype.updateHasChildren = function () {
// we need to return true when this.group=true, as this is used by server side row model
// (as children are lazy loaded and stored in a cache anyway). otherwise we return true
// if children exist.
var newValue = (this.group && !this.footer) || (this.childrenAfterGroup && this.childrenAfterGroup.length > 0);
if (newValue !== this.__hasChildren) {
this.__hasChildren = newValue;
if (this.eventService) {
this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_HAS_CHILDREN_CHANGED));
}
}
};
RowNode.prototype.hasChildren = function () {
if (this.__hasChildren == null) {
this.updateHasChildren();
}
return this.__hasChildren;
};
RowNode.prototype.isEmptyRowGroupNode = function () {
return this.group && Object(_utils_generic__WEBPACK_IMPORTED_MODULE_4__["missingOrEmpty"])(this.childrenAfterGroup);
};
RowNode.prototype.dispatchCellChangedEvent = function (column, newValue, oldValue) {
var cellChangedEvent = {
type: RowNode.EVENT_CELL_CHANGED,
node: this,
column: column,
newValue: newValue,
oldValue: oldValue
};
this.dispatchLocalEvent(cellChangedEvent);
};
RowNode.prototype.resetQuickFilterAggregateText = function () {
this.quickFilterAggregateText = null;
};
RowNode.prototype.isExpandable = function () {
return this.hasChildren() || this.master ? true : false;
};
RowNode.prototype.isSelected = function () {
// for footers, we just return what our sibling selected state is, as cannot select a footer
if (this.footer) {
return this.sibling.isSelected();
}
return this.selected;
};
RowNode.prototype.depthFirstSearch = function (callback) {
if (this.childrenAfterGroup) {
this.childrenAfterGroup.forEach(function (child) { return child.depthFirstSearch(callback); });
}
callback(this);
};
// + rowController.updateGroupsInSelection()
// + selectionController.calculatedSelectedForAllGroupNodes()
RowNode.prototype.calculateSelectedFromChildren = function () {
var atLeastOneSelected = false;
var atLeastOneDeSelected = false;
var atLeastOneMixed = false;
var newSelectedValue;
if (this.childrenAfterGroup) {
for (var i = 0; i < this.childrenAfterGroup.length; i++) {
var child = this.childrenAfterGroup[i];
// skip non-selectable nodes to prevent inconsistent selection values
if (!child.selectable) {
continue;
}
var childState = child.isSelected();
switch (childState) {
case true:
atLeastOneSelected = true;
break;
case false:
atLeastOneDeSelected = true;
break;
default:
atLeastOneMixed = true;
break;
}
}
}
if (atLeastOneMixed) {
newSelectedValue = undefined;
}
else if (atLeastOneSelected && !atLeastOneDeSelected) {
newSelectedValue = true;
}
else if (!atLeastOneSelected && atLeastOneDeSelected) {
newSelectedValue = false;
}
else {
newSelectedValue = undefined;
}
this.selectThisNode(newSelectedValue);
};
RowNode.prototype.setSelectedInitialValue = function (selected) {
this.selected = selected;
};
RowNode.prototype.setSelected = function (newValue, clearSelection, suppressFinishActions) {
if (clearSelection === void 0) { clearSelection = false; }
if (suppressFinishActions === void 0) { suppressFinishActions = false; }
this.setSelectedParams({
newValue: newValue,
clearSelection: clearSelection,
suppressFinishActions: suppressFinishActions,
rangeSelect: false
});
};
RowNode.prototype.isRowPinned = function () {
return this.rowPinned === _constants_constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].PINNED_TOP || this.rowPinned === _constants_constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].PINNED_BOTTOM;
};
// to make calling code more readable, this is the same method as setSelected except it takes names parameters
RowNode.prototype.setSelectedParams = function (params) {
var groupSelectsChildren = this.gridOptionsWrapper.isGroupSelectsChildren();
var newValue = params.newValue === true;
var clearSelection = params.clearSelection === true;
var suppressFinishActions = params.suppressFinishActions === true;
var rangeSelect = params.rangeSelect === true;
// groupSelectsFiltered only makes sense when group selects children
var groupSelectsFiltered = groupSelectsChildren && (params.groupSelectsFiltered === true);
if (this.id === undefined) {
console.warn('ag-Grid: cannot select node until id for node is known');
return 0;
}
if (this.rowPinned) {
console.warn('ag-Grid: cannot select pinned rows');
return 0;
}
// if we are a footer, we don't do selection, just pass the info
// to the sibling (the parent of the group)
if (this.footer) {
return this.sibling.setSelectedParams(params);
}
if (rangeSelect && this.selectionController.getLastSelectedNode()) {
var newRowClicked = this.selectionController.getLastSelectedNode() !== this;
var allowMultiSelect = this.gridOptionsWrapper.isRowSelectionMulti();
if (newRowClicked && allowMultiSelect) {
var nodesChanged = this.doRowRangeSelection(params.newValue);
this.selectionController.setLastSelectedNode(this);
return nodesChanged;
}
}
var updatedCount = 0;
// when groupSelectsFiltered, then this node may end up intermediate despite
// trying to set it to true / false. this group will be calculated further on
// down when we call calculatedSelectedForAllGroupNodes(). we need to skip it
// here, otherwise the updatedCount would include it.
var skipThisNode = groupSelectsFiltered && this.group;
if (!skipThisNode) {
var thisNodeWasSelected = this.selectThisNode(newValue);
if (thisNodeWasSelected) {
updatedCount++;
}
}
if (groupSelectsChildren && this.group) {
updatedCount += this.selectChildNodes(newValue, groupSelectsFiltered);
}
// clear other nodes if not doing multi select
if (!suppressFinishActions) {
var clearOtherNodes = newValue && (clearSelection || !this.gridOptionsWrapper.isRowSelectionMulti());
if (clearOtherNodes) {
updatedCount += this.selectionController.clearOtherNodes(this);
}
// only if we selected something, then update groups and fire events
if (updatedCount > 0) {
this.selectionController.updateGroupsFromChildrenSelections();
// this is the very end of the 'action node', so we are finished all the updates,
// include any parent / child changes that this method caused
var event_1 = {
type: _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_SELECTION_CHANGED,
api: this.gridApi,
columnApi: this.columnApi
};
this.mainEventService.dispatchEvent(event_1);
}
// so if user next does shift-select, we know where to start the selection from
if (newValue) {
this.selectionController.setLastSelectedNode(this);
}
}
return updatedCount;
};
// selects all rows between this node and the last selected node (or the top if this is the first selection).
// not to be mixed up with 'cell range selection' where you drag the mouse, this is row range selection, by
// holding down 'shift'.
RowNode.prototype.doRowRangeSelection = function (value) {
var _this = this;
if (value === void 0) { value = true; }
var groupsSelectChildren = this.gridOptionsWrapper.isGroupSelectsChildren();
var lastSelectedNode = this.selectionController.getLastSelectedNode();
var nodesToSelect = this.rowModel.getNodesInRangeForSelection(this, lastSelectedNode);
var updatedCount = 0;
nodesToSelect.forEach(function (rowNode) {
if (rowNode.group && groupsSelectChildren || (value === false && _this === rowNode)) {
return;
}
var nodeWasSelected = rowNode.selectThisNode(value);
if (nodeWasSelected) {
updatedCount++;
}
});
this.selectionController.updateGroupsFromChildrenSelections();
var event = {
type: _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_SELECTION_CHANGED,
api: this.gridApi,
columnApi: this.columnApi
};
this.mainEventService.dispatchEvent(event);
return updatedCount;
};
RowNode.prototype.isParentOfNode = function (potentialParent) {
var parentNode = this.parent;
while (parentNode) {
if (parentNode === potentialParent) {
return true;
}
parentNode = parentNode.parent;
}
return false;
};
RowNode.prototype.selectThisNode = function (newValue) {
// we only check selectable when newValue=true (ie selecting) to allow unselecting values,
// as selectable is dynamic, need a way to unselect rows when selectable becomes false.
var selectionNotAllowed = !this.selectable && newValue;
var selectionNotChanged = this.selected === newValue;
if (selectionNotAllowed || selectionNotChanged) {
return false;
}
this.selected = newValue;
if (this.eventService) {
this.dispatchLocalEvent(this.createLocalRowEvent(RowNode.EVENT_ROW_SELECTED));
}
var event = this.createGlobalRowEvent(_events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_ROW_SELECTED);
this.mainEventService.dispatchEvent(event);
return true;
};
RowNode.prototype.selectChildNodes = function (newValue, groupSelectsFiltered) {
var children = groupSelectsFiltered ? this.childrenAfterFilter : this.childrenAfterGroup;
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_4__["missing"])(children)) {
return;
}
var updatedCount = 0;
for (var i = 0; i < children.length; i++) {
updatedCount += children[i].setSelectedParams({
newValue: newValue,
clearSelection: false,
suppressFinishActions: true,
groupSelectsFiltered: groupSelectsFiltered
});
}
return updatedCount;
};
RowNode.prototype.addEventListener = function (eventType, listener) {
if (!this.eventService) {
this.eventService = new _eventService__WEBPACK_IMPORTED_MODULE_0__["EventService"]();
}
this.eventService.addEventListener(eventType, listener);
};
RowNode.prototype.removeEventListener = function (eventType, listener) {
this.eventService.removeEventListener(eventType, listener);
};
RowNode.prototype.onMouseEnter = function () {
this.dispatchLocalEvent(this.createLocalRowEvent(RowNode.EVENT_MOUSE_ENTER));
};
RowNode.prototype.onMouseLeave = function () {
this.dispatchLocalEvent(this.createLocalRowEvent(RowNode.EVENT_MOUSE_LEAVE));
};
RowNode.prototype.getFirstChildOfFirstChild = function (rowGroupColumn) {
var currentRowNode = this;
var isCandidate = true;
var foundFirstChildPath = false;
var nodeToSwapIn;
// if we are hiding groups, then if we are the first child, of the first child,
// all the way up to the column we are interested in, then we show the group cell.
while (isCandidate && !foundFirstChildPath) {
var parentRowNode = currentRowNode.parent;
var firstChild = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_4__["exists"])(parentRowNode) && currentRowNode.firstChild;
if (firstChild) {
if (parentRowNode.rowGroupColumn === rowGroupColumn) {
foundFirstChildPath = true;
nodeToSwapIn = parentRowNode;
}
}
else {
isCandidate = false;
}
currentRowNode = parentRowNode;
}
return foundFirstChildPath ? nodeToSwapIn : null;
};
RowNode.prototype.isFullWidthCell = function () {
var isFullWidthCellFunc = this.gridOptionsWrapper.getIsFullWidthCellFunc();
return isFullWidthCellFunc ? isFullWidthCellFunc(this) : false;
};
RowNode.prototype.getRoute = function () {
if (this.key == null) {
return;
}
var res = [];
var pointer = this;
while (pointer.key != null) {
res.push(pointer.key);
pointer = pointer.parent;
}
return res.reverse();
};
RowNode.ID_PREFIX_ROW_GROUP = 'row-group-';
RowNode.ID_PREFIX_TOP_PINNED = 't-';
RowNode.ID_PREFIX_BOTTOM_PINNED = 'b-';
RowNode.OBJECT_ID_SEQUENCE = 0;
RowNode.EVENT_ROW_SELECTED = 'rowSelected';
RowNode.EVENT_DATA_CHANGED = 'dataChanged';
RowNode.EVENT_CELL_CHANGED = 'cellChanged';
RowNode.EVENT_ALL_CHILDREN_COUNT_CHANGED = 'allChildrenCountChanged';
RowNode.EVENT_MASTER_CHANGED = 'masterChanged';
RowNode.EVENT_MOUSE_ENTER = 'mouseEnter';
RowNode.EVENT_MOUSE_LEAVE = 'mouseLeave';
RowNode.EVENT_HEIGHT_CHANGED = 'heightChanged';
RowNode.EVENT_TOP_CHANGED = 'topChanged';
RowNode.EVENT_FIRST_CHILD_CHANGED = 'firstChildChanged';
RowNode.EVENT_LAST_CHILD_CHANGED = 'lastChildChanged';
RowNode.EVENT_CHILD_INDEX_CHANGED = 'childIndexChanged';
RowNode.EVENT_ROW_INDEX_CHANGED = 'rowIndexChanged';
RowNode.EVENT_EXPANDED_CHANGED = 'expandedChanged';
RowNode.EVENT_HAS_CHILDREN_CHANGED = 'hasChildrenChanged';
RowNode.EVENT_SELECTABLE_CHANGED = 'selectableChanged';
RowNode.EVENT_UI_LEVEL_CHANGED = 'uiLevelChanged';
RowNode.EVENT_HIGHLIGHT_CHANGED = 'rowHighlightChanged';
RowNode.EVENT_DRAGGING_CHANGED = 'draggingChanged';
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('eventService')
], RowNode.prototype, "mainEventService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('gridOptionsWrapper')
], RowNode.prototype, "gridOptionsWrapper", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('selectionController')
], RowNode.prototype, "selectionController", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('columnController')
], RowNode.prototype, "columnController", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('valueService')
], RowNode.prototype, "valueService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('rowModel')
], RowNode.prototype, "rowModel", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('context')
], RowNode.prototype, "context", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('valueCache')
], RowNode.prototype, "valueCache", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('columnApi')
], RowNode.prototype, "columnApi", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('gridApi')
], RowNode.prototype, "gridApi", void 0);
return RowNode;
}());
/***/ }),
/* 72 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CheckboxSelectionComponent", function() { return CheckboxSelectionComponent; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _widgets_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(36);
/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(23);
/* harmony import */ var _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(57);
/* harmony import */ var _entities_rowNode__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(71);
/* harmony import */ var _utils_event__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(21);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 CheckboxSelectionComponent = /** @class */ (function (_super) {
__extends(CheckboxSelectionComponent, _super);
function CheckboxSelectionComponent() {
return _super.call(this, /* html*/ "\n
\n \n
") || this;
}
CheckboxSelectionComponent.prototype.postConstruct = function () {
this.eCheckbox.setPassive(true);
};
CheckboxSelectionComponent.prototype.onDataChanged = function () {
// when rows are loaded for the second time, this can impact the selection, as a row
// could be loaded as already selected (if user scrolls down, and then up again).
this.onSelectionChanged();
};
CheckboxSelectionComponent.prototype.onSelectableChanged = function () {
this.showOrHideSelect();
};
CheckboxSelectionComponent.prototype.onSelectionChanged = function () {
var translate = this.gridOptionsWrapper.getLocaleTextFunc();
var state = this.rowNode.isSelected();
var stateName = state === undefined
? translate('ariaIndeterminate', 'indeterminate')
: (state === true
? translate('ariaChecked', 'checked')
: translate('ariaUnchecked', 'unchecked'));
var ariaLabel = translate('ariaRowToggleSelection', 'Press Space to toggle row selection');
this.eCheckbox.setValue(state, true);
this.eCheckbox.setInputAriaLabel(ariaLabel + " (" + stateName + ")");
};
CheckboxSelectionComponent.prototype.onCheckedClicked = function (event) {
var groupSelectsFiltered = this.gridOptionsWrapper.isGroupSelectsFiltered();
var updatedCount = this.rowNode.setSelectedParams({ newValue: false, rangeSelect: event.shiftKey, groupSelectsFiltered: groupSelectsFiltered });
return updatedCount;
};
CheckboxSelectionComponent.prototype.onUncheckedClicked = function (event) {
var groupSelectsFiltered = this.gridOptionsWrapper.isGroupSelectsFiltered();
var updatedCount = this.rowNode.setSelectedParams({ newValue: true, rangeSelect: event.shiftKey, groupSelectsFiltered: groupSelectsFiltered });
return updatedCount;
};
CheckboxSelectionComponent.prototype.init = function (params) {
var _this = this;
this.rowNode = params.rowNode;
this.column = params.column;
this.onSelectionChanged();
// we don't want the row clicked event to fire when selecting the checkbox, otherwise the row
// would possibly get selected twice
this.addGuiEventListener('click', function (event) { return Object(_utils_event__WEBPACK_IMPORTED_MODULE_5__["stopPropagationForAgGrid"])(event); });
// likewise we don't want double click on this icon to open a group
this.addGuiEventListener('dblclick', function (event) { return Object(_utils_event__WEBPACK_IMPORTED_MODULE_5__["stopPropagationForAgGrid"])(event); });
this.addManagedListener(this.eCheckbox.getInputElement(), 'click', function (event) {
var isSelected = _this.eCheckbox.getValue();
var previousValue = _this.eCheckbox.getPreviousValue();
if (previousValue === undefined) { // indeterminate
var result = _this.onUncheckedClicked(event || {});
if (result === 0) {
_this.onCheckedClicked(event);
}
}
else if (isSelected) {
_this.onCheckedClicked(event);
}
else {
_this.onUncheckedClicked(event || {});
}
});
this.addManagedListener(this.rowNode, _entities_rowNode__WEBPACK_IMPORTED_MODULE_4__["RowNode"].EVENT_ROW_SELECTED, this.onSelectionChanged.bind(this));
this.addManagedListener(this.rowNode, _entities_rowNode__WEBPACK_IMPORTED_MODULE_4__["RowNode"].EVENT_DATA_CHANGED, this.onDataChanged.bind(this));
this.addManagedListener(this.rowNode, _entities_rowNode__WEBPACK_IMPORTED_MODULE_4__["RowNode"].EVENT_SELECTABLE_CHANGED, this.onSelectableChanged.bind(this));
this.isRowSelectableFunc = this.gridOptionsWrapper.getIsRowSelectableFunc();
var checkboxVisibleIsDynamic = this.isRowSelectableFunc || this.checkboxCallbackExists();
if (checkboxVisibleIsDynamic) {
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_DISPLAYED_COLUMNS_CHANGED, this.showOrHideSelect.bind(this));
this.showOrHideSelect();
}
this.eCheckbox.getInputElement().setAttribute('tabindex', '-1');
};
CheckboxSelectionComponent.prototype.showOrHideSelect = function () {
// if the isRowSelectable() is not provided the row node is selectable by default
var selectable = this.rowNode.selectable;
// checkboxSelection callback is deemed a legacy solution however we will still consider it's result.
// If selectable, then also check the colDef callback. if not selectable, this it short circuits - no need
// to call the colDef callback.
if (selectable && this.checkboxCallbackExists()) {
selectable = this.column.isCellCheckboxSelection(this.rowNode);
}
// show checkbox if both conditions are true
this.setDisplayed(selectable);
};
CheckboxSelectionComponent.prototype.checkboxCallbackExists = function () {
// column will be missing if groupUseEntireRow=true
var colDef = this.column ? this.column.getColDef() : null;
return colDef && typeof colDef.checkboxSelection === 'function';
};
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_3__["RefSelector"])('eCheckbox')
], CheckboxSelectionComponent.prototype, "eCheckbox", void 0);
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_0__["PostConstruct"]
], CheckboxSelectionComponent.prototype, "postConstruct", null);
return CheckboxSelectionComponent;
}(_widgets_component__WEBPACK_IMPORTED_MODULE_1__["Component"]));
/***/ }),
/* 73 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ComponentSource", function() { return ComponentSource; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UserComponentFactory", function() { return UserComponentFactory; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _userComponentRegistry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(33);
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(37);
/* harmony import */ var _componentTypes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(74);
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(20);
/* harmony import */ var _utils_object__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(13);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 ComponentSource;
(function (ComponentSource) {
ComponentSource[ComponentSource["DEFAULT"] = 0] = "DEFAULT";
ComponentSource[ComponentSource["REGISTERED_BY_NAME"] = 1] = "REGISTERED_BY_NAME";
ComponentSource[ComponentSource["HARDCODED"] = 2] = "HARDCODED";
})(ComponentSource || (ComponentSource = {}));
var UserComponentFactory = /** @class */ (function (_super) {
__extends(UserComponentFactory, _super);
function UserComponentFactory() {
return _super !== null && _super.apply(this, arguments) || this;
}
UserComponentFactory.prototype.newDateComponent = function (params) {
return this.createAndInitUserComponent(this.gridOptions, params, _componentTypes__WEBPACK_IMPORTED_MODULE_3__["DateComponent"], 'agDateInput');
};
UserComponentFactory.prototype.newHeaderComponent = function (params) {
return this.createAndInitUserComponent(params.column.getColDef(), params, _componentTypes__WEBPACK_IMPORTED_MODULE_3__["HeaderComponent"], 'agColumnHeader');
};
UserComponentFactory.prototype.newHeaderGroupComponent = function (params) {
return this.createAndInitUserComponent(params.columnGroup.getColGroupDef(), params, _componentTypes__WEBPACK_IMPORTED_MODULE_3__["HeaderGroupComponent"], 'agColumnGroupHeader');
};
UserComponentFactory.prototype.newFullWidthGroupRowInnerCellRenderer = function (params) {
return this.createAndInitUserComponent(this.gridOptions.groupRowRendererParams, params, _componentTypes__WEBPACK_IMPORTED_MODULE_3__["InnerRendererComponent"], null, true);
};
// this one is unusual, as it can be LoadingCellRenderer, DetailCellRenderer, FullWidthCellRenderer or GroupRowRenderer.
// so we have to pass the type in.
UserComponentFactory.prototype.newFullWidthCellRenderer = function (params, cellRendererType, cellRendererName) {
return this.createAndInitUserComponent(null, params, { propertyName: cellRendererType, isCellRenderer: function () { return true; } }, cellRendererName);
};
UserComponentFactory.prototype.newCellRenderer = function (target, params, isPinned) {
if (isPinned === void 0) { isPinned = false; }
return this.createAndInitUserComponent(target, params, isPinned ? _componentTypes__WEBPACK_IMPORTED_MODULE_3__["PinnedRowCellRendererComponent"] : _componentTypes__WEBPACK_IMPORTED_MODULE_3__["CellRendererComponent"], null, true);
};
UserComponentFactory.prototype.newCellEditor = function (colDef, params) {
return this.createAndInitUserComponent(colDef, params, _componentTypes__WEBPACK_IMPORTED_MODULE_3__["CellEditorComponent"], 'agCellEditor');
};
UserComponentFactory.prototype.newInnerCellRenderer = function (target, params) {
return this.createAndInitUserComponent(target, params, _componentTypes__WEBPACK_IMPORTED_MODULE_3__["InnerRendererComponent"], null);
};
UserComponentFactory.prototype.newLoadingOverlayComponent = function (params) {
return this.createAndInitUserComponent(this.gridOptions, params, _componentTypes__WEBPACK_IMPORTED_MODULE_3__["LoadingOverlayComponent"], 'agLoadingOverlay');
};
UserComponentFactory.prototype.newNoRowsOverlayComponent = function (params) {
return this.createAndInitUserComponent(this.gridOptions, params, _componentTypes__WEBPACK_IMPORTED_MODULE_3__["NoRowsOverlayComponent"], 'agNoRowsOverlay');
};
UserComponentFactory.prototype.newTooltipComponent = function (params) {
return this.createAndInitUserComponent(params.colDef, params, _componentTypes__WEBPACK_IMPORTED_MODULE_3__["TooltipComponent"], 'agTooltipComponent');
};
UserComponentFactory.prototype.newFilterComponent = function (def, params, defaultFilter) {
return this.createAndInitUserComponent(def, params, _componentTypes__WEBPACK_IMPORTED_MODULE_3__["FilterComponent"], defaultFilter, false);
};
UserComponentFactory.prototype.newSetFilterCellRenderer = function (target, params) {
return this.createAndInitUserComponent(target, params, _componentTypes__WEBPACK_IMPORTED_MODULE_3__["CellRendererComponent"], null, true);
};
UserComponentFactory.prototype.newFloatingFilterComponent = function (def, params, defaultFloatingFilter) {
return this.createAndInitUserComponent(def, params, _componentTypes__WEBPACK_IMPORTED_MODULE_3__["FloatingFilterComponent"], defaultFloatingFilter, true);
};
UserComponentFactory.prototype.newToolPanelComponent = function (toolPanelDef, params) {
return this.createAndInitUserComponent(toolPanelDef, params, _componentTypes__WEBPACK_IMPORTED_MODULE_3__["ToolPanelComponent"]);
};
UserComponentFactory.prototype.newStatusPanelComponent = function (def, params) {
return this.createAndInitUserComponent(def, params, _componentTypes__WEBPACK_IMPORTED_MODULE_3__["StatusPanelComponent"]);
};
/**
* This method creates a component given everything needed to guess what sort of component needs to be instantiated
* It takes
* @param definitionObject: This is the context for which this component needs to be created, it can be gridOptions
* (global) or columnDef mostly.
* @param paramsFromGrid: Params to be passed to the component and passed by ag-Grid. This will get merged with any params
* specified by the user in the configuration
* @param propertyName: The name of the property used in ag-grid as a convention to refer to the component, it can be:
* 'floatingFilter', 'cellRenderer', is used to find if the user is specifying a custom component
* @param defaultComponentName: The actual name of the component to instantiate, this is usually the same as propertyName, but in
* some cases is not, like floatingFilter, if it is the same is not necessary to specify
* @param optional: Handy method to tell if this should return a component ALWAYS. if that is the case, but there is no
* component found, it throws an error, by default all components are MANDATORY
*/
UserComponentFactory.prototype.createAndInitUserComponent = function (definitionObject, paramsFromGrid, componentType, defaultComponentName,
// optional items are: FloatingFilter, CellComp (for cellRenderer)
optional) {
if (optional === void 0) { optional = false; }
if (!definitionObject) {
definitionObject = this.gridOptions;
}
// Create the component instance
var componentAndParams = this.createComponentInstance(definitionObject, componentType, paramsFromGrid, defaultComponentName, optional);
if (!componentAndParams) {
return null;
}
var componentInstance = componentAndParams.componentInstance;
// Wire the component and call the init method with the correct params
var params = this.createFinalParams(definitionObject, componentType.propertyName, paramsFromGrid, componentAndParams.paramsFromSelector);
this.addReactHacks(params);
var deferredInit = this.initComponent(componentInstance, params);
if (deferredInit == null) {
return _utils__WEBPACK_IMPORTED_MODULE_2__["AgPromise"].resolve(componentInstance);
}
else {
return deferredInit.then(function () { return componentInstance; });
}
};
UserComponentFactory.prototype.addReactHacks = function (params) {
// a temporary fix for AG-1574
// AG-1715 raised to do a wider ranging refactor to improve this
var agGridReact = this.context.getBean('agGridReact');
if (agGridReact) {
params.agGridReact = Object(_utils_object__WEBPACK_IMPORTED_MODULE_5__["cloneObject"])(agGridReact);
}
// AG-1716 - directly related to AG-1574 and AG-1715
var frameworkComponentWrapper = this.context.getBean('frameworkComponentWrapper');
if (frameworkComponentWrapper) {
params.frameworkComponentWrapper = frameworkComponentWrapper;
}
};
/**
* This method creates a component given everything needed to guess what sort of component needs to be instantiated
* It takes
* @param clazz: The class to instantiate,
* @param agGridParams: Params to be passed to the component and passed by ag-Grid. This will get merged with any params
* specified by the user in the configuration
* @param modifyParamsCallback: A chance to customise the params passed to the init method. It receives what the current
* params are and the component that init is about to get called for
*/
UserComponentFactory.prototype.createUserComponentFromConcreteClass = function (clazz, agGridParams) {
var internalComponent = new clazz();
this.initComponent(internalComponent, agGridParams);
return internalComponent;
};
/**
* This method returns the underlying representation of the component to be created. ie for Javascript the
* underlying function where we should be calling new into. In case of the frameworks, the framework class
* object that represents the component to be created.
*
* This method is handy for different reasons, for example if you want to check if a component has a particular
* method implemented without having to create the component, just by inspecting the source component
*
* It takes
* @param definitionObject: This is the context for which this component needs to be created, it can be gridOptions
* (global) or columnDef mostly.
* @param propertyName: The name of the property used in ag-grid as a convention to refer to the component, it can be:
* 'floatingFilter', 'cellRenderer', is used to find if the user is specifying a custom component
* @param params: Params to be passed to the dynamic component function in case it needs to be
* invoked
* @param defaultComponentName: The name of the component to load if there is no component specified
*/
UserComponentFactory.prototype.lookupComponentClassDef = function (definitionObject, propertyName, params, defaultComponentName) {
if (params === void 0) { params = null; }
/**
* There are five things that can happen when resolving a component.
* a) HardcodedFwComponent: That holder[propertyName]Framework has associated a Framework native component
* b) HardcodedJsComponent: That holder[propertyName] has associate a JS component
* c) hardcodedJsFunction: That holder[propertyName] has associate a JS function
* d) hardcodedNameComponent: That holder[propertyName] has associate a string that represents a component to load
* e) That none of the three previous are specified, then we need to use the DefaultRegisteredComponent
*/
var hardcodedNameComponent = null;
var HardcodedJsComponent = null;
var hardcodedJsFunction = null;
var HardcodedFwComponent = null;
var componentSelectorFunc;
if (definitionObject != null) {
var componentPropertyValue = definitionObject[propertyName];
// for filters only, we allow 'true' for the component, which means default filter to be used
var usingDefaultComponent = componentPropertyValue === true;
if (componentPropertyValue != null && !usingDefaultComponent) {
if (typeof componentPropertyValue === 'string') {
hardcodedNameComponent = componentPropertyValue;
}
else if (typeof componentPropertyValue === 'boolean') {
// never happens, as we test for usingDefaultComponent above,
// however it's needed for the next block to compile
}
else if (this.agComponentUtils.doesImplementIComponent(componentPropertyValue)) {
HardcodedJsComponent = componentPropertyValue;
}
else {
hardcodedJsFunction = componentPropertyValue;
}
}
HardcodedFwComponent = definitionObject[propertyName + "Framework"];
componentSelectorFunc = definitionObject[propertyName + "Selector"];
}
/**
* Since we allow many types of flavors for specifying the components, let's make sure this is not an illegal
* combination
*/
if ((HardcodedJsComponent && HardcodedFwComponent) ||
(hardcodedNameComponent && HardcodedFwComponent) ||
(hardcodedJsFunction && HardcodedFwComponent)) {
throw Error("ag-grid: you are trying to specify: " + propertyName + " twice as a component.");
}
if (HardcodedFwComponent && !this.frameworkComponentWrapper) {
throw Error("ag-grid: you are specifying a framework component but you are not using a framework version of ag-grid for : " + propertyName);
}
if (componentSelectorFunc && (hardcodedNameComponent || HardcodedJsComponent || hardcodedJsFunction || HardcodedFwComponent)) {
throw Error("ag-grid: you can't specify both, the selector and the component of ag-grid for : " + propertyName);
}
/**
* At this stage we are guaranteed to either have,
* DEPRECATED
* - A unique HardcodedFwComponent
* - A unique HardcodedJsComponent
* - A unique hardcodedJsFunction
* BY NAME- FAVOURED APPROACH
* - A unique hardcodedNameComponent
* - None of the previous, hence we revert to: RegisteredComponent
*/
if (HardcodedFwComponent) {
// console.warn(`ag-grid: Since version 12.1.0 specifying a component directly is deprecated, you should register the component by name`);
// console.warn(`${HardcodedFwComponent}`);
return {
componentFromFramework: true,
component: HardcodedFwComponent,
source: ComponentSource.HARDCODED,
paramsFromSelector: null
};
}
if (HardcodedJsComponent) {
// console.warn(`ag-grid: Since version 12.1.0 specifying a component directly is deprecated, you should register the component by name`);
// console.warn(`${HardcodedJsComponent}`);
return {
componentFromFramework: false,
component: HardcodedJsComponent,
source: ComponentSource.HARDCODED,
paramsFromSelector: null
};
}
if (hardcodedJsFunction) {
// console.warn(`ag-grid: Since version 12.1.0 specifying a function directly is deprecated, you should register the component by name`);
// console.warn(`${hardcodedJsFunction}`);
return this.agComponentUtils.adaptFunction(propertyName, hardcodedJsFunction, false, ComponentSource.HARDCODED);
}
var selectorResult = componentSelectorFunc ? componentSelectorFunc(params) : null;
var componentNameToUse;
if (selectorResult && selectorResult.component) {
componentNameToUse = selectorResult.component;
}
else if (hardcodedNameComponent) {
componentNameToUse = hardcodedNameComponent;
}
else {
componentNameToUse = defaultComponentName;
}
if (!componentNameToUse) {
return null;
}
var registeredCompClassDef = this.lookupFromRegisteredComponents(propertyName, componentNameToUse);
if (!registeredCompClassDef) {
return null;
}
return {
componentFromFramework: registeredCompClassDef.componentFromFramework,
component: registeredCompClassDef.component,
source: registeredCompClassDef.source,
paramsFromSelector: selectorResult ? selectorResult.params : null
};
};
UserComponentFactory.prototype.lookupFromRegisteredComponents = function (propertyName, componentNameOpt) {
var componentName = componentNameOpt != null ? componentNameOpt : propertyName;
var registeredComponent = this.userComponentRegistry.retrieve(componentName);
if (registeredComponent == null) {
return null;
}
//If it is a FW it has to be registered as a component
if (registeredComponent.componentFromFramework) {
return {
component: registeredComponent.component,
componentFromFramework: true,
source: ComponentSource.REGISTERED_BY_NAME,
paramsFromSelector: null
};
}
//If it is JS it may be a function or a component
if (this.agComponentUtils.doesImplementIComponent(registeredComponent.component)) {
return {
component: registeredComponent.component,
componentFromFramework: false,
source: (registeredComponent.source == _userComponentRegistry__WEBPACK_IMPORTED_MODULE_1__["RegisteredComponentSource"].REGISTERED) ? ComponentSource.REGISTERED_BY_NAME : ComponentSource.DEFAULT,
paramsFromSelector: null
};
}
// This is a function
return this.agComponentUtils.adaptFunction(propertyName, registeredComponent.component, registeredComponent.componentFromFramework, (registeredComponent.source == _userComponentRegistry__WEBPACK_IMPORTED_MODULE_1__["RegisteredComponentSource"].REGISTERED) ? ComponentSource.REGISTERED_BY_NAME : ComponentSource.DEFAULT);
};
/**
* Useful to check what would be the resultant params for a given object
* @param definitionObject: This is the context for which this component needs to be created, it can be gridOptions
* (global) or columnDef mostly.
* @param propertyName: The name of the property used in ag-grid as a convention to refer to the component, it can be:
* 'floatingFilter', 'cellRenderer', is used to find if the user is specifying a custom component
* @param paramsFromGrid: Params to be passed to the component and passed by ag-Grid. This will get merged with any params
* specified by the user in the configuration
* @returns {TParams} It merges the user agGridParams with the actual params specified by the user.
*/
UserComponentFactory.prototype.createFinalParams = function (definitionObject, propertyName, paramsFromGrid, paramsFromSelector) {
if (paramsFromSelector === void 0) { paramsFromSelector = null; }
var params = {};
Object(_utils_object__WEBPACK_IMPORTED_MODULE_5__["mergeDeep"])(params, paramsFromGrid);
var userParams = definitionObject ? definitionObject[propertyName + "Params"] : null;
if (userParams != null) {
if (typeof userParams === 'function') {
var userParamsFromFunc = userParams(paramsFromGrid);
Object(_utils_object__WEBPACK_IMPORTED_MODULE_5__["mergeDeep"])(params, userParamsFromFunc);
}
else if (typeof userParams === 'object') {
Object(_utils_object__WEBPACK_IMPORTED_MODULE_5__["mergeDeep"])(params, userParams);
}
}
Object(_utils_object__WEBPACK_IMPORTED_MODULE_5__["mergeDeep"])(params, paramsFromSelector);
return params;
};
UserComponentFactory.prototype.createComponentInstance = function (holder, componentType, paramsForSelector, defaultComponentName, optional) {
var propertyName = componentType.propertyName;
var componentToUse = this.lookupComponentClassDef(holder, propertyName, paramsForSelector, defaultComponentName);
var missing = !componentToUse || !componentToUse.component;
if (missing) {
// to help the user, we print out the name they are looking for, rather than the default name.
// i don't know why the default name was originally printed out (that doesn't help the user)
var overrideName = holder ? holder[propertyName] : defaultComponentName;
var nameToReport = overrideName ? overrideName : defaultComponentName;
if (!optional) {
console.error("Could not find component " + nameToReport + ", did you forget to configure this component?");
}
return null;
}
var componentInstance;
if (componentToUse.componentFromFramework) {
// Using framework component
var FrameworkComponentRaw = componentToUse.component;
var thisComponentConfig = this.componentMetadataProvider.retrieve(propertyName);
componentInstance = this.frameworkComponentWrapper.wrap(FrameworkComponentRaw, thisComponentConfig.mandatoryMethodList, thisComponentConfig.optionalMethodList, componentType, defaultComponentName);
}
else {
// Using plain JavaScript component
componentInstance = new componentToUse.component();
}
return { componentInstance: componentInstance, paramsFromSelector: componentToUse.paramsFromSelector };
};
UserComponentFactory.prototype.initComponent = function (component, params) {
this.context.createBean(component);
if (component.init == null) {
return;
}
return component.init(params);
};
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptions')
], UserComponentFactory.prototype, "gridOptions", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('agComponentUtils')
], UserComponentFactory.prototype, "agComponentUtils", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('componentMetadataProvider')
], UserComponentFactory.prototype, "componentMetadataProvider", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('userComponentRegistry')
], UserComponentFactory.prototype, "userComponentRegistry", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Optional"])('frameworkComponentWrapper')
], UserComponentFactory.prototype, "frameworkComponentWrapper", void 0);
UserComponentFactory = __decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('userComponentFactory')
], UserComponentFactory);
return UserComponentFactory;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_4__["BeanStub"]));
/***/ }),
/* 74 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DateComponent", function() { return DateComponent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HeaderComponent", function() { return HeaderComponent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HeaderGroupComponent", function() { return HeaderGroupComponent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CellRendererComponent", function() { return CellRendererComponent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PinnedRowCellRendererComponent", function() { return PinnedRowCellRendererComponent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CellEditorComponent", function() { return CellEditorComponent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InnerRendererComponent", function() { return InnerRendererComponent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LoadingOverlayComponent", function() { return LoadingOverlayComponent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NoRowsOverlayComponent", function() { return NoRowsOverlayComponent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TooltipComponent", function() { return TooltipComponent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FilterComponent", function() { return FilterComponent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FloatingFilterComponent", function() { return FloatingFilterComponent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ToolPanelComponent", function() { return ToolPanelComponent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StatusPanelComponent", function() { return StatusPanelComponent; });
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var DateComponent = {
propertyName: 'dateComponent',
isCellRenderer: function () { return false; }
};
var HeaderComponent = {
propertyName: 'headerComponent',
isCellRenderer: function () { return false; },
};
var HeaderGroupComponent = {
propertyName: 'headerGroupComponent',
isCellRenderer: function () { return false; },
};
var CellRendererComponent = {
propertyName: 'cellRenderer',
isCellRenderer: function () { return true; },
};
var PinnedRowCellRendererComponent = {
propertyName: 'pinnedRowCellRenderer',
isCellRenderer: function () { return true; },
};
var CellEditorComponent = {
propertyName: 'cellEditor',
isCellRenderer: function () { return false; },
};
var InnerRendererComponent = {
propertyName: 'innerRenderer',
isCellRenderer: function () { return true; },
};
var LoadingOverlayComponent = {
propertyName: 'loadingOverlayComponent',
isCellRenderer: function () { return false; },
};
var NoRowsOverlayComponent = {
propertyName: 'noRowsOverlayComponent',
isCellRenderer: function () { return false; },
};
var TooltipComponent = {
propertyName: 'tooltipComponent',
isCellRenderer: function () { return false; },
};
var FilterComponent = {
propertyName: 'filter',
isCellRenderer: function () { return false; },
};
var FloatingFilterComponent = {
propertyName: 'floatingFilterComponent',
isCellRenderer: function () { return false; },
};
var ToolPanelComponent = {
propertyName: 'toolPanel',
isCellRenderer: function () { return false; },
};
var StatusPanelComponent = {
propertyName: 'statusPanel',
isCellRenderer: function () { return false; },
};
/***/ }),
/* 75 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimateShowChangeCellRenderer", function() { return AnimateShowChangeCellRenderer; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _widgets_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(36);
/* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7);
/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(42);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 ARROW_UP = '\u2191';
var ARROW_DOWN = '\u2193';
var AnimateShowChangeCellRenderer = /** @class */ (function (_super) {
__extends(AnimateShowChangeCellRenderer, _super);
function AnimateShowChangeCellRenderer() {
var _this = _super.call(this, AnimateShowChangeCellRenderer.TEMPLATE) || this;
_this.refreshCount = 0;
return _this;
}
AnimateShowChangeCellRenderer.prototype.init = function (params) {
// this.params = params;
this.eValue = this.queryForHtmlElement('.ag-value-change-value');
this.eDelta = this.queryForHtmlElement('.ag-value-change-delta');
this.refresh(params);
};
AnimateShowChangeCellRenderer.prototype.showDelta = function (params, delta) {
var absDelta = Math.abs(delta);
var valueFormatted = params.formatValue(absDelta);
var valueToUse = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_2__["exists"])(valueFormatted) ? valueFormatted : absDelta;
var deltaUp = (delta >= 0);
if (deltaUp) {
this.eDelta.innerHTML = ARROW_UP + valueToUse;
}
else {
// because negative, use ABS to remove sign
this.eDelta.innerHTML = ARROW_DOWN + valueToUse;
}
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["addOrRemoveCssClass"])(this.eDelta, 'ag-value-change-delta-up', deltaUp);
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["addOrRemoveCssClass"])(this.eDelta, 'ag-value-change-delta-down', !deltaUp);
};
AnimateShowChangeCellRenderer.prototype.setTimerToRemoveDelta = function () {
var _this = this;
// the refreshCount makes sure that if the value updates again while
// the below timer is waiting, then the below timer will realise it
// is not the most recent and will not try to remove the delta value.
this.refreshCount++;
var refreshCountCopy = this.refreshCount;
window.setTimeout(function () {
if (refreshCountCopy === _this.refreshCount) {
_this.hideDeltaValue();
}
}, 2000);
};
AnimateShowChangeCellRenderer.prototype.hideDeltaValue = function () {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["removeCssClass"])(this.eValue, 'ag-value-change-value-highlight');
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["clearElement"])(this.eDelta);
};
AnimateShowChangeCellRenderer.prototype.refresh = function (params) {
var value = params.value;
if (value === this.lastValue) {
return;
}
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_2__["exists"])(params.valueFormatted)) {
this.eValue.innerHTML = params.valueFormatted;
}
else if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_2__["exists"])(params.value)) {
this.eValue.innerHTML = value;
}
else {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["clearElement"])(this.eValue);
}
// we don't show the delta if we are in the middle of a filter. see comment on FilterManager
// with regards processingFilterChange
if (this.filterManager.isSuppressFlashingCellsBecauseFiltering()) {
return;
}
if (typeof value === 'number' && typeof this.lastValue === 'number') {
var delta = value - this.lastValue;
this.showDelta(params, delta);
}
// highlight the current value, but only if it's not new, otherwise it
// would get highlighted first time the value is shown
if (this.lastValue) {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["addCssClass"])(this.eValue, 'ag-value-change-value-highlight');
}
this.setTimerToRemoveDelta();
this.lastValue = value;
return true;
};
AnimateShowChangeCellRenderer.TEMPLATE = '' +
'' +
'' +
'';
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('filterManager')
], AnimateShowChangeCellRenderer.prototype, "filterManager", void 0);
return AnimateShowChangeCellRenderer;
}(_widgets_component__WEBPACK_IMPORTED_MODULE_1__["Component"]));
/***/ }),
/* 76 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimateSlideCellRenderer", function() { return AnimateSlideCellRenderer; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _widgets_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(36);
/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(42);
/* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 AnimateSlideCellRenderer = /** @class */ (function (_super) {
__extends(AnimateSlideCellRenderer, _super);
function AnimateSlideCellRenderer() {
var _this = _super.call(this, AnimateSlideCellRenderer.TEMPLATE) || this;
_this.refreshCount = 0;
_this.eCurrent = _this.queryForHtmlElement('.ag-value-slide-current');
return _this;
}
AnimateSlideCellRenderer.prototype.init = function (params) {
this.params = params;
this.refresh(params);
};
AnimateSlideCellRenderer.prototype.addSlideAnimation = function () {
var _this = this;
this.refreshCount++;
// below we keep checking this, and stop working on the animation
// if it no longer matches - this means another animation has started
// and this one is stale.
var refreshCountCopy = this.refreshCount;
// if old animation, remove it
if (this.ePrevious) {
this.getGui().removeChild(this.ePrevious);
}
this.ePrevious = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_2__["loadTemplate"])('');
this.ePrevious.innerHTML = this.eCurrent.innerHTML;
this.getGui().insertBefore(this.ePrevious, this.eCurrent);
// having timeout of 0 allows use to skip to the next css turn,
// so we know the previous css classes have been applied. so the
// complex set of setTimeout below creates the animation
window.setTimeout(function () {
if (refreshCountCopy !== _this.refreshCount) {
return;
}
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_2__["addCssClass"])(_this.ePrevious, 'ag-value-slide-out-end');
}, 50);
window.setTimeout(function () {
if (refreshCountCopy !== _this.refreshCount) {
return;
}
_this.getGui().removeChild(_this.ePrevious);
_this.ePrevious = null;
}, 3000);
};
AnimateSlideCellRenderer.prototype.refresh = function (params) {
var value = params.value;
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_3__["missing"])(value)) {
value = '';
}
if (value === this.lastValue) {
return;
}
// we don't show the delta if we are in the middle of a filter. see comment on FilterManager
// with regards processingFilterChange
if (this.filterManager.isSuppressFlashingCellsBecauseFiltering()) {
return;
}
this.addSlideAnimation();
this.lastValue = value;
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_3__["exists"])(params.valueFormatted)) {
this.eCurrent.innerHTML = params.valueFormatted;
}
else if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_3__["exists"])(params.value)) {
this.eCurrent.innerHTML = value;
}
else {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_2__["clearElement"])(this.eCurrent);
}
return true;
};
AnimateSlideCellRenderer.TEMPLATE = '' +
'' +
'';
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('filterManager')
], AnimateSlideCellRenderer.prototype, "filterManager", void 0);
return AnimateSlideCellRenderer;
}(_widgets_component__WEBPACK_IMPORTED_MODULE_1__["Component"]));
/***/ }),
/* 77 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LoadingCellRenderer", function() { return LoadingCellRenderer; });
/* harmony import */ var _widgets_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(36);
/* harmony import */ var _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(57);
/* harmony import */ var _utils_icon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(47);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 LoadingCellRenderer = /** @class */ (function (_super) {
__extends(LoadingCellRenderer, _super);
function LoadingCellRenderer() {
return _super.call(this, LoadingCellRenderer.TEMPLATE) || this;
}
LoadingCellRenderer.prototype.init = function (params) {
params.node.failedLoad ? this.setupFailed() : this.setupLoading();
};
LoadingCellRenderer.prototype.setupFailed = function () {
this.eLoadingText.innerText = 'ERR';
};
LoadingCellRenderer.prototype.setupLoading = function () {
var eLoadingIcon = Object(_utils_icon__WEBPACK_IMPORTED_MODULE_2__["createIconNoSpan"])('groupLoading', this.gridOptionsWrapper, null);
if (eLoadingIcon) {
this.eLoadingIcon.appendChild(eLoadingIcon);
}
var localeTextFunc = this.gridOptionsWrapper.getLocaleTextFunc();
this.eLoadingText.innerText = localeTextFunc('loadingOoo', 'Loading');
};
LoadingCellRenderer.prototype.refresh = function (params) {
return false;
};
LoadingCellRenderer.TEMPLATE = "
\n \n \n
";
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_1__["RefSelector"])('eLoadingIcon')
], LoadingCellRenderer.prototype, "eLoadingIcon", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_1__["RefSelector"])('eLoadingText')
], LoadingCellRenderer.prototype, "eLoadingText", void 0);
return LoadingCellRenderer;
}(_widgets_component__WEBPACK_IMPORTED_MODULE_0__["Component"]));
/***/ }),
/* 78 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SelectCellEditor", function() { return SelectCellEditor; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _widgets_popupComponent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(35);
/* harmony import */ var _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(57);
/* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7);
/* harmony import */ var _constants_keyCode__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(58);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 SelectCellEditor = /** @class */ (function (_super) {
__extends(SelectCellEditor, _super);
function SelectCellEditor() {
var _this = _super.call(this, '
') || this;
_this.startedByEnter = false;
return _this;
}
SelectCellEditor.prototype.init = function (params) {
var _this = this;
this.focusAfterAttached = params.cellStartedEdit;
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_3__["missing"])(params.values)) {
console.warn('ag-Grid: no values found for select cellEditor');
return;
}
this.startedByEnter = params.keyPress === _constants_keyCode__WEBPACK_IMPORTED_MODULE_4__["KeyCode"].ENTER;
var hasValue = false;
params.values.forEach(function (value) {
var option = { value: value };
var valueFormatted = _this.valueFormatterService.formatValue(params.column, null, null, value);
var valueFormattedExits = valueFormatted !== null && valueFormatted !== undefined;
option.text = valueFormattedExits ? valueFormatted : value;
_this.eSelect.addOption(option);
hasValue = hasValue || params.value === value;
});
if (hasValue) {
this.eSelect.setValue(params.value, true);
}
else if (params.values.length) {
this.eSelect.setValue(params.values[0], true);
}
// we don't want to add this if full row editing, otherwise selecting will stop the
// full row editing.
if (!this.gridOptionsWrapper.isFullRowEdit()) {
this.eSelect.onValueChange(function () { return params.stopEditing(); });
}
};
SelectCellEditor.prototype.afterGuiAttached = function () {
if (this.focusAfterAttached) {
this.eSelect.getFocusableElement().focus();
}
if (this.startedByEnter) {
this.eSelect.showPicker();
}
};
SelectCellEditor.prototype.focusIn = function () {
this.eSelect.getFocusableElement().focus();
};
SelectCellEditor.prototype.getValue = function () {
return this.eSelect.getValue();
};
SelectCellEditor.prototype.isPopup = function () {
return false;
};
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('valueFormatterService')
], SelectCellEditor.prototype, "valueFormatterService", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_2__["RefSelector"])('eSelect')
], SelectCellEditor.prototype, "eSelect", void 0);
return SelectCellEditor;
}(_widgets_popupComponent__WEBPACK_IMPORTED_MODULE_1__["PopupComponent"]));
/***/ }),
/* 79 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PopupTextCellEditor", function() { return PopupTextCellEditor; });
/* harmony import */ var _textCellEditor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(34);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var PopupTextCellEditor = /** @class */ (function (_super) {
__extends(PopupTextCellEditor, _super);
function PopupTextCellEditor() {
return _super !== null && _super.apply(this, arguments) || this;
}
PopupTextCellEditor.prototype.isPopup = function () {
return true;
};
return PopupTextCellEditor;
}(_textCellEditor__WEBPACK_IMPORTED_MODULE_0__["TextCellEditor"]));
/***/ }),
/* 80 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PopupSelectCellEditor", function() { return PopupSelectCellEditor; });
/* harmony import */ var _selectCellEditor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var PopupSelectCellEditor = /** @class */ (function (_super) {
__extends(PopupSelectCellEditor, _super);
function PopupSelectCellEditor() {
return _super !== null && _super.apply(this, arguments) || this;
}
PopupSelectCellEditor.prototype.isPopup = function () {
return true;
};
return PopupSelectCellEditor;
}(_selectCellEditor__WEBPACK_IMPORTED_MODULE_0__["SelectCellEditor"]));
/***/ }),
/* 81 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LargeTextCellEditor", function() { return LargeTextCellEditor; });
/* harmony import */ var _widgets_popupComponent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(35);
/* harmony import */ var _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(57);
/* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7);
/* harmony import */ var _constants_keyCode__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(58);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 LargeTextCellEditor = /** @class */ (function (_super) {
__extends(LargeTextCellEditor, _super);
function LargeTextCellEditor() {
return _super.call(this, LargeTextCellEditor.TEMPLATE) || this;
}
LargeTextCellEditor.prototype.init = function (params) {
this.params = params;
this.focusAfterAttached = params.cellStartedEdit;
this.eTextArea
.setMaxLength(params.maxLength || 200)
.setCols(params.cols || 60)
.setRows(params.rows || 10);
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_2__["exists"])(params.value)) {
this.eTextArea.setValue(params.value.toString(), true);
}
this.addGuiEventListener('keydown', this.onKeyDown.bind(this));
};
LargeTextCellEditor.prototype.onKeyDown = function (event) {
var key = event.which || event.keyCode;
if (key === _constants_keyCode__WEBPACK_IMPORTED_MODULE_3__["KeyCode"].LEFT ||
key === _constants_keyCode__WEBPACK_IMPORTED_MODULE_3__["KeyCode"].UP ||
key === _constants_keyCode__WEBPACK_IMPORTED_MODULE_3__["KeyCode"].RIGHT ||
key === _constants_keyCode__WEBPACK_IMPORTED_MODULE_3__["KeyCode"].DOWN ||
(event.shiftKey && key === _constants_keyCode__WEBPACK_IMPORTED_MODULE_3__["KeyCode"].ENTER)) { // shift+enter allows for newlines
event.stopPropagation();
}
};
LargeTextCellEditor.prototype.afterGuiAttached = function () {
var translate = this.gridOptionsWrapper.getLocaleTextFunc();
this.eTextArea.setInputAriaLabel(translate('ariaInputEditor', 'Input Editor'));
if (this.focusAfterAttached) {
this.eTextArea.getFocusableElement().focus();
}
};
LargeTextCellEditor.prototype.getValue = function () {
return this.params.parseValue(this.eTextArea.getValue());
};
LargeTextCellEditor.TEMPLATE = "
\n \n
";
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_1__["RefSelector"])("eTextArea")
], LargeTextCellEditor.prototype, "eTextArea", void 0);
return LargeTextCellEditor;
}(_widgets_popupComponent__WEBPACK_IMPORTED_MODULE_0__["PopupComponent"]));
/***/ }),
/* 82 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NumberFilter", function() { return NumberFilter; });
/* harmony import */ var _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57);
/* harmony import */ var _simpleFilter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(61);
/* harmony import */ var _scalarFilter__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(66);
/* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7);
/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(42);
/* harmony import */ var _utils_browser__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(43);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 NumberFilter = /** @class */ (function (_super) {
__extends(NumberFilter, _super);
function NumberFilter() {
return _super.call(this, 'numberFilter') || this;
}
NumberFilter.prototype.mapRangeFromModel = function (filterModel) {
return {
from: filterModel.filter,
to: filterModel.filterTo
};
};
NumberFilter.prototype.getDefaultDebounceMs = function () {
return 500;
};
NumberFilter.prototype.resetUiToDefaults = function (silent) {
var _this = this;
return _super.prototype.resetUiToDefaults.call(this, silent).then(function () {
var fields = [_this.eValueFrom1, _this.eValueFrom2, _this.eValueTo1, _this.eValueTo2];
fields.forEach(function (field) { return field.setValue(null, silent); });
_this.resetPlaceholder();
});
};
NumberFilter.prototype.setConditionIntoUi = function (model, position) {
var positionOne = position === _simpleFilter__WEBPACK_IMPORTED_MODULE_1__["ConditionPosition"].One;
var eValueFrom = positionOne ? this.eValueFrom1 : this.eValueFrom2;
var eValueTo = positionOne ? this.eValueTo1 : this.eValueTo2;
eValueFrom.setValue(model ? ('' + model.filter) : null);
eValueTo.setValue(model ? ('' + model.filterTo) : null);
};
NumberFilter.prototype.setValueFromFloatingFilter = function (value) {
this.eValueFrom1.setValue(value);
this.eValueTo1.setValue(null);
this.eValueFrom2.setValue(null);
this.eValueTo2.setValue(null);
};
NumberFilter.prototype.comparator = function () {
return function (left, right) {
if (left === right) {
return 0;
}
return left < right ? 1 : -1;
};
};
NumberFilter.prototype.setParams = function (params) {
this.numberFilterParams = params;
var allowedCharPattern = this.getAllowedCharPattern();
if (allowedCharPattern) {
var config = { allowedCharPattern: allowedCharPattern };
this.resetTemplate({
eValueFrom1: config,
eValueTo1: config,
eValueFrom2: config,
eValueTo2: config,
});
}
_super.prototype.setParams.call(this, params);
this.addValueChangedListeners();
};
NumberFilter.prototype.addValueChangedListeners = function () {
var _this = this;
var listener = function () { return _this.onUiChanged(); };
this.eValueFrom1.onValueChange(listener);
this.eValueTo1.onValueChange(listener);
this.eValueFrom2.onValueChange(listener);
this.eValueTo2.onValueChange(listener);
};
NumberFilter.prototype.resetPlaceholder = function () {
var globalTranslate = this.gridOptionsWrapper.getLocaleTextFunc();
var isRange1 = this.showValueTo(this.getCondition1Type());
var isRange2 = this.showValueTo(this.getCondition2Type());
this.eValueFrom1.setInputPlaceholder(this.translate(isRange1 ? 'inRangeStart' : 'filterOoo'));
this.eValueFrom1.setInputAriaLabel(isRange1
? globalTranslate('ariaFilterFromValue', 'Filter from value')
: globalTranslate('ariaFilterValue', 'Filter Value'));
this.eValueTo1.setInputPlaceholder(this.translate('inRangeEnd'));
this.eValueTo1.setInputAriaLabel(globalTranslate('ariaFilterToValue', 'Filter to Value'));
this.eValueFrom2.setInputPlaceholder(this.translate(isRange2 ? 'inRangeStart' : 'filterOoo'));
this.eValueFrom2.setInputAriaLabel(isRange2
? globalTranslate('ariaFilterFromValue', 'Filter from value')
: globalTranslate('ariaFilterValue', 'Filter Value'));
this.eValueTo2.setInputPlaceholder(this.translate('inRangeEnd'));
this.eValueTo2.setInputAriaLabel(globalTranslate('ariaFilterToValue', 'Filter to Value'));
};
NumberFilter.prototype.afterGuiAttached = function (params) {
_super.prototype.afterGuiAttached.call(this, params);
this.resetPlaceholder();
if (!params || !params.suppressFocus) {
this.eValueFrom1.getInputElement().focus();
}
};
NumberFilter.prototype.getDefaultFilterOptions = function () {
return NumberFilter.DEFAULT_FILTER_OPTIONS;
};
NumberFilter.prototype.createValueTemplate = function (position) {
var pos = position === _simpleFilter__WEBPACK_IMPORTED_MODULE_1__["ConditionPosition"].One ? '1' : '2';
var allowedCharPattern = this.getAllowedCharPattern();
var agElementTag = allowedCharPattern ? 'ag-input-text-field' : 'ag-input-number-field';
return /* html */ "\n
";
};
NumberFilter.prototype.isConditionUiComplete = function (position) {
var positionOne = position === _simpleFilter__WEBPACK_IMPORTED_MODULE_1__["ConditionPosition"].One;
var option = positionOne ? this.getCondition1Type() : this.getCondition2Type();
if (option === _simpleFilter__WEBPACK_IMPORTED_MODULE_1__["SimpleFilter"].EMPTY) {
return false;
}
if (this.doesFilterHaveHiddenInput(option)) {
return true;
}
var eValue = positionOne ? this.eValueFrom1 : this.eValueFrom2;
var eValueTo = positionOne ? this.eValueTo1 : this.eValueTo2;
var value = this.stringToFloat(eValue.getValue());
return value != null && (!this.showValueTo(option) || this.stringToFloat(eValueTo.getValue()) != null);
};
NumberFilter.prototype.areSimpleModelsEqual = function (aSimple, bSimple) {
return aSimple.filter === bSimple.filter
&& aSimple.filterTo === bSimple.filterTo
&& aSimple.type === bSimple.type;
};
NumberFilter.prototype.getFilterType = function () {
return 'number';
};
NumberFilter.prototype.stringToFloat = function (value) {
if (typeof value === 'number') {
return value;
}
var filterText = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_3__["makeNull"])(value);
if (filterText != null && filterText.trim() === '') {
filterText = null;
}
if (this.numberFilterParams.numberParser) {
return this.numberFilterParams.numberParser(filterText);
}
return filterText == null || filterText.trim() === '-' ? null : parseFloat(filterText);
};
NumberFilter.prototype.createCondition = function (position) {
var positionOne = position === _simpleFilter__WEBPACK_IMPORTED_MODULE_1__["ConditionPosition"].One;
var type = positionOne ? this.getCondition1Type() : this.getCondition2Type();
var eValue = positionOne ? this.eValueFrom1 : this.eValueFrom2;
var value = this.stringToFloat(eValue.getValue());
var model = {
filterType: this.getFilterType(),
type: type
};
if (!this.doesFilterHaveHiddenInput(type)) {
model.filter = value;
if (this.showValueTo(type)) {
var eValueTo = positionOne ? this.eValueTo1 : this.eValueTo2;
var valueTo = this.stringToFloat(eValueTo.getValue());
model.filterTo = valueTo;
}
}
return model;
};
NumberFilter.prototype.updateUiVisibility = function () {
_super.prototype.updateUiVisibility.call(this);
this.resetPlaceholder();
var condition1Type = this.getCondition1Type();
var condition2Type = this.getCondition2Type();
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_4__["setDisplayed"])(this.eValueFrom1.getGui(), this.showValueFrom(condition1Type));
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_4__["setDisplayed"])(this.eValueTo1.getGui(), this.showValueTo(condition1Type));
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_4__["setDisplayed"])(this.eValueFrom2.getGui(), this.showValueFrom(condition2Type));
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_4__["setDisplayed"])(this.eValueTo2.getGui(), this.showValueTo(condition2Type));
};
NumberFilter.prototype.getAllowedCharPattern = function () {
var allowedCharPattern = (this.numberFilterParams || {}).allowedCharPattern;
if (allowedCharPattern) {
return allowedCharPattern;
}
if (!Object(_utils_browser__WEBPACK_IMPORTED_MODULE_5__["isBrowserChrome"])() && !Object(_utils_browser__WEBPACK_IMPORTED_MODULE_5__["isBrowserEdge"])()) {
// only Chrome and Edge support the HTML5 number field, so for other browsers we provide an equivalent
// constraint instead
return '\\d\\-\\.';
}
return null;
};
NumberFilter.DEFAULT_FILTER_OPTIONS = [
_scalarFilter__WEBPACK_IMPORTED_MODULE_2__["ScalarFilter"].EQUALS,
_scalarFilter__WEBPACK_IMPORTED_MODULE_2__["ScalarFilter"].NOT_EQUAL,
_scalarFilter__WEBPACK_IMPORTED_MODULE_2__["ScalarFilter"].LESS_THAN,
_scalarFilter__WEBPACK_IMPORTED_MODULE_2__["ScalarFilter"].LESS_THAN_OR_EQUAL,
_scalarFilter__WEBPACK_IMPORTED_MODULE_2__["ScalarFilter"].GREATER_THAN,
_scalarFilter__WEBPACK_IMPORTED_MODULE_2__["ScalarFilter"].GREATER_THAN_OR_EQUAL,
_scalarFilter__WEBPACK_IMPORTED_MODULE_2__["ScalarFilter"].IN_RANGE
];
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__["RefSelector"])('eValueFrom1')
], NumberFilter.prototype, "eValueFrom1", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__["RefSelector"])('eValueTo1')
], NumberFilter.prototype, "eValueTo1", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__["RefSelector"])('eValueFrom2')
], NumberFilter.prototype, "eValueFrom2", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__["RefSelector"])('eValueTo2')
], NumberFilter.prototype, "eValueTo2", void 0);
return NumberFilter;
}(_scalarFilter__WEBPACK_IMPORTED_MODULE_2__["ScalarFilter"]));
/***/ }),
/* 83 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LoadingOverlayComponent", function() { return LoadingOverlayComponent; });
/* harmony import */ var _widgets_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(36);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var LoadingOverlayComponent = /** @class */ (function (_super) {
__extends(LoadingOverlayComponent, _super);
function LoadingOverlayComponent() {
return _super.call(this) || this;
}
// this is a user component, and IComponent has "public destroy()" as part of the interface.
// so we need to override destroy() just to make the method public.
LoadingOverlayComponent.prototype.destroy = function () {
_super.prototype.destroy.call(this);
};
LoadingOverlayComponent.prototype.init = function (params) {
var template = this.gridOptionsWrapper.getOverlayLoadingTemplate() ?
this.gridOptionsWrapper.getOverlayLoadingTemplate() : LoadingOverlayComponent.DEFAULT_LOADING_OVERLAY_TEMPLATE;
var localeTextFunc = this.gridOptionsWrapper.getLocaleTextFunc();
var localisedTemplate = template.replace('[LOADING...]', localeTextFunc('loadingOoo', 'Loading...'));
this.setTemplate(localisedTemplate);
};
LoadingOverlayComponent.DEFAULT_LOADING_OVERLAY_TEMPLATE = '[LOADING...]';
return LoadingOverlayComponent;
}(_widgets_component__WEBPACK_IMPORTED_MODULE_0__["Component"]));
/***/ }),
/* 84 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NoRowsOverlayComponent", function() { return NoRowsOverlayComponent; });
/* harmony import */ var _widgets_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(36);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var NoRowsOverlayComponent = /** @class */ (function (_super) {
__extends(NoRowsOverlayComponent, _super);
function NoRowsOverlayComponent() {
return _super.call(this) || this;
}
// this is a user component, and IComponent has "public destroy()" as part of the interface.
// so we need to override destroy() just to make the method public.
NoRowsOverlayComponent.prototype.destroy = function () {
_super.prototype.destroy.call(this);
};
NoRowsOverlayComponent.prototype.init = function (params) {
var template = this.gridOptionsWrapper.getOverlayNoRowsTemplate() ?
this.gridOptionsWrapper.getOverlayNoRowsTemplate() : NoRowsOverlayComponent.DEFAULT_NO_ROWS_TEMPLATE;
var localeTextFunc = this.gridOptionsWrapper.getLocaleTextFunc();
var localisedTemplate = template.replace('[NO_ROWS_TO_SHOW]', localeTextFunc('noRowsToShow', 'No Rows To Show'));
this.setTemplate(localisedTemplate);
};
NoRowsOverlayComponent.DEFAULT_NO_ROWS_TEMPLATE = '[NO_ROWS_TO_SHOW]';
return NoRowsOverlayComponent;
}(_widgets_component__WEBPACK_IMPORTED_MODULE_0__["Component"]));
/***/ }),
/* 85 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TooltipComponent", function() { return TooltipComponent; });
/* harmony import */ var _widgets_popupComponent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(35);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var TooltipComponent = /** @class */ (function (_super) {
__extends(TooltipComponent, _super);
function TooltipComponent() {
return _super.call(this, /* html */ "") || this;
}
// will need to type params
TooltipComponent.prototype.init = function (params) {
var value = params.value;
this.getGui().innerHTML = value;
};
return TooltipComponent;
}(_widgets_popupComponent__WEBPACK_IMPORTED_MODULE_0__["PopupComponent"]));
/***/ }),
/* 86 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DefaultDateComponent", function() { return DefaultDateComponent; });
/* harmony import */ var _widgets_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(36);
/* harmony import */ var _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(57);
/* harmony import */ var _utils_date__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(45);
/* harmony import */ var _utils_browser__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(43);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 DefaultDateComponent = /** @class */ (function (_super) {
__extends(DefaultDateComponent, _super);
function DefaultDateComponent() {
return _super.call(this, /* html */ "\n
\n \n
") || this;
}
// this is a user component, and IComponent has "public destroy()" as part of the interface.
// so we need to override destroy() just to make the method public.
DefaultDateComponent.prototype.destroy = function () {
_super.prototype.destroy.call(this);
};
DefaultDateComponent.prototype.init = function (params) {
var inputElement = this.eDateInput.getInputElement();
if (this.shouldUseBrowserDatePicker(params)) {
if (Object(_utils_browser__WEBPACK_IMPORTED_MODULE_3__["isBrowserIE"])()) {
console.warn('ag-grid: browserDatePicker is specified to true, but it is not supported in IE 11; reverting to text date picker');
}
else {
inputElement.type = 'date';
}
}
// ensures that the input element is focussed when a clear button is clicked
this.addManagedListener(inputElement, 'mousedown', function () { return inputElement.focus(); });
this.addManagedListener(this.eDateInput.getInputElement(), 'input', function (e) {
if (e.target !== document.activeElement) {
return;
}
params.onDateChanged();
});
};
DefaultDateComponent.prototype.getDate = function () {
return Object(_utils_date__WEBPACK_IMPORTED_MODULE_2__["parseDateTimeFromString"])(this.eDateInput.getValue());
};
DefaultDateComponent.prototype.setDate = function (date) {
this.eDateInput.setValue(Object(_utils_date__WEBPACK_IMPORTED_MODULE_2__["serialiseDate"])(date, false));
};
DefaultDateComponent.prototype.setInputPlaceholder = function (placeholder) {
this.eDateInput.setInputPlaceholder(placeholder);
};
DefaultDateComponent.prototype.afterGuiAttached = function (params) {
if (!params || !params.suppressFocus) {
this.eDateInput.getInputElement().focus();
}
};
DefaultDateComponent.prototype.shouldUseBrowserDatePicker = function (params) {
if (params.filterParams && params.filterParams.browserDatePicker != null) {
return params.filterParams.browserDatePicker;
}
else {
return Object(_utils_browser__WEBPACK_IMPORTED_MODULE_3__["isBrowserChrome"])() || Object(_utils_browser__WEBPACK_IMPORTED_MODULE_3__["isBrowserFirefox"])();
}
};
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_1__["RefSelector"])('eDateInput')
], DefaultDateComponent.prototype, "eDateInput", void 0);
return DefaultDateComponent;
}(_widgets_component__WEBPACK_IMPORTED_MODULE_0__["Component"]));
/***/ }),
/* 87 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DateFloatingFilter", function() { return DateFloatingFilter; });
/* harmony import */ var _dateFilter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(59);
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12);
/* harmony import */ var _dateCompWrapper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(60);
/* harmony import */ var _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(57);
/* harmony import */ var _simpleFilter__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(61);
/* harmony import */ var _floating_provided_simpleFloatingFilter__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(88);
/* harmony import */ var _providedFilter__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(63);
/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(42);
/* harmony import */ var _utils_date__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(45);
/* harmony import */ var _utils_function__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(15);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 DateFloatingFilter = /** @class */ (function (_super) {
__extends(DateFloatingFilter, _super);
function DateFloatingFilter() {
return _super.call(this, /* html */ "\n
\n \n \n
") || this;
}
DateFloatingFilter.prototype.getDefaultFilterOptions = function () {
return _dateFilter__WEBPACK_IMPORTED_MODULE_0__["DateFilter"].DEFAULT_FILTER_OPTIONS;
};
DateFloatingFilter.prototype.conditionToString = function (condition) {
var type = condition.type;
var dateFrom = Object(_utils_date__WEBPACK_IMPORTED_MODULE_8__["parseDateTimeFromString"])(condition.dateFrom);
if (type === _simpleFilter__WEBPACK_IMPORTED_MODULE_4__["SimpleFilter"].IN_RANGE) {
var dateTo = Object(_utils_date__WEBPACK_IMPORTED_MODULE_8__["parseDateTimeFromString"])(condition.dateTo);
return Object(_utils_date__WEBPACK_IMPORTED_MODULE_8__["serialiseDate"])(dateFrom, false) + "-" + Object(_utils_date__WEBPACK_IMPORTED_MODULE_8__["serialiseDate"])(dateTo, false);
}
// cater for when the type doesn't need a value
return dateFrom == null ? "" + type : "" + Object(_utils_date__WEBPACK_IMPORTED_MODULE_8__["serialiseDate"])(dateFrom, false);
};
DateFloatingFilter.prototype.init = function (params) {
_super.prototype.init.call(this, params);
this.params = params;
this.createDateComponent();
var translate = this.gridOptionsWrapper.getLocaleTextFunc();
this.eReadOnlyText
.setDisabled(true)
.setInputAriaLabel(translate('ariaDateFilterInput', 'Date Filter Input'));
};
DateFloatingFilter.prototype.setEditable = function (editable) {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_7__["setDisplayed"])(this.eDateWrapper, editable);
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_7__["setDisplayed"])(this.eReadOnlyText.getGui(), !editable);
};
DateFloatingFilter.prototype.onParentModelChanged = function (model, event) {
// We don't want to update the floating filter if the floating filter caused the change,
// because the UI is already in sync. if we didn't do this, the UI would behave strangely
// as it would be updating as the user is typing
if (this.isEventFromFloatingFilter(event)) {
return;
}
_super.prototype.setLastTypeFromModel.call(this, model);
var allowEditing = this.canWeEditAfterModelFromParentFilter(model);
this.setEditable(allowEditing);
if (allowEditing) {
if (model) {
var dateModel = model;
this.dateComp.setDate(Object(_utils_date__WEBPACK_IMPORTED_MODULE_8__["parseDateTimeFromString"])(dateModel.dateFrom));
}
else {
this.dateComp.setDate(null);
}
this.eReadOnlyText.setValue('');
}
else {
this.eReadOnlyText.setValue(this.getTextFromModel(model));
this.dateComp.setDate(null);
}
};
DateFloatingFilter.prototype.onDateChanged = function () {
var _this = this;
var filterValueDate = this.dateComp.getDate();
var filterValueText = Object(_utils_date__WEBPACK_IMPORTED_MODULE_8__["serialiseDate"])(filterValueDate);
this.params.parentFilterInstance(function (filterInstance) {
if (filterInstance) {
var simpleFilter = filterInstance;
simpleFilter.onFloatingFilterChanged(_this.getLastType(), filterValueText);
}
});
};
DateFloatingFilter.prototype.createDateComponent = function () {
var _this = this;
var debounceMs = _providedFilter__WEBPACK_IMPORTED_MODULE_6__["ProvidedFilter"].getDebounceMs(this.params.filterParams, this.getDefaultDebounceMs());
var dateComponentParams = {
onDateChanged: Object(_utils_function__WEBPACK_IMPORTED_MODULE_9__["debounce"])(this.onDateChanged.bind(this), debounceMs),
filterParams: this.params.column.getColDef().filterParams
};
this.dateComp = new _dateCompWrapper__WEBPACK_IMPORTED_MODULE_2__["DateCompWrapper"](this.getContext(), this.userComponentFactory, dateComponentParams, this.eDateWrapper);
this.addDestroyFunc(function () { return _this.dateComp.destroy(); });
};
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('userComponentFactory')
], DateFloatingFilter.prototype, "userComponentFactory", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_3__["RefSelector"])('eReadOnlyText')
], DateFloatingFilter.prototype, "eReadOnlyText", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_3__["RefSelector"])('eDateWrapper')
], DateFloatingFilter.prototype, "eDateWrapper", void 0);
return DateFloatingFilter;
}(_floating_provided_simpleFloatingFilter__WEBPACK_IMPORTED_MODULE_5__["SimpleFloatingFilter"]));
/***/ }),
/* 88 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleFloatingFilter", function() { return SimpleFloatingFilter; });
/* harmony import */ var _widgets_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(36);
/* harmony import */ var _provided_simpleFilter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(61);
/* harmony import */ var _provided_optionsFactory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(62);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var SimpleFloatingFilter = /** @class */ (function (_super) {
__extends(SimpleFloatingFilter, _super);
function SimpleFloatingFilter() {
return _super !== null && _super.apply(this, arguments) || this;
}
SimpleFloatingFilter.prototype.getDefaultDebounceMs = function () {
return 0;
};
// this is a user component, and IComponent has "public destroy()" as part of the interface.
// so we need to override destroy() just to make the method public.
SimpleFloatingFilter.prototype.destroy = function () {
_super.prototype.destroy.call(this);
};
// used by:
// 1) NumberFloatingFilter & TextFloatingFilter: Always, for both when editable and read only.
// 2) DateFloatingFilter: Only when read only (as we show text rather than a date picker when read only)
SimpleFloatingFilter.prototype.getTextFromModel = function (model) {
if (!model) {
return null;
}
var isCombined = model.operator;
if (isCombined) {
var combinedModel = model;
var con1Str = this.conditionToString(combinedModel.condition1);
var con2Str = this.conditionToString(combinedModel.condition2);
return con1Str + " " + combinedModel.operator + " " + con2Str;
}
else {
var condition = model;
return this.conditionToString(condition);
}
};
SimpleFloatingFilter.prototype.isEventFromFloatingFilter = function (event) {
return event && event.afterFloatingFilter;
};
SimpleFloatingFilter.prototype.getLastType = function () {
return this.lastType;
};
SimpleFloatingFilter.prototype.setLastTypeFromModel = function (model) {
// if no model provided by the parent filter use default
if (!model) {
this.lastType = this.optionsFactory.getDefaultOption();
return;
}
var isCombined = model.operator;
var condition;
if (isCombined) {
var combinedModel = model;
condition = combinedModel.condition1;
}
else {
condition = model;
}
this.lastType = condition.type;
};
SimpleFloatingFilter.prototype.canWeEditAfterModelFromParentFilter = function (model) {
if (!model) {
// if no model, then we can edit as long as the lastType is something we can edit, as this
// is the type we will provide to the parent filter if the user decides to use the floating filter.
return this.isTypeEditable(this.lastType);
}
// never allow editing if the filter is combined (ie has two parts)
var isCombined = model.operator;
if (isCombined) {
return false;
}
var simpleModel = model;
return this.isTypeEditable(simpleModel.type);
};
SimpleFloatingFilter.prototype.init = function (params) {
this.optionsFactory = new _provided_optionsFactory__WEBPACK_IMPORTED_MODULE_2__["OptionsFactory"]();
this.optionsFactory.init(params.filterParams, this.getDefaultFilterOptions());
this.lastType = this.optionsFactory.getDefaultOption();
// we are editable if:
// 1) there is a type (user has configured filter wrong if not type)
// AND
// 2) the default type is not 'in range'
var editable = this.isTypeEditable(this.lastType);
this.setEditable(editable);
};
SimpleFloatingFilter.prototype.doesFilterHaveHiddenInput = function (filterType) {
var customFilterOption = this.optionsFactory.getCustomOption(filterType);
return customFilterOption && customFilterOption.hideFilterInput;
};
SimpleFloatingFilter.prototype.isTypeEditable = function (type) {
return !this.doesFilterHaveHiddenInput(type) &&
type
&& type !== _provided_simpleFilter__WEBPACK_IMPORTED_MODULE_1__["SimpleFilter"].IN_RANGE
&& type !== _provided_simpleFilter__WEBPACK_IMPORTED_MODULE_1__["SimpleFilter"].EMPTY;
};
return SimpleFloatingFilter;
}(_widgets_component__WEBPACK_IMPORTED_MODULE_0__["Component"]));
/***/ }),
/* 89 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextFilter", function() { return TextFilter; });
/* harmony import */ var _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57);
/* harmony import */ var _simpleFilter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(61);
/* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7);
/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(42);
/* harmony import */ var _utils_array__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(14);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 TextFilter = /** @class */ (function (_super) {
__extends(TextFilter, _super);
function TextFilter() {
return _super.call(this, 'textFilter') || this;
}
TextFilter.cleanInput = function (value) {
var trimmedInput = value && value.trim();
// trim the input, unless it is all whitespace (this is consistent with Excel behaviour)
return trimmedInput === '' ? value : trimmedInput;
};
TextFilter.prototype.getDefaultDebounceMs = function () {
return 500;
};
TextFilter.prototype.getCleanValue = function (inputField) {
return TextFilter.cleanInput(Object(_utils_generic__WEBPACK_IMPORTED_MODULE_2__["makeNull"])(inputField.getValue()));
};
TextFilter.prototype.addValueChangedListeners = function () {
var _this = this;
var listener = function () { return _this.onUiChanged(); };
this.eValue1.onValueChange(listener);
this.eValue2.onValueChange(listener);
};
TextFilter.prototype.setParams = function (params) {
_super.prototype.setParams.call(this, params);
this.textFilterParams = params;
this.comparator = this.textFilterParams.textCustomComparator || TextFilter.DEFAULT_COMPARATOR;
this.formatter = this.textFilterParams.textFormatter ||
(this.textFilterParams.caseSensitive == true
? TextFilter.DEFAULT_FORMATTER
: TextFilter.DEFAULT_LOWERCASE_FORMATTER);
this.addValueChangedListeners();
};
TextFilter.prototype.setConditionIntoUi = function (model, position) {
var positionOne = position === _simpleFilter__WEBPACK_IMPORTED_MODULE_1__["ConditionPosition"].One;
var eValue = positionOne ? this.eValue1 : this.eValue2;
eValue.setValue(model ? model.filter : null);
};
TextFilter.prototype.createCondition = function (position) {
var positionOne = position === _simpleFilter__WEBPACK_IMPORTED_MODULE_1__["ConditionPosition"].One;
var type = positionOne ? this.getCondition1Type() : this.getCondition2Type();
var eValue = positionOne ? this.eValue1 : this.eValue2;
var value = this.getCleanValue(eValue);
eValue.setValue(value, true); // ensure clean value is visible
var model = {
filterType: this.getFilterType(),
type: type
};
if (!this.doesFilterHaveHiddenInput(type)) {
model.filter = value;
}
return model;
};
TextFilter.prototype.getFilterType = function () {
return 'text';
};
TextFilter.prototype.areSimpleModelsEqual = function (aSimple, bSimple) {
return aSimple.filter === bSimple.filter && aSimple.type === bSimple.type;
};
TextFilter.prototype.resetUiToDefaults = function (silent) {
var _this = this;
return _super.prototype.resetUiToDefaults.call(this, silent).then(function () {
_this.forEachInput(function (field) { return field.setValue(null, silent); });
_this.resetPlaceholder();
});
};
TextFilter.prototype.resetPlaceholder = function () {
var globalTranslate = this.gridOptionsWrapper.getLocaleTextFunc();
var placeholder = this.translate('filterOoo');
this.forEachInput(function (field) {
field.setInputPlaceholder(placeholder);
field.setInputAriaLabel(globalTranslate('ariaFilterValue', 'Filter Value'));
});
};
TextFilter.prototype.forEachInput = function (action) {
Object(_utils_array__WEBPACK_IMPORTED_MODULE_4__["forEach"])([this.eValue1, this.eValue2], action);
};
TextFilter.prototype.setValueFromFloatingFilter = function (value) {
this.eValue1.setValue(value);
this.eValue2.setValue(null);
};
TextFilter.prototype.getDefaultFilterOptions = function () {
return TextFilter.DEFAULT_FILTER_OPTIONS;
};
TextFilter.prototype.createValueTemplate = function (position) {
var pos = position === _simpleFilter__WEBPACK_IMPORTED_MODULE_1__["ConditionPosition"].One ? '1' : '2';
return /* html */ "\n
\n \n
";
};
TextFilter.prototype.updateUiVisibility = function () {
_super.prototype.updateUiVisibility.call(this);
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["setDisplayed"])(this.eCondition1Body, this.showValueFrom(this.getCondition1Type()));
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["setDisplayed"])(this.eCondition2Body, this.isCondition2Enabled() && this.showValueFrom(this.getCondition2Type()));
};
TextFilter.prototype.afterGuiAttached = function (params) {
_super.prototype.afterGuiAttached.call(this, params);
this.resetPlaceholder();
if (!params || !params.suppressFocus) {
this.eValue1.getInputElement().focus();
}
};
TextFilter.prototype.isConditionUiComplete = function (position) {
var positionOne = position === _simpleFilter__WEBPACK_IMPORTED_MODULE_1__["ConditionPosition"].One;
var option = positionOne ? this.getCondition1Type() : this.getCondition2Type();
if (option === _simpleFilter__WEBPACK_IMPORTED_MODULE_1__["SimpleFilter"].EMPTY) {
return false;
}
if (this.doesFilterHaveHiddenInput(option)) {
return true;
}
return this.getCleanValue(positionOne ? this.eValue1 : this.eValue2) != null;
};
TextFilter.prototype.individualConditionPasses = function (params, filterModel) {
var filterText = filterModel.filter;
var filterOption = filterModel.type;
var cellValue = this.textFilterParams.valueGetter(params.node);
var cellValueFormatted = this.formatter(cellValue);
var customFilterOption = this.optionsFactory.getCustomOption(filterOption);
if (customFilterOption) {
// only execute the custom filter if a value exists or a value isn't required, i.e. input is hidden
if (filterText != null || customFilterOption.hideFilterInput) {
return customFilterOption.test(filterText, cellValueFormatted);
}
}
if (cellValue == null) {
return filterOption === _simpleFilter__WEBPACK_IMPORTED_MODULE_1__["SimpleFilter"].NOT_EQUAL || filterOption === _simpleFilter__WEBPACK_IMPORTED_MODULE_1__["SimpleFilter"].NOT_CONTAINS;
}
var filterTextFormatted = this.formatter(filterText);
return this.comparator(filterOption, cellValueFormatted, filterTextFormatted);
};
TextFilter.DEFAULT_FILTER_OPTIONS = [
_simpleFilter__WEBPACK_IMPORTED_MODULE_1__["SimpleFilter"].CONTAINS,
_simpleFilter__WEBPACK_IMPORTED_MODULE_1__["SimpleFilter"].NOT_CONTAINS,
_simpleFilter__WEBPACK_IMPORTED_MODULE_1__["SimpleFilter"].EQUALS,
_simpleFilter__WEBPACK_IMPORTED_MODULE_1__["SimpleFilter"].NOT_EQUAL,
_simpleFilter__WEBPACK_IMPORTED_MODULE_1__["SimpleFilter"].STARTS_WITH,
_simpleFilter__WEBPACK_IMPORTED_MODULE_1__["SimpleFilter"].ENDS_WITH
];
TextFilter.DEFAULT_FORMATTER = function (from) { return from; };
TextFilter.DEFAULT_LOWERCASE_FORMATTER = function (from) {
return from == null ? null : from.toString().toLowerCase();
};
TextFilter.DEFAULT_COMPARATOR = function (filter, value, filterText) {
switch (filter) {
case TextFilter.CONTAINS:
return value.indexOf(filterText) >= 0;
case TextFilter.NOT_CONTAINS:
return value.indexOf(filterText) < 0;
case TextFilter.EQUALS:
return value === filterText;
case TextFilter.NOT_EQUAL:
return value != filterText;
case TextFilter.STARTS_WITH:
return value.indexOf(filterText) === 0;
case TextFilter.ENDS_WITH:
var index = value.lastIndexOf(filterText);
return index >= 0 && index === (value.length - filterText.length);
default:
// should never happen
console.warn('invalid filter type ' + filter);
return false;
}
};
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__["RefSelector"])('eValue1')
], TextFilter.prototype, "eValue1", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__["RefSelector"])('eValue2')
], TextFilter.prototype, "eValue2", void 0);
return TextFilter;
}(_simpleFilter__WEBPACK_IMPORTED_MODULE_1__["SimpleFilter"]));
/***/ }),
/* 90 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NumberFloatingFilter", function() { return NumberFloatingFilter; });
/* harmony import */ var _numberFilter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82);
/* harmony import */ var _simpleFilter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(61);
/* harmony import */ var _floating_provided_textInputFloatingFilter__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(91);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var NumberFloatingFilter = /** @class */ (function (_super) {
__extends(NumberFloatingFilter, _super);
function NumberFloatingFilter() {
return _super !== null && _super.apply(this, arguments) || this;
}
NumberFloatingFilter.prototype.getDefaultFilterOptions = function () {
return _numberFilter__WEBPACK_IMPORTED_MODULE_0__["NumberFilter"].DEFAULT_FILTER_OPTIONS;
};
NumberFloatingFilter.prototype.conditionToString = function (condition) {
var isRange = condition.type == _simpleFilter__WEBPACK_IMPORTED_MODULE_1__["SimpleFilter"].IN_RANGE;
if (isRange) {
return condition.filter + "-" + condition.filterTo;
}
// cater for when the type doesn't need a value
if (condition.filter != null) {
return "" + condition.filter;
}
return "" + condition.type;
};
return NumberFloatingFilter;
}(_floating_provided_textInputFloatingFilter__WEBPACK_IMPORTED_MODULE_2__["TextInputFloatingFilter"]));
/***/ }),
/* 91 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextInputFloatingFilter", function() { return TextInputFloatingFilter; });
/* harmony import */ var _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57);
/* harmony import */ var _utils_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15);
/* harmony import */ var _provided_providedFilter__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(63);
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(12);
/* harmony import */ var _simpleFloatingFilter__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(88);
/* harmony import */ var _utils_keyboard__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(48);
/* harmony import */ var _constants_keyCode__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(58);
/* harmony import */ var _provided_text_textFilter__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(89);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 TextInputFloatingFilter = /** @class */ (function (_super) {
__extends(TextInputFloatingFilter, _super);
function TextInputFloatingFilter() {
return _super !== null && _super.apply(this, arguments) || this;
}
TextInputFloatingFilter.prototype.postConstruct = function () {
this.setTemplate(/* html */ "\n
\n \n
");
};
TextInputFloatingFilter.prototype.getDefaultDebounceMs = function () {
return 500;
};
TextInputFloatingFilter.prototype.onParentModelChanged = function (model, event) {
if (this.isEventFromFloatingFilter(event)) {
// if the floating filter triggered the change, it is already in sync
return;
}
this.setLastTypeFromModel(model);
this.eFloatingFilterInput.setValue(this.getTextFromModel(model));
this.setEditable(this.canWeEditAfterModelFromParentFilter(model));
};
TextInputFloatingFilter.prototype.init = function (params) {
_super.prototype.init.call(this, params);
this.params = params;
this.applyActive = _provided_providedFilter__WEBPACK_IMPORTED_MODULE_2__["ProvidedFilter"].isUseApplyButton(this.params.filterParams);
var debounceMs = _provided_providedFilter__WEBPACK_IMPORTED_MODULE_2__["ProvidedFilter"].getDebounceMs(this.params.filterParams, this.getDefaultDebounceMs());
var toDebounce = Object(_utils_function__WEBPACK_IMPORTED_MODULE_1__["debounce"])(this.syncUpWithParentFilter.bind(this), debounceMs);
var filterGui = this.eFloatingFilterInput.getGui();
this.addManagedListener(filterGui, 'input', toDebounce);
this.addManagedListener(filterGui, 'keypress', toDebounce);
this.addManagedListener(filterGui, 'keydown', toDebounce);
var columnDef = params.column.getDefinition();
if (columnDef.filterParams &&
columnDef.filterParams.filterOptions &&
columnDef.filterParams.filterOptions.length === 1 &&
columnDef.filterParams.filterOptions[0] === 'inRange') {
this.eFloatingFilterInput.setDisabled(true);
}
var displayName = this.columnController.getDisplayNameForColumn(params.column, 'header', true);
var translate = this.gridOptionsWrapper.getLocaleTextFunc();
this.eFloatingFilterInput.setInputAriaLabel(displayName + " " + translate('ariaFilterInput', 'Filter Input'));
};
TextInputFloatingFilter.prototype.syncUpWithParentFilter = function (e) {
var _this = this;
var enterKeyPressed = Object(_utils_keyboard__WEBPACK_IMPORTED_MODULE_5__["isKeyPressed"])(e, _constants_keyCode__WEBPACK_IMPORTED_MODULE_6__["KeyCode"].ENTER);
if (this.applyActive && !enterKeyPressed) {
return;
}
var value = _provided_text_textFilter__WEBPACK_IMPORTED_MODULE_7__["TextFilter"].cleanInput(this.eFloatingFilterInput.getValue());
this.eFloatingFilterInput.setValue(value, true); // ensure visible value is clean
this.params.parentFilterInstance(function (filterInstance) {
if (filterInstance) {
var simpleFilter = filterInstance;
simpleFilter.onFloatingFilterChanged(_this.getLastType(), value);
}
});
};
TextInputFloatingFilter.prototype.setEditable = function (editable) {
this.eFloatingFilterInput.setDisabled(!editable);
};
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_3__["Autowired"])('columnController')
], TextInputFloatingFilter.prototype, "columnController", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__["RefSelector"])('eFloatingFilterInput')
], TextInputFloatingFilter.prototype, "eFloatingFilterInput", void 0);
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_3__["PostConstruct"]
], TextInputFloatingFilter.prototype, "postConstruct", null);
return TextInputFloatingFilter;
}(_simpleFloatingFilter__WEBPACK_IMPORTED_MODULE_4__["SimpleFloatingFilter"]));
/***/ }),
/* 92 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextFloatingFilter", function() { return TextFloatingFilter; });
/* harmony import */ var _textFilter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(89);
/* harmony import */ var _floating_provided_textInputFloatingFilter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(91);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var TextFloatingFilter = /** @class */ (function (_super) {
__extends(TextFloatingFilter, _super);
function TextFloatingFilter() {
return _super !== null && _super.apply(this, arguments) || this;
}
TextFloatingFilter.prototype.conditionToString = function (condition) {
// it's not possible to have 'in range' for string, so no need to check for it.
// also cater for when the type doesn't need a value
if (condition.filter != null) {
return "" + condition.filter;
}
else {
return "" + condition.type;
}
};
TextFloatingFilter.prototype.getDefaultFilterOptions = function () {
return _textFilter__WEBPACK_IMPORTED_MODULE_0__["TextFilter"].DEFAULT_FILTER_OPTIONS;
};
return TextFloatingFilter;
}(_floating_provided_textInputFloatingFilter__WEBPACK_IMPORTED_MODULE_1__["TextInputFloatingFilter"]));
/***/ }),
/* 93 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initialiseAgGridWithAngular1", function() { return initialiseAgGridWithAngular1; });
/* harmony import */ var _grid__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(94);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
function initialiseAgGridWithAngular1(angular) {
var angularModule = angular.module("agGrid", []);
angularModule.directive("agGrid", function () {
return {
restrict: "A",
controller: ['$element', '$scope', '$compile', '$attrs', AngularDirectiveController],
scope: true
};
});
}
function AngularDirectiveController($element, $scope, $compile, $attrs) {
var gridOptions;
var quickFilterOnScope;
var keyOfGridInScope = $attrs.agGrid;
quickFilterOnScope = keyOfGridInScope + '.quickFilterText';
gridOptions = $scope.$eval(keyOfGridInScope);
if (!gridOptions) {
console.warn("WARNING - grid options for ag-Grid not found. Please ensure the attribute ag-grid points to a valid object on the scope");
return;
}
var eGridDiv = $element[0];
var gridParams = {
$scope: $scope,
$compile: $compile,
quickFilterOnScope: quickFilterOnScope
};
var grid = new _grid__WEBPACK_IMPORTED_MODULE_0__["Grid"](eGridDiv, gridOptions, gridParams);
$scope.$on("$destroy", function () {
grid.destroy();
grid = null;
});
}
/***/ }),
/* 94 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Grid", function() { return Grid; });
/* harmony import */ var _gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(95);
/* harmony import */ var _selectionController__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97);
/* harmony import */ var _columnController_columnApi__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(99);
/* harmony import */ var _columnController_columnController__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(22);
/* harmony import */ var _rendering_rowRenderer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(100);
/* harmony import */ var _headerRendering_headerRootComp__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(109);
/* harmony import */ var _filter_filterManager__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(131);
/* harmony import */ var _valueService_valueService__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(132);
/* harmony import */ var _eventService__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(11);
/* harmony import */ var _gridPanel_gridPanel__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(133);
/* harmony import */ var _gridApi__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(136);
/* harmony import */ var _columnController_columnFactory__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(5);
/* harmony import */ var _columnController_displayedGroupCreator__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(29);
/* harmony import */ var _valueService_expressionService__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(137);
/* harmony import */ var _templateService__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(138);
/* harmony import */ var _widgets_popupService__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(139);
/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(140);
/* harmony import */ var _columnController_columnUtils__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(27);
/* harmony import */ var _rendering_autoWidthCalculator__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(141);
/* harmony import */ var _headerRendering_horizontalResizeService__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(142);
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(12);
/* harmony import */ var _gridCore__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(143);
/* harmony import */ var _headerRendering_standardMenu__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(144);
/* harmony import */ var _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(105);
/* harmony import */ var _dragAndDrop_dragService__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(145);
/* harmony import */ var _sortController__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(146);
/* harmony import */ var _focusController__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(147);
/* harmony import */ var _gridPanel_mouseEventService__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(148);
/* harmony import */ var _cellNavigationService__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(149);
/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(23);
/* harmony import */ var _rendering_valueFormatterService__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(150);
/* harmony import */ var _widgets_agCheckbox__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(117);
/* harmony import */ var _widgets_agRadioButton__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(151);
/* harmony import */ var _vanillaFrameworkOverrides__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(152);
/* harmony import */ var _gridPanel_scrollVisibleService__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(153);
/* harmony import */ var _styling_stylingService__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(154);
/* harmony import */ var _rendering_columnHoverService__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(155);
/* harmony import */ var _rendering_columnAnimationService__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(156);
/* harmony import */ var _columnController_autoGroupColService__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(157);
/* harmony import */ var _pagination_paginationProxy__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(158);
/* harmony import */ var _pagination_paginationAutoPageSizeService__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(159);
/* harmony import */ var _constants_constants__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(16);
/* harmony import */ var _valueService_valueCache__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(160);
/* harmony import */ var _valueService_changeDetectionService__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(161);
/* harmony import */ var _alignedGridsService__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(162);
/* harmony import */ var _components_framework_userComponentFactory__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(73);
/* harmony import */ var _components_framework_userComponentRegistry__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(33);
/* harmony import */ var _components_framework_agComponentUtils__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(163);
/* harmony import */ var _components_framework_componentMetadataProvider__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(164);
/* harmony import */ var _rendering_beans__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(165);
/* harmony import */ var _environment__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(166);
/* harmony import */ var _misc_animationFrameService__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(167);
/* harmony import */ var _gridPanel_navigationService__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(168);
/* harmony import */ var _rendering_maxDivHeightScaler__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(169);
/* harmony import */ var _rowNodes_selectableService__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(170);
/* harmony import */ var _rendering_row_autoHeightCalculator__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(171);
/* harmony import */ var _pagination_paginationComp__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(172);
/* harmony import */ var _misc_resizeObserverService__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(173);
/* harmony import */ var _rendering_overlays_overlayWrapperComponent__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(174);
/* harmony import */ var _widgets_agGroupComponent__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(175);
/* harmony import */ var _widgets_agDialog__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(176);
/* harmony import */ var _widgets_agPanel__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(177);
/* harmony import */ var _widgets_agInputTextField__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(178);
/* harmony import */ var _widgets_agInputTextArea__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(179);
/* harmony import */ var _widgets_agSlider__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(180);
/* harmony import */ var _widgets_agColorPicker__WEBPACK_IMPORTED_MODULE_65__ = __webpack_require__(181);
/* harmony import */ var _widgets_agInputNumberField__WEBPACK_IMPORTED_MODULE_66__ = __webpack_require__(184);
/* harmony import */ var _widgets_agInputRange__WEBPACK_IMPORTED_MODULE_67__ = __webpack_require__(185);
/* harmony import */ var _widgets_agSelect__WEBPACK_IMPORTED_MODULE_68__ = __webpack_require__(186);
/* harmony import */ var _widgets_agAngleSelect__WEBPACK_IMPORTED_MODULE_69__ = __webpack_require__(188);
/* harmony import */ var _widgets_agToggleButton__WEBPACK_IMPORTED_MODULE_70__ = __webpack_require__(189);
/* harmony import */ var _rendering_row_detailRowCompCache__WEBPACK_IMPORTED_MODULE_71__ = __webpack_require__(190);
/* harmony import */ var _entities_rowPosition__WEBPACK_IMPORTED_MODULE_72__ = __webpack_require__(191);
/* harmony import */ var _entities_cellPosition__WEBPACK_IMPORTED_MODULE_73__ = __webpack_require__(192);
/* harmony import */ var _pinnedRowModel_pinnedRowModel__WEBPACK_IMPORTED_MODULE_74__ = __webpack_require__(193);
/* harmony import */ var _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_75__ = __webpack_require__(18);
/* harmony import */ var _modules_moduleNames__WEBPACK_IMPORTED_MODULE_76__ = __webpack_require__(17);
/* harmony import */ var _undoRedo_undoRedoService__WEBPACK_IMPORTED_MODULE_77__ = __webpack_require__(194);
/* harmony import */ var _components_agStackComponentsRegistry__WEBPACK_IMPORTED_MODULE_78__ = __webpack_require__(196);
/* harmony import */ var _headerRendering_header_headerPosition__WEBPACK_IMPORTED_MODULE_79__ = __webpack_require__(197);
/* harmony import */ var _headerRendering_header_headerNavigationService__WEBPACK_IMPORTED_MODULE_80__ = __webpack_require__(129);
/* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_81__ = __webpack_require__(7);
/* harmony import */ var _utils_object__WEBPACK_IMPORTED_MODULE_82__ = __webpack_require__(13);
/* harmony import */ var _columnController_columnDefFactory__WEBPACK_IMPORTED_MODULE_83__ = __webpack_require__(198);
/* harmony import */ var _rendering_row_rowCssClassCalculator__WEBPACK_IMPORTED_MODULE_84__ = __webpack_require__(199);
/* harmony import */ var _rowNodeCache_rowNodeBlockLoader__WEBPACK_IMPORTED_MODULE_85__ = __webpack_require__(200);
/* harmony import */ var _rowNodes_rowNodeSorter__WEBPACK_IMPORTED_MODULE_86__ = __webpack_require__(202);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var Grid = /** @class */ (function () {
function Grid(eGridDiv, gridOptions, params) {
if (!eGridDiv) {
console.error('ag-Grid: no div element provided to the grid');
return;
}
if (!gridOptions) {
console.error('ag-Grid: no gridOptions provided to the grid');
return;
}
var debug = !!gridOptions.debug;
this.gridOptions = gridOptions;
var registeredModules = this.getRegisteredModules(params);
var beanClasses = this.createBeansList(registeredModules);
var providedBeanInstances = this.createProvidedBeans(eGridDiv, params);
if (!beanClasses) {
return;
} // happens when no row model found
var contextParams = {
providedBeanInstances: providedBeanInstances,
beanClasses: beanClasses,
debug: debug
};
this.logger = new _logger__WEBPACK_IMPORTED_MODULE_16__["Logger"]('ag-Grid', function () { return gridOptions.debug; });
var contextLogger = new _logger__WEBPACK_IMPORTED_MODULE_16__["Logger"]('Context', function () { return contextParams.debug; });
this.context = new _context_context__WEBPACK_IMPORTED_MODULE_20__["Context"](contextParams, contextLogger);
this.registerModuleUserComponents(registeredModules);
this.registerStackComponents(registeredModules);
var gridCoreClass = (params && params.rootComponent) || _gridCore__WEBPACK_IMPORTED_MODULE_21__["GridCore"];
var gridCore = new gridCoreClass();
this.context.createBean(gridCore);
this.setColumnsAndData();
this.dispatchGridReadyEvent(gridOptions);
var isEnterprise = _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_75__["ModuleRegistry"].isRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_76__["ModuleNames"].EnterpriseCoreModule);
this.logger.log("initialised successfully, enterprise = " + isEnterprise);
}
Grid.prototype.registerStackComponents = function (registeredModules) {
var agStackComponents = this.createAgStackComponentsList(registeredModules);
var agStackComponentsRegistry = this.context.getBean('agStackComponentsRegistry');
agStackComponentsRegistry.setupComponents(agStackComponents);
};
Grid.prototype.getRegisteredModules = function (params) {
var passedViaConstructor = params ? params.modules : null;
var registered = _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_75__["ModuleRegistry"].getRegisteredModules();
var allModules = [];
var mapNames = {};
// adds to list and removes duplicates
function addModule(moduleBased, mod) {
function addIndividualModule(currentModule) {
if (!mapNames[currentModule.moduleName]) {
mapNames[currentModule.moduleName] = true;
allModules.push(currentModule);
_modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_75__["ModuleRegistry"].register(currentModule, moduleBased);
}
}
addIndividualModule(module);
if (module.dependantModules) {
module.dependantModules.forEach(addModule.bind(null, moduleBased));
}
}
if (passedViaConstructor) {
passedViaConstructor.forEach(addModule.bind(null, true));
}
if (registered) {
registered.forEach(addModule.bind(null, !_modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_75__["ModuleRegistry"].isPackageBased()));
}
return allModules;
};
Grid.prototype.registerModuleUserComponents = function (registeredModules) {
var userComponentRegistry = this.context.getBean('userComponentRegistry');
var moduleUserComps = this.extractModuleEntity(registeredModules, function (module) { return module.userComponents ? module.userComponents : []; });
moduleUserComps.forEach(function (compMeta) {
userComponentRegistry.registerDefaultComponent(compMeta.componentName, compMeta.componentClass);
});
};
Grid.prototype.createProvidedBeans = function (eGridDiv, params) {
var frameworkOverrides = params ? params.frameworkOverrides : null;
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_81__["missing"])(frameworkOverrides)) {
frameworkOverrides = new _vanillaFrameworkOverrides__WEBPACK_IMPORTED_MODULE_33__["VanillaFrameworkOverrides"]();
}
var seed = {
gridOptions: this.gridOptions,
eGridDiv: eGridDiv,
$scope: params ? params.$scope : null,
$compile: params ? params.$compile : null,
quickFilterOnScope: params ? params.quickFilterOnScope : null,
globalEventListener: params ? params.globalEventListener : null,
frameworkOverrides: frameworkOverrides
};
if (params && params.providedBeanInstances) {
Object(_utils_object__WEBPACK_IMPORTED_MODULE_82__["assign"])(seed, params.providedBeanInstances);
}
return seed;
};
Grid.prototype.createAgStackComponentsList = function (registeredModules) {
var components = [
{ componentName: 'AgCheckbox', componentClass: _widgets_agCheckbox__WEBPACK_IMPORTED_MODULE_31__["AgCheckbox"] },
{ componentName: 'AgRadioButton', componentClass: _widgets_agRadioButton__WEBPACK_IMPORTED_MODULE_32__["AgRadioButton"] },
{ componentName: 'AgToggleButton', componentClass: _widgets_agToggleButton__WEBPACK_IMPORTED_MODULE_70__["AgToggleButton"] },
{ componentName: 'AgInputTextField', componentClass: _widgets_agInputTextField__WEBPACK_IMPORTED_MODULE_62__["AgInputTextField"] },
{ componentName: 'AgInputTextArea', componentClass: _widgets_agInputTextArea__WEBPACK_IMPORTED_MODULE_63__["AgInputTextArea"] },
{ componentName: 'AgInputNumberField', componentClass: _widgets_agInputNumberField__WEBPACK_IMPORTED_MODULE_66__["AgInputNumberField"] },
{ componentName: 'AgInputRange', componentClass: _widgets_agInputRange__WEBPACK_IMPORTED_MODULE_67__["AgInputRange"] },
{ componentName: 'AgSelect', componentClass: _widgets_agSelect__WEBPACK_IMPORTED_MODULE_68__["AgSelect"] },
{ componentName: 'AgSlider', componentClass: _widgets_agSlider__WEBPACK_IMPORTED_MODULE_64__["AgSlider"] },
{ componentName: 'AgAngleSelect', componentClass: _widgets_agAngleSelect__WEBPACK_IMPORTED_MODULE_69__["AgAngleSelect"] },
{ componentName: 'AgColorPicker', componentClass: _widgets_agColorPicker__WEBPACK_IMPORTED_MODULE_65__["AgColorPicker"] },
{ componentName: 'AgGridComp', componentClass: _gridPanel_gridPanel__WEBPACK_IMPORTED_MODULE_9__["GridPanel"] },
{ componentName: 'AgHeaderRoot', componentClass: _headerRendering_headerRootComp__WEBPACK_IMPORTED_MODULE_5__["HeaderRootComp"] },
{ componentName: 'AgPagination', componentClass: _pagination_paginationComp__WEBPACK_IMPORTED_MODULE_56__["PaginationComp"] },
{ componentName: 'AgOverlayWrapper', componentClass: _rendering_overlays_overlayWrapperComponent__WEBPACK_IMPORTED_MODULE_58__["OverlayWrapperComponent"] },
{ componentName: 'AgGroupComponent', componentClass: _widgets_agGroupComponent__WEBPACK_IMPORTED_MODULE_59__["AgGroupComponent"] },
{ componentName: 'AgPanel', componentClass: _widgets_agPanel__WEBPACK_IMPORTED_MODULE_61__["AgPanel"] },
{ componentName: 'AgDialog', componentClass: _widgets_agDialog__WEBPACK_IMPORTED_MODULE_60__["AgDialog"] }
];
var moduleAgStackComps = this.extractModuleEntity(registeredModules, function (module) { return module.agStackComponents ? module.agStackComponents : []; });
components = components.concat(moduleAgStackComps);
return components;
};
Grid.prototype.createBeansList = function (registeredModules) {
var rowModelClass = this.getRowModelClass(registeredModules);
if (!rowModelClass) {
return;
}
// beans should only contain SERVICES, it should NEVER contain COMPONENTS
var beans = [
rowModelClass, _rendering_beans__WEBPACK_IMPORTED_MODULE_49__["Beans"], _entities_rowPosition__WEBPACK_IMPORTED_MODULE_72__["RowPositionUtils"], _entities_cellPosition__WEBPACK_IMPORTED_MODULE_73__["CellPositionUtils"], _headerRendering_header_headerPosition__WEBPACK_IMPORTED_MODULE_79__["HeaderPositionUtils"],
_pagination_paginationAutoPageSizeService__WEBPACK_IMPORTED_MODULE_40__["PaginationAutoPageSizeService"], _gridApi__WEBPACK_IMPORTED_MODULE_10__["GridApi"], _components_framework_userComponentRegistry__WEBPACK_IMPORTED_MODULE_46__["UserComponentRegistry"], _components_framework_agComponentUtils__WEBPACK_IMPORTED_MODULE_47__["AgComponentUtils"],
_components_framework_componentMetadataProvider__WEBPACK_IMPORTED_MODULE_48__["ComponentMetadataProvider"], _misc_resizeObserverService__WEBPACK_IMPORTED_MODULE_57__["ResizeObserverService"], _components_framework_userComponentFactory__WEBPACK_IMPORTED_MODULE_45__["UserComponentFactory"],
_rendering_maxDivHeightScaler__WEBPACK_IMPORTED_MODULE_53__["MaxDivHeightScaler"], _rendering_row_autoHeightCalculator__WEBPACK_IMPORTED_MODULE_55__["AutoHeightCalculator"], _headerRendering_horizontalResizeService__WEBPACK_IMPORTED_MODULE_19__["HorizontalResizeService"],
_pinnedRowModel_pinnedRowModel__WEBPACK_IMPORTED_MODULE_74__["PinnedRowModel"], _dragAndDrop_dragService__WEBPACK_IMPORTED_MODULE_24__["DragService"], _columnController_displayedGroupCreator__WEBPACK_IMPORTED_MODULE_12__["DisplayedGroupCreator"], _eventService__WEBPACK_IMPORTED_MODULE_8__["EventService"], _gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__["GridOptionsWrapper"],
_widgets_popupService__WEBPACK_IMPORTED_MODULE_15__["PopupService"], _selectionController__WEBPACK_IMPORTED_MODULE_1__["SelectionController"], _filter_filterManager__WEBPACK_IMPORTED_MODULE_6__["FilterManager"], _columnController_columnController__WEBPACK_IMPORTED_MODULE_3__["ColumnController"], _headerRendering_header_headerNavigationService__WEBPACK_IMPORTED_MODULE_80__["HeaderNavigationService"],
_pagination_paginationProxy__WEBPACK_IMPORTED_MODULE_39__["PaginationProxy"], _rendering_rowRenderer__WEBPACK_IMPORTED_MODULE_4__["RowRenderer"], _valueService_expressionService__WEBPACK_IMPORTED_MODULE_13__["ExpressionService"], _columnController_columnFactory__WEBPACK_IMPORTED_MODULE_11__["ColumnFactory"], _templateService__WEBPACK_IMPORTED_MODULE_14__["TemplateService"],
_alignedGridsService__WEBPACK_IMPORTED_MODULE_44__["AlignedGridsService"], _gridPanel_navigationService__WEBPACK_IMPORTED_MODULE_52__["NavigationService"], _valueService_valueCache__WEBPACK_IMPORTED_MODULE_42__["ValueCache"], _valueService_valueService__WEBPACK_IMPORTED_MODULE_7__["ValueService"], _logger__WEBPACK_IMPORTED_MODULE_16__["LoggerFactory"],
_columnController_columnUtils__WEBPACK_IMPORTED_MODULE_17__["ColumnUtils"], _rendering_autoWidthCalculator__WEBPACK_IMPORTED_MODULE_18__["AutoWidthCalculator"], _headerRendering_standardMenu__WEBPACK_IMPORTED_MODULE_22__["StandardMenuFactory"], _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_23__["DragAndDropService"], _columnController_columnApi__WEBPACK_IMPORTED_MODULE_2__["ColumnApi"],
_focusController__WEBPACK_IMPORTED_MODULE_26__["FocusController"], _gridPanel_mouseEventService__WEBPACK_IMPORTED_MODULE_27__["MouseEventService"], _environment__WEBPACK_IMPORTED_MODULE_50__["Environment"], _cellNavigationService__WEBPACK_IMPORTED_MODULE_28__["CellNavigationService"], _rendering_valueFormatterService__WEBPACK_IMPORTED_MODULE_30__["ValueFormatterService"],
_styling_stylingService__WEBPACK_IMPORTED_MODULE_35__["StylingService"], _gridPanel_scrollVisibleService__WEBPACK_IMPORTED_MODULE_34__["ScrollVisibleService"], _sortController__WEBPACK_IMPORTED_MODULE_25__["SortController"], _rendering_columnHoverService__WEBPACK_IMPORTED_MODULE_36__["ColumnHoverService"], _rendering_columnAnimationService__WEBPACK_IMPORTED_MODULE_37__["ColumnAnimationService"],
_rowNodes_selectableService__WEBPACK_IMPORTED_MODULE_54__["SelectableService"], _columnController_autoGroupColService__WEBPACK_IMPORTED_MODULE_38__["AutoGroupColService"], _valueService_changeDetectionService__WEBPACK_IMPORTED_MODULE_43__["ChangeDetectionService"], _misc_animationFrameService__WEBPACK_IMPORTED_MODULE_51__["AnimationFrameService"],
_rendering_row_detailRowCompCache__WEBPACK_IMPORTED_MODULE_71__["DetailRowCompCache"], _undoRedo_undoRedoService__WEBPACK_IMPORTED_MODULE_77__["UndoRedoService"], _components_agStackComponentsRegistry__WEBPACK_IMPORTED_MODULE_78__["AgStackComponentsRegistry"], _columnController_columnDefFactory__WEBPACK_IMPORTED_MODULE_83__["ColumnDefFactory"],
_rendering_row_rowCssClassCalculator__WEBPACK_IMPORTED_MODULE_84__["RowCssClassCalculator"], _rowNodeCache_rowNodeBlockLoader__WEBPACK_IMPORTED_MODULE_85__["RowNodeBlockLoader"], _rowNodes_rowNodeSorter__WEBPACK_IMPORTED_MODULE_86__["RowNodeSorter"]
];
var moduleBeans = this.extractModuleEntity(registeredModules, function (module) { return module.beans ? module.beans : []; });
beans.push.apply(beans, moduleBeans);
// check for duplicates, as different modules could include the same beans that
// they depend on, eg ClientSideRowModel in enterprise, and ClientSideRowModel in community
var beansNoDuplicates = [];
beans.forEach(function (bean) {
if (beansNoDuplicates.indexOf(bean) < 0) {
beansNoDuplicates.push(bean);
}
});
return beansNoDuplicates;
};
Grid.prototype.extractModuleEntity = function (moduleEntities, extractor) {
return [].concat.apply([], moduleEntities.map(extractor));
};
Grid.prototype.setColumnsAndData = function () {
var gridOptionsWrapper = this.context.getBean('gridOptionsWrapper');
var columnController = this.context.getBean('columnController');
var columnDefs = gridOptionsWrapper.getColumnDefs();
columnController.setColumnDefs(columnDefs || [], "gridInitializing");
var rowModel = this.context.getBean('rowModel');
rowModel.start();
};
Grid.prototype.dispatchGridReadyEvent = function (gridOptions) {
var eventService = this.context.getBean('eventService');
var readyEvent = {
type: _events__WEBPACK_IMPORTED_MODULE_29__["Events"].EVENT_GRID_READY,
api: gridOptions.api,
columnApi: gridOptions.columnApi
};
eventService.dispatchEvent(readyEvent);
};
Grid.prototype.getRowModelClass = function (registeredModules) {
var rowModelType = this.gridOptions.rowModelType;
// default to client side
if (!rowModelType) {
rowModelType = _constants_constants__WEBPACK_IMPORTED_MODULE_41__["Constants"].ROW_MODEL_TYPE_CLIENT_SIDE;
}
var rowModelClasses = {};
registeredModules.forEach(function (module) {
Object(_utils_object__WEBPACK_IMPORTED_MODULE_82__["iterateObject"])(module.rowModels, function (key, value) {
rowModelClasses[key] = value;
});
});
var rowModelClass = rowModelClasses[rowModelType];
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_81__["exists"])(rowModelClass)) {
return rowModelClass;
}
if (rowModelType === _constants_constants__WEBPACK_IMPORTED_MODULE_41__["Constants"].ROW_MODEL_TYPE_INFINITE) {
console.error("ag-Grid: Row Model \"Infinite\" not found. Please ensure the " + _modules_moduleNames__WEBPACK_IMPORTED_MODULE_76__["ModuleNames"].InfiniteRowModelModule + " is registered.';");
}
console.error('ag-Grid: could not find matching row model for rowModelType ' + rowModelType);
if (rowModelType === _constants_constants__WEBPACK_IMPORTED_MODULE_41__["Constants"].ROW_MODEL_TYPE_VIEWPORT) {
console.error("ag-Grid: Row Model \"Viewport\" not found. Please ensure the ag-Grid Enterprise Module " + _modules_moduleNames__WEBPACK_IMPORTED_MODULE_76__["ModuleNames"].ViewportRowModelModule + " is registered.';");
}
if (rowModelType === _constants_constants__WEBPACK_IMPORTED_MODULE_41__["Constants"].ROW_MODEL_TYPE_SERVER_SIDE) {
console.error("ag-Grid: Row Model \"Server Side\" not found. Please ensure the ag-Grid Enterprise Module " + _modules_moduleNames__WEBPACK_IMPORTED_MODULE_76__["ModuleNames"].ServerSideRowModelModule + " is registered.';");
}
if (rowModelType === _constants_constants__WEBPACK_IMPORTED_MODULE_41__["Constants"].ROW_MODEL_TYPE_CLIENT_SIDE) {
console.error("ag-Grid: Row Model \"Client Side\" not found. Please ensure the " + _modules_moduleNames__WEBPACK_IMPORTED_MODULE_76__["ModuleNames"].ClientSideRowModelModule + " is registered.';");
}
};
Grid.prototype.destroy = function () {
this.gridOptions.api.destroy();
};
return Grid;
}());
/***/ }),
/* 95 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GridOptionsWrapper", function() { return GridOptionsWrapper; });
/* harmony import */ var _eventService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11);
/* harmony import */ var _constants_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16);
/* harmony import */ var _components_componentUtil__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(30);
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(12);
/* harmony import */ var _propertyKeys__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(31);
/* harmony import */ var _components_colDefUtil__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(32);
/* harmony import */ var _eventKeys__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(24);
/* harmony import */ var _entities_sideBar__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(96);
/* harmony import */ var _modules_moduleNames__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(17);
/* harmony import */ var _utils_object__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(13);
/* harmony import */ var _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(18);
/* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(7);
/* harmony import */ var _utils_fuzzyMatch__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(46);
/* harmony import */ var _utils_function__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(15);
/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(42);
/* harmony import */ var _utils_browser__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(43);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (undefined && undefined.__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 __param = (undefined && undefined.__param) || function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
var __spreadArrays = (undefined && undefined.__spreadArrays) || function () {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
};
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 DEFAULT_KEEP_DETAIL_ROW_COUNT = 10;
function isTrue(value) {
return value === true || value === 'true';
}
function toNumber(value) {
if (typeof value == 'number') {
return value;
}
if (typeof value == 'string') {
return parseInt(value, 10);
}
}
function zeroOrGreater(value, defaultValue) {
if (value >= 0) {
return value;
}
// zero gets returned if number is missing or the wrong type
return defaultValue;
}
function oneOrGreater(value, defaultValue) {
if (value > 0) {
return value;
}
// zero gets returned if number is missing or the wrong type
return defaultValue;
}
var GridOptionsWrapper = /** @class */ (function () {
function GridOptionsWrapper() {
this.propertyEventService = new _eventService__WEBPACK_IMPORTED_MODULE_0__["EventService"]();
this.domDataKey = '__AG_' + Math.random().toString();
this.layoutElements = [];
this.destroyed = false;
}
GridOptionsWrapper_1 = GridOptionsWrapper;
GridOptionsWrapper.prototype.agWire = function (gridApi, columnApi) {
this.gridOptions.api = gridApi;
this.gridOptions.columnApi = columnApi;
this.checkForDeprecated();
this.checkForViolations();
};
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;
this.removeEventListener(GridOptionsWrapper_1.PROP_DOM_LAYOUT, this.updateLayoutClassesListener);
this.destroyed = true;
};
GridOptionsWrapper.prototype.init = function () {
var _this = this;
if (!(this.gridOptions.suppressPropertyNamesCheck === true)) {
this.checkGridOptionsProperties();
this.checkColumnDefProperties();
}
// parse side bar options into correct format
if (this.gridOptions.sideBar != null) {
this.gridOptions.sideBar = _entities_sideBar__WEBPACK_IMPORTED_MODULE_7__["SideBarDefParser"].parse(this.gridOptions.sideBar);
}
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 with '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.isRowModelServerSide()) {
console.warn('ag-Grid: group selects children is NOT support for Server Side 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!");
}
if (this.isRowModelServerSide()) {
var msg = function (prop) { return "ag-Grid: '" + prop + "' is not supported on the Server-Side Row Model"; };
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_11__["exists"])(this.gridOptions.groupDefaultExpanded)) {
console.warn(msg('groupDefaultExpanded'));
}
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_11__["exists"])(this.gridOptions.groupDefaultExpanded)) {
console.warn(msg('groupIncludeFooter'));
}
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_11__["exists"])(this.gridOptions.groupDefaultExpanded)) {
console.warn(msg('groupIncludeTotalFooter'));
}
}
if (this.isEnableRangeSelection()) {
_modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_10__["ModuleRegistry"].assertRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_8__["ModuleNames"].RangeSelectionModule, 'enableRangeSelection');
}
if (!this.isEnableRangeSelection() && (this.isEnableRangeHandle() || this.isEnableFillHandle())) {
console.warn("ag-Grid: 'enableRangeHandle' and 'enableFillHandle' will not work unless 'enableRangeSelection' is set to true");
}
var warnOfDeprecaredIcon = function (name) {
if (_this.gridOptions.icons && _this.gridOptions.icons[name]) {
console.warn("gridOptions.icons." + name + " is no longer supported. For information on how to style checkboxes and radio buttons, see https://www.ag-grid.com/javascript-grid-icons/");
}
};
warnOfDeprecaredIcon('radioButtonOff');
warnOfDeprecaredIcon('radioButtonOn');
warnOfDeprecaredIcon('checkboxChecked');
warnOfDeprecaredIcon('checkboxUnchecked');
warnOfDeprecaredIcon('checkboxIndeterminate');
this.updateLayoutClassesListener = this.updateLayoutClasses.bind(this);
this.addEventListener(GridOptionsWrapper_1.PROP_DOM_LAYOUT, this.updateLayoutClassesListener);
// sets an initial calculation for the scrollbar width
this.getScrollbarWidth();
};
GridOptionsWrapper.prototype.checkColumnDefProperties = function () {
var _this = this;
if (this.gridOptions.columnDefs == null) {
return;
}
this.gridOptions.columnDefs.forEach(function (colDef) {
var userProperties = Object.getOwnPropertyNames(colDef);
var validProperties = __spreadArrays(_components_colDefUtil__WEBPACK_IMPORTED_MODULE_5__["ColDefUtil"].ALL_PROPERTIES, _components_colDefUtil__WEBPACK_IMPORTED_MODULE_5__["ColDefUtil"].FRAMEWORK_PROPERTIES);
_this.checkProperties(userProperties, validProperties, validProperties, 'colDef', 'https://www.ag-grid.com/javascript-grid-column-properties/');
});
};
GridOptionsWrapper.prototype.checkGridOptionsProperties = function () {
var userProperties = Object.getOwnPropertyNames(this.gridOptions);
var validProperties = __spreadArrays(_propertyKeys__WEBPACK_IMPORTED_MODULE_4__["PropertyKeys"].ALL_PROPERTIES, _propertyKeys__WEBPACK_IMPORTED_MODULE_4__["PropertyKeys"].FRAMEWORK_PROPERTIES, Object(_utils_generic__WEBPACK_IMPORTED_MODULE_11__["values"])(_eventKeys__WEBPACK_IMPORTED_MODULE_6__["Events"]).map(function (event) { return _components_componentUtil__WEBPACK_IMPORTED_MODULE_2__["ComponentUtil"].getCallbackForEvent(event); }));
var validPropertiesAndExceptions = __spreadArrays(validProperties, ['api', 'columnApi']);
this.checkProperties(userProperties, validPropertiesAndExceptions, validProperties, 'gridOptions', 'https://www.ag-grid.com/javascript-grid-properties/');
};
GridOptionsWrapper.prototype.checkProperties = function (userProperties, validPropertiesAndExceptions, validProperties, containerName, docsUrl) {
var invalidProperties = Object(_utils_fuzzyMatch__WEBPACK_IMPORTED_MODULE_12__["fuzzyCheckStrings"])(userProperties, validPropertiesAndExceptions, validProperties);
Object(_utils_object__WEBPACK_IMPORTED_MODULE_9__["iterateObject"])(invalidProperties, function (key, value) {
console.warn("ag-grid: invalid " + containerName + " property '" + key + "' did you mean any of these: " + value.slice(0, 8).join(", "));
});
if (Object.keys(invalidProperties).length > 0) {
console.warn("ag-grid: to see all the valid " + containerName + " properties please check: " + docsUrl);
}
};
GridOptionsWrapper.prototype.getDomDataKey = function () {
return this.domDataKey;
};
// returns the dom data, or undefined if not found
GridOptionsWrapper.prototype.getDomData = function (element, key) {
var domData = element[this.getDomDataKey()];
return domData ? domData[key] : undefined;
};
GridOptionsWrapper.prototype.setDomData = function (element, key, value) {
var domDataKey = this.getDomDataKey();
var domData = element[domDataKey];
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_11__["missing"])(domData)) {
domData = {};
element[domDataKey] = domData;
}
domData[key] = value;
};
GridOptionsWrapper.prototype.isRowSelection = function () {
return this.gridOptions.rowSelection === 'single' || this.gridOptions.rowSelection === 'multiple';
};
GridOptionsWrapper.prototype.isSuppressRowDeselection = function () {
return isTrue(this.gridOptions.suppressRowDeselection);
};
GridOptionsWrapper.prototype.isRowSelectionMulti = function () {
return this.gridOptions.rowSelection === 'multiple';
};
GridOptionsWrapper.prototype.isRowMultiSelectWithClick = function () {
return isTrue(this.gridOptions.rowMultiSelectWithClick);
};
GridOptionsWrapper.prototype.getContext = function () {
return this.gridOptions.context;
};
GridOptionsWrapper.prototype.isPivotMode = function () {
return isTrue(this.gridOptions.pivotMode);
};
GridOptionsWrapper.prototype.isSuppressExpandablePivotGroups = function () {
return isTrue(this.gridOptions.suppressExpandablePivotGroups);
};
GridOptionsWrapper.prototype.getPivotColumnGroupTotals = function () {
return this.gridOptions.pivotColumnGroupTotals;
};
GridOptionsWrapper.prototype.getPivotRowTotals = function () {
return this.gridOptions.pivotRowTotals;
};
GridOptionsWrapper.prototype.isRowModelInfinite = function () {
return this.gridOptions.rowModelType === _constants_constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].ROW_MODEL_TYPE_INFINITE;
};
GridOptionsWrapper.prototype.isRowModelViewport = function () {
return this.gridOptions.rowModelType === _constants_constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].ROW_MODEL_TYPE_VIEWPORT;
};
GridOptionsWrapper.prototype.isRowModelServerSide = function () {
return this.gridOptions.rowModelType === _constants_constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].ROW_MODEL_TYPE_SERVER_SIDE;
};
GridOptionsWrapper.prototype.isRowModelDefault = function () {
return (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_11__["missing"])(this.gridOptions.rowModelType) ||
this.gridOptions.rowModelType === _constants_constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].ROW_MODEL_TYPE_CLIENT_SIDE);
};
GridOptionsWrapper.prototype.isFullRowEdit = function () {
return this.gridOptions.editType === 'fullRow';
};
GridOptionsWrapper.prototype.isSuppressFocusAfterRefresh = function () {
return isTrue(this.gridOptions.suppressFocusAfterRefresh);
};
GridOptionsWrapper.prototype.isSuppressBrowserResizeObserver = function () {
return isTrue(this.gridOptions.suppressBrowserResizeObserver);
};
GridOptionsWrapper.prototype.isSuppressMaintainUnsortedOrder = function () {
return isTrue(this.gridOptions.suppressMaintainUnsortedOrder);
};
GridOptionsWrapper.prototype.isSuppressClearOnFillReduction = function () {
return isTrue(this.gridOptions.suppressClearOnFillReduction);
};
GridOptionsWrapper.prototype.isShowToolPanel = function () {
return isTrue(this.gridOptions.sideBar && Array.isArray(this.getSideBar().toolPanels));
};
GridOptionsWrapper.prototype.getSideBar = function () {
return this.gridOptions.sideBar;
};
GridOptionsWrapper.prototype.isSuppressTouch = function () {
return isTrue(this.gridOptions.suppressTouch);
};
GridOptionsWrapper.prototype.isApplyColumnDefOrder = function () {
return isTrue(this.gridOptions.applyColumnDefOrder);
};
GridOptionsWrapper.prototype.isSuppressRowTransform = function () {
return isTrue(this.gridOptions.suppressRowTransform);
};
GridOptionsWrapper.prototype.isSuppressColumnStateEvents = function () {
return isTrue(this.gridOptions.suppressColumnStateEvents);
};
GridOptionsWrapper.prototype.isAllowDragFromColumnsToolPanel = function () {
return isTrue(this.gridOptions.allowDragFromColumnsToolPanel);
};
GridOptionsWrapper.prototype.useAsyncEvents = function () {
return !isTrue(this.gridOptions.suppressAsyncEvents);
};
GridOptionsWrapper.prototype.isEnableCellChangeFlash = function () {
return isTrue(this.gridOptions.enableCellChangeFlash);
};
GridOptionsWrapper.prototype.getCellFlashDelay = function () {
return this.gridOptions.cellFlashDelay || 500;
};
GridOptionsWrapper.prototype.getCellFadeDelay = function () {
return this.gridOptions.cellFadeDelay || 1000;
};
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;
}
return result;
};
GridOptionsWrapper.prototype.isSuppressRowHoverHighlight = function () {
return isTrue(this.gridOptions.suppressRowHoverHighlight);
};
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.isGroupIncludeTotalFooter = function () {
return isTrue(this.gridOptions.groupIncludeTotalFooter);
};
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.isMultiSortKeyCtrl = function () {
return this.gridOptions.multiSortKey === 'ctrl';
};
GridOptionsWrapper.prototype.isGroupSuppressAutoColumn = function () {
return isTrue(this.gridOptions.groupSuppressAutoColumn);
};
GridOptionsWrapper.prototype.isPivotSuppressAutoColumn = function () {
return isTrue(this.gridOptions.pivotSuppressAutoColumn);
};
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.isSuppressMoveWhenRowDragging = function () {
return isTrue(this.gridOptions.suppressMoveWhenRowDragging);
};
GridOptionsWrapper.prototype.isEnableMultiRowDragging = function () {
return isTrue(this.gridOptions.enableMultiRowDragging);
};
// returns either 'print', 'autoHeight' or 'normal' (normal is the default)
GridOptionsWrapper.prototype.getDomLayout = function () {
var domLayout = this.gridOptions.domLayout || _constants_constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].DOM_LAYOUT_NORMAL;
var validLayouts = [
_constants_constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].DOM_LAYOUT_PRINT,
_constants_constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].DOM_LAYOUT_AUTO_HEIGHT,
_constants_constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].DOM_LAYOUT_NORMAL
];
if (validLayouts.indexOf(domLayout) === -1) {
Object(_utils_function__WEBPACK_IMPORTED_MODULE_13__["doOnce"])(function () {
return console.warn("ag-Grid: " + domLayout + " is not valid for DOM Layout, valid values are " + _constants_constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].DOM_LAYOUT_NORMAL + ", " + _constants_constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].DOM_LAYOUT_AUTO_HEIGHT + " and " + _constants_constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].DOM_LAYOUT_PRINT);
}, 'warn about dom layout values');
return _constants_constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].DOM_LAYOUT_NORMAL;
}
return domLayout;
};
GridOptionsWrapper.prototype.isSuppressHorizontalScroll = function () {
return isTrue(this.gridOptions.suppressHorizontalScroll);
};
GridOptionsWrapper.prototype.isSuppressMaxRenderedRowRestriction = function () {
return isTrue(this.gridOptions.suppressMaxRenderedRowRestriction);
};
GridOptionsWrapper.prototype.isExcludeChildrenWhenTreeDataFiltering = function () {
return isTrue(this.gridOptions.excludeChildrenWhenTreeDataFiltering);
};
GridOptionsWrapper.prototype.isAlwaysShowVerticalScroll = function () {
return isTrue(this.gridOptions.alwaysShowVerticalScroll);
};
GridOptionsWrapper.prototype.isDebounceVerticalScrollbar = function () {
return isTrue(this.gridOptions.debounceVerticalScrollbar);
};
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.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.isEnterMovesDown = function () {
return isTrue(this.gridOptions.enterMovesDown);
};
GridOptionsWrapper.prototype.isUndoRedoCellEditing = function () {
return isTrue(this.gridOptions.undoRedoCellEditing);
};
GridOptionsWrapper.prototype.getUndoRedoCellEditingLimit = function () {
return this.gridOptions.undoRedoCellEditingLimit;
};
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.getServerSideStoreType = function () {
return this.gridOptions.serverSideStoreType;
};
GridOptionsWrapper.prototype.getServerSideStoreParamsFunc = function () {
return this.gridOptions.getServerSideStoreParams;
};
GridOptionsWrapper.prototype.getCreateChartContainerFunc = function () {
return this.gridOptions.createChartContainer;
};
GridOptionsWrapper.prototype.getPopupParent = function () {
return this.gridOptions.popupParent;
};
GridOptionsWrapper.prototype.getBlockLoadDebounceMillis = function () {
return this.gridOptions.blockLoadDebounceMillis;
};
GridOptionsWrapper.prototype.getPostProcessPopupFunc = function () {
return this.gridOptions.postProcessPopup;
};
GridOptionsWrapper.prototype.getPaginationNumberFormatterFunc = function () {
return this.gridOptions.paginationNumberFormatter;
};
GridOptionsWrapper.prototype.getChildCountFunc = function () {
return this.gridOptions.getChildCount;
};
GridOptionsWrapper.prototype.getDefaultGroupSortComparator = function () {
return this.gridOptions.defaultGroupSortComparator;
};
GridOptionsWrapper.prototype.getIsFullWidthCellFunc = function () {
return this.gridOptions.isFullWidthCell;
};
GridOptionsWrapper.prototype.getFullWidthCellRendererParams = function () {
return this.gridOptions.fullWidthCellRendererParams;
};
GridOptionsWrapper.prototype.isEmbedFullWidthRows = function () {
return isTrue(this.gridOptions.embedFullWidthRows) || isTrue(this.gridOptions.deprecatedEmbedFullWidthRows);
};
GridOptionsWrapper.prototype.isDetailRowAutoHeight = function () {
return isTrue(this.gridOptions.detailRowAutoHeight);
};
GridOptionsWrapper.prototype.getSuppressKeyboardEventFunc = function () {
return this.gridOptions.suppressKeyboardEvent;
};
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.isImmutableData = function () {
return isTrue(this.gridOptions.immutableData);
};
GridOptionsWrapper.prototype.isEnsureDomOrder = function () {
return isTrue(this.gridOptions.ensureDomOrder);
};
GridOptionsWrapper.prototype.isEnableCharts = function () {
if (isTrue(this.gridOptions.enableCharts)) {
return _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_10__["ModuleRegistry"].assertRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_8__["ModuleNames"].GridChartsModule, 'enableCharts');
}
return false;
};
GridOptionsWrapper.prototype.getColResizeDefault = function () {
return this.gridOptions.colResizeDefault;
};
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 toNumber(this.gridOptions.paginationPageSize);
};
GridOptionsWrapper.prototype.isPaginateChildRows = function () {
var shouldPaginate = this.isGroupRemoveSingleChildren() || this.isGroupRemoveLowestSingleChildren();
if (shouldPaginate) {
return true;
}
return isTrue(this.gridOptions.paginateChildRows);
};
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;
};
// this property is different - we never allow groupUseEntireRow if in pivot mode,
// as otherwise we don't see the pivot values.
GridOptionsWrapper.prototype.isGroupUseEntireRow = function (pivotMode) {
return pivotMode ? false : isTrue(this.gridOptions.groupUseEntireRow);
};
GridOptionsWrapper.prototype.isEnableRtl = function () {
return isTrue(this.gridOptions.enableRtl);
};
GridOptionsWrapper.prototype.getAutoGroupColumnDef = function () {
return this.gridOptions.autoGroupColumnDef;
};
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.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.getServerSideDatasource = function () {
return this.gridOptions.serverSideDatasource;
};
GridOptionsWrapper.prototype.isAccentedSort = function () {
return isTrue(this.gridOptions.accentedSort);
};
GridOptionsWrapper.prototype.isEnableBrowserTooltips = function () {
return isTrue(this.gridOptions.enableBrowserTooltips);
};
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.isPreventDefaultOnContextMenu = function () {
return isTrue(this.gridOptions.preventDefaultOnContextMenu);
};
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.isCopyHeadersToClipboard = function () {
return isTrue(this.gridOptions.copyHeadersToClipboard);
};
GridOptionsWrapper.prototype.isSuppressClipboardPaste = function () {
return isTrue(this.gridOptions.suppressClipboardPaste);
};
GridOptionsWrapper.prototype.isSuppressLastEmptyLineOnPaste = function () {
return isTrue(this.gridOptions.suppressLastEmptyLineOnPaste);
};
GridOptionsWrapper.prototype.isPagination = function () {
return isTrue(this.gridOptions.pagination);
};
GridOptionsWrapper.prototype.isSuppressEnterpriseResetOnNewColumns = function () {
return isTrue(this.gridOptions.suppressEnterpriseResetOnNewColumns);
};
GridOptionsWrapper.prototype.getProcessDataFromClipboardFunc = function () {
return this.gridOptions.processDataFromClipboard;
};
GridOptionsWrapper.prototype.getAsyncTransactionWaitMillis = function () {
return Object(_utils_generic__WEBPACK_IMPORTED_MODULE_11__["exists"])(this.gridOptions.asyncTransactionWaitMillis) ? this.gridOptions.asyncTransactionWaitMillis : _constants_constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].BATCH_WAIT_MILLIS;
};
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.isSuppressAggFilteredOnly = function () {
return isTrue(this.gridOptions.suppressAggFilteredOnly);
};
GridOptionsWrapper.prototype.isShowOpenedGroup = function () {
return isTrue(this.gridOptions.showOpenedGroup);
};
GridOptionsWrapper.prototype.isEnableRangeSelection = function () {
return _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_10__["ModuleRegistry"].isRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_8__["ModuleNames"].RangeSelectionModule) && isTrue(this.gridOptions.enableRangeSelection);
};
GridOptionsWrapper.prototype.isEnableRangeHandle = function () {
return isTrue(this.gridOptions.enableRangeHandle);
};
GridOptionsWrapper.prototype.isEnableFillHandle = function () {
return isTrue(this.gridOptions.enableFillHandle);
};
GridOptionsWrapper.prototype.getFillHandleDirection = function () {
var direction = this.gridOptions.fillHandleDirection;
if (!direction) {
return 'xy';
}
if (direction !== 'x' && direction !== 'y' && direction !== 'xy') {
Object(_utils_function__WEBPACK_IMPORTED_MODULE_13__["doOnce"])(function () { return console.warn("ag-Grid: valid values for fillHandleDirection are 'x', 'y' and 'xy'. Default to 'xy'."); }, 'warn invalid fill direction');
return 'xy';
}
return direction;
};
GridOptionsWrapper.prototype.getFillOperation = function () {
return this.gridOptions.fillOperation;
};
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 masterDetail = isTrue(this.gridOptions.masterDetail);
if (masterDetail) {
return _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_10__["ModuleRegistry"].assertRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_8__["ModuleNames"].MasterDetailModule, 'masterDetail');
}
else {
return false;
}
};
GridOptionsWrapper.prototype.isKeepDetailRows = function () {
return isTrue(this.gridOptions.keepDetailRows);
};
GridOptionsWrapper.prototype.getKeepDetailRowsCount = function () {
if (this.gridOptions.keepDetailRowsCount > 0) {
return this.gridOptions.keepDetailRowsCount;
}
return DEFAULT_KEEP_DETAIL_ROW_COUNT;
};
GridOptionsWrapper.prototype.getIsRowMasterFunc = function () {
return this.gridOptions.isRowMaster;
};
GridOptionsWrapper.prototype.getIsRowSelectableFunc = function () {
return this.gridOptions.isRowSelectable;
};
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.isEnableCellTextSelection = function () {
return isTrue(this.gridOptions.enableCellTextSelection);
};
GridOptionsWrapper.prototype.isSuppressParentsInRowNodes = function () {
return isTrue(this.gridOptions.suppressParentsInRowNodes);
};
GridOptionsWrapper.prototype.isSuppressClipboardApi = function () {
return isTrue(this.gridOptions.suppressClipboardApi);
};
GridOptionsWrapper.prototype.isFunctionsReadOnly = function () {
return isTrue(this.gridOptions.functionsReadOnly);
};
GridOptionsWrapper.prototype.isFloatingFilter = function () {
return this.gridOptions.floatingFilter;
};
GridOptionsWrapper.prototype.isEnableCellTextSelect = function () {
return isTrue(this.gridOptions.enableCellTextSelection);
};
GridOptionsWrapper.prototype.isEnableOldSetFilterModel = function () {
return isTrue(this.gridOptions.enableOldSetFilterModel);
};
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.isAllowShowChangeAfterFilter = function () {
return isTrue(this.gridOptions.allowShowChangeAfterFilter);
};
GridOptionsWrapper.prototype.isSuppressExcelExport = function () {
return isTrue(this.gridOptions.suppressExcelExport);
};
GridOptionsWrapper.prototype.isSuppressMakeColumnVisibleAfterUnGroup = function () {
return isTrue(this.gridOptions.suppressMakeColumnVisibleAfterUnGroup);
};
GridOptionsWrapper.prototype.getDataPathFunc = function () {
return this.gridOptions.getDataPath;
};
GridOptionsWrapper.prototype.getIsServerSideGroupFunc = function () {
return this.gridOptions.isServerSideGroup;
};
GridOptionsWrapper.prototype.getIsServerSideGroupOpenByDefaultFunc = function () {
return this.gridOptions.isServerSideGroupOpenByDefault;
};
GridOptionsWrapper.prototype.getServerSideGroupKeyFunc = function () {
return this.gridOptions.getServerSideGroupKey;
};
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.getNavigateToNextHeaderFunc = function () {
return this.gridOptions.navigateToNextHeader;
};
GridOptionsWrapper.prototype.getTabToNextHeaderFunc = function () {
return this.gridOptions.tabToNextHeader;
};
GridOptionsWrapper.prototype.getNavigateToNextCellFunc = function () {
return this.gridOptions.navigateToNextCell;
};
GridOptionsWrapper.prototype.getTabToNextCellFunc = function () {
return this.gridOptions.tabToNextCell;
};
GridOptionsWrapper.prototype.isTreeData = function () {
var usingTreeData = isTrue(this.gridOptions.treeData);
if (usingTreeData) {
return _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_10__["ModuleRegistry"].assertRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_8__["ModuleNames"].RowGroupingModule, 'Tree Data');
}
else {
return false;
}
};
GridOptionsWrapper.prototype.isValueCache = function () {
return isTrue(this.gridOptions.valueCache);
};
GridOptionsWrapper.prototype.isValueCacheNeverExpires = function () {
return isTrue(this.gridOptions.valueCacheNeverExpires);
};
GridOptionsWrapper.prototype.isDeltaSort = function () {
return isTrue(this.gridOptions.deltaSort);
};
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.getProcessHeaderForClipboardFunc = function () {
return this.gridOptions.processHeaderForClipboard;
};
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);
};
GridOptionsWrapper.prototype.isServerSideSortingAlwaysResets = function () {
return isTrue(this.gridOptions.serverSideSortingAlwaysResets);
};
GridOptionsWrapper.prototype.isServerSideFilteringAlwaysResets = function () {
return isTrue(this.gridOptions.serverSideFilteringAlwaysResets);
};
GridOptionsWrapper.prototype.getPostSortFunc = function () {
return this.gridOptions.postSort;
};
GridOptionsWrapper.prototype.getChartToolbarItemsFunc = function () {
return this.gridOptions.getChartToolbarItems;
};
GridOptionsWrapper.prototype.getChartThemeOverrides = function () {
return this.gridOptions.chartThemeOverrides;
};
GridOptionsWrapper.prototype.getCustomChartThemes = function () {
return this.gridOptions.customChartThemes;
};
GridOptionsWrapper.prototype.getChartThemes = function () {
// return default themes if user hasn't supplied any
return this.gridOptions.chartThemes || ['ag-default', 'ag-material', 'ag-pastel', 'ag-vivid', 'ag-solar'];
};
GridOptionsWrapper.prototype.getProcessChartOptionsFunc = function () {
return this.gridOptions.processChartOptions;
};
GridOptionsWrapper.prototype.getClipboardDeliminator = function () {
return Object(_utils_generic__WEBPACK_IMPORTED_MODULE_11__["exists"])(this.gridOptions.clipboardDeliminator) ? this.gridOptions.clipboardDeliminator : '\t';
};
GridOptionsWrapper.prototype.setProperty = function (key, value, force) {
if (force === void 0) { force = false; }
var gridOptionsNoType = this.gridOptions;
var previousValue = gridOptionsNoType[key];
if (force || previousValue !== value) {
gridOptionsNoType[key] = value;
var event_1 = {
type: key,
currentValue: value,
previousValue: previousValue
};
this.propertyEventService.dispatchEvent(event_1);
}
};
// this logic is repeated in lots of places. any element that had different CSS
// dependent on the layout needs to have the layout class added ot it.
GridOptionsWrapper.prototype.addLayoutElement = function (element) {
this.layoutElements.push(element);
this.updateLayoutClasses();
};
GridOptionsWrapper.prototype.updateLayoutClasses = function () {
var domLayout = this.getDomLayout();
var domLayoutAutoHeight = domLayout === _constants_constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].DOM_LAYOUT_AUTO_HEIGHT;
var domLayoutPrint = domLayout === _constants_constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].DOM_LAYOUT_PRINT;
var domLayoutNormal = domLayout === _constants_constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].DOM_LAYOUT_NORMAL;
this.layoutElements.forEach(function (e) {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_14__["addOrRemoveCssClass"])(e, 'ag-layout-auto-height', domLayoutAutoHeight);
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_14__["addOrRemoveCssClass"])(e, 'ag-layout-normal', domLayoutNormal);
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_14__["addOrRemoveCssClass"])(e, 'ag-layout-print', domLayoutPrint);
});
};
GridOptionsWrapper.prototype.addEventListener = function (key, listener) {
this.propertyEventService.addEventListener(key, listener);
};
GridOptionsWrapper.prototype.removeEventListener = function (key, listener) {
this.propertyEventService.removeEventListener(key, listener);
};
GridOptionsWrapper.prototype.isSkipHeaderOnAutoSize = function () {
return !!this.gridOptions.skipHeaderOnAutoSize;
};
GridOptionsWrapper.prototype.getAutoSizePadding = function () {
var value = this.gridOptions.autoSizePadding;
return value != null && value >= 0 ? value : 20;
};
// properties
GridOptionsWrapper.prototype.getHeaderHeight = function () {
if (typeof this.gridOptions.headerHeight === 'number') {
return this.gridOptions.headerHeight;
}
return this.getFromTheme(25, 'headerHeight');
};
GridOptionsWrapper.prototype.getFloatingFiltersHeight = function () {
if (typeof this.gridOptions.floatingFiltersHeight === 'number') {
return this.gridOptions.floatingFiltersHeight;
}
return this.getFromTheme(25, 'headerHeight');
};
GridOptionsWrapper.prototype.getGroupHeaderHeight = function () {
if (typeof this.gridOptions.groupHeaderHeight === 'number') {
return this.gridOptions.groupHeaderHeight;
}
return this.getHeaderHeight();
};
GridOptionsWrapper.prototype.getPivotHeaderHeight = function () {
if (typeof this.gridOptions.pivotHeaderHeight === 'number') {
return this.gridOptions.pivotHeaderHeight;
}
return this.getHeaderHeight();
};
GridOptionsWrapper.prototype.getPivotGroupHeaderHeight = function () {
if (typeof this.gridOptions.pivotGroupHeaderHeight === 'number') {
return this.gridOptions.pivotGroupHeaderHeight;
}
return this.getGroupHeaderHeight();
};
GridOptionsWrapper.prototype.isExternalFilterPresent = function () {
if (typeof this.gridOptions.isExternalFilterPresent === 'function') {
return this.gridOptions.isExternalFilterPresent();
}
return false;
};
GridOptionsWrapper.prototype.doesExternalFilterPass = function (node) {
if (typeof this.gridOptions.doesExternalFilterPass === 'function') {
return this.gridOptions.doesExternalFilterPass(node);
}
return false;
};
GridOptionsWrapper.prototype.getTooltipShowDelay = function () {
var tooltipShowDelay = this.gridOptions.tooltipShowDelay;
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_11__["exists"])(tooltipShowDelay)) {
if (tooltipShowDelay < 0) {
console.warn('ag-grid: tooltipShowDelay should not be lower than 0');
}
return Math.max(200, tooltipShowDelay);
}
return null;
};
GridOptionsWrapper.prototype.isTooltipMouseTrack = function () {
return isTrue(this.gridOptions.tooltipMouseTrack);
};
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 = null;
if (this.gridOptions.getDocument && Object(_utils_generic__WEBPACK_IMPORTED_MODULE_11__["exists"])(this.gridOptions.getDocument)) {
result = this.gridOptions.getDocument();
}
if (result && Object(_utils_generic__WEBPACK_IMPORTED_MODULE_11__["exists"])(result)) {
return result;
}
return document;
};
GridOptionsWrapper.prototype.getMinColWidth = function () {
if (this.gridOptions.minColWidth > GridOptionsWrapper_1.MIN_COL_WIDTH) {
return this.gridOptions.minColWidth;
}
var measuredMin = this.getFromTheme(null, 'headerCellMinWidth');
return Math.max(measuredMin, GridOptionsWrapper_1.MIN_COL_WIDTH);
};
GridOptionsWrapper.prototype.getMaxColWidth = function () {
if (this.gridOptions.maxColWidth && this.gridOptions.maxColWidth > GridOptionsWrapper_1.MIN_COL_WIDTH) {
return this.gridOptions.maxColWidth;
}
return null;
};
GridOptionsWrapper.prototype.getColWidth = function () {
if (typeof this.gridOptions.colWidth !== 'number' || this.gridOptions.colWidth < GridOptionsWrapper_1.MIN_COL_WIDTH) {
return 200;
}
return this.gridOptions.colWidth;
};
GridOptionsWrapper.prototype.getRowBuffer = function () {
var rowBuffer = this.gridOptions.rowBuffer;
if (typeof rowBuffer === 'number') {
if (rowBuffer < 0) {
Object(_utils_function__WEBPACK_IMPORTED_MODULE_13__["doOnce"])(function () { return console.warn("ag-Grid: rowBuffer should not be negative"); }, 'warn rowBuffer negative');
this.gridOptions.rowBuffer = rowBuffer = 0;
}
}
else {
rowBuffer = _constants_constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].ROW_BUFFER_SIZE;
}
return rowBuffer;
};
GridOptionsWrapper.prototype.getRowBufferInPixels = function () {
var rowsToBuffer = this.getRowBuffer();
var defaultRowHeight = this.getRowHeightAsNumber();
return rowsToBuffer * defaultRowHeight;
};
// 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 () {
if (this.scrollbarWidth == null) {
var useGridOptions = typeof this.gridOptions.scrollbarWidth === 'number' && this.gridOptions.scrollbarWidth >= 0;
var scrollbarWidth = useGridOptions ? this.gridOptions.scrollbarWidth : Object(_utils_browser__WEBPACK_IMPORTED_MODULE_15__["getScrollbarWidth"])();
if (scrollbarWidth != null) {
this.scrollbarWidth = scrollbarWidth;
this.eventService.dispatchEvent({
type: _eventKeys__WEBPACK_IMPORTED_MODULE_6__["Events"].EVENT_SCROLLBAR_WIDTH_CHANGED
});
}
}
return this.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.deprecatedEmbedFullWidthRows) {
console.warn("ag-Grid: since v21.2, deprecatedEmbedFullWidthRows has been replaced with embedFullWidthRows.");
}
if (options.enableOldSetFilterModel) {
console.warn('ag-Grid: since v22.x, enableOldSetFilterModel is deprecated. Please move to the new Set Filter Model as the old one may not be supported in v23 onwards.');
}
if (options.floatingFilter) {
console.warn('ag-Grid: since v23.1, floatingFilter on the gridOptions is deprecated. Please use floatingFilter on the colDef instead.');
if (!options.defaultColDef) {
options.defaultColDef = {};
}
if (options.defaultColDef.floatingFilter == null) {
options.defaultColDef.floatingFilter = true;
}
}
if (options.rowDeselection) {
console.warn('ag-Grid: since v24.x, rowDeselection is deprecated and the behaviour is true by default. Please use `suppressRowDeselection` to prevent rows from being deselected.');
}
var checkRenamedProperty = function (oldProp, newProp, version) {
if (options[oldProp] != null) {
console.warn("ag-grid: since version " + version + ", '" + oldProp + "' is deprecated / renamed, please use the new property name '" + newProp + "' instead.");
if (options[newProp] == null) {
options[newProp] = options[oldProp];
}
}
};
checkRenamedProperty('batchUpdateWaitMillis', 'asyncTransactionWaitMillis', '23.1.x');
checkRenamedProperty('deltaRowDataMode', 'immutableData', '23.1.x');
if (options.immutableColumns || options.deltaColumnMode) {
console.warn('ag-Grid: since v24.0, immutableColumns and deltaColumnMode properties are gone. The grid now works like this as default. To keep column order maintained, set grid property applyColumnDefOrder=true');
}
checkRenamedProperty('suppressSetColumnStateEvents', 'suppressColumnStateEvents', '24.0.x');
if (options.groupRowInnerRenderer || options.groupRowInnerRendererParams || options.groupRowInnerRendererFramework) {
console.warn('ag-Grid: since v24.0, grid properties groupRowInnerRenderer, groupRowInnerRendererFramework and groupRowInnerRendererParams are no longer used.');
console.warn(' Instead use the grid properties groupRowRendererParams.innerRenderer, groupRowRendererParams.innerRendererFramework and groupRowRendererParams.innerRendererParams.');
console.warn(' For example instead of this:');
console.warn(' groupRowInnerRenderer: "myRenderer"');
console.warn(' groupRowInnerRendererParams: {x: a}');
console.warn(' Replace with this:');
console.warn(' groupRowRendererParams: {');
console.warn(' innerRenderer: "myRenderer",');
console.warn(' innerRendererParams: {x: a}');
console.warn(' }');
console.warn(' We have copied the properties over for you. However to stop this error message, please change your application code.');
if (!options.groupRowRendererParams) {
options.groupRowRendererParams = {};
}
var params = options.groupRowRendererParams;
if (options.groupRowInnerRenderer) {
params.innerRenderer = options.groupRowInnerRenderer;
}
if (options.groupRowInnerRendererParams) {
params.innerRendererParams = options.groupRowInnerRendererParams;
}
if (options.groupRowInnerRendererFramework) {
params.innerRendererFramework = options.groupRowInnerRendererFramework;
}
}
if (options.rememberGroupStateWhenNewData) {
console.warn('ag-Grid: since v24.0, grid property rememberGroupStateWhenNewData is deprecated. This feature was provided before Transaction Updates worked (which keep group state). Now that transaction updates are possible and they keep group state, this feature is no longer needed.');
}
if (options.detailCellRendererParams && options.detailCellRendererParams.autoHeight) {
console.warn('ag-Grid: since v24.1, grid property detailCellRendererParams.autoHeight is replaced with grid property detailRowAutoHeight. This allows this feature to work when you provide a custom DetailCellRenderer');
options.detailRowAutoHeight = true;
}
if (options.suppressKeyboardEvent) {
console.warn("ag-Grid: since v24.1 suppressKeyboardEvent in the gridOptions has been deprecated and will be removed in\n future versions of ag-Grid. If you need this to be set for every column use the defaultColDef property.");
}
};
GridOptionsWrapper.prototype.checkForViolations = function () {
if (this.isTreeData()) {
this.treeDataViolations();
}
};
GridOptionsWrapper.prototype.treeDataViolations = function () {
if (this.isRowModelDefault()) {
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_11__["missing"])(this.getDataPathFunc())) {
console.warn('ag-Grid: property usingTreeData=true with rowModel=clientSide, but you did not ' +
'provide getDataPath function, please provide getDataPath function if using tree data.');
}
}
if (this.isRowModelServerSide()) {
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_11__["missing"])(this.getIsServerSideGroupFunc())) {
console.warn('ag-Grid: property usingTreeData=true with rowModel=serverSide, but you did not ' +
'provide isServerSideGroup function, please provide isServerSideGroup function if using tree data.');
}
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_11__["missing"])(this.getServerSideGroupKeyFunc())) {
console.warn('ag-Grid: property usingTreeData=true with rowModel=serverSide, but you did not ' +
'provide getServerSideGroupKey function, please provide getServerSideGroupKey function if using tree data.');
}
}
};
GridOptionsWrapper.prototype.getLocaleTextFunc = function () {
if (this.gridOptions.localeTextFunc) {
return this.gridOptions.localeTextFunc;
}
var localeText = this.gridOptions.localeText;
return function (key, defaultValue) {
return localeText && localeText[key] ? localeText[key] : defaultValue;
};
};
// responsible for calling the onXXX functions on gridOptions
GridOptionsWrapper.prototype.globalEventHandler = function (eventName, event) {
// prevent events from being fired _after_ the grid has been destroyed
if (this.destroyed) {
return;
}
var callbackMethodName = _components_componentUtil__WEBPACK_IMPORTED_MODULE_2__["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 () {
if (!this.gridOptions.rowHeight || Object(_utils_generic__WEBPACK_IMPORTED_MODULE_11__["missing"])(this.gridOptions.rowHeight)) {
return this.getDefaultRowHeight();
}
if (this.gridOptions.rowHeight && this.isNumeric(this.gridOptions.rowHeight)) {
return this.gridOptions.rowHeight;
}
console.warn('ag-Grid row height must be a number if not using standard row model');
return this.getDefaultRowHeight();
};
GridOptionsWrapper.prototype.getRowHeightForNode = function (rowNode, allowEstimate) {
// 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 (allowEstimate === void 0) { allowEstimate = false; }
if (typeof this.gridOptions.getRowHeight === 'function') {
if (allowEstimate) {
return { height: this.getDefaultRowHeight(), estimated: true };
}
var params = {
node: rowNode,
data: rowNode.data,
api: this.gridOptions.api,
context: this.gridOptions.context
};
var height = this.gridOptions.getRowHeight(params);
if (this.isNumeric(height)) {
return { height: height, estimated: false };
}
}
if (rowNode.detail && this.isMasterDetail()) {
if (this.isNumeric(this.gridOptions.detailRowHeight)) {
return { height: this.gridOptions.detailRowHeight, estimated: false };
}
return { height: DEFAULT_DETAIL_ROW_HEIGHT, estimated: false };
}
var defaultRowHeight = this.getDefaultRowHeight();
var rowHeight = this.gridOptions.rowHeight && this.isNumeric(this.gridOptions.rowHeight) ? this.gridOptions.rowHeight : defaultRowHeight;
var minRowHeight = Math.min(defaultRowHeight, rowHeight);
if (this.columnController.isAutoRowHeightActive()) {
if (allowEstimate) {
return { height: rowHeight, estimated: true };
}
var autoHeight = this.autoHeightCalculator.getPreferredHeightForRow(rowNode);
// never return less than the default row height - covers when auto height
// cells are blank.
return { height: Math.max(autoHeight, minRowHeight), estimated: false };
}
return { height: rowHeight, estimated: false };
};
GridOptionsWrapper.prototype.isDynamicRowHeight = function () {
return typeof this.gridOptions.getRowHeight === 'function';
};
GridOptionsWrapper.prototype.getListItemHeight = function () {
return this.getFromTheme(20, 'listItemHeight');
};
GridOptionsWrapper.prototype.chartMenuPanelWidth = function () {
return this.environment.chartMenuPanelWidth();
};
GridOptionsWrapper.prototype.isNumeric = function (value) {
return !isNaN(value) && typeof value === 'number' && isFinite(value);
};
// 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.getFromTheme = function (defaultValue, sassVariableName) {
var theme = this.environment.getTheme().theme;
if (theme && theme.indexOf('ag-theme') === 0) {
return this.environment.getSassVariable(theme, sassVariableName);
}
return defaultValue;
};
GridOptionsWrapper.prototype.getDefaultRowHeight = function () {
return this.getFromTheme(DEFAULT_ROW_HEIGHT, 'rowHeight');
};
var GridOptionsWrapper_1;
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_SUPPRESS_CLIPBOARD_PASTE = 'suppressClipboardPaste';
GridOptionsWrapper.PROP_GROUP_HEADER_HEIGHT = 'groupHeaderHeight';
GridOptionsWrapper.PROP_PIVOT_GROUP_HEADER_HEIGHT = 'pivotGroupHeaderHeight';
GridOptionsWrapper.PROP_FLOATING_FILTERS_HEIGHT = 'floatingFiltersHeight';
GridOptionsWrapper.PROP_SUPPRESS_ROW_CLICK_SELECTION = 'suppressRowClickSelection';
GridOptionsWrapper.PROP_SUPPRESS_ROW_DRAG = 'suppressRowDrag';
GridOptionsWrapper.PROP_SUPPRESS_MOVE_WHEN_ROW_DRAG = 'suppressMoveWhenRowDragging';
GridOptionsWrapper.PROP_POPUP_PARENT = 'popupParent';
GridOptionsWrapper.PROP_DOM_LAYOUT = 'domLayout';
GridOptionsWrapper.PROP_FILL_HANDLE_DIRECTION = 'fillHandleDirection';
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_3__["Autowired"])('gridOptions')
], GridOptionsWrapper.prototype, "gridOptions", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_3__["Autowired"])('columnController')
], GridOptionsWrapper.prototype, "columnController", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_3__["Autowired"])('eventService')
], GridOptionsWrapper.prototype, "eventService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_3__["Autowired"])('environment')
], GridOptionsWrapper.prototype, "environment", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_3__["Autowired"])('autoHeightCalculator')
], GridOptionsWrapper.prototype, "autoHeightCalculator", void 0);
__decorate([
__param(0, Object(_context_context__WEBPACK_IMPORTED_MODULE_3__["Qualifier"])('gridApi')), __param(1, Object(_context_context__WEBPACK_IMPORTED_MODULE_3__["Qualifier"])('columnApi'))
], GridOptionsWrapper.prototype, "agWire", null);
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_3__["PreDestroy"]
], GridOptionsWrapper.prototype, "destroy", null);
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_3__["PostConstruct"]
], GridOptionsWrapper.prototype, "init", null);
GridOptionsWrapper = GridOptionsWrapper_1 = __decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_3__["Bean"])('gridOptionsWrapper')
], GridOptionsWrapper);
return GridOptionsWrapper;
}());
/***/ }),
/* 96 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SideBarDefParser", function() { return SideBarDefParser; });
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var SideBarDefParser = /** @class */ (function () {
function SideBarDefParser() {
}
SideBarDefParser.parse = function (toParse) {
if (!toParse) {
return null;
}
if (toParse === true) {
return {
toolPanels: [
SideBarDefParser.DEFAULT_COLUMN_COMP,
SideBarDefParser.DEFAULT_FILTER_COMP,
],
defaultToolPanel: 'columns'
};
}
if (typeof toParse === 'string') {
return SideBarDefParser.parse([toParse]);
}
if (Array.isArray(toParse)) {
var comps_1 = [];
toParse.forEach(function (key) {
var lookupResult = SideBarDefParser.DEFAULT_BY_KEY[key];
if (!lookupResult) {
console.warn("ag-grid: the key " + key + " is not a valid key for specifying a tool panel, valid keys are: " + Object.keys(SideBarDefParser.DEFAULT_BY_KEY).join(','));
return;
}
comps_1.push(lookupResult);
});
if (comps_1.length === 0) {
return null;
}
return {
toolPanels: comps_1,
defaultToolPanel: comps_1[0].id
};
}
var result = {
toolPanels: SideBarDefParser.parseComponents(toParse.toolPanels),
defaultToolPanel: toParse.defaultToolPanel,
hiddenByDefault: toParse.hiddenByDefault,
position: toParse.position
};
return result;
};
SideBarDefParser.parseComponents = function (from) {
var result = [];
from.forEach(function (it) {
var toAdd = null;
if (typeof it === 'string') {
var lookupResult = SideBarDefParser.DEFAULT_BY_KEY[it];
if (!lookupResult) {
console.warn("ag-grid: the key " + it + " is not a valid key for specifying a tool panel, valid keys are: " + Object.keys(SideBarDefParser.DEFAULT_BY_KEY).join(','));
return;
}
toAdd = lookupResult;
}
else {
toAdd = it;
}
result.push(toAdd);
});
return result;
};
SideBarDefParser.DEFAULT_COLUMN_COMP = {
id: 'columns',
labelDefault: 'Columns',
labelKey: 'columns',
iconKey: 'columns',
toolPanel: 'agColumnsToolPanel',
};
SideBarDefParser.DEFAULT_FILTER_COMP = {
id: 'filters',
labelDefault: 'Filters',
labelKey: 'filters',
iconKey: 'filter',
toolPanel: 'agFiltersToolPanel',
};
SideBarDefParser.DEFAULT_BY_KEY = {
columns: SideBarDefParser.DEFAULT_COLUMN_COMP,
filters: SideBarDefParser.DEFAULT_FILTER_COMP
};
return SideBarDefParser;
}());
/***/ }),
/* 97 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SelectionController", function() { return SelectionController; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20);
/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(23);
/* harmony import */ var _constants_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(16);
/* harmony import */ var _utils_changedPath__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(98);
/* harmony import */ var _utils_object__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(13);
/* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 __param = (undefined && undefined.__param) || function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
var SelectionController = /** @class */ (function (_super) {
__extends(SelectionController, _super);
function SelectionController() {
return _super !== null && _super.apply(this, arguments) || this;
}
SelectionController.prototype.setBeans = function (loggerFactory) {
this.logger = loggerFactory.create('SelectionController');
this.reset();
if (this.gridOptionsWrapper.isRowModelDefault()) {
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_ROW_DATA_CHANGED, this.reset.bind(this));
}
};
SelectionController.prototype.init = function () {
this.groupSelectsChildren = this.gridOptionsWrapper.isGroupSelectsChildren();
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_ROW_SELECTED, this.onRowSelected.bind(this));
};
SelectionController.prototype.setLastSelectedNode = function (rowNode) {
this.lastSelectedNode = rowNode;
};
SelectionController.prototype.getLastSelectedNode = function () {
return this.lastSelectedNode;
};
SelectionController.prototype.getSelectedNodes = function () {
var selectedNodes = [];
Object(_utils_object__WEBPACK_IMPORTED_MODULE_5__["iterateObject"])(this.selectedNodes, function (key, rowNode) {
if (rowNode) {
selectedNodes.push(rowNode);
}
});
return selectedNodes;
};
SelectionController.prototype.getSelectedRows = function () {
var selectedRows = [];
Object(_utils_object__WEBPACK_IMPORTED_MODULE_5__["iterateObject"])(this.selectedNodes, function (key, rowNode) {
if (rowNode && rowNode.data) {
selectedRows.push(rowNode.data);
}
});
return selectedRows;
};
SelectionController.prototype.removeGroupsFromSelection = function () {
var _this = this;
Object(_utils_object__WEBPACK_IMPORTED_MODULE_5__["iterateObject"])(this.selectedNodes, function (key, rowNode) {
if (rowNode && rowNode.group) {
_this.selectedNodes[rowNode.id] = undefined;
}
});
};
// should only be called if groupSelectsChildren=true
SelectionController.prototype.updateGroupsFromChildrenSelections = function (changedPath) {
// we only do this when group selection state depends on selected children
if (!this.gridOptionsWrapper.isGroupSelectsChildren()) {
return;
}
// also only do it if CSRM (code should never allow this anyway)
if (this.rowModel.getType() !== _constants_constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].ROW_MODEL_TYPE_CLIENT_SIDE) {
return;
}
var clientSideRowModel = this.rowModel;
var rootNode = clientSideRowModel.getRootNode();
if (!changedPath) {
changedPath = new _utils_changedPath__WEBPACK_IMPORTED_MODULE_4__["ChangedPath"](true, rootNode);
changedPath.setInactive();
}
changedPath.forEachChangedNodeDepthFirst(function (rowNode) {
if (rowNode !== rootNode) {
rowNode.calculateSelectedFromChildren();
}
});
// clientSideRowModel.getTopLevelNodes()!.forEach((rowNode: RowNode) => {
// rowNode.depthFirstSearch((node) => {
// if (node.group) {
// }
// });
// });
};
SelectionController.prototype.getNodeForIdIfSelected = function (id) {
return this.selectedNodes[id];
};
SelectionController.prototype.clearOtherNodes = function (rowNodeToKeepSelected) {
var _this = this;
var groupsToRefresh = {};
var updatedCount = 0;
Object(_utils_object__WEBPACK_IMPORTED_MODULE_5__["iterateObject"])(this.selectedNodes, function (key, otherRowNode) {
if (otherRowNode && otherRowNode.id !== rowNodeToKeepSelected.id) {
var rowNode = _this.selectedNodes[otherRowNode.id];
updatedCount += rowNode.setSelectedParams({
newValue: false,
clearSelection: false,
suppressFinishActions: true
});
if (_this.groupSelectsChildren && otherRowNode.parent) {
groupsToRefresh[otherRowNode.parent.id] = otherRowNode.parent;
}
}
});
Object(_utils_object__WEBPACK_IMPORTED_MODULE_5__["iterateObject"])(groupsToRefresh, function (key, group) {
group.calculateSelectedFromChildren();
});
return updatedCount;
};
SelectionController.prototype.onRowSelected = function (event) {
var rowNode = event.node;
// we do not store the group rows when the groups select children
if (this.groupSelectsChildren && rowNode.group) {
return;
}
if (rowNode.isSelected()) {
this.selectedNodes[rowNode.id] = rowNode;
}
else {
this.selectedNodes[rowNode.id] = undefined;
}
};
SelectionController.prototype.syncInRowNode = function (rowNode, oldNode) {
this.syncInOldRowNode(rowNode, oldNode);
this.syncInNewRowNode(rowNode);
};
// if the id has changed for the node, then this means the rowNode
// is getting used for a different data item, which breaks
// our selectedNodes, as the node now is mapped by the old id
// which is inconsistent. so to keep the old node as selected,
// we swap in the clone (with the old id and old data). this means
// the oldNode is effectively a daemon we keep a reference to,
// so if client calls api.getSelectedNodes(), it gets the daemon
// in the result. when the client un-selects, the reference to the
// daemon is removed. the daemon, because it's an oldNode, is not
// used by the grid for rendering, it's a copy of what the node used
// to be like before the id was changed.
SelectionController.prototype.syncInOldRowNode = function (rowNode, oldNode) {
var oldNodeHasDifferentId = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_6__["exists"])(oldNode) && (rowNode.id !== oldNode.id);
if (oldNodeHasDifferentId) {
var oldNodeSelected = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_6__["exists"])(this.selectedNodes[oldNode.id]);
if (oldNodeSelected) {
this.selectedNodes[oldNode.id] = oldNode;
}
}
};
SelectionController.prototype.syncInNewRowNode = function (rowNode) {
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_6__["exists"])(this.selectedNodes[rowNode.id])) {
rowNode.setSelectedInitialValue(true);
this.selectedNodes[rowNode.id] = rowNode;
}
else {
rowNode.setSelectedInitialValue(false);
}
};
SelectionController.prototype.reset = function () {
this.logger.log('reset');
this.selectedNodes = {};
this.lastSelectedNode = null;
};
// returns a list of all nodes at 'best cost' - a feature to be used
// with groups / trees. if a group has all it's children selected,
// then the group appears in the result, but not the children.
// Designed for use with 'children' as the group selection type,
// where groups don't actually appear in the selection normally.
SelectionController.prototype.getBestCostNodeSelection = function () {
if (this.rowModel.getType() !== _constants_constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].ROW_MODEL_TYPE_CLIENT_SIDE) {
console.warn('getBestCostNodeSelection is only available when using normal row model');
return;
}
var clientSideRowModel = this.rowModel;
var topLevelNodes = clientSideRowModel.getTopLevelNodes();
if (topLevelNodes === null) {
console.warn('selectAll not available doing rowModel=virtual');
return;
}
var result = [];
// recursive function, to find the selected nodes
function traverse(nodes) {
for (var i = 0, l = nodes.length; i < l; i++) {
var node = nodes[i];
if (node.isSelected()) {
result.push(node);
}
else {
// if not selected, then if it's a group, and the group
// has children, continue to search for selections
if (node.group && node.children) {
traverse(node.children);
}
}
}
}
traverse(topLevelNodes);
return result;
};
SelectionController.prototype.setRowModel = function (rowModel) {
this.rowModel = rowModel;
};
SelectionController.prototype.isEmpty = function () {
var count = 0;
Object(_utils_object__WEBPACK_IMPORTED_MODULE_5__["iterateObject"])(this.selectedNodes, function (nodeId, rowNode) {
if (rowNode) {
count++;
}
});
return count === 0;
};
SelectionController.prototype.deselectAllRowNodes = function (justFiltered) {
if (justFiltered === void 0) { justFiltered = false; }
var callback = function (rowNode) { return rowNode.selectThisNode(false); };
var rowModelClientSide = this.rowModel.getType() === _constants_constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].ROW_MODEL_TYPE_CLIENT_SIDE;
if (justFiltered) {
if (!rowModelClientSide) {
console.error('ag-Grid: selecting just filtered only works with In Memory Row Model');
return;
}
var clientSideRowModel = this.rowModel;
clientSideRowModel.forEachNodeAfterFilter(callback);
}
else {
Object(_utils_object__WEBPACK_IMPORTED_MODULE_5__["iterateObject"])(this.selectedNodes, function (id, rowNode) {
// remember the reference can be to null, as we never 'delete' from the map
if (rowNode) {
callback(rowNode);
}
});
// this clears down the map (whereas above only sets the items in map to 'undefined')
this.reset();
}
// the above does not clean up the parent rows if they are selected
if (rowModelClientSide && this.groupSelectsChildren) {
this.updateGroupsFromChildrenSelections();
}
var event = {
type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_SELECTION_CHANGED,
api: this.gridApi,
columnApi: this.columnApi
};
this.eventService.dispatchEvent(event);
};
SelectionController.prototype.selectAllRowNodes = function (justFiltered) {
if (justFiltered === void 0) { justFiltered = false; }
if (this.rowModel.getType() !== _constants_constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].ROW_MODEL_TYPE_CLIENT_SIDE) {
throw new Error("selectAll only available with normal row model, ie not " + this.rowModel.getType());
}
var clientSideRowModel = this.rowModel;
var callback = function (rowNode) { return rowNode.selectThisNode(true); };
if (justFiltered) {
clientSideRowModel.forEachNodeAfterFilter(callback);
}
else {
clientSideRowModel.forEachNode(callback);
}
// the above does not clean up the parent rows if they are selected
if (this.rowModel.getType() === _constants_constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].ROW_MODEL_TYPE_CLIENT_SIDE && this.groupSelectsChildren) {
this.updateGroupsFromChildrenSelections();
}
var event = {
type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_SELECTION_CHANGED,
api: this.gridApi,
columnApi: this.columnApi
};
this.eventService.dispatchEvent(event);
};
/**
* @method
* @deprecated
*/
SelectionController.prototype.selectNode = function (rowNode, tryMulti) {
if (rowNode) {
rowNode.setSelectedParams({ newValue: true, clearSelection: !tryMulti });
}
};
/**
* @method
* @deprecated
*/
SelectionController.prototype.deselectIndex = function (rowIndex) {
var node = this.rowModel.getRow(rowIndex);
this.deselectNode(node);
};
/**
* @method
* @deprecated
*/
SelectionController.prototype.deselectNode = function (rowNode) {
if (rowNode) {
rowNode.setSelectedParams({ newValue: false, clearSelection: false });
}
};
/**
* @method
* @deprecated
*/
SelectionController.prototype.selectIndex = function (index, tryMulti) {
var node = this.rowModel.getRow(index);
this.selectNode(node, tryMulti);
};
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('rowModel')
], SelectionController.prototype, "rowModel", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnApi')
], SelectionController.prototype, "columnApi", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridApi')
], SelectionController.prototype, "gridApi", void 0);
__decorate([
__param(0, Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Qualifier"])('loggerFactory'))
], SelectionController.prototype, "setBeans", null);
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_0__["PostConstruct"]
], SelectionController.prototype, "init", null);
SelectionController = __decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('selectionController')
], SelectionController);
return SelectionController;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
/***/ }),
/* 98 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ChangedPath", function() { return ChangedPath; });
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
// when doing transactions, or change detection, and grouping is present
// in the data, there is no need for the ClientSideRowModel to update each
// group after an update, ony parts that were impacted by the change.
// this class keeps track of all groups that were impacted by a transaction.
// the the different CSRM operations (filter, sort etc) use the forEach method
// to visit each group that was changed.
var ChangedPath = /** @class */ (function () {
function ChangedPath(keepingColumns, rootNode) {
// whether changed path is active of not. it is active when a) doing
// a transaction update or b) doing change detection. if we are doing
// a CSRM refresh for other reasons (after sort or filter, or user calling
// setRowData() without delta mode) then we are not active. we are also
// marked as not active if secondary columns change in pivot (as this impacts
// aggregations)
this.active = true;
// for each node in the change path, we also store which columns need
// to be re-aggregated.
this.nodeIdsToColumns = {};
// for quick lookup, all items in the change path are mapped by nodeId
this.mapToItems = {};
this.keepingColumns = keepingColumns;
this.pathRoot = {
rowNode: rootNode,
children: null
};
this.mapToItems[rootNode.id] = this.pathRoot;
}
// can be set inactive by:
// a) ClientSideRowModel, if no transactions or
// b) PivotService, if secondary columns changed
ChangedPath.prototype.setInactive = function () {
this.active = false;
};
ChangedPath.prototype.isActive = function () {
return this.active;
};
ChangedPath.prototype.depthFirstSearchChangedPath = function (pathItem, callback) {
if (pathItem.children) {
for (var i = 0; i < pathItem.children.length; i++) {
this.depthFirstSearchChangedPath(pathItem.children[i], callback);
}
}
callback(pathItem.rowNode);
};
ChangedPath.prototype.depthFirstSearchEverything = function (rowNode, callback, traverseEverything) {
if (rowNode.childrenAfterGroup) {
for (var i = 0; i < rowNode.childrenAfterGroup.length; i++) {
var childNode = rowNode.childrenAfterGroup[i];
if (childNode.childrenAfterGroup) {
this.depthFirstSearchEverything(rowNode.childrenAfterGroup[i], callback, traverseEverything);
}
else if (traverseEverything) {
callback(childNode);
}
}
}
callback(rowNode);
};
// traverseLeafNodes -> used when NOT doing changed path, ie traversing everything. the callback
// will be called for child nodes in addition to parent nodes.
ChangedPath.prototype.forEachChangedNodeDepthFirst = function (callback, traverseLeafNodes) {
if (traverseLeafNodes === void 0) { traverseLeafNodes = false; }
if (this.active) {
// if we are active, then use the change path to callback
// only for updated groups
this.depthFirstSearchChangedPath(this.pathRoot, callback);
}
else {
// we are not active, so callback for everything, walk the entire path
this.depthFirstSearchEverything(this.pathRoot.rowNode, callback, traverseLeafNodes);
}
};
ChangedPath.prototype.executeFromRootNode = function (callback) {
callback(this.pathRoot.rowNode);
};
ChangedPath.prototype.createPathItems = function (rowNode) {
var pointer = rowNode;
var newEntryCount = 0;
while (!this.mapToItems[pointer.id]) {
var newEntry = {
rowNode: pointer,
children: null
};
this.mapToItems[pointer.id] = newEntry;
newEntryCount++;
pointer = pointer.parent;
}
return newEntryCount;
};
ChangedPath.prototype.populateColumnsMap = function (rowNode, columns) {
var _this = this;
if (!this.keepingColumns || !columns) {
return;
}
var pointer = rowNode;
while (pointer) {
// if columns, add the columns in all the way to parent, merging
// in any other columns that might be there already
if (!this.nodeIdsToColumns[pointer.id]) {
this.nodeIdsToColumns[pointer.id] = {};
}
columns.forEach(function (col) { return _this.nodeIdsToColumns[pointer.id][col.getId()] = true; });
pointer = pointer.parent;
}
};
ChangedPath.prototype.linkPathItems = function (rowNode, newEntryCount) {
var pointer = rowNode;
for (var i = 0; i < newEntryCount; i++) {
var thisItem = this.mapToItems[pointer.id];
var parentItem = this.mapToItems[pointer.parent.id];
if (!parentItem.children) {
parentItem.children = [];
}
parentItem.children.push(thisItem);
pointer = pointer.parent;
}
};
// called by
// 1) change detection (provides cols) and
// 2) groupStage if doing transaction update (doesn't provide cols)
ChangedPath.prototype.addParentNode = function (rowNode, columns) {
if (!rowNode || rowNode.isRowPinned()) {
return;
}
// we cannot do both steps below in the same loop as
// the second loop has a dependency on the first loop.
// ie the hierarchy cannot be stitched up yet because
// we don't have it built yet
// create the new PathItem objects.
var newEntryCount = this.createPathItems(rowNode);
// link in the node items
this.linkPathItems(rowNode, newEntryCount);
// update columns
this.populateColumnsMap(rowNode, columns);
};
ChangedPath.prototype.canSkip = function (rowNode) {
return this.active && !this.mapToItems[rowNode.id];
};
ChangedPath.prototype.getValueColumnsForNode = function (rowNode, valueColumns) {
if (!this.keepingColumns) {
return valueColumns;
}
var colsForThisNode = this.nodeIdsToColumns[rowNode.id];
var result = valueColumns.filter(function (col) { return colsForThisNode[col.getId()]; });
return result;
};
ChangedPath.prototype.getNotValueColumnsForNode = function (rowNode, valueColumns) {
if (!this.keepingColumns) {
return null;
}
var colsForThisNode = this.nodeIdsToColumns[rowNode.id];
var result = valueColumns.filter(function (col) { return !colsForThisNode[col.getId()]; });
return result;
};
return ChangedPath;
}());
/***/ }),
/* 99 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColumnApi", function() { return ColumnApi; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(37);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (undefined && undefined.__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 ColumnApi = /** @class */ (function () {
function ColumnApi() {
}
ColumnApi.prototype.sizeColumnsToFit = function (gridWidth) {
// AG-3403 validate that gridWidth is provided because this method has the same name as
// a method on the grid API that takes no arguments, and it's easy to confuse the two
if (typeof gridWidth === "undefined") {
console.error('ag-Grid: missing parameter to columnApi.sizeColumnsToFit(gridWidth)');
}
this.columnController.sizeColumnsToFit(gridWidth, 'api');
};
ColumnApi.prototype.setColumnGroupOpened = function (group, newValue) { this.columnController.setColumnGroupOpened(group, newValue, 'api'); };
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.applyColumnState = function (params) { return this.columnController.applyColumnState(params, 'api'); };
ColumnApi.prototype.getColumnState = function () { return this.columnController.getColumnState(); };
ColumnApi.prototype.resetColumnState = function () { this.columnController.resetColumnState(false, 'api'); };
ColumnApi.prototype.getColumnGroupState = function () { return this.columnController.getColumnGroupState(); };
ColumnApi.prototype.setColumnGroupState = function (stateItems) { this.columnController.setColumnGroupState(stateItems, 'api'); };
ColumnApi.prototype.resetColumnGroupState = function () { this.columnController.resetColumnGroupState('api'); };
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, 'api'); };
ColumnApi.prototype.setColumnsVisible = function (keys, visible) { this.columnController.setColumnsVisible(keys, visible, 'api'); };
ColumnApi.prototype.setColumnPinned = function (key, pinned) { this.columnController.setColumnPinned(key, pinned, 'api'); };
ColumnApi.prototype.setColumnsPinned = function (keys, pinned) { this.columnController.setColumnsPinned(keys, pinned, 'api'); };
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.warn('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, 'api');
}
else {
this.columnController.moveColumn(key, toIndex, 'api');
}
};
ColumnApi.prototype.moveColumnByIndex = function (fromIndex, toIndex) { this.columnController.moveColumnByIndex(fromIndex, toIndex, 'api'); };
ColumnApi.prototype.moveColumns = function (columnsToMoveKeys, toIndex) { this.columnController.moveColumns(columnsToMoveKeys, toIndex, 'api'); };
ColumnApi.prototype.moveRowGroupColumn = function (fromIndex, toIndex) { this.columnController.moveRowGroupColumn(fromIndex, toIndex); };
ColumnApi.prototype.setColumnAggFunc = function (key, aggFunc) { this.columnController.setColumnAggFunc(key, aggFunc); };
ColumnApi.prototype.setColumnWidth = function (key, newWidth, finished) {
if (finished === void 0) { finished = true; }
this.columnController.setColumnWidths([{ key: key, newWidth: newWidth }], false, finished);
};
ColumnApi.prototype.setColumnWidths = function (columnWidths, finished) {
if (finished === void 0) { finished = true; }
this.columnController.setColumnWidths(columnWidths, false, finished);
};
ColumnApi.prototype.setPivotMode = function (pivotMode) { 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, 'api'); };
ColumnApi.prototype.getValueColumns = function () { return this.columnController.getValueColumns(); };
ColumnApi.prototype.removeValueColumn = function (colKey) { this.columnController.removeValueColumn(colKey, 'api'); };
ColumnApi.prototype.removeValueColumns = function (colKeys) { this.columnController.removeValueColumns(colKeys, 'api'); };
ColumnApi.prototype.addValueColumn = function (colKey) { this.columnController.addValueColumn(colKey, 'api'); };
ColumnApi.prototype.addValueColumns = function (colKeys) { this.columnController.addValueColumns(colKeys, 'api'); };
ColumnApi.prototype.setRowGroupColumns = function (colKeys) { this.columnController.setRowGroupColumns(colKeys, 'api'); };
ColumnApi.prototype.removeRowGroupColumn = function (colKey) { this.columnController.removeRowGroupColumn(colKey, 'api'); };
ColumnApi.prototype.removeRowGroupColumns = function (colKeys) { this.columnController.removeRowGroupColumns(colKeys, 'api'); };
ColumnApi.prototype.addRowGroupColumn = function (colKey) { this.columnController.addRowGroupColumn(colKey, 'api'); };
ColumnApi.prototype.addRowGroupColumns = function (colKeys) { this.columnController.addRowGroupColumns(colKeys, 'api'); };
ColumnApi.prototype.getRowGroupColumns = function () { return this.columnController.getRowGroupColumns(); };
ColumnApi.prototype.setPivotColumns = function (colKeys) { this.columnController.setPivotColumns(colKeys, 'api'); };
ColumnApi.prototype.removePivotColumn = function (colKey) { this.columnController.removePivotColumn(colKey, 'api'); };
ColumnApi.prototype.removePivotColumns = function (colKeys) { this.columnController.removePivotColumns(colKeys, 'api'); };
ColumnApi.prototype.addPivotColumn = function (colKey) { this.columnController.addPivotColumn(colKey, 'api'); };
ColumnApi.prototype.addPivotColumns = function (colKeys) { this.columnController.addPivotColumns(colKeys, 'api'); };
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, skipHeader) { return this.columnController.autoSizeColumn(key, skipHeader, 'api'); };
ColumnApi.prototype.autoSizeColumns = function (keys, skipHeader) { return this.columnController.autoSizeColumns(keys, skipHeader, 'api'); };
ColumnApi.prototype.autoSizeAllColumns = function (skipHeader) { this.columnController.autoSizeAllColumns(skipHeader, 'api'); };
ColumnApi.prototype.setSecondaryColumns = function (colDefs) { this.columnController.setSecondaryColumns(colDefs, 'api'); };
ColumnApi.prototype.getSecondaryColumns = function () { return this.columnController.getSecondaryColumns(); };
ColumnApi.prototype.getPrimaryColumns = function () { return this.columnController.getAllPrimaryColumns(); };
ColumnApi.prototype.cleanDownReferencesToAvoidMemoryLeakInCaseApplicationIsKeepingReferenceToDestroyedGrid = function () {
// some users were raising support issues with regards memory leaks. the problem was the customers applications
// were keeping references to the API. trying to educate them all would be difficult, easier to just remove
// all references in teh API so at least the core grid can be garbage collected.
//
// wait about 100ms before clearing down the references, in case user has some cleanup to do,
// and needs to deference the API first
setTimeout(_utils__WEBPACK_IMPORTED_MODULE_1__["_"].removeAllReferences.bind(window, this, 'Column API'), 100);
};
// below goes through deprecated items, prints message to user, then calls the new version of the same method
// public getColumnDefs(): (ColDef | ColGroupDef)[] {
// this.setColumnGroupOpened(group, newValue);
// return null;
// }
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, 'api');
};
ColumnApi.prototype.hideColumn = function (colId, hide) {
console.error('ag-Grid: hideColumn is deprecated, use setColumnVisible');
this.columnController.setColumnVisible(colId, !hide, 'api');
};
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, 'api');
};
ColumnApi.prototype.removeAggregationColumns = function (colKeys) {
console.error('ag-Grid: removeAggregationColumns is deprecated, use removeValueColumns');
this.columnController.removeValueColumns(colKeys, 'api');
};
ColumnApi.prototype.addAggregationColumn = function (colKey) {
console.error('ag-Grid: addAggregationColumn is deprecated, use addValueColumn');
this.columnController.addValueColumn(colKey, 'api');
};
ColumnApi.prototype.addAggregationColumns = function (colKeys) {
console.error('ag-Grid: addAggregationColumns is deprecated, use addValueColumns');
this.columnController.addValueColumns(colKeys, 'api');
};
ColumnApi.prototype.setColumnAggFunction = function (column, aggFunc) {
console.error('ag-Grid: setColumnAggFunction is deprecated, use setColumnAggFunc');
this.columnController.setColumnAggFunc(column, aggFunc, 'api');
};
ColumnApi.prototype.getDisplayNameForCol = function (column) {
console.error('ag-Grid: getDisplayNameForCol is deprecated, use getDisplayNameForColumn');
return this.getDisplayNameForColumn(column, null);
};
ColumnApi.prototype.setColumnState = function (columnState) {
return this.columnController.applyColumnState({ state: columnState, applyOrder: true }, 'api');
};
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnController')
], ColumnApi.prototype, "columnController", void 0);
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_0__["PreDestroy"]
], ColumnApi.prototype, "cleanDownReferencesToAvoidMemoryLeakInCaseApplicationIsKeepingReferenceToDestroyedGrid", null);
ColumnApi = __decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('columnApi')
], ColumnApi);
return ColumnApi;
}());
/***/ }),
/* 100 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RowRenderer", function() { return RowRenderer; });
/* harmony import */ var _gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(95);
/* harmony import */ var _row_rowComp__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(101);
/* harmony import */ var _entities_column__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(10);
/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(23);
/* harmony import */ var _constants_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(16);
/* harmony import */ var _cellComp__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(102);
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(12);
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(20);
/* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(7);
/* harmony import */ var _utils_object__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(13);
/* harmony import */ var _utils_number__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(28);
/* harmony import */ var _utils_array__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(14);
/* harmony import */ var _utils_function__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(15);
/* harmony import */ var _constants_keyCode__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(58);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 __param = (undefined && undefined.__param) || function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
var RowRenderer = /** @class */ (function (_super) {
__extends(RowRenderer, _super);
function RowRenderer() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.destroyFuncsForColumnListeners = [];
// map of row ids to row objects. keeps track of which elements
// are rendered for which rows in the dom.
_this.rowCompsByIndex = {};
_this.floatingTopRowComps = [];
_this.floatingBottomRowComps = [];
// we only allow one refresh at a time, otherwise the internal memory structure here
// will get messed up. this can happen if the user has a cellRenderer, and inside the
// renderer they call an API method that results in another pass of the refresh,
// then it will be trying to draw rows in the middle of a refresh.
_this.refreshInProgress = false;
return _this;
}
RowRenderer.prototype.registerGridCore = function (gridCore) {
this.gridCore = gridCore;
};
RowRenderer.prototype.getGridCore = function () {
return this.gridCore;
};
RowRenderer.prototype.agWire = function (loggerFactory) {
this.logger = loggerFactory.create("RowRenderer");
};
RowRenderer.prototype.registerGridComp = function (gridPanel) {
this.gridPanel = gridPanel;
this.rowContainers = this.gridPanel.getRowContainers();
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_PAGINATION_CHANGED, this.onPageLoaded.bind(this));
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_PINNED_ROW_DATA_CHANGED, this.onPinnedRowDataChanged.bind(this));
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_DISPLAYED_COLUMNS_CHANGED, this.onDisplayedColumnsChanged.bind(this));
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_BODY_SCROLL, this.redrawAfterScroll.bind(this));
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_BODY_HEIGHT_CHANGED, this.redrawAfterScroll.bind(this));
this.addManagedListener(this.gridOptionsWrapper, _gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__["GridOptionsWrapper"].PROP_DOM_LAYOUT, this.onDomLayoutChanged.bind(this));
this.registerCellEventListeners();
this.printLayout = this.gridOptionsWrapper.getDomLayout() === _constants_constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].DOM_LAYOUT_PRINT;
this.embedFullWidthRows = this.printLayout || this.gridOptionsWrapper.isEmbedFullWidthRows();
this.redrawAfterModelUpdate();
};
// in a clean design, each cell would register for each of these events. however when scrolling, all the cells
// registering and de-registering for events is a performance bottleneck. so we register here once and inform
// all active cells.
RowRenderer.prototype.registerCellEventListeners = function () {
var _this = this;
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_CELL_FOCUSED, function (event) {
_this.forEachCellComp(function (cellComp) { return cellComp.onCellFocused(event); });
});
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_FLASH_CELLS, function (event) {
_this.forEachCellComp(function (cellComp) { return cellComp.onFlashCells(event); });
});
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_COLUMN_HOVER_CHANGED, function () {
_this.forEachCellComp(function (cellComp) { return cellComp.onColumnHover(); });
});
// only for printLayout - because we are rendering all the cells in the same row, regardless of pinned state,
// then changing the width of the containers will impact left position. eg the center cols all have their
// left position adjusted by the width of the left pinned column, so if the pinned left column width changes,
// all the center cols need to be shifted to accommodate this. when in normal layout, the pinned cols are
// in different containers so doesn't impact.
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED, function () {
if (_this.printLayout) {
_this.forEachCellComp(function (cellComp) { return cellComp.onLeftChanged(); });
}
});
var rangeSelectionEnabled = this.gridOptionsWrapper.isEnableRangeSelection();
if (rangeSelectionEnabled) {
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_RANGE_SELECTION_CHANGED, function () {
_this.forEachCellComp(function (cellComp) { return cellComp.onRangeSelectionChanged(); });
});
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_COLUMN_MOVED, function () {
_this.forEachCellComp(function (cellComp) { return cellComp.updateRangeBordersIfRangeCount(); });
});
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_COLUMN_PINNED, function () {
_this.forEachCellComp(function (cellComp) { return cellComp.updateRangeBordersIfRangeCount(); });
});
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_COLUMN_VISIBLE, function () {
_this.forEachCellComp(function (cellComp) { return cellComp.updateRangeBordersIfRangeCount(); });
});
}
// add listeners to the grid columns
this.refreshListenersToColumnsForCellComps();
// if the grid columns change, then refresh the listeners again
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_GRID_COLUMNS_CHANGED, this.refreshListenersToColumnsForCellComps.bind(this));
this.addDestroyFunc(this.removeGridColumnListeners.bind(this));
};
// executes all functions in destroyFuncsForColumnListeners and then clears the list
RowRenderer.prototype.removeGridColumnListeners = function () {
this.destroyFuncsForColumnListeners.forEach(function (func) { return func(); });
this.destroyFuncsForColumnListeners.length = 0;
};
// this function adds listeners onto all the grid columns, which are the column that we could have cellComps for.
// when the grid columns change, we add listeners again. in an ideal design, each CellComp would just register to
// the column it belongs to on creation, however this was a bottleneck with the number of cells, so do it here
// once instead.
RowRenderer.prototype.refreshListenersToColumnsForCellComps = function () {
var _this = this;
this.removeGridColumnListeners();
var cols = this.columnController.getAllGridColumns();
if (!cols) {
return;
}
cols.forEach(function (col) {
var forEachCellWithThisCol = function (callback) {
_this.forEachCellComp(function (cellComp) {
if (cellComp.getColumn() === col) {
callback(cellComp);
}
});
};
var leftChangedListener = function () {
forEachCellWithThisCol(function (cellComp) { return cellComp.onLeftChanged(); });
};
var widthChangedListener = function () {
forEachCellWithThisCol(function (cellComp) { return cellComp.onWidthChanged(); });
};
var firstRightPinnedChangedListener = function () {
forEachCellWithThisCol(function (cellComp) { return cellComp.onFirstRightPinnedChanged(); });
};
var lastLeftPinnedChangedListener = function () {
forEachCellWithThisCol(function (cellComp) { return cellComp.onLastLeftPinnedChanged(); });
};
col.addEventListener(_entities_column__WEBPACK_IMPORTED_MODULE_2__["Column"].EVENT_LEFT_CHANGED, leftChangedListener);
col.addEventListener(_entities_column__WEBPACK_IMPORTED_MODULE_2__["Column"].EVENT_WIDTH_CHANGED, widthChangedListener);
col.addEventListener(_entities_column__WEBPACK_IMPORTED_MODULE_2__["Column"].EVENT_FIRST_RIGHT_PINNED_CHANGED, firstRightPinnedChangedListener);
col.addEventListener(_entities_column__WEBPACK_IMPORTED_MODULE_2__["Column"].EVENT_LAST_LEFT_PINNED_CHANGED, lastLeftPinnedChangedListener);
_this.destroyFuncsForColumnListeners.push(function () {
col.removeEventListener(_entities_column__WEBPACK_IMPORTED_MODULE_2__["Column"].EVENT_LEFT_CHANGED, leftChangedListener);
col.removeEventListener(_entities_column__WEBPACK_IMPORTED_MODULE_2__["Column"].EVENT_WIDTH_CHANGED, widthChangedListener);
col.removeEventListener(_entities_column__WEBPACK_IMPORTED_MODULE_2__["Column"].EVENT_FIRST_RIGHT_PINNED_CHANGED, firstRightPinnedChangedListener);
col.removeEventListener(_entities_column__WEBPACK_IMPORTED_MODULE_2__["Column"].EVENT_LAST_LEFT_PINNED_CHANGED, lastLeftPinnedChangedListener);
});
});
};
RowRenderer.prototype.onDomLayoutChanged = function () {
var printLayout = this.gridOptionsWrapper.getDomLayout() === _constants_constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].DOM_LAYOUT_PRINT;
var embedFullWidthRows = printLayout || this.gridOptionsWrapper.isEmbedFullWidthRows();
// if moving towards or away from print layout, means we need to destroy all rows, as rows are not laid
// out using absolute positioning when doing print layout
var destroyRows = embedFullWidthRows !== this.embedFullWidthRows || this.printLayout !== printLayout;
this.printLayout = printLayout;
this.embedFullWidthRows = embedFullWidthRows;
if (destroyRows) {
this.redrawAfterModelUpdate();
}
};
// for row models that have datasources, when we update the datasource, we need to force the rowRenderer
// to redraw all rows. otherwise the old rows from the old datasource will stay displayed.
RowRenderer.prototype.datasourceChanged = function () {
this.firstRenderedRow = 0;
this.lastRenderedRow = -1;
var rowIndexesToRemove = Object.keys(this.rowCompsByIndex);
this.removeRowComps(rowIndexesToRemove);
};
RowRenderer.prototype.onPageLoaded = function (refreshEvent) {
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_8__["missing"])(refreshEvent)) {
refreshEvent = {
type: _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_MODEL_UPDATED,
api: this.gridApi,
columnApi: this.columnApi,
animate: false,
keepRenderedRows: false,
newData: false,
newPage: false
};
}
this.onModelUpdated(refreshEvent);
};
RowRenderer.prototype.getAllCellsForColumn = function (column) {
var eCells = [];
function callback(key, rowComp) {
var eCell = rowComp.getCellForCol(column);
if (eCell) {
eCells.push(eCell);
}
}
Object(_utils_object__WEBPACK_IMPORTED_MODULE_9__["iterateObject"])(this.rowCompsByIndex, callback);
Object(_utils_object__WEBPACK_IMPORTED_MODULE_9__["iterateObject"])(this.floatingBottomRowComps, callback);
Object(_utils_object__WEBPACK_IMPORTED_MODULE_9__["iterateObject"])(this.floatingTopRowComps, callback);
return eCells;
};
RowRenderer.prototype.refreshFloatingRowComps = function () {
this.refreshFloatingRows(this.floatingTopRowComps, this.pinnedRowModel.getPinnedTopRowData(), this.rowContainers.floatingTopPinnedLeft, this.rowContainers.floatingTopPinnedRight, this.rowContainers.floatingTop, this.rowContainers.floatingTopFullWidth);
this.refreshFloatingRows(this.floatingBottomRowComps, this.pinnedRowModel.getPinnedBottomRowData(), this.rowContainers.floatingBottomPinnedLeft, this.rowContainers.floatingBottomPinnedRight, this.rowContainers.floatingBottom, this.rowContainers.floatingBottomFullWidth);
};
RowRenderer.prototype.refreshFloatingRows = function (rowComps, rowNodes, pinnedLeftContainerComp, pinnedRightContainerComp, bodyContainerComp, fullWidthContainerComp) {
var _this = this;
rowComps.forEach(function (row) {
row.destroy();
});
rowComps.length = 0;
if (rowNodes) {
rowNodes.forEach(function (node) {
var rowComp = new _row_rowComp__WEBPACK_IMPORTED_MODULE_1__["RowComp"](_this.$scope, bodyContainerComp, pinnedLeftContainerComp, pinnedRightContainerComp, fullWidthContainerComp, node, _this.beans, false, false, _this.printLayout, _this.embedFullWidthRows);
rowComp.init();
rowComps.push(rowComp);
});
}
this.flushContainers(rowComps);
};
RowRenderer.prototype.onPinnedRowDataChanged = function () {
// recycling rows in order to ensure cell editing is not cancelled
var params = {
recycleRows: true
};
this.redrawAfterModelUpdate(params);
};
RowRenderer.prototype.onModelUpdated = function (refreshEvent) {
var params = {
recycleRows: refreshEvent.keepRenderedRows,
animate: refreshEvent.animate,
newData: refreshEvent.newData,
newPage: refreshEvent.newPage,
// because this is a model updated event (not pinned rows), we
// can skip updating the pinned rows. this is needed so that if user
// is doing transaction updates, the pinned rows are not getting constantly
// trashed - or editing cells in pinned rows are not refreshed and put into read mode
onlyBody: true
};
this.redrawAfterModelUpdate(params);
};
// if the row nodes are not rendered, no index is returned
RowRenderer.prototype.getRenderedIndexesForRowNodes = function (rowNodes) {
var result = [];
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_8__["missing"])(rowNodes)) {
return result;
}
Object(_utils_object__WEBPACK_IMPORTED_MODULE_9__["iterateObject"])(this.rowCompsByIndex, function (index, renderedRow) {
var rowNode = renderedRow.getRowNode();
if (rowNodes.indexOf(rowNode) >= 0) {
result.push(index);
}
});
return result;
};
RowRenderer.prototype.redrawRows = function (rowNodes) {
if (!rowNodes || rowNodes.length == 0) {
return;
}
// we only need to be worried about rendered rows, as this method is
// called to what's rendered. if the row isn't rendered, we don't care
var indexesToRemove = this.getRenderedIndexesForRowNodes(rowNodes);
// remove the rows
this.removeRowComps(indexesToRemove);
// add draw them again
this.redrawAfterModelUpdate({
recycleRows: true
});
};
RowRenderer.prototype.getCellToRestoreFocusToAfterRefresh = function (params) {
var focusedCell = params.suppressKeepFocus ? null : this.focusController.getFocusCellToUseAfterRefresh();
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_8__["missing"])(focusedCell)) {
return null;
}
// if the dom is not actually focused on a cell, then we don't try to refocus. the problem this
// solves is with editing - if the user is editing, eg focus is on a text field, and not on the
// cell itself, then the cell can be registered as having focus, however it's the text field that
// has the focus and not the cell div. therefore, when the refresh is finished, the grid will focus
// the cell, and not the textfield. that means if the user is in a text field, and the grid refreshes,
// the focus is lost from the text field. we do not want this.
var activeElement = document.activeElement;
var domData = this.gridOptionsWrapper.getDomData(activeElement, _cellComp__WEBPACK_IMPORTED_MODULE_5__["CellComp"].DOM_DATA_KEY_CELL_COMP);
var elementIsNotACellDev = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_8__["missing"])(domData);
return elementIsNotACellDev ? null : focusedCell;
};
// gets called after changes to the model.
RowRenderer.prototype.redrawAfterModelUpdate = function (params) {
if (params === void 0) { params = {}; }
this.getLockOnRefresh();
var focusedCell = this.getCellToRestoreFocusToAfterRefresh(params);
this.sizeContainerToPageHeight();
this.scrollToTopIfNewData(params);
// never recycle rows when print layout, we draw each row again from scratch. this is because print layout
// uses normal dom layout to put cells into dom - it doesn't allow reordering rows.
var recycleRows = !this.printLayout && params.recycleRows;
var animate = params.animate && this.gridOptionsWrapper.isAnimateRows();
var rowsToRecycle = this.binRowComps(recycleRows);
var isFocusedCellGettingRecycled = function () {
if (focusedCell == null || rowsToRecycle == null) {
return false;
}
var res = false;
Object(_utils_object__WEBPACK_IMPORTED_MODULE_9__["iterateObject"])(rowsToRecycle, function (key, rowComp) {
var rowNode = rowComp.getRowNode();
var rowIndexEqual = rowNode.rowIndex == focusedCell.rowIndex;
var pinnedEqual = rowNode.rowPinned == focusedCell.rowPinned;
if (rowIndexEqual && pinnedEqual) {
res = true;
}
});
return res;
};
var focusedCellRecycled = isFocusedCellGettingRecycled();
this.redraw(rowsToRecycle, animate);
if (!params.onlyBody) {
this.refreshFloatingRowComps();
}
// if we focus a cell that's already focused, then we get an unnecessary 'cellFocused' event fired.
// this was happening when user clicked 'expand' on a rowGroup, then cellFocused was getting fired twice.
if (!focusedCellRecycled) {
this.restoreFocusedCell(focusedCell);
}
this.releaseLockOnRefresh();
};
RowRenderer.prototype.scrollToTopIfNewData = function (params) {
var scrollToTop = params.newData || params.newPage;
var suppressScrollToTop = this.gridOptionsWrapper.isSuppressScrollOnNewData();
if (scrollToTop && !suppressScrollToTop) {
this.gridPanel.scrollToTop();
}
};
RowRenderer.prototype.sizeContainerToPageHeight = function () {
var containers = [
this.rowContainers.body,
this.rowContainers.fullWidth,
this.rowContainers.pinnedLeft,
this.rowContainers.pinnedRight
];
if (this.printLayout) {
containers.forEach(function (container) { return container.setHeight(null); });
return;
}
var containerHeight = this.paginationProxy.getCurrentPageHeight();
// we need at least 1 pixel for the horizontal scroll to work. so if there are now rows,
// we still want the scroll to be present, otherwise there would be no way to scroll the header
// which might be needed us user wants to access columns
// on the RHS - and if that was where the filter was that cause no rows to be presented, there
// is no way to remove the filter.
if (containerHeight === 0) {
containerHeight = 1;
}
this.maxDivHeightScaler.setModelHeight(containerHeight);
var realHeight = this.maxDivHeightScaler.getUiContainerHeight();
containers.forEach(function (container) { return container.setHeight(realHeight); });
};
RowRenderer.prototype.getLockOnRefresh = function () {
if (this.refreshInProgress) {
throw new Error("ag-Grid: cannot get grid to draw rows when it is in the middle of drawing rows. " +
"Your code probably called a grid API method while the grid was in the render stage. To overcome " +
"this, put the API call into a timeout, e.g. instead of api.refreshView(), " +
"call setTimeout(function() { api.refreshView(); }, 0). To see what part of your code " +
"that caused the refresh check this stacktrace.");
}
this.refreshInProgress = true;
};
RowRenderer.prototype.releaseLockOnRefresh = function () {
this.refreshInProgress = false;
};
// sets the focus to the provided cell, if the cell is provided. this way, the user can call refresh without
// worry about the focus been lost. this is important when the user is using keyboard navigation to do edits
// and the cellEditor is calling 'refresh' to get other cells to update (as other cells might depend on the
// edited cell).
RowRenderer.prototype.restoreFocusedCell = function (cellPosition) {
if (cellPosition) {
this.focusController.setFocusedCell(cellPosition.rowIndex, cellPosition.column, cellPosition.rowPinned, true);
}
};
RowRenderer.prototype.stopEditing = function (cancel) {
if (cancel === void 0) { cancel = false; }
this.forEachRowComp(function (key, rowComp) {
rowComp.stopEditing(cancel);
});
};
RowRenderer.prototype.forEachCellComp = function (callback) {
this.forEachRowComp(function (key, rowComp) { return rowComp.forEachCellComp(callback); });
};
RowRenderer.prototype.forEachRowComp = function (callback) {
Object(_utils_object__WEBPACK_IMPORTED_MODULE_9__["iterateObject"])(this.rowCompsByIndex, callback);
Object(_utils_object__WEBPACK_IMPORTED_MODULE_9__["iterateObject"])(this.floatingTopRowComps, callback);
Object(_utils_object__WEBPACK_IMPORTED_MODULE_9__["iterateObject"])(this.floatingBottomRowComps, callback);
};
RowRenderer.prototype.addRenderedRowListener = function (eventName, rowIndex, callback) {
var rowComp = this.rowCompsByIndex[rowIndex];
if (rowComp) {
rowComp.addEventListener(eventName, callback);
}
};
RowRenderer.prototype.flashCells = function (params) {
if (params === void 0) { params = {}; }
var flashDelay = params.flashDelay, fadeDelay = params.fadeDelay;
this.forEachCellCompFiltered(params.rowNodes, params.columns, function (cellComp) { return cellComp.flashCell({ flashDelay: flashDelay, fadeDelay: fadeDelay }); });
};
RowRenderer.prototype.refreshCells = function (params) {
if (params === void 0) { params = {}; }
var refreshCellParams = {
forceRefresh: params.force,
newData: false,
suppressFlash: params.suppressFlash
};
this.forEachCellCompFiltered(params.rowNodes, params.columns, function (cellComp) { return cellComp.refreshCell(refreshCellParams); });
};
RowRenderer.prototype.getCellRendererInstances = function (params) {
var res = [];
this.forEachCellCompFiltered(params.rowNodes, params.columns, function (cellComp) {
var cellRenderer = cellComp.getCellRenderer();
if (cellRenderer) {
res.push(cellRenderer);
}
});
return res;
};
RowRenderer.prototype.getCellEditorInstances = function (params) {
var res = [];
this.forEachCellCompFiltered(params.rowNodes, params.columns, function (cellComp) {
var cellEditor = cellComp.getCellEditor();
if (cellEditor) {
res.push(cellEditor);
}
});
return res;
};
RowRenderer.prototype.getEditingCells = function () {
var res = [];
this.forEachCellComp(function (cellComp) {
if (cellComp.isEditing()) {
var cellPosition = cellComp.getCellPosition();
res.push(cellPosition);
}
});
return res;
};
// calls the callback for each cellComp that match the provided rowNodes and columns. eg if one row node
// and two columns provided, that identifies 4 cells, so callback gets called 4 times, once for each cell.
RowRenderer.prototype.forEachCellCompFiltered = function (rowNodes, columns, callback) {
var _this = this;
var rowIdsMap;
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_8__["exists"])(rowNodes)) {
rowIdsMap = {
top: {},
bottom: {},
normal: {}
};
rowNodes.forEach(function (rowNode) {
if (rowNode.rowPinned === _constants_constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].PINNED_TOP) {
rowIdsMap.top[rowNode.id] = true;
}
else if (rowNode.rowPinned === _constants_constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].PINNED_BOTTOM) {
rowIdsMap.bottom[rowNode.id] = true;
}
else {
rowIdsMap.normal[rowNode.id] = true;
}
});
}
var colIdsMap;
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_8__["exists"])(columns)) {
colIdsMap = {};
columns.forEach(function (colKey) {
var column = _this.columnController.getGridColumn(colKey);
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_8__["exists"])(column)) {
colIdsMap[column.getId()] = true;
}
});
}
var processRow = function (rowComp) {
var rowNode = rowComp.getRowNode();
var id = rowNode.id;
var floating = rowNode.rowPinned;
// skip this row if it is missing from the provided list
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_8__["exists"])(rowIdsMap)) {
if (floating === _constants_constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].PINNED_BOTTOM) {
if (!rowIdsMap.bottom[id]) {
return;
}
}
else if (floating === _constants_constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].PINNED_TOP) {
if (!rowIdsMap.top[id]) {
return;
}
}
else {
if (!rowIdsMap.normal[id]) {
return;
}
}
}
rowComp.forEachCellComp(function (cellComp) {
var colId = cellComp.getColumn().getId();
var excludeColFromRefresh = colIdsMap && !colIdsMap[colId];
if (excludeColFromRefresh) {
return;
}
callback(cellComp);
});
};
Object(_utils_object__WEBPACK_IMPORTED_MODULE_9__["iterateObject"])(this.rowCompsByIndex, function (index, rowComp) {
processRow(rowComp);
});
if (this.floatingTopRowComps) {
this.floatingTopRowComps.forEach(processRow);
}
if (this.floatingBottomRowComps) {
this.floatingBottomRowComps.forEach(processRow);
}
};
RowRenderer.prototype.destroy = function () {
var rowIndexesToRemove = Object.keys(this.rowCompsByIndex);
this.removeRowComps(rowIndexesToRemove);
_super.prototype.destroy.call(this);
};
RowRenderer.prototype.binRowComps = function (recycleRows) {
var _this = this;
var rowsToRecycle = {};
var indexesToRemove;
if (recycleRows) {
indexesToRemove = [];
Object(_utils_object__WEBPACK_IMPORTED_MODULE_9__["iterateObject"])(this.rowCompsByIndex, function (index, rowComp) {
var rowNode = rowComp.getRowNode();
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_8__["exists"])(rowNode.id)) {
rowsToRecycle[rowNode.id] = rowComp;
delete _this.rowCompsByIndex[index];
}
else {
indexesToRemove.push(index);
}
});
}
else {
indexesToRemove = Object.keys(this.rowCompsByIndex);
}
this.removeRowComps(indexesToRemove);
return rowsToRecycle;
};
// takes array of row indexes
RowRenderer.prototype.removeRowComps = function (rowsToRemove) {
var _this = this;
// if no fromIndex then set to -1, which will refresh everything
// let realFromIndex = -1;
rowsToRemove.forEach(function (indexToRemove) {
var renderedRow = _this.rowCompsByIndex[indexToRemove];
renderedRow.destroy();
delete _this.rowCompsByIndex[indexToRemove];
});
};
// gets called when rows don't change, but viewport does, so after:
// 1) height of grid body changes, ie number of displayed rows has changed
// 2) grid scrolled to new position
// 3) ensure index visible (which is a scroll)
RowRenderer.prototype.redrawAfterScroll = function () {
this.getLockOnRefresh();
this.redraw(null, false, true);
this.releaseLockOnRefresh();
};
RowRenderer.prototype.removeRowCompsNotToDraw = function (indexesToDraw) {
// for speedy lookup, dump into map
var indexesToDrawMap = {};
indexesToDraw.forEach(function (index) { return (indexesToDrawMap[index] = true); });
var existingIndexes = Object.keys(this.rowCompsByIndex);
var indexesNotToDraw = existingIndexes.filter(function (index) { return !indexesToDrawMap[index]; });
this.removeRowComps(indexesNotToDraw);
};
RowRenderer.prototype.calculateIndexesToDraw = function (rowsToRecycle) {
var _this = this;
// all in all indexes in the viewport
var indexesToDraw = Object(_utils_number__WEBPACK_IMPORTED_MODULE_10__["createArrayOfNumbers"])(this.firstRenderedRow, this.lastRenderedRow);
var checkRowToDraw = function (indexStr, rowComp) {
var index = rowComp.getRowNode().rowIndex;
if (index == null) {
return;
}
if (index < _this.firstRenderedRow || index > _this.lastRenderedRow) {
if (_this.doNotUnVirtualiseRow(rowComp)) {
indexesToDraw.push(index);
}
}
};
// if we are redrawing due to scrolling change, then old rows are in this.rowCompsByIndex
Object(_utils_object__WEBPACK_IMPORTED_MODULE_9__["iterateObject"])(this.rowCompsByIndex, checkRowToDraw);
// if we are redrawing due to model update, then old rows are in rowsToRecycle
Object(_utils_object__WEBPACK_IMPORTED_MODULE_9__["iterateObject"])(rowsToRecycle, checkRowToDraw);
indexesToDraw.sort(function (a, b) { return a - b; });
return indexesToDraw;
};
RowRenderer.prototype.redraw = function (rowsToRecycle, animate, afterScroll) {
var _this = this;
if (animate === void 0) { animate = false; }
if (afterScroll === void 0) { afterScroll = false; }
this.maxDivHeightScaler.updateOffset();
this.workOutFirstAndLastRowsToRender();
// the row can already exist and be in the following:
// rowsToRecycle -> if model change, then the index may be different, however row may
// exist here from previous time (mapped by id).
// this.rowCompsByIndex -> if just a scroll, then this will contain what is currently in the viewport
// this is all the indexes we want, including those that already exist, so this method
// will end up going through each index and drawing only if the row doesn't already exist
var indexesToDraw = this.calculateIndexesToDraw(rowsToRecycle);
this.removeRowCompsNotToDraw(indexesToDraw);
// never animate when doing print layout - as we want to get things ready to print as quickly as possible,
// otherwise we risk the printer printing a row that's half faded (half way through fading in)
if (this.printLayout) {
animate = false;
}
// add in new rows
var nextVmTurnFunctions = [];
var rowComps = [];
indexesToDraw.forEach(function (rowIndex) {
var rowComp = _this.createOrUpdateRowComp(rowIndex, rowsToRecycle, animate, afterScroll);
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_8__["exists"])(rowComp)) {
rowComps.push(rowComp);
Object(_utils_array__WEBPACK_IMPORTED_MODULE_11__["pushAll"])(nextVmTurnFunctions, rowComp.getAndClearNextVMTurnFunctions());
}
});
this.flushContainers(rowComps);
Object(_utils_function__WEBPACK_IMPORTED_MODULE_12__["executeNextVMTurn"])(nextVmTurnFunctions);
var useAnimationFrame = afterScroll && !this.gridOptionsWrapper.isSuppressAnimationFrame() && !this.printLayout;
if (useAnimationFrame) {
this.beans.taskQueue.addDestroyTask(this.destroyRowComps.bind(this, rowsToRecycle, animate));
}
else {
this.destroyRowComps(rowsToRecycle, animate);
}
this.checkAngularCompile();
this.gridPanel.updateRowCount();
};
RowRenderer.prototype.flushContainers = function (rowComps) {
Object(_utils_object__WEBPACK_IMPORTED_MODULE_9__["iterateObject"])(this.rowContainers, function (key, rowContainerComp) {
if (rowContainerComp) {
rowContainerComp.flushRowTemplates();
}
});
rowComps.forEach(function (rowComp) { return rowComp.afterFlush(); });
};
RowRenderer.prototype.onDisplayedColumnsChanged = function () {
var pinningLeft = this.columnController.isPinningLeft();
var pinningRight = this.columnController.isPinningRight();
var atLeastOneChanged = this.pinningLeft !== pinningLeft || pinningRight !== this.pinningRight;
if (atLeastOneChanged) {
this.pinningLeft = pinningLeft;
this.pinningRight = pinningRight;
if (this.embedFullWidthRows) {
this.redrawFullWidthEmbeddedRows();
}
}
};
// when embedding, what gets showed in each section depends on what is pinned. eg if embedding group expand / collapse,
// then it should go into the pinned left area if pinning left, or the center area if not pinning.
RowRenderer.prototype.redrawFullWidthEmbeddedRows = function () {
// if either of the pinned panels has shown / hidden, then need to redraw the fullWidth bits when
// embedded, as what appears in each section depends on whether we are pinned or not
var rowsToRemove = [];
Object(_utils_object__WEBPACK_IMPORTED_MODULE_9__["iterateObject"])(this.rowCompsByIndex, function (id, rowComp) {
if (rowComp.isFullWidth()) {
var rowIndex = rowComp.getRowNode().rowIndex;
rowsToRemove.push(rowIndex.toString());
}
});
this.refreshFloatingRowComps();
this.removeRowComps(rowsToRemove);
this.redrawAfterScroll();
};
RowRenderer.prototype.refreshFullWidthRows = function (rowNodesToRefresh) {
var rowsToRemove = [];
var selectivelyRefreshing = !!rowNodesToRefresh;
var idsToRefresh = selectivelyRefreshing ? {} : undefined;
if (selectivelyRefreshing) {
rowNodesToRefresh.forEach(function (r) { return idsToRefresh[r.id] = true; });
}
Object(_utils_object__WEBPACK_IMPORTED_MODULE_9__["iterateObject"])(this.rowCompsByIndex, function (id, rowComp) {
if (!rowComp.isFullWidth()) {
return;
}
var rowNode = rowComp.getRowNode();
if (selectivelyRefreshing) {
// we refresh if a) this node is present or b) this parents nodes is present. checking parent
// node is important for master/detail, as we want detail to refresh on changes to parent node.
// it's also possible, if user is provider their own fullWidth, that details panels contain
// some info on the parent, eg if in tree data and child row shows some data from parent row also.
var parentId = (rowNode.level > 0 && rowNode.parent) ? rowNode.parent.id : undefined;
var skipThisNode = !idsToRefresh[rowNode.id] && !idsToRefresh[parentId];
if (skipThisNode) {
return;
}
}
var fullWidthRowsRefreshed = rowComp.refreshFullWidth();
if (!fullWidthRowsRefreshed) {
var rowIndex = rowComp.getRowNode().rowIndex;
rowsToRemove.push(rowIndex.toString());
}
});
this.removeRowComps(rowsToRemove);
this.redrawAfterScroll();
};
RowRenderer.prototype.createOrUpdateRowComp = function (rowIndex, rowsToRecycle, animate, afterScroll) {
var rowNode;
var rowComp = this.rowCompsByIndex[rowIndex];
// if no row comp, see if we can get it from the previous rowComps
if (!rowComp) {
rowNode = this.paginationProxy.getRow(rowIndex);
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_8__["exists"])(rowNode) && Object(_utils_generic__WEBPACK_IMPORTED_MODULE_8__["exists"])(rowsToRecycle) && rowsToRecycle[rowNode.id] && rowNode.alreadyRendered) {
rowComp = rowsToRecycle[rowNode.id];
rowsToRecycle[rowNode.id] = null;
}
}
var creatingNewRowComp = !rowComp;
if (creatingNewRowComp) {
// create a new one
if (!rowNode) {
rowNode = this.paginationProxy.getRow(rowIndex);
}
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_8__["exists"])(rowNode)) {
rowComp = this.createRowComp(rowNode, animate, afterScroll);
}
else {
// this should never happen - if somehow we are trying to create
// a row for a rowNode that does not exist.
return;
}
}
else {
// ensure row comp is in right position in DOM
rowComp.ensureDomOrder();
}
if (rowNode) {
// set node as 'alreadyRendered' to ensure we only recycle rowComps that have been rendered, this ensures
// we don't reuse rowComps that have been removed and then re-added in the same batch transaction.
rowNode.alreadyRendered = true;
}
this.rowCompsByIndex[rowIndex] = rowComp;
return rowComp;
};
RowRenderer.prototype.destroyRowComps = function (rowCompsMap, animate) {
var delayedFuncs = [];
Object(_utils_object__WEBPACK_IMPORTED_MODULE_9__["iterateObject"])(rowCompsMap, function (nodeId, rowComp) {
// if row was used, then it's null
if (!rowComp) {
return;
}
rowComp.destroy(animate);
Object(_utils_array__WEBPACK_IMPORTED_MODULE_11__["pushAll"])(delayedFuncs, rowComp.getAndClearDelayedDestroyFunctions());
});
Object(_utils_function__WEBPACK_IMPORTED_MODULE_12__["executeInAWhile"])(delayedFuncs);
};
RowRenderer.prototype.checkAngularCompile = function () {
var _this = this;
// if we are doing angular compiling, then do digest the scope here
if (this.gridOptionsWrapper.isAngularCompileRows()) {
// we do it in a timeout, in case we are already in an apply
window.setTimeout(function () {
_this.$scope.$apply();
}, 0);
}
};
RowRenderer.prototype.workOutFirstAndLastRowsToRender = function () {
var _this = this;
var newFirst;
var newLast;
if (!this.paginationProxy.isRowsToRender()) {
newFirst = 0;
newLast = -1; // setting to -1 means nothing in range
}
else if (this.printLayout) {
newFirst = this.paginationProxy.getPageFirstRow();
newLast = this.paginationProxy.getPageLastRow();
}
else {
var paginationOffset = this.paginationProxy.getPixelOffset();
var maxDivHeightScaler = this.maxDivHeightScaler.getOffset();
var bodyVRange = this.gridPanel.getVScrollPosition();
var bodyTopPixel = bodyVRange.top;
var bodyBottomPixel = bodyVRange.bottom;
var bufferPixels = this.gridOptionsWrapper.getRowBufferInPixels();
var firstPixel = bodyTopPixel + paginationOffset + maxDivHeightScaler - bufferPixels;
var lastPixel = bodyBottomPixel + paginationOffset + maxDivHeightScaler + bufferPixels;
this.ensureAllRowsInRangeHaveHeightsCalculated(firstPixel, lastPixel);
var firstRowIndex = this.paginationProxy.getRowIndexAtPixel(firstPixel);
var lastRowIndex = this.paginationProxy.getRowIndexAtPixel(lastPixel);
var pageFirstRow = this.paginationProxy.getPageFirstRow();
var pageLastRow = this.paginationProxy.getPageLastRow();
// adjust, in case buffer extended actual size
if (firstRowIndex < pageFirstRow) {
firstRowIndex = pageFirstRow;
}
if (lastRowIndex > pageLastRow) {
lastRowIndex = pageLastRow;
}
newFirst = firstRowIndex;
newLast = lastRowIndex;
}
// sometimes user doesn't set CSS right and ends up with grid with no height and grid ends up
// trying to render all the rows, eg 10,000+ rows. this will kill the browser. so instead of
// killing the browser, we limit the number of rows. just in case some use case we didn't think
// of, we also have a property to not do this operation.
var rowLayoutNormal = this.gridOptionsWrapper.getDomLayout() === _constants_constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].DOM_LAYOUT_NORMAL;
var suppressRowCountRestriction = this.gridOptionsWrapper.isSuppressMaxRenderedRowRestriction();
var rowBufferMaxSize = Math.max(this.gridOptionsWrapper.getRowBuffer(), 500);
if (rowLayoutNormal && !suppressRowCountRestriction) {
if (newLast - newFirst > rowBufferMaxSize) {
newLast = newFirst + rowBufferMaxSize;
}
}
var firstDiffers = newFirst !== this.firstRenderedRow;
var lastDiffers = newLast !== this.lastRenderedRow;
if (firstDiffers || lastDiffers) {
this.firstRenderedRow = newFirst;
this.lastRenderedRow = newLast;
var event_1 = {
type: _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_VIEWPORT_CHANGED,
firstRow: newFirst,
lastRow: newLast,
api: this.gridApi,
columnApi: this.columnApi
};
this.eventService.dispatchEvent(event_1);
}
// only dispatch firstDataRendered if we have actually rendered some data
if (this.paginationProxy.isRowsToRender()) {
var event_2 = {
type: _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_FIRST_DATA_RENDERED,
firstRow: newFirst,
lastRow: newLast,
api: this.gridApi,
columnApi: this.columnApi
};
// added a small delay here because in some scenarios this can be fired
// before the grid is actually rendered, causing component creation
// on EVENT_FIRST_DATA_RENDERED to fail.
window.setTimeout(function () { return _this.eventService.dispatchEventOnce(event_2); }, 50);
}
};
RowRenderer.prototype.ensureAllRowsInRangeHaveHeightsCalculated = function (topPixel, bottomPixel) {
// ensureRowHeightsVisible only works with CSRM, as it's the only row model that allows lazy row height calcs.
// all the other row models just hard code so the method just returns back false
var rowHeightsChanged = this.paginationProxy.ensureRowHeightsValid(topPixel, bottomPixel, -1, -1);
if (rowHeightsChanged) {
// if row heights have changed, we need to resize the containers the rows sit it
this.sizeContainerToPageHeight();
// we also need to update heightScaler as this has dependency of row container height
this.maxDivHeightScaler.updateOffset();
}
};
RowRenderer.prototype.getFirstVirtualRenderedRow = function () {
return this.firstRenderedRow;
};
RowRenderer.prototype.getLastVirtualRenderedRow = function () {
return this.lastRenderedRow;
};
// check that none of the rows to remove are editing or focused as:
// a) if editing, we want to keep them, otherwise the user will loose the context of the edit,
// eg user starts editing, enters some text, then scrolls down and then up, next time row rendered
// the edit is reset - so we want to keep it rendered.
// b) if focused, we want ot keep keyboard focus, so if user ctrl+c, it goes to clipboard,
// otherwise the user can range select and drag (with focus cell going out of the viewport)
// and then ctrl+c, nothing will happen if cell is removed from dom.
// c) if detail record of master detail, as users complained that the context of detail rows
// was getting lost when detail row out of view. eg user expands to show detail row,
// then manipulates the detail panel (eg sorts the detail grid), then context is lost
// after detail panel is scrolled out of / into view.
RowRenderer.prototype.doNotUnVirtualiseRow = function (rowComp) {
var REMOVE_ROW = false;
var KEEP_ROW = true;
var rowNode = rowComp.getRowNode();
var rowHasFocus = this.focusController.isRowNodeFocused(rowNode);
var rowIsEditing = rowComp.isEditing();
var rowIsDetail = rowNode.detail;
var mightWantToKeepRow = rowHasFocus || rowIsEditing || rowIsDetail;
// if we deffo don't want to keep it,
if (!mightWantToKeepRow) {
return REMOVE_ROW;
}
// editing row, only remove if it is no longer rendered, eg filtered out or new data set.
// the reason we want to keep is if user is scrolling up and down, we don't want to loose
// the context of the editing in process.
var rowNodePresent = this.paginationProxy.isRowPresent(rowNode);
return rowNodePresent ? KEEP_ROW : REMOVE_ROW;
};
RowRenderer.prototype.createRowComp = function (rowNode, animate, afterScroll) {
var suppressAnimationFrame = this.gridOptionsWrapper.isSuppressAnimationFrame();
// we don't use animations frames for printing, so the user can put the grid into print mode
// and immediately print - otherwise the user would have to wait for the rows to draw in the background
// (via the animation frames) which is awkward to do from code.
// we only do the animation frames after scrolling, as this is where we want the smooth user experience.
// having animation frames for other times makes the grid look 'jumpy'.
var useAnimationFrameForCreate = afterScroll && !suppressAnimationFrame && !this.printLayout;
var rowComp = new _row_rowComp__WEBPACK_IMPORTED_MODULE_1__["RowComp"](this.$scope, this.rowContainers.body, this.rowContainers.pinnedLeft, this.rowContainers.pinnedRight, this.rowContainers.fullWidth, rowNode, this.beans, animate, useAnimationFrameForCreate, this.printLayout, this.embedFullWidthRows);
rowComp.init();
return rowComp;
};
RowRenderer.prototype.getRenderedNodes = function () {
var renderedRows = this.rowCompsByIndex;
return Object.keys(renderedRows).map(function (key) { return renderedRows[key].getRowNode(); });
};
// we use index for rows, but column object for columns, as the next column (by index) might not
// be visible (header grouping) so it's not reliable, so using the column object instead.
RowRenderer.prototype.navigateToNextCell = function (event, key, currentCell, allowUserOverride) {
// we keep searching for a next cell until we find one. this is how the group rows get skipped
var nextCell = currentCell;
var hitEdgeOfGrid = false;
while (nextCell && (nextCell === currentCell || !this.isValidNavigateCell(nextCell))) {
// if the current cell is spanning across multiple columns, we need to move
// our current position to be the last cell on the right before finding the
// the next target.
if (this.gridOptionsWrapper.isEnableRtl()) {
if (key === _constants_keyCode__WEBPACK_IMPORTED_MODULE_13__["KeyCode"].LEFT) {
nextCell = this.getLastCellOfColSpan(nextCell);
}
}
else if (key === _constants_keyCode__WEBPACK_IMPORTED_MODULE_13__["KeyCode"].RIGHT) {
nextCell = this.getLastCellOfColSpan(nextCell);
}
nextCell = this.cellNavigationService.getNextCellToFocus(key, nextCell);
// eg if going down, and nextCell=undefined, means we are gone past the last row
hitEdgeOfGrid = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_8__["missing"])(nextCell);
}
if (hitEdgeOfGrid && event && event.keyCode === _constants_keyCode__WEBPACK_IMPORTED_MODULE_13__["KeyCode"].UP) {
nextCell = {
rowIndex: -1,
rowPinned: null,
column: currentCell.column
};
}
// allow user to override what cell to go to next. when doing normal cell navigation (with keys)
// we allow this, however if processing 'enter after edit' we don't allow override
if (allowUserOverride) {
var userFunc = this.gridOptionsWrapper.getNavigateToNextCellFunc();
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_8__["exists"])(userFunc)) {
var params = {
key: key,
previousCellPosition: currentCell,
nextCellPosition: nextCell ? nextCell : null,
event: event
};
var userCell = userFunc(params);
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_8__["exists"])(userCell)) {
if (userCell.floating) {
Object(_utils_function__WEBPACK_IMPORTED_MODULE_12__["doOnce"])(function () { console.warn("ag-Grid: tabToNextCellFunc return type should have attributes: rowIndex, rowPinned, column. However you had 'floating', maybe you meant 'rowPinned'?"); }, 'no floating in userCell');
userCell.rowPinned = userCell.floating;
}
nextCell = {
rowPinned: userCell.rowPinned,
rowIndex: userCell.rowIndex,
column: userCell.column
};
}
else {
nextCell = null;
}
}
}
// no next cell means we have reached a grid boundary, eg left, right, top or bottom of grid
if (!nextCell) {
return;
}
if (nextCell.rowIndex < 0) {
var headerLen = this.beans.headerNavigationService.getHeaderRowCount();
this.focusController.focusHeaderPosition({ headerRowIndex: headerLen + (nextCell.rowIndex), column: currentCell.column });
return;
}
// in case we have col spanning we get the cellComp and use it to
// get the position. This was we always focus the first cell inside
// the spanning.
this.ensureCellVisible(nextCell); // ensureCellVisible first, to make sure nextCell is rendered
var cellComp = this.getComponentForCell(nextCell);
// not guaranteed to have a cellComp when using the SSRM as blocks are loading.
if (!cellComp) {
return;
}
nextCell = cellComp.getCellPosition();
// we call this again, as nextCell can be different to it's previous value due to Column Spanning
// (ie if cursor moving from right to left, and cell is spanning columns, then nextCell was the
// last column in the group, however now it's the first column in the group). if we didn't do
// ensureCellVisible again, then we could only be showing the last portion (last column) of the
// merged cells.
this.ensureCellVisible(nextCell);
this.focusController.setFocusedCell(nextCell.rowIndex, nextCell.column, nextCell.rowPinned, true);
if (this.rangeController) {
this.rangeController.setRangeToCell(nextCell);
}
};
RowRenderer.prototype.isValidNavigateCell = function (cell) {
var rowNode = this.rowPositionUtils.getRowNode(cell);
// we do not allow focusing on detail rows and full width rows
if (rowNode.detail || rowNode.isFullWidthCell()) {
return false;
}
// if not a group, then we have a valid row, so quit the search
if (!rowNode.group) {
return true;
}
// full width rows cannot be focused, so if it's a group and using full width rows,
// we need to skip over the row
var pivotMode = this.columnController.isPivotMode();
var usingFullWidthRows = this.gridOptionsWrapper.isGroupUseEntireRow(pivotMode);
if (!usingFullWidthRows) {
return true;
}
return false;
};
RowRenderer.prototype.getLastCellOfColSpan = function (cell) {
var cellComp = this.getComponentForCell(cell);
if (!cellComp) {
return cell;
}
var colSpanningList = cellComp.getColSpanningList();
if (colSpanningList.length === 1) {
return cell;
}
return {
rowIndex: cell.rowIndex,
column: Object(_utils_array__WEBPACK_IMPORTED_MODULE_11__["last"])(colSpanningList),
rowPinned: cell.rowPinned
};
};
RowRenderer.prototype.ensureCellVisible = function (gridCell) {
// this scrolls the row into view
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_8__["missing"])(gridCell.rowPinned)) {
this.gridPanel.ensureIndexVisible(gridCell.rowIndex);
}
if (!gridCell.column.isPinned()) {
this.gridPanel.ensureColumnVisible(gridCell.column);
}
// need to nudge the scrolls for the floating items. otherwise when we set focus on a non-visible
// floating cell, the scrolls get out of sync
this.gridPanel.horizontallyScrollHeaderCenterAndFloatingCenter();
// need to flush frames, to make sure the correct cells are rendered
this.animationFrameService.flushAllFrames();
};
RowRenderer.prototype.startEditingCell = function (gridCell, keyPress, charPress) {
var cell = this.getComponentForCell(gridCell);
if (cell) {
cell.startRowOrCellEdit(keyPress, charPress);
}
};
RowRenderer.prototype.getComponentForCell = function (cellPosition) {
var rowComponent;
switch (cellPosition.rowPinned) {
case _constants_constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].PINNED_TOP:
rowComponent = this.floatingTopRowComps[cellPosition.rowIndex];
break;
case _constants_constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].PINNED_BOTTOM:
rowComponent = this.floatingBottomRowComps[cellPosition.rowIndex];
break;
default:
rowComponent = this.rowCompsByIndex[cellPosition.rowIndex];
break;
}
if (!rowComponent) {
return null;
}
var cellComponent = rowComponent.getRenderedCellForColumn(cellPosition.column);
return cellComponent;
};
RowRenderer.prototype.getRowNode = function (gridRow) {
switch (gridRow.rowPinned) {
case _constants_constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].PINNED_TOP:
return this.pinnedRowModel.getPinnedTopRowData()[gridRow.rowIndex];
case _constants_constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].PINNED_BOTTOM:
return this.pinnedRowModel.getPinnedBottomRowData()[gridRow.rowIndex];
default:
return this.rowModel.getRow(gridRow.rowIndex);
}
};
RowRenderer.prototype.onTabKeyDown = function (previousRenderedCell, keyboardEvent) {
var backwards = keyboardEvent.shiftKey;
var success = this.moveToCellAfter(previousRenderedCell, backwards);
if (success) {
keyboardEvent.preventDefault();
}
else if (backwards) {
var _a = previousRenderedCell.getCellPosition(), rowIndex = _a.rowIndex, rowPinned = _a.rowPinned;
var firstRow = rowPinned ? rowIndex === 0 : rowIndex === this.paginationProxy.getPageFirstRow();
if (firstRow) {
keyboardEvent.preventDefault();
var headerRowIndex = this.beans.headerNavigationService.getHeaderRowCount() - 1;
var column = Object(_utils_array__WEBPACK_IMPORTED_MODULE_11__["last"])(this.columnController.getAllDisplayedColumns());
this.focusController.focusHeaderPosition({ headerRowIndex: headerRowIndex, column: column });
}
}
else {
// if the case it's a popup editor, the focus is on the editor and not the previous cell.
// in order for the tab navigation to work, we need to focus the browser back onto the
// previous cell.
previousRenderedCell.focusCell(true);
if (this.focusController.focusNextGridCoreContainer(false)) {
keyboardEvent.preventDefault();
}
}
};
RowRenderer.prototype.tabToNextCell = function (backwards) {
var focusedCell = this.focusController.getFocusedCell();
// if no focus, then cannot navigate
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_8__["missing"])(focusedCell)) {
return false;
}
var renderedCell = this.getComponentForCell(focusedCell);
// if cell is not rendered, means user has scrolled away from the cell
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_8__["missing"])(renderedCell)) {
return false;
}
var result = this.moveToCellAfter(renderedCell, backwards);
return result;
};
RowRenderer.prototype.moveToCellAfter = function (previousRenderedCell, backwards) {
var editing = previousRenderedCell.isEditing();
var res;
if (editing) {
if (this.gridOptionsWrapper.isFullRowEdit()) {
res = this.moveToNextEditingRow(previousRenderedCell, backwards);
}
else {
res = this.moveToNextEditingCell(previousRenderedCell, backwards);
}
}
else {
res = this.moveToNextCellNotEditing(previousRenderedCell, backwards);
}
// if a cell wasn't found, it's possible that focus was moved to the header
return res || !!this.focusController.getFocusedHeader();
};
RowRenderer.prototype.moveToNextEditingCell = function (previousRenderedCell, backwards) {
var gridCell = previousRenderedCell.getCellPosition();
// need to do this before getting next cell to edit, in case the next cell
// has editable function (eg colDef.editable=func() ) and it depends on the
// result of this cell, so need to save updates from the first edit, in case
// the value is referenced in the function.
previousRenderedCell.stopEditing();
// find the next cell to start editing
var nextRenderedCell = this.findNextCellToFocusOn(gridCell, backwards, true);
var foundCell = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_8__["exists"])(nextRenderedCell);
// only prevent default if we found a cell. so if user is on last cell and hits tab, then we default
// to the normal tabbing so user can exit the grid.
if (foundCell) {
nextRenderedCell.startEditingIfEnabled(null, null, true);
nextRenderedCell.focusCell(false);
}
return foundCell;
};
RowRenderer.prototype.moveToNextEditingRow = function (previousRenderedCell, backwards) {
var gridCell = previousRenderedCell.getCellPosition();
// find the next cell to start editing
var nextRenderedCell = this.findNextCellToFocusOn(gridCell, backwards, true);
var foundCell = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_8__["exists"])(nextRenderedCell);
// only prevent default if we found a cell. so if user is on last cell and hits tab, then we default
// to the normal tabbing so user can exit the grid.
if (foundCell) {
this.moveEditToNextCellOrRow(previousRenderedCell, nextRenderedCell);
}
return foundCell;
};
RowRenderer.prototype.moveToNextCellNotEditing = function (previousRenderedCell, backwards) {
var gridCell = previousRenderedCell.getCellPosition();
// find the next cell to start editing
var nextRenderedCell = this.findNextCellToFocusOn(gridCell, backwards, false);
var foundCell = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_8__["exists"])(nextRenderedCell);
// only prevent default if we found a cell. so if user is on last cell and hits tab, then we default
// to the normal tabbing so user can exit the grid.
if (foundCell) {
nextRenderedCell.focusCell(true);
}
return foundCell;
};
RowRenderer.prototype.moveEditToNextCellOrRow = function (previousRenderedCell, nextRenderedCell) {
var pGridCell = previousRenderedCell.getCellPosition();
var nGridCell = nextRenderedCell.getCellPosition();
var rowsMatch = pGridCell.rowIndex === nGridCell.rowIndex && pGridCell.rowPinned === nGridCell.rowPinned;
if (rowsMatch) {
// same row, so we don't start / stop editing, we just move the focus along
previousRenderedCell.setFocusOutOnEditor();
nextRenderedCell.setFocusInOnEditor();
}
else {
var pRow = previousRenderedCell.getRenderedRow();
var nRow = nextRenderedCell.getRenderedRow();
previousRenderedCell.setFocusOutOnEditor();
pRow.stopEditing();
nRow.startRowEditing();
nextRenderedCell.setFocusInOnEditor();
}
nextRenderedCell.focusCell();
};
// called by the cell, when tab is pressed while editing.
// @return: RenderedCell when navigation successful, otherwise null
RowRenderer.prototype.findNextCellToFocusOn = function (gridCell, backwards, startEditing) {
var nextCell = gridCell;
while (true) {
if (!backwards) {
nextCell = this.getLastCellOfColSpan(nextCell);
}
nextCell = this.cellNavigationService.getNextTabbedCell(nextCell, backwards);
// allow user to override what cell to go to next
var userFunc = this.gridOptionsWrapper.getTabToNextCellFunc();
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_8__["exists"])(userFunc)) {
var params = {
backwards: backwards,
editing: startEditing,
previousCellPosition: gridCell,
nextCellPosition: nextCell ? nextCell : null
};
var userCell = userFunc(params);
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_8__["exists"])(userCell)) {
if (userCell.floating) {
Object(_utils_function__WEBPACK_IMPORTED_MODULE_12__["doOnce"])(function () { console.warn("ag-Grid: tabToNextCellFunc return type should have attributes: rowIndex, rowPinned, column. However you had 'floating', maybe you meant 'rowPinned'?"); }, 'no floating in userCell');
userCell.rowPinned = userCell.floating;
}
nextCell = {
rowIndex: userCell.rowIndex,
column: userCell.column,
rowPinned: userCell.rowPinned
};
}
else {
nextCell = null;
}
}
// if no 'next cell', means we have got to last cell of grid, so nothing to move to,
// so bottom right cell going forwards, or top left going backwards
if (!nextCell) {
return null;
}
if (nextCell.rowIndex < 0) {
var headerLen = this.beans.headerNavigationService.getHeaderRowCount();
this.focusController.focusHeaderPosition({ headerRowIndex: headerLen + (nextCell.rowIndex), column: nextCell.column });
return null;
}
// if editing, but cell not editable, skip cell. we do this before we do all of
// the 'ensure index visible' and 'flush all frames', otherwise if we are skipping
// a bunch of cells (eg 10 rows) then all the work on ensuring cell visible is useless
// (except for the last one) which causes grid to stall for a while.
if (startEditing) {
var rowNode = this.lookupRowNodeForCell(nextCell);
var cellIsEditable = nextCell.column.isCellEditable(rowNode);
if (!cellIsEditable) {
continue;
}
}
// this scrolls the row into view
var cellIsNotFloating = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_8__["missing"])(nextCell.rowPinned);
if (cellIsNotFloating) {
this.gridPanel.ensureIndexVisible(nextCell.rowIndex);
}
// pinned columns don't scroll, so no need to ensure index visible
if (!nextCell.column.isPinned()) {
this.gridPanel.ensureColumnVisible(nextCell.column);
}
// need to nudge the scrolls for the floating items. otherwise when we set focus on a non-visible
// floating cell, the scrolls get out of sync
this.gridPanel.horizontallyScrollHeaderCenterAndFloatingCenter();
// get the grid panel to flush all animation frames - otherwise the call below to get the cellComp
// could fail, if we just scrolled the grid (to make a cell visible) and the rendering hasn't finished.
this.animationFrameService.flushAllFrames();
// we have to call this after ensureColumnVisible - otherwise it could be a virtual column
// or row that is not currently in view, hence the renderedCell would not exist
var nextCellComp = this.getComponentForCell(nextCell);
// if next cell is fullWidth row, then no rendered cell,
// as fullWidth rows have no cells, so we skip it
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_8__["missing"])(nextCellComp)) {
continue;
}
if (nextCellComp.isSuppressNavigable()) {
continue;
}
// by default, when we click a cell, it gets selected into a range, so to keep keyboard navigation
// consistent, we set into range here also.
if (this.rangeController) {
this.rangeController.setRangeToCell(nextCell);
}
// we successfully tabbed onto a grid cell, so return true
return nextCellComp;
}
};
RowRenderer.prototype.lookupRowNodeForCell = function (cell) {
if (cell.rowPinned === _constants_constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].PINNED_TOP) {
return this.pinnedRowModel.getPinnedTopRow(cell.rowIndex);
}
if (cell.rowPinned === _constants_constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].PINNED_BOTTOM) {
return this.pinnedRowModel.getPinnedBottomRow(cell.rowIndex);
}
return this.paginationProxy.getRow(cell.rowIndex);
};
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])("paginationProxy")
], RowRenderer.prototype, "paginationProxy", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])("columnController")
], RowRenderer.prototype, "columnController", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])("$scope")
], RowRenderer.prototype, "$scope", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])("pinnedRowModel")
], RowRenderer.prototype, "pinnedRowModel", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])("rowModel")
], RowRenderer.prototype, "rowModel", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])("loggerFactory")
], RowRenderer.prototype, "loggerFactory", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])("focusController")
], RowRenderer.prototype, "focusController", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])("cellNavigationService")
], RowRenderer.prototype, "cellNavigationService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])("columnApi")
], RowRenderer.prototype, "columnApi", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])("gridApi")
], RowRenderer.prototype, "gridApi", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])("beans")
], RowRenderer.prototype, "beans", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])("maxDivHeightScaler")
], RowRenderer.prototype, "maxDivHeightScaler", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])("animationFrameService")
], RowRenderer.prototype, "animationFrameService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])("rowPositionUtils")
], RowRenderer.prototype, "rowPositionUtils", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Optional"])("rangeController")
], RowRenderer.prototype, "rangeController", void 0);
__decorate([
__param(0, Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Qualifier"])("loggerFactory"))
], RowRenderer.prototype, "agWire", null);
RowRenderer = __decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Bean"])("rowRenderer")
], RowRenderer);
return RowRenderer;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_7__["BeanStub"]));
/***/ }),
/* 101 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RowComp", function() { return RowComp; });
/* harmony import */ var _cellComp__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(102);
/* harmony import */ var _entities_rowNode__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71);
/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(23);
/* harmony import */ var _widgets_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(36);
/* harmony import */ var _constants_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(16);
/* harmony import */ var _modules_moduleNames__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(17);
/* harmony import */ var _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(18);
/* harmony import */ var _utils_aria__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(44);
/* harmony import */ var _utils_string__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(26);
/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(42);
/* harmony import */ var _utils_array__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(14);
/* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(7);
/* harmony import */ var _utils_event__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(21);
/* harmony import */ var _utils_object__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(13);
/* harmony import */ var _utils_general__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(41);
/* harmony import */ var _angularRowUtils__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(108);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var RowComp = /** @class */ (function (_super) {
__extends(RowComp, _super);
function RowComp(parentScope, bodyContainerComp, pinnedLeftContainerComp, pinnedRightContainerComp, fullWidthContainerComp, rowNode, beans, animateIn, useAnimationFrameForCreate, printLayout, embedFullWidth) {
var _this = _super.call(this) || this;
_this.eAllRowContainers = [];
_this.fullWidthRowDestroyFuncs = [];
_this.active = true;
_this.rowContainerReadyCount = 0;
_this.refreshNeeded = false;
_this.columnRefreshPending = false;
_this.cellComps = {};
// for animations, there are bits we want done in the next VM turn, to all DOM to update first.
// instead of each row doing a setTimeout(func,0), we put the functions here and the rowRenderer
// executes them all in one timeout
_this.createSecondPassFuncs = [];
// these get called before the row is destroyed - they set up the DOM for the remove animation (ie they
// set the DOM up for the animation), then the delayedDestroyFunctions get called when the animation is
// complete (ie removes from the dom).
_this.removeFirstPassFuncs = [];
// for animations, these functions get called 400ms after the row is cleared, called by the rowRenderer
// so each row isn't setting up it's own timeout
_this.removeSecondPassFuncs = [];
_this.initialised = false;
_this.elementOrderChanged = false;
_this.lastMouseDownOnDragger = false;
_this.parentScope = parentScope;
_this.beans = beans;
_this.bodyContainerComp = bodyContainerComp;
_this.pinnedLeftContainerComp = pinnedLeftContainerComp;
_this.pinnedRightContainerComp = pinnedRightContainerComp;
_this.fullWidthContainerComp = fullWidthContainerComp;
_this.rowNode = rowNode;
_this.rowIsEven = _this.rowNode.rowIndex % 2 === 0;
_this.paginationPage = _this.beans.paginationProxy.getCurrentPage();
_this.useAnimationFrameForCreate = useAnimationFrameForCreate;
_this.printLayout = printLayout;
_this.embedFullWidth = embedFullWidth;
_this.setAnimateFlags(animateIn);
return _this;
}
RowComp.prototype.init = function () {
var _this = this;
this.rowFocused = this.beans.focusController.isRowFocused(this.rowNode.rowIndex, this.rowNode.rowPinned);
this.setupAngular1Scope();
this.rowLevel = this.beans.rowCssClassCalculator.calculateRowLevel(this.rowNode);
this.setupRowContainers();
this.addListeners();
if (this.slideRowIn) {
this.createSecondPassFuncs.push(function () {
_this.onTopChanged();
});
}
if (this.fadeRowIn) {
this.createSecondPassFuncs.push(function () {
_this.eAllRowContainers.forEach(function (eRow) { return Object(_utils_dom__WEBPACK_IMPORTED_MODULE_9__["removeCssClass"])(eRow, 'ag-opacity-zero'); });
});
}
};
RowComp.prototype.setupAngular1Scope = function () {
var scopeResult = _angularRowUtils__WEBPACK_IMPORTED_MODULE_15__["AngularRowUtils"].createChildScopeOrNull(this.rowNode, this.parentScope, this.beans.gridOptionsWrapper);
if (scopeResult) {
this.scope = scopeResult.scope;
this.addDestroyFunc(scopeResult.scopeDestroyFunc);
}
};
RowComp.prototype.createTemplate = function (contents, extraCssClass) {
if (extraCssClass === void 0) { extraCssClass = null; }
var templateParts = [];
var rowHeight = this.rowNode.rowHeight;
var rowClasses = this.getInitialRowClasses(extraCssClass).join(' ');
var rowIdSanitised = Object(_utils_string__WEBPACK_IMPORTED_MODULE_8__["escapeString"])(this.rowNode.id);
var userRowStyles = this.preProcessStylesFromGridOptions();
var businessKey = this.getRowBusinessKey();
var businessKeySanitised = Object(_utils_string__WEBPACK_IMPORTED_MODULE_8__["escapeString"])(businessKey);
var rowTopStyle = this.getInitialRowTopStyle();
var rowIdx = this.rowNode.getRowIndexString();
var headerRowCount = this.beans.headerNavigationService.getHeaderRowCount();
templateParts.push("
");
// add in the template for the cells
templateParts.push(contents);
templateParts.push("
");
return templateParts.join('');
};
RowComp.prototype.getCellForCol = function (column) {
var cellComp = this.cellComps[column.getColId()];
return cellComp ? cellComp.getGui() : null;
};
RowComp.prototype.afterFlush = function () {
if (this.initialised) {
return;
}
this.initialised = true;
this.executeProcessRowPostCreateFunc();
};
RowComp.prototype.executeProcessRowPostCreateFunc = function () {
var func = this.beans.gridOptionsWrapper.getProcessRowPostCreateFunc();
if (!func) {
return;
}
var params = {
eRow: this.eBodyRow,
ePinnedLeftRow: this.ePinnedLeftRow,
ePinnedRightRow: this.ePinnedRightRow,
node: this.rowNode,
api: this.beans.gridOptionsWrapper.getApi(),
rowIndex: this.rowNode.rowIndex,
addRenderedRowListener: this.addEventListener.bind(this),
columnApi: this.beans.gridOptionsWrapper.getColumnApi(),
context: this.beans.gridOptionsWrapper.getContext()
};
func(params);
};
RowComp.prototype.getInitialRowTopStyle = function () {
// print layout uses normal flow layout for row positioning
if (this.printLayout) {
return '';
}
// if sliding in, we take the old row top. otherwise we just set the current row top.
var pixels = this.slideRowIn ? this.roundRowTopToBounds(this.rowNode.oldRowTop) : this.rowNode.rowTop;
var afterPaginationPixels = this.applyPaginationOffset(pixels);
// we don't apply scaling if row is pinned
var afterScalingPixels = this.rowNode.isRowPinned() ? afterPaginationPixels : this.beans.maxDivHeightScaler.getRealPixelPosition(afterPaginationPixels);
var isSuppressRowTransform = this.beans.gridOptionsWrapper.isSuppressRowTransform();
return isSuppressRowTransform ? "top: " + afterScalingPixels + "px; " : "transform: translateY(" + afterScalingPixels + "px);";
};
RowComp.prototype.getRowBusinessKey = function () {
var businessKeyForNodeFunc = this.beans.gridOptionsWrapper.getBusinessKeyForNodeFunc();
if (typeof businessKeyForNodeFunc !== 'function') {
return;
}
return businessKeyForNodeFunc(this.rowNode);
};
RowComp.prototype.areAllContainersReady = function () {
return this.rowContainerReadyCount === 3;
};
RowComp.prototype.lazyCreateCells = function (cols, eRow) {
if (!this.active) {
return;
}
var cellTemplatesAndComps = this.createCells(cols);
eRow.innerHTML = cellTemplatesAndComps.template;
this.callAfterRowAttachedOnCells(cellTemplatesAndComps.cellComps, eRow);
this.rowContainerReadyCount++;
if (this.areAllContainersReady() && this.refreshNeeded) {
this.refreshCells();
}
};
RowComp.prototype.createRowContainer = function (rowContainerComp, cols, callback) {
var _this = this;
var useAnimationsFrameForCreate = this.useAnimationFrameForCreate;
var cellTemplatesAndComps = useAnimationsFrameForCreate ? { cellComps: [], template: '' } : this.createCells(cols);
var rowTemplate = this.createTemplate(cellTemplatesAndComps.template);
// the RowRenderer is probably inserting many rows. rather than inserting each template one
// at a time, the grid inserts all rows together - so the callback here is called by the
// rowRenderer when all RowComps are created, then all the HTML is inserted in one go,
// and then all the callbacks are called. this is NOT done in an animation frame.
rowContainerComp.appendRowTemplate(rowTemplate, function () {
var eRow = rowContainerComp.getRowElement(_this.getCompId());
_this.refreshAriaLabel(eRow, _this.rowNode.isSelected());
_this.afterRowAttached(rowContainerComp, eRow);
callback(eRow);
if (useAnimationsFrameForCreate) {
_this.beans.taskQueue.createTask(_this.lazyCreateCells.bind(_this, cols, eRow), _this.rowNode.rowIndex, 'createTasksP1');
}
else {
_this.callAfterRowAttachedOnCells(cellTemplatesAndComps.cellComps, eRow);
_this.rowContainerReadyCount = 3;
}
});
};
RowComp.prototype.setupRowContainers = function () {
var isFullWidthCell = this.rowNode.isFullWidthCell();
var isDetailCell = this.beans.doingMasterDetail && this.rowNode.detail;
var pivotMode = this.beans.columnController.isPivotMode();
// we only use full width for groups, not footers. it wouldn't make sense to include footers if not looking
// for totals. if users complain about this, then we should introduce a new property 'footerUseEntireRow'
// so each can be set independently (as a customer complained about footers getting full width, hence
// introducing this logic)
var isGroupRow = this.rowNode.group && !this.rowNode.footer;
var isFullWidthGroup = isGroupRow && this.beans.gridOptionsWrapper.isGroupUseEntireRow(pivotMode);
if (this.rowNode.stub) {
this.createFullWidthRows(RowComp.LOADING_CELL_RENDERER, RowComp.LOADING_CELL_RENDERER_COMP_NAME, false);
}
else if (isDetailCell) {
this.createFullWidthRows(RowComp.DETAIL_CELL_RENDERER, RowComp.DETAIL_CELL_RENDERER_COMP_NAME, true);
}
else if (isFullWidthCell) {
this.createFullWidthRows(RowComp.FULL_WIDTH_CELL_RENDERER, null, false);
}
else if (isFullWidthGroup) {
this.createFullWidthRows(RowComp.GROUP_ROW_RENDERER, RowComp.GROUP_ROW_RENDERER_COMP_NAME, false);
}
else {
this.setupNormalRowContainers();
}
};
RowComp.prototype.setupNormalRowContainers = function () {
var _this = this;
var centerCols;
var leftCols = [];
var rightCols = [];
if (this.printLayout) {
centerCols = this.beans.columnController.getAllDisplayedColumns();
}
else {
centerCols = this.beans.columnController.getAllDisplayedCenterVirtualColumnsForRow(this.rowNode);
leftCols = this.beans.columnController.getDisplayedLeftColumnsForRow(this.rowNode);
rightCols = this.beans.columnController.getDisplayedRightColumnsForRow(this.rowNode);
}
this.createRowContainer(this.bodyContainerComp, centerCols, function (eRow) { return _this.eBodyRow = eRow; });
this.createRowContainer(this.pinnedRightContainerComp, rightCols, function (eRow) { return _this.ePinnedRightRow = eRow; });
this.createRowContainer(this.pinnedLeftContainerComp, leftCols, function (eRow) { return _this.ePinnedLeftRow = eRow; });
};
RowComp.prototype.createFullWidthRows = function (type, name, detailRow) {
var _this = this;
this.fullWidthRow = true;
if (this.embedFullWidth) {
this.createFullWidthRowContainer(this.bodyContainerComp, null, null, type, name, function (eRow) {
_this.eFullWidthRowBody = eRow;
}, function (cellRenderer) {
_this.fullWidthRowComponentBody = cellRenderer;
}, detailRow);
// printLayout doesn't put components into the pinned sections
if (this.printLayout) {
return;
}
this.createFullWidthRowContainer(this.pinnedLeftContainerComp, _constants_constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].PINNED_LEFT, 'ag-cell-last-left-pinned', type, name, function (eRow) {
_this.eFullWidthRowLeft = eRow;
}, function (cellRenderer) {
_this.fullWidthRowComponentLeft = cellRenderer;
}, detailRow);
this.createFullWidthRowContainer(this.pinnedRightContainerComp, _constants_constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].PINNED_RIGHT, 'ag-cell-first-right-pinned', type, name, function (eRow) {
_this.eFullWidthRowRight = eRow;
}, function (cellRenderer) {
_this.fullWidthRowComponentRight = cellRenderer;
}, detailRow);
}
else {
// otherwise we add to the fullWidth container as normal
// let previousFullWidth = ensureDomOrder ? this.lastPlacedElements.eFullWidth : null;
this.createFullWidthRowContainer(this.fullWidthContainerComp, null, null, type, name, function (eRow) {
_this.eFullWidthRow = eRow;
}, function (cellRenderer) {
_this.fullWidthRowComponent = cellRenderer;
}, detailRow);
}
};
RowComp.prototype.setAnimateFlags = function (animateIn) {
if (animateIn) {
var oldRowTopExists = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_11__["exists"])(this.rowNode.oldRowTop);
// if the row had a previous position, we slide it in (animate row top)
this.slideRowIn = oldRowTopExists;
// if the row had no previous position, we fade it in (animate
this.fadeRowIn = !oldRowTopExists;
}
else {
this.slideRowIn = false;
this.fadeRowIn = false;
}
};
RowComp.prototype.isEditing = function () {
return this.editingRow;
};
RowComp.prototype.stopRowEditing = function (cancel) {
this.stopEditing(cancel);
};
RowComp.prototype.isFullWidth = function () {
return this.fullWidthRow;
};
RowComp.prototype.refreshFullWidth = function () {
var _this = this;
// returns 'true' if refresh succeeded
var tryRefresh = function (eRow, cellComp, pinned) {
if (!eRow || !cellComp) {
return true;
} // no refresh needed
// no refresh method present, so can't refresh, hard refresh needed
if (!cellComp.refresh) {
return false;
}
var params = _this.createFullWidthParams(eRow, pinned);
var refreshSucceeded = cellComp.refresh(params);
return refreshSucceeded;
};
var normalSuccess = tryRefresh(this.eFullWidthRow, this.fullWidthRowComponent, null);
var bodySuccess = tryRefresh(this.eFullWidthRowBody, this.fullWidthRowComponentBody, null);
var leftSuccess = tryRefresh(this.eFullWidthRowLeft, this.fullWidthRowComponentLeft, _constants_constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].PINNED_LEFT);
var rightSuccess = tryRefresh(this.eFullWidthRowRight, this.fullWidthRowComponentRight, _constants_constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].PINNED_RIGHT);
var allFullWidthRowsRefreshed = normalSuccess && bodySuccess && leftSuccess && rightSuccess;
return allFullWidthRowsRefreshed;
};
RowComp.prototype.addListeners = function () {
this.addManagedListener(this.rowNode, _entities_rowNode__WEBPACK_IMPORTED_MODULE_1__["RowNode"].EVENT_HEIGHT_CHANGED, this.onRowHeightChanged.bind(this));
this.addManagedListener(this.rowNode, _entities_rowNode__WEBPACK_IMPORTED_MODULE_1__["RowNode"].EVENT_ROW_SELECTED, this.onRowSelected.bind(this));
this.addManagedListener(this.rowNode, _entities_rowNode__WEBPACK_IMPORTED_MODULE_1__["RowNode"].EVENT_ROW_INDEX_CHANGED, this.onRowIndexChanged.bind(this));
this.addManagedListener(this.rowNode, _entities_rowNode__WEBPACK_IMPORTED_MODULE_1__["RowNode"].EVENT_TOP_CHANGED, this.onTopChanged.bind(this));
this.addManagedListener(this.rowNode, _entities_rowNode__WEBPACK_IMPORTED_MODULE_1__["RowNode"].EVENT_EXPANDED_CHANGED, this.updateExpandedCss.bind(this));
this.addManagedListener(this.rowNode, _entities_rowNode__WEBPACK_IMPORTED_MODULE_1__["RowNode"].EVENT_HAS_CHILDREN_CHANGED, this.updateExpandedCss.bind(this));
this.addManagedListener(this.rowNode, _entities_rowNode__WEBPACK_IMPORTED_MODULE_1__["RowNode"].EVENT_DATA_CHANGED, this.onRowNodeDataChanged.bind(this));
this.addManagedListener(this.rowNode, _entities_rowNode__WEBPACK_IMPORTED_MODULE_1__["RowNode"].EVENT_CELL_CHANGED, this.onRowNodeCellChanged.bind(this));
this.addManagedListener(this.rowNode, _entities_rowNode__WEBPACK_IMPORTED_MODULE_1__["RowNode"].EVENT_HIGHLIGHT_CHANGED, this.onRowNodeHighlightChanged.bind(this));
this.addManagedListener(this.rowNode, _entities_rowNode__WEBPACK_IMPORTED_MODULE_1__["RowNode"].EVENT_DRAGGING_CHANGED, this.onRowNodeDraggingChanged.bind(this));
this.addManagedListener(this.rowNode, _entities_rowNode__WEBPACK_IMPORTED_MODULE_1__["RowNode"].EVENT_UI_LEVEL_CHANGED, this.onUiLevelChanged.bind(this));
var eventService = this.beans.eventService;
this.addManagedListener(eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_PAGINATION_PIXEL_OFFSET_CHANGED, this.onPaginationPixelOffsetChanged.bind(this));
this.addManagedListener(eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_HEIGHT_SCALE_CHANGED, this.onTopChanged.bind(this));
this.addManagedListener(eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_DISPLAYED_COLUMNS_CHANGED, this.onDisplayedColumnsChanged.bind(this));
this.addManagedListener(eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_VIRTUAL_COLUMNS_CHANGED, this.onVirtualColumnsChanged.bind(this));
this.addManagedListener(eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_RESIZED, this.onColumnResized.bind(this));
this.addManagedListener(eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_CELL_FOCUSED, this.onCellFocusChanged.bind(this));
this.addManagedListener(eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_PAGINATION_CHANGED, this.onPaginationChanged.bind(this));
this.addManagedListener(eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_MODEL_UPDATED, this.onModelUpdated.bind(this));
this.addManagedListener(eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_MOVED, this.onColumnMoved.bind(this));
this.addListenersForCellComps();
};
RowComp.prototype.addListenersForCellComps = function () {
var _this = this;
this.addManagedListener(this.rowNode, _entities_rowNode__WEBPACK_IMPORTED_MODULE_1__["RowNode"].EVENT_ROW_INDEX_CHANGED, function () {
_this.forEachCellComp(function (cellComp) { return cellComp.onRowIndexChanged(); });
});
this.addManagedListener(this.rowNode, _entities_rowNode__WEBPACK_IMPORTED_MODULE_1__["RowNode"].EVENT_CELL_CHANGED, function (event) {
_this.forEachCellComp(function (cellComp) { return cellComp.onCellChanged(event); });
});
};
RowComp.prototype.onRowNodeDataChanged = function (event) {
// if this is an update, we want to refresh, as this will allow the user to put in a transition
// into the cellRenderer refresh method. otherwise this might be completely new data, in which case
// we will want to completely replace the cells
this.forEachCellComp(function (cellComp) {
return cellComp.refreshCell({
suppressFlash: !event.update,
newData: !event.update
});
});
// check for selected also, as this could be after lazy loading of the row data, in which case
// the id might of just gotten set inside the row and the row selected state may of changed
// as a result. this is what happens when selected rows are loaded in virtual pagination.
// - niall note - since moving to the stub component, this may no longer be true, as replacing
// the stub component now replaces the entire row
this.onRowSelected();
// as data has changed, then the style and class needs to be recomputed
this.postProcessCss();
};
RowComp.prototype.onRowNodeCellChanged = function () {
// as data has changed, then the style and class needs to be recomputed
this.postProcessCss();
};
RowComp.prototype.postProcessCss = function () {
this.postProcessStylesFromGridOptions();
this.postProcessClassesFromGridOptions();
this.postProcessRowClassRules();
this.postProcessRowDragging();
};
RowComp.prototype.onRowNodeHighlightChanged = function () {
var highlighted = this.rowNode.highlighted;
this.eAllRowContainers.forEach(function (row) {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_9__["removeCssClass"])(row, 'ag-row-highlight-above');
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_9__["removeCssClass"])(row, 'ag-row-highlight-below');
if (highlighted) {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_9__["addCssClass"])(row, 'ag-row-highlight-' + highlighted);
}
});
};
RowComp.prototype.onRowNodeDraggingChanged = function () {
this.postProcessRowDragging();
};
RowComp.prototype.postProcessRowDragging = function () {
var dragging = this.rowNode.dragging;
this.eAllRowContainers.forEach(function (row) { return Object(_utils_dom__WEBPACK_IMPORTED_MODULE_9__["addOrRemoveCssClass"])(row, 'ag-row-dragging', dragging); });
};
RowComp.prototype.updateExpandedCss = function () {
var expandable = this.rowNode.isExpandable();
var expanded = this.rowNode.expanded == true;
this.eAllRowContainers.forEach(function (eRow) {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_9__["addOrRemoveCssClass"])(eRow, 'ag-row-group', expandable);
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_9__["addOrRemoveCssClass"])(eRow, 'ag-row-group-expanded', expandable && expanded);
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_9__["addOrRemoveCssClass"])(eRow, 'ag-row-group-contracted', expandable && !expanded);
Object(_utils_aria__WEBPACK_IMPORTED_MODULE_7__["setAriaExpanded"])(eRow, expandable && expanded);
});
};
RowComp.prototype.onDisplayedColumnsChanged = function () {
if (this.fullWidthRow) {
return;
}
this.refreshCells();
};
RowComp.prototype.destroyFullWidthComponents = function () {
this.fullWidthRowDestroyFuncs.forEach(function (f) { return f(); });
this.fullWidthRowDestroyFuncs = [];
if (this.fullWidthRowComponent) {
this.beans.detailRowCompCache.addOrDestroy(this.rowNode, null, this.fullWidthRowComponent);
this.fullWidthRowComponent = null;
}
if (this.fullWidthRowComponentBody) {
this.beans.detailRowCompCache.addOrDestroy(this.rowNode, null, this.fullWidthRowComponentBody);
this.fullWidthRowComponentBody = null;
}
if (this.fullWidthRowComponentLeft) {
this.beans.detailRowCompCache.addOrDestroy(this.rowNode, _constants_constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].PINNED_LEFT, this.fullWidthRowComponentLeft);
this.fullWidthRowComponentLeft = null;
}
if (this.fullWidthRowComponentRight) {
this.beans.detailRowCompCache.addOrDestroy(this.rowNode, _constants_constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].PINNED_RIGHT, this.fullWidthRowComponentRight);
this.fullWidthRowComponentRight = null;
}
};
RowComp.prototype.getContainerForCell = function (pinnedType) {
switch (pinnedType) {
case _constants_constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].PINNED_LEFT: return this.ePinnedLeftRow;
case _constants_constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].PINNED_RIGHT: return this.ePinnedRightRow;
default: return this.eBodyRow;
}
};
RowComp.prototype.onVirtualColumnsChanged = function () {
if (this.fullWidthRow) {
return;
}
this.refreshCells();
};
RowComp.prototype.onColumnResized = function () {
if (this.fullWidthRow) {
return;
}
this.refreshCells();
};
RowComp.prototype.refreshCells = function () {
if (!this.areAllContainersReady()) {
this.refreshNeeded = true;
return;
}
var suppressAnimationFrame = this.beans.gridOptionsWrapper.isSuppressAnimationFrame();
var skipAnimationFrame = suppressAnimationFrame || this.printLayout;
if (skipAnimationFrame) {
this.refreshCellsInAnimationFrame();
}
else {
if (this.columnRefreshPending) {
return;
}
this.beans.taskQueue.createTask(this.refreshCellsInAnimationFrame.bind(this), this.rowNode.rowIndex, 'createTasksP1');
}
};
RowComp.prototype.refreshCellsInAnimationFrame = function () {
if (!this.active) {
return;
}
this.columnRefreshPending = false;
var centerCols;
var leftCols;
var rightCols;
if (this.printLayout) {
centerCols = this.beans.columnController.getAllDisplayedColumns();
leftCols = [];
rightCols = [];
}
else {
centerCols = this.beans.columnController.getAllDisplayedCenterVirtualColumnsForRow(this.rowNode);
leftCols = this.beans.columnController.getDisplayedLeftColumnsForRow(this.rowNode);
rightCols = this.beans.columnController.getDisplayedRightColumnsForRow(this.rowNode);
}
this.insertCellsIntoContainer(this.eBodyRow, centerCols);
this.insertCellsIntoContainer(this.ePinnedLeftRow, leftCols);
this.insertCellsIntoContainer(this.ePinnedRightRow, rightCols);
this.elementOrderChanged = false;
var colIdsToRemove = Object.keys(this.cellComps);
centerCols.forEach(function (col) { return Object(_utils_array__WEBPACK_IMPORTED_MODULE_10__["removeFromArray"])(colIdsToRemove, col.getId()); });
leftCols.forEach(function (col) { return Object(_utils_array__WEBPACK_IMPORTED_MODULE_10__["removeFromArray"])(colIdsToRemove, col.getId()); });
rightCols.forEach(function (col) { return Object(_utils_array__WEBPACK_IMPORTED_MODULE_10__["removeFromArray"])(colIdsToRemove, col.getId()); });
// we never remove editing cells, as this would cause the cells to loose their values while editing
// as the grid is scrolling horizontally.
var eligibleToBeRemoved = colIdsToRemove.filter(this.isCellEligibleToBeRemoved.bind(this));
// remove old cells from gui, but we don't destroy them, we might use them again
this.destroyCells(eligibleToBeRemoved);
};
RowComp.prototype.onColumnMoved = function () {
this.elementOrderChanged = true;
};
RowComp.prototype.destroyCells = function (colIds) {
var _this = this;
colIds.forEach(function (key) {
var cellComp = _this.cellComps[key];
// could be old reference, ie removed cell
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_11__["missing"])(cellComp)) {
return;
}
cellComp.detach();
cellComp.destroy();
_this.cellComps[key] = null;
});
};
RowComp.prototype.isCellEligibleToBeRemoved = function (indexStr) {
var displayedColumns = this.beans.columnController.getAllDisplayedColumns();
var REMOVE_CELL = true;
var KEEP_CELL = false;
var renderedCell = this.cellComps[indexStr];
// always remove the cell if it's not rendered or if it's in the wrong pinned location
if (!renderedCell || this.isCellInWrongRow(renderedCell)) {
return REMOVE_CELL;
}
// we want to try and keep editing and focused cells
var editing = renderedCell.isEditing();
var focused = this.beans.focusController.isCellFocused(renderedCell.getCellPosition());
var mightWantToKeepCell = editing || focused;
if (mightWantToKeepCell) {
var column = renderedCell.getColumn();
var cellStillDisplayed = displayedColumns.indexOf(column) >= 0;
return cellStillDisplayed ? KEEP_CELL : REMOVE_CELL;
}
return REMOVE_CELL;
};
RowComp.prototype.ensureCellInCorrectContainer = function (cellComp) {
// for print layout, we always put cells into centre, otherwise we put in correct pinned section
if (this.printLayout) {
return;
}
var element = cellComp.getGui();
var column = cellComp.getColumn();
var pinnedType = column.getPinned();
var eContainer = this.getContainerForCell(pinnedType);
// if in wrong container, remove it
var eOldContainer = cellComp.getParentRow();
var inWrongRow = eOldContainer !== eContainer;
if (inWrongRow) {
// take out from old row
if (eOldContainer) {
eOldContainer.removeChild(element);
}
eContainer.appendChild(element);
cellComp.setParentRow(eContainer);
this.elementOrderChanged = true;
}
};
RowComp.prototype.isCellInWrongRow = function (cellComp) {
var column = cellComp.getColumn();
var rowWeWant = this.getContainerForCell(column.getPinned());
var oldRow = cellComp.getParentRow(); // if in wrong container, remove it
return oldRow !== rowWeWant;
};
RowComp.prototype.insertCellsIntoContainer = function (eRow, cols) {
var _this = this;
if (!eRow) {
return;
}
var cellTemplates = [];
var newCellComps = [];
cols.forEach(function (col) {
var colId = col.getId();
var existingCell = _this.cellComps[colId];
// need to check the column is the same one, not a new column with the same ID
if (existingCell && existingCell.getColumn() == col) {
_this.ensureCellInCorrectContainer(existingCell);
}
else {
if (existingCell) {
// here there is a col with the same id, so need to destroy the old cell first,
// as the old column no longer exists. this happens often with pivoting, where
// id's are pivot_1, pivot_2 etc, so common for new cols with same ID's
_this.destroyCells([colId]);
}
_this.createNewCell(col, eRow, cellTemplates, newCellComps);
}
});
if (cellTemplates.length > 0) {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_9__["appendHtml"])(eRow, cellTemplates.join(''));
this.callAfterRowAttachedOnCells(newCellComps, eRow);
}
if (this.elementOrderChanged && this.beans.gridOptionsWrapper.isEnsureDomOrder()) {
var correctChildOrder = cols.map(function (col) { return _this.getCellForCol(col); });
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_9__["setDomChildOrder"])(eRow, correctChildOrder);
}
};
RowComp.prototype.addDomData = function (eRowContainer) {
var gow = this.beans.gridOptionsWrapper;
gow.setDomData(eRowContainer, RowComp.DOM_DATA_KEY_RENDERED_ROW, this);
this.addDestroyFunc(function () {
gow.setDomData(eRowContainer, RowComp.DOM_DATA_KEY_RENDERED_ROW, null);
});
};
RowComp.prototype.createNewCell = function (col, eContainer, cellTemplates, newCellComps) {
var newCellComp = new _cellComp__WEBPACK_IMPORTED_MODULE_0__["CellComp"](this.scope, this.beans, col, this.rowNode, this, false, this.printLayout);
var cellTemplate = newCellComp.getCreateTemplate();
cellTemplates.push(cellTemplate);
newCellComps.push(newCellComp);
this.cellComps[col.getId()] = newCellComp;
newCellComp.setParentRow(eContainer);
this.elementOrderChanged = true;
};
RowComp.prototype.onMouseEvent = function (eventName, mouseEvent) {
switch (eventName) {
case 'dblclick':
this.onRowDblClick(mouseEvent);
break;
case 'click':
this.onRowClick(mouseEvent);
break;
case 'mousedown':
this.onRowMouseDown(mouseEvent);
break;
}
};
RowComp.prototype.createRowEvent = function (type, domEvent) {
return {
type: type,
node: this.rowNode,
data: this.rowNode.data,
rowIndex: this.rowNode.rowIndex,
rowPinned: this.rowNode.rowPinned,
context: this.beans.gridOptionsWrapper.getContext(),
api: this.beans.gridOptionsWrapper.getApi(),
columnApi: this.beans.gridOptionsWrapper.getColumnApi(),
event: domEvent
};
};
RowComp.prototype.createRowEventWithSource = function (type, domEvent) {
var event = this.createRowEvent(type, domEvent);
// when first developing this, we included the rowComp in the event.
// this seems very weird. so when introducing the event types, i left the 'source'
// out of the type, and just include the source in the two places where this event
// was fired (rowClicked and rowDoubleClicked). it doesn't make sense for any
// users to be using this, as the rowComp isn't an object we expose, so would be
// very surprising if a user was using it.
event.source = this;
return event;
};
RowComp.prototype.onRowDblClick = function (mouseEvent) {
if (Object(_utils_event__WEBPACK_IMPORTED_MODULE_12__["isStopPropagationForAgGrid"])(mouseEvent)) {
return;
}
var agEvent = this.createRowEventWithSource(_events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_ROW_DOUBLE_CLICKED, mouseEvent);
this.beans.eventService.dispatchEvent(agEvent);
};
RowComp.prototype.onRowMouseDown = function (mouseEvent) {
this.lastMouseDownOnDragger = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_9__["isElementChildOfClass"])(mouseEvent.target, 'ag-row-drag', 3);
};
RowComp.prototype.onRowClick = function (mouseEvent) {
var stop = Object(_utils_event__WEBPACK_IMPORTED_MODULE_12__["isStopPropagationForAgGrid"])(mouseEvent) || this.lastMouseDownOnDragger;
if (stop) {
return;
}
var agEvent = this.createRowEventWithSource(_events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_ROW_CLICKED, mouseEvent);
this.beans.eventService.dispatchEvent(agEvent);
// ctrlKey for windows, metaKey for Apple
var multiSelectKeyPressed = mouseEvent.ctrlKey || mouseEvent.metaKey;
var shiftKeyPressed = mouseEvent.shiftKey;
// we do not allow selecting the group by clicking, when groupSelectChildren, as the logic to
// handle this is broken. to observe, change the logic below and allow groups to be selected.
// you will see the group gets selected, then all children get selected, then the grid unselects
// the children (as the default behaviour when clicking is to unselect other rows) which results
// in the group getting unselected (as all children are unselected). the correct thing would be
// to change this, so that children of the selected group are not then subsequenly un-selected.
var groupSelectsChildren = this.beans.gridOptionsWrapper.isGroupSelectsChildren();
if (
// we do not allow selecting groups by clicking (as the click here expands the group), or if it's a detail row,
// so return if it's a group row
(groupSelectsChildren && this.rowNode.group) ||
// this is needed so we don't unselect other rows when we click this row, eg if this row is not selectable,
// and we click it, the selection should not change (ie any currently selected row should stay selected)
!this.rowNode.selectable ||
// we also don't allow selection of pinned rows
this.rowNode.rowPinned ||
// if no selection method enabled, do nothing
!this.beans.gridOptionsWrapper.isRowSelection() ||
// if click selection suppressed, do nothing
this.beans.gridOptionsWrapper.isSuppressRowClickSelection()) {
return;
}
var multiSelectOnClick = this.beans.gridOptionsWrapper.isRowMultiSelectWithClick();
var rowDeselectionWithCtrl = !this.beans.gridOptionsWrapper.isSuppressRowDeselection();
if (this.rowNode.isSelected()) {
if (multiSelectOnClick) {
this.rowNode.setSelectedParams({ newValue: false });
}
else if (multiSelectKeyPressed) {
if (rowDeselectionWithCtrl) {
this.rowNode.setSelectedParams({ newValue: false });
}
}
else {
// selected with no multi key, must make sure anything else is unselected
this.rowNode.setSelectedParams({ newValue: !shiftKeyPressed, clearSelection: !shiftKeyPressed, rangeSelect: shiftKeyPressed });
}
}
else {
var clearSelection = multiSelectOnClick ? false : !multiSelectKeyPressed;
this.rowNode.setSelectedParams({ newValue: true, clearSelection: clearSelection, rangeSelect: shiftKeyPressed });
}
};
RowComp.prototype.createFullWidthRowContainer = function (rowContainerComp, pinned, extraCssClass, cellRendererType, cellRendererName, eRowCallback, cellRendererCallback, detailRow) {
var _this = this;
var rowTemplate = this.createTemplate('', extraCssClass);
rowContainerComp.appendRowTemplate(rowTemplate, function () {
var eRow = rowContainerComp.getRowElement(_this.getCompId());
var params = _this.createFullWidthParams(eRow, pinned);
var callback = function (cellRenderer) {
if (_this.isAlive()) {
var eGui = cellRenderer.getGui();
eRow.appendChild(eGui);
if (detailRow) {
_this.setupDetailRowAutoHeight(eGui);
}
cellRendererCallback(cellRenderer);
}
else {
_this.beans.context.destroyBean(cellRenderer);
}
};
// if doing master detail, it's possible we have a cached row comp from last time detail was displayed
var cachedRowComp = _this.beans.detailRowCompCache.get(_this.rowNode, pinned);
if (cachedRowComp) {
callback(cachedRowComp);
}
else {
var res = _this.beans.userComponentFactory.newFullWidthCellRenderer(params, cellRendererType, cellRendererName);
if (!res) {
var masterDetailModuleLoaded = _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_6__["ModuleRegistry"].isRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_5__["ModuleNames"].MasterDetailModule);
if (cellRendererName === 'agDetailCellRenderer' && !masterDetailModuleLoaded) {
console.warn("ag-Grid: cell renderer agDetailCellRenderer (for master detail) not found. Did you forget to include the master detail module?");
}
else {
console.error("ag-Grid: fullWidthCellRenderer " + cellRendererName + " not found");
}
return;
}
res.then(callback);
}
_this.afterRowAttached(rowContainerComp, eRow);
eRowCallback(eRow);
_this.angular1Compile(eRow);
});
};
RowComp.prototype.setupDetailRowAutoHeight = function (eDetailGui) {
var _this = this;
if (!this.beans.gridOptionsWrapper.isDetailRowAutoHeight()) {
return;
}
var checkRowSizeFunc = function () {
var clientHeight = eDetailGui.clientHeight;
// if the UI is not ready, the height can be 0, which we ignore, as otherwise a flicker will occur
// as UI goes from the default height, to 0, then to the real height as UI becomes ready. this means
// it's not possible for have 0 as auto-height, however this is an improbable use case, as even an
// empty detail grid would still have some styling around it giving at least a few pixels.
if (clientHeight != null && clientHeight > 0) {
// we do the update in a timeout, to make sure we are not calling from inside the grid
// doing another update
var updateRowHeightFunc = function () {
_this.rowNode.setRowHeight(clientHeight);
if (_this.beans.clientSideRowModel) {
_this.beans.clientSideRowModel.onRowHeightChanged();
}
else if (_this.beans.serverSideRowModel) {
_this.beans.serverSideRowModel.onRowHeightChanged();
}
};
_this.beans.frameworkOverrides.setTimeout(updateRowHeightFunc, 0);
}
};
var resizeObserverDestroyFunc = this.beans.resizeObserverService.observeResize(eDetailGui, checkRowSizeFunc);
this.fullWidthRowDestroyFuncs.push(resizeObserverDestroyFunc);
checkRowSizeFunc();
};
RowComp.prototype.angular1Compile = function (element) {
if (!this.scope) {
return;
}
this.beans.$compile(element)(this.scope);
};
RowComp.prototype.createFullWidthParams = function (eRow, pinned) {
var params = {
fullWidth: true,
data: this.rowNode.data,
node: this.rowNode,
value: this.rowNode.key,
$scope: this.scope ? this.scope : this.parentScope,
$compile: this.beans.$compile,
rowIndex: this.rowNode.rowIndex,
api: this.beans.gridOptionsWrapper.getApi(),
columnApi: this.beans.gridOptionsWrapper.getColumnApi(),
context: this.beans.gridOptionsWrapper.getContext(),
// these need to be taken out, as part of 'afterAttached' now
eGridCell: eRow,
eParentOfValue: eRow,
pinned: pinned,
addRenderedRowListener: this.addEventListener.bind(this)
};
return params;
};
RowComp.prototype.getInitialRowClasses = function (extraCssClass) {
var params = {
rowNode: this.rowNode,
extraCssClass: extraCssClass,
rowFocused: this.rowFocused,
fadeRowIn: this.fadeRowIn,
rowIsEven: this.rowIsEven,
rowLevel: this.rowLevel,
fullWidthRow: this.fullWidthRow,
firstRowOnPage: this.isFirstRowOnPage(),
lastRowOnPage: this.isLastRowOnPage(),
printLayout: this.printLayout,
expandable: this.rowNode.isExpandable(),
scope: this.scope
};
return this.beans.rowCssClassCalculator.getInitialRowClasses(params);
};
RowComp.prototype.onUiLevelChanged = function () {
var newLevel = this.beans.rowCssClassCalculator.calculateRowLevel(this.rowNode);
if (this.rowLevel != newLevel) {
var classToAdd_1 = 'ag-row-level-' + newLevel;
var classToRemove_1 = 'ag-row-level-' + this.rowLevel;
this.eAllRowContainers.forEach(function (row) {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_9__["addCssClass"])(row, classToAdd_1);
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_9__["removeCssClass"])(row, classToRemove_1);
});
}
this.rowLevel = newLevel;
};
RowComp.prototype.isFirstRowOnPage = function () {
return this.rowNode.rowIndex === this.beans.paginationProxy.getPageFirstRow();
};
RowComp.prototype.isLastRowOnPage = function () {
return this.rowNode.rowIndex === this.beans.paginationProxy.getPageLastRow();
};
RowComp.prototype.onModelUpdated = function () {
var newFirst = this.isFirstRowOnPage();
var newLast = this.isLastRowOnPage();
if (this.firstRowOnPage !== newFirst) {
this.firstRowOnPage = newFirst;
this.eAllRowContainers.forEach(function (row) { return Object(_utils_dom__WEBPACK_IMPORTED_MODULE_9__["addOrRemoveCssClass"])(row, 'ag-row-first', newFirst); });
}
if (this.lastRowOnPage !== newLast) {
this.lastRowOnPage = newLast;
this.eAllRowContainers.forEach(function (row) { return Object(_utils_dom__WEBPACK_IMPORTED_MODULE_9__["addOrRemoveCssClass"])(row, 'ag-row-last', newLast); });
}
};
RowComp.prototype.stopEditing = function (cancel) {
if (cancel === void 0) { cancel = false; }
this.forEachCellComp(function (renderedCell) {
renderedCell.stopEditing(cancel);
});
if (!this.editingRow) {
return;
}
if (!cancel) {
var event_1 = this.createRowEvent(_events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_ROW_VALUE_CHANGED);
this.beans.eventService.dispatchEvent(event_1);
}
this.setEditingRow(false);
};
RowComp.prototype.setEditingRow = function (value) {
this.editingRow = value;
this.eAllRowContainers.forEach(function (row) { return Object(_utils_dom__WEBPACK_IMPORTED_MODULE_9__["addOrRemoveCssClass"])(row, 'ag-row-editing', value); });
var event = value ?
this.createRowEvent(_events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_ROW_EDITING_STARTED)
: this.createRowEvent(_events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_ROW_EDITING_STOPPED);
this.beans.eventService.dispatchEvent(event);
};
RowComp.prototype.startRowEditing = function (keyPress, charPress, sourceRenderedCell) {
if (keyPress === void 0) { keyPress = null; }
if (charPress === void 0) { charPress = null; }
if (sourceRenderedCell === void 0) { sourceRenderedCell = null; }
// don't do it if already editing
if (this.editingRow) {
return;
}
this.forEachCellComp(function (renderedCell) {
var cellStartedEdit = renderedCell === sourceRenderedCell;
if (cellStartedEdit) {
renderedCell.startEditingIfEnabled(keyPress, charPress, cellStartedEdit);
}
else {
renderedCell.startEditingIfEnabled(null, null, cellStartedEdit);
}
});
this.setEditingRow(true);
};
RowComp.prototype.forEachCellComp = function (callback) {
Object(_utils_object__WEBPACK_IMPORTED_MODULE_13__["iterateObject"])(this.cellComps, function (key, cellComp) {
if (!cellComp) {
return;
}
callback(cellComp);
});
};
RowComp.prototype.postProcessClassesFromGridOptions = function () {
var _this = this;
var cssClasses = this.beans.rowCssClassCalculator.processClassesFromGridOptions(this.rowNode);
if (!cssClasses || !cssClasses.length) {
return;
}
cssClasses.forEach(function (classStr) {
_this.eAllRowContainers.forEach(function (row) { return Object(_utils_dom__WEBPACK_IMPORTED_MODULE_9__["addCssClass"])(row, classStr); });
});
};
RowComp.prototype.postProcessRowClassRules = function () {
var _this = this;
this.beans.rowCssClassCalculator.processRowClassRules(this.rowNode, this.scope, function (className) {
_this.eAllRowContainers.forEach(function (row) { return Object(_utils_dom__WEBPACK_IMPORTED_MODULE_9__["addCssClass"])(row, className); });
}, function (className) {
_this.eAllRowContainers.forEach(function (row) { return Object(_utils_dom__WEBPACK_IMPORTED_MODULE_9__["removeCssClass"])(row, className); });
});
};
RowComp.prototype.preProcessStylesFromGridOptions = function () {
var rowStyles = this.processStylesFromGridOptions();
return Object(_utils_general__WEBPACK_IMPORTED_MODULE_14__["cssStyleObjectToMarkup"])(rowStyles);
};
RowComp.prototype.postProcessStylesFromGridOptions = function () {
var rowStyles = this.processStylesFromGridOptions();
this.eAllRowContainers.forEach(function (row) { return Object(_utils_dom__WEBPACK_IMPORTED_MODULE_9__["addStylesToElement"])(row, rowStyles); });
};
RowComp.prototype.processStylesFromGridOptions = function () {
// part 1 - rowStyle
var rowStyle = this.beans.gridOptionsWrapper.getRowStyle();
if (rowStyle && typeof rowStyle === 'function') {
console.warn('ag-Grid: rowStyle should be an object of key/value styles, not be a function, use getRowStyle() instead');
return;
}
// part 1 - rowStyleFunc
var rowStyleFunc = this.beans.gridOptionsWrapper.getRowStyleFunc();
var rowStyleFuncResult;
if (rowStyleFunc) {
var params = {
data: this.rowNode.data,
node: this.rowNode,
api: this.beans.gridOptionsWrapper.getApi(),
context: this.beans.gridOptionsWrapper.getContext(),
$scope: this.scope
};
rowStyleFuncResult = rowStyleFunc(params);
}
return Object(_utils_object__WEBPACK_IMPORTED_MODULE_13__["assign"])({}, rowStyle, rowStyleFuncResult);
};
RowComp.prototype.createCells = function (cols) {
var _this = this;
var templateParts = [];
var newCellComps = [];
cols.forEach(function (col) {
var newCellComp = new _cellComp__WEBPACK_IMPORTED_MODULE_0__["CellComp"](_this.scope, _this.beans, col, _this.rowNode, _this, false, _this.printLayout);
var cellTemplate = newCellComp.getCreateTemplate();
templateParts.push(cellTemplate);
newCellComps.push(newCellComp);
_this.cellComps[col.getId()] = newCellComp;
});
var templateAndComps = {
template: templateParts.join(''),
cellComps: newCellComps
};
return templateAndComps;
};
RowComp.prototype.onRowSelected = function () {
var _this = this;
var selected = this.rowNode.isSelected();
this.eAllRowContainers.forEach(function (row) {
Object(_utils_aria__WEBPACK_IMPORTED_MODULE_7__["setAriaSelected"])(row, selected);
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_9__["addOrRemoveCssClass"])(row, 'ag-row-selected', selected);
_this.refreshAriaLabel(row, selected);
});
};
RowComp.prototype.refreshAriaLabel = function (node, selected) {
if (selected && this.beans.gridOptionsWrapper.isSuppressRowDeselection()) {
node.removeAttribute('aria-label');
return;
}
var translate = this.beans.gridOptionsWrapper.getLocaleTextFunc();
var label = translate(selected ? 'ariaRowDeselect' : 'ariaRowSelect', "Press SPACE to " + (selected ? 'deselect' : 'select') + " this row.");
Object(_utils_aria__WEBPACK_IMPORTED_MODULE_7__["setAriaLabel"])(node, label);
};
// called:
// + after row created for first time
// + after horizontal scroll, so new cells due to column virtualisation
RowComp.prototype.callAfterRowAttachedOnCells = function (newCellComps, eRow) {
var _this = this;
newCellComps.forEach(function (cellComp) {
cellComp.setParentRow(eRow);
cellComp.afterAttached();
// if we are editing the row, then the cell needs to turn
// into edit mode
if (_this.editingRow) {
cellComp.startEditingIfEnabled();
}
});
};
RowComp.prototype.afterRowAttached = function (rowContainerComp, eRow) {
var _this = this;
this.addDomData(eRow);
this.removeSecondPassFuncs.push(function () {
rowContainerComp.removeRowElement(eRow);
});
this.removeFirstPassFuncs.push(function () {
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_11__["exists"])(_this.rowNode.rowTop)) {
// the row top is updated anyway, however we set it here again
// to something more reasonable for the animation - ie if the
// row top is 10000px away, the row will flash out, so this
// gives it a rounded value, so row animates out more slowly
var rowTop = _this.roundRowTopToBounds(_this.rowNode.rowTop);
_this.setRowTop(rowTop);
}
else {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_9__["addCssClass"])(eRow, 'ag-opacity-zero');
}
});
this.eAllRowContainers.push(eRow);
// adding hover functionality adds listener to this row, so we
// do it lazily in an animation frame
if (this.useAnimationFrameForCreate) {
this.beans.taskQueue.createTask(this.addHoverFunctionality.bind(this, eRow), this.rowNode.rowIndex, 'createTasksP2');
}
else {
this.addHoverFunctionality(eRow);
}
};
RowComp.prototype.addHoverFunctionality = function (eRow) {
var _this = this;
// because we use animation frames to do this, it's possible the row no longer exists
// by the time we get to add it
if (!this.active) {
return;
}
// because mouseenter and mouseleave do not propagate, we cannot listen on the gridPanel
// like we do for all the other mouse events.
// because of the pinning, we cannot simply add / remove the class based on the eRow. we
// have to check all eRow's (body & pinned). so the trick is if any of the rows gets a
// mouse hover, it sets such in the rowNode, and then all three reflect the change as
// all are listening for event on the row node.
// step 1 - add listener, to set flag on row node
this.addManagedListener(eRow, 'mouseenter', function () { return _this.rowNode.onMouseEnter(); });
this.addManagedListener(eRow, 'mouseleave', function () { return _this.rowNode.onMouseLeave(); });
// step 2 - listen for changes on row node (which any eRow can trigger)
this.addManagedListener(this.rowNode, _entities_rowNode__WEBPACK_IMPORTED_MODULE_1__["RowNode"].EVENT_MOUSE_ENTER, function () {
// if hover turned off, we don't add the class. we do this here so that if the application
// toggles this property mid way, we remove the hover form the last row, but we stop
// adding hovers from that point onwards.
if (!_this.beans.gridOptionsWrapper.isSuppressRowHoverHighlight()) {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_9__["addCssClass"])(eRow, 'ag-row-hover');
}
});
this.addManagedListener(this.rowNode, _entities_rowNode__WEBPACK_IMPORTED_MODULE_1__["RowNode"].EVENT_MOUSE_LEAVE, function () {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_9__["removeCssClass"])(eRow, 'ag-row-hover');
});
};
// for animation, we don't want to animate entry or exit to a very far away pixel,
// otherwise the row would move so fast, it would appear to disappear. so this method
// moves the row closer to the viewport if it is far away, so the row slide in / out
// at a speed the user can see.
RowComp.prototype.roundRowTopToBounds = function (rowTop) {
var range = this.beans.gridPanel.getVScrollPosition();
var minPixel = this.applyPaginationOffset(range.top, true) - 100;
var maxPixel = this.applyPaginationOffset(range.bottom, true) + 100;
return Math.min(Math.max(minPixel, rowTop), maxPixel);
};
RowComp.prototype.getFrameworkOverrides = function () {
return this.beans.frameworkOverrides;
};
RowComp.prototype.onRowHeightChanged = function () {
// check for exists first - if the user is resetting the row height, then
// it will be null (or undefined) momentarily until the next time the flatten
// stage is called where the row will then update again with a new height
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_11__["exists"])(this.rowNode.rowHeight)) {
var heightPx_1 = this.rowNode.rowHeight + "px";
this.eAllRowContainers.forEach(function (row) { return row.style.height = heightPx_1; });
}
};
RowComp.prototype.addEventListener = function (eventType, listener) {
if (eventType === 'renderedRowRemoved' || eventType === 'rowRemoved') {
eventType = _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_VIRTUAL_ROW_REMOVED;
console.warn('ag-Grid: Since version 11, event renderedRowRemoved is now called ' + _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_VIRTUAL_ROW_REMOVED);
}
_super.prototype.addEventListener.call(this, eventType, listener);
};
RowComp.prototype.removeEventListener = function (eventType, listener) {
if (eventType === 'renderedRowRemoved' || eventType === 'rowRemoved') {
eventType = _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_VIRTUAL_ROW_REMOVED;
console.warn('ag-Grid: Since version 11, event renderedRowRemoved and rowRemoved is now called ' + _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_VIRTUAL_ROW_REMOVED);
}
_super.prototype.removeEventListener.call(this, eventType, listener);
};
// note - this is NOT called by context, as we don't wire / unwire the CellComp for performance reasons.
RowComp.prototype.destroy = function (animate) {
if (animate === void 0) { animate = false; }
this.active = false;
// why do we have this method? shouldn't everything below be added as a destroy func beside
// the corresponding create logic?
this.destroyFullWidthComponents();
if (animate) {
this.removeFirstPassFuncs.forEach(function (func) { return func(); });
this.removeSecondPassFuncs.push(this.destroyContainingCells.bind(this));
}
else {
this.destroyContainingCells();
// we are not animating, so execute the second stage of removal now.
// we call getAndClear, so that they are only called once
var delayedDestroyFunctions = this.getAndClearDelayedDestroyFunctions();
delayedDestroyFunctions.forEach(function (func) { return func(); });
}
var event = this.createRowEvent(_events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_VIRTUAL_ROW_REMOVED);
this.dispatchEvent(event);
this.beans.eventService.dispatchEvent(event);
_super.prototype.destroy.call(this);
};
RowComp.prototype.destroyContainingCells = function () {
var cellsToDestroy = Object.keys(this.cellComps);
this.destroyCells(cellsToDestroy);
};
// we clear so that the functions are never executed twice
RowComp.prototype.getAndClearDelayedDestroyFunctions = function () {
var result = this.removeSecondPassFuncs;
this.removeSecondPassFuncs = [];
return result;
};
RowComp.prototype.onCellFocusChanged = function () {
var rowFocused = this.beans.focusController.isRowFocused(this.rowNode.rowIndex, this.rowNode.rowPinned);
if (rowFocused !== this.rowFocused) {
this.eAllRowContainers.forEach(function (row) { return Object(_utils_dom__WEBPACK_IMPORTED_MODULE_9__["addOrRemoveCssClass"])(row, 'ag-row-focus', rowFocused); });
this.eAllRowContainers.forEach(function (row) { return Object(_utils_dom__WEBPACK_IMPORTED_MODULE_9__["addOrRemoveCssClass"])(row, 'ag-row-no-focus', !rowFocused); });
this.rowFocused = rowFocused;
}
// if we are editing, then moving the focus out of a row will stop editing
if (!rowFocused && this.editingRow) {
this.stopEditing(false);
}
};
RowComp.prototype.onPaginationChanged = function () {
var currentPage = this.beans.paginationProxy.getCurrentPage();
// it is possible this row is in the new page, but the page number has changed, which means
// it needs to reposition itself relative to the new page
if (this.paginationPage !== currentPage) {
this.paginationPage = currentPage;
this.onTopChanged();
}
};
RowComp.prototype.onTopChanged = function () {
this.setRowTop(this.rowNode.rowTop);
};
RowComp.prototype.onPaginationPixelOffsetChanged = function () {
// the pixel offset is used when calculating rowTop to set on the row DIV
this.onTopChanged();
};
// applies pagination offset, eg if on second page, and page height is 500px, then removes
// 500px from the top position, so a row with rowTop 600px is displayed at location 100px.
// reverse will take the offset away rather than add.
RowComp.prototype.applyPaginationOffset = function (topPx, reverse) {
if (reverse === void 0) { reverse = false; }
if (this.rowNode.isRowPinned()) {
return topPx;
}
var pixelOffset = this.beans.paginationProxy.getPixelOffset();
var multiplier = reverse ? 1 : -1;
return topPx + (pixelOffset * multiplier);
};
RowComp.prototype.setRowTop = function (pixels) {
// print layout uses normal flow layout for row positioning
if (this.printLayout) {
return;
}
// need to make sure rowTop is not null, as this can happen if the node was once
// visible (ie parent group was expanded) but is now not visible
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_11__["exists"])(pixels)) {
var afterPaginationPixels = this.applyPaginationOffset(pixels);
var afterScalingPixels = this.rowNode.isRowPinned() ? afterPaginationPixels : this.beans.maxDivHeightScaler.getRealPixelPosition(afterPaginationPixels);
var topPx_1 = afterScalingPixels + "px";
if (this.beans.gridOptionsWrapper.isSuppressRowTransform()) {
this.eAllRowContainers.forEach(function (row) { return row.style.top = topPx_1; });
}
else {
this.eAllRowContainers.forEach(function (row) { return row.style.transform = "translateY(" + topPx_1 + ")"; });
}
}
};
// we clear so that the functions are never executed twice
RowComp.prototype.getAndClearNextVMTurnFunctions = function () {
var result = this.createSecondPassFuncs;
this.createSecondPassFuncs = [];
return result;
};
RowComp.prototype.getRowNode = function () {
return this.rowNode;
};
RowComp.prototype.getRenderedCellForColumn = function (column) {
var _this = this;
var cellComp = this.cellComps[column.getColId()];
if (cellComp) {
return cellComp;
}
var spanList = Object.keys(this.cellComps)
.map(function (name) { return _this.cellComps[name]; })
.filter(function (cmp) { return cmp && cmp.getColSpanningList().indexOf(column) !== -1; });
return spanList.length ? spanList[0] : undefined;
};
RowComp.prototype.onRowIndexChanged = function () {
// we only bother updating if the rowIndex is present. if it is not present, it means this row
// is child of a group node, and the group node was closed, it's the only way to have no row index.
// when this happens, row is about to be de-rendered, so we don't care, rowComp is about to die!
if (this.rowNode.rowIndex != null) {
this.onCellFocusChanged();
this.updateRowIndexes();
}
};
RowComp.prototype.updateRowIndexes = function () {
var _this = this;
var rowIndexStr = this.rowNode.getRowIndexString();
var rowIsEven = this.rowNode.rowIndex % 2 === 0;
var rowIsEvenChanged = this.rowIsEven !== rowIsEven;
var headerRowCount = this.beans.headerNavigationService.getHeaderRowCount();
if (rowIsEvenChanged) {
this.rowIsEven = rowIsEven;
}
this.eAllRowContainers.forEach(function (eRow) {
eRow.setAttribute('row-index', rowIndexStr);
Object(_utils_aria__WEBPACK_IMPORTED_MODULE_7__["setAriaRowIndex"])(eRow, headerRowCount + _this.rowNode.rowIndex + 1);
if (!rowIsEvenChanged) {
return;
}
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_9__["addOrRemoveCssClass"])(eRow, 'ag-row-even', rowIsEven);
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_9__["addOrRemoveCssClass"])(eRow, 'ag-row-odd', !rowIsEven);
});
};
RowComp.prototype.ensureDomOrder = function () {
var sides = [
{
el: this.getBodyRowElement(),
ct: this.bodyContainerComp
},
{
el: this.getPinnedLeftRowElement(),
ct: this.pinnedLeftContainerComp
}, {
el: this.getPinnedRightRowElement(),
ct: this.pinnedRightContainerComp
}, {
el: this.getFullWidthRowElement(),
ct: this.fullWidthContainerComp
}
];
sides.forEach(function (side) {
if (!side.el) {
return;
}
side.ct.ensureDomOrder(side.el);
});
};
// returns the pinned left container, either the normal one, or the embedded full with one if exists
RowComp.prototype.getPinnedLeftRowElement = function () {
return this.ePinnedLeftRow ? this.ePinnedLeftRow : this.eFullWidthRowLeft;
};
// returns the pinned right container, either the normal one, or the embedded full with one if exists
RowComp.prototype.getPinnedRightRowElement = function () {
return this.ePinnedRightRow ? this.ePinnedRightRow : this.eFullWidthRowRight;
};
// returns the body container, either the normal one, or the embedded full with one if exists
RowComp.prototype.getBodyRowElement = function () {
return this.eBodyRow ? this.eBodyRow : this.eFullWidthRowBody;
};
// returns the full width container
RowComp.prototype.getFullWidthRowElement = function () {
return this.eFullWidthRow;
};
RowComp.DOM_DATA_KEY_RENDERED_ROW = 'renderedRow';
RowComp.FULL_WIDTH_CELL_RENDERER = 'fullWidthCellRenderer';
RowComp.GROUP_ROW_RENDERER = 'groupRowRenderer';
RowComp.GROUP_ROW_RENDERER_COMP_NAME = 'agGroupRowRenderer';
RowComp.LOADING_CELL_RENDERER = 'loadingCellRenderer';
RowComp.LOADING_CELL_RENDERER_COMP_NAME = 'agLoadingCellRenderer';
RowComp.DETAIL_CELL_RENDERER = 'detailCellRenderer';
RowComp.DETAIL_CELL_RENDERER_COMP_NAME = 'agDetailCellRenderer';
return RowComp;
}(_widgets_component__WEBPACK_IMPORTED_MODULE_3__["Component"]));
/***/ }),
/* 102 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CellComp", function() { return CellComp; });
/* harmony import */ var _constants_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16);
/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23);
/* harmony import */ var _widgets_component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(36);
/* harmony import */ var _checkboxSelectionComponent__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(72);
/* harmony import */ var _interfaces_iRangeController__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(103);
/* harmony import */ var _row_rowDragComp__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(104);
/* harmony import */ var _cellEditors_popupEditorWrapper__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(106);
/* harmony import */ var _dndSourceComp__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(107);
/* harmony import */ var _widgets_tooltipFeature__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(56);
/* harmony import */ var _utils_aria__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(44);
/* harmony import */ var _utils_object__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(13);
/* harmony import */ var _utils_string__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(26);
/* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(7);
/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(42);
/* harmony import */ var _utils_array__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(14);
/* harmony import */ var _utils_general__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(41);
/* harmony import */ var _utils_event__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(21);
/* harmony import */ var _utils_keyboard__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(48);
/* harmony import */ var _utils_browser__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(43);
/* harmony import */ var _utils_function__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(15);
/* harmony import */ var _constants_keyCode__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(58);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __assign = (undefined && undefined.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var CSS_CELL = 'ag-cell';
var CSS_CELL_VALUE = 'ag-cell-value';
var CSS_AUTO_HEIGHT = 'ag-cell-auto-height';
var CSS_RANGE_TOP = 'ag-cell-range-top';
var CSS_RANGE_RIGHT = 'ag-cell-range-right';
var CSS_RANGE_BOTTOM = 'ag-cell-range-bottom';
var CSS_RANGE_LEFT = 'ag-cell-range-left';
var CSS_CELL_FOCUS = 'ag-cell-focus';
var CSS_FIRST_RIGHT_PINNED = 'ag-cell-first-right-pinned';
var CSS_LAST_LEFT_PINNED = 'ag-cell-last-left-pinned';
var CSS_NOT_INLINE_EDITING = 'ag-cell-not-inline-editing';
var CSS_INLINE_EDITING = 'ag-cell-inline-editing';
var CSS_POPUP_EDITING = 'ag-cell-popup-editing';
var CSS_RANGE_SELECTED = 'ag-cell-range-selected';
var CSS_COLUMN_HOVER = 'ag-column-hover';
var CSS_CELL_WRAP_TEXT = 'ag-cell-wrap-text';
var CSS_RANGE_CHART = 'ag-cell-range-chart';
var CSS_RANGE_SINGLE_CELL = 'ag-cell-range-single-cell';
var CSS_RANGE_CHART_CATEGORY = 'ag-cell-range-chart-category';
var CSS_RANGE_HANDLE = 'ag-cell-range-handle';
var CellComp = /** @class */ (function (_super) {
__extends(CellComp, _super);
function CellComp(scope, beans, column, rowNode, rowComp, autoHeightCell, printLayout) {
var _this = _super.call(this) || this;
_this.hasChartRange = false;
_this.editingCell = false;
_this.suppressRefreshCell = false;
_this.tooltipFeatureEnabled = false;
_this.scope = null;
// every time we go into edit mode, or back again, this gets incremented.
// it's the components way of dealing with the async nature of framework components,
// so if a framework component takes a while to be created, we know if the object
// is still relevant when creating is finished. eg we could click edit / un-edit 20
// times before the first React edit component comes back - we should discard
// the first 19.
_this.cellEditorVersion = 0;
_this.cellRendererVersion = 0;
_this.scope = scope;
_this.beans = beans;
_this.column = column;
_this.rowNode = rowNode;
_this.rowComp = rowComp;
_this.autoHeightCell = autoHeightCell;
_this.printLayout = printLayout;
_this.createGridCellVo();
_this.rangeSelectionEnabled = _this.beans.rangeController && beans.gridOptionsWrapper.isEnableRangeSelection();
_this.cellFocused = _this.beans.focusController.isCellFocused(_this.cellPosition);
_this.firstRightPinned = _this.column.isFirstRightPinned();
_this.lastLeftPinned = _this.column.isLastLeftPinned();
if (_this.rangeSelectionEnabled && _this.beans.rangeController) {
var rangeController = _this.beans.rangeController;
_this.rangeCount = rangeController.getCellRangeCount(_this.cellPosition);
_this.hasChartRange = _this.getHasChartRange();
}
_this.getValueAndFormat();
_this.setUsingWrapper();
_this.chooseCellRenderer();
_this.setupColSpan();
_this.rowSpan = _this.column.getRowSpan(_this.rowNode);
return _this;
}
CellComp.prototype.getCreateTemplate = function () {
var unselectable = !this.beans.gridOptionsWrapper.isEnableCellTextSelection() ? 'unselectable="on"' : '';
var templateParts = [];
var col = this.column;
var width = this.getCellWidth();
var left = this.modifyLeftForPrintLayout(this.getCellLeft());
var valueToRender = this.getInitialValueToRender();
var valueSanitised = Object(_utils_object__WEBPACK_IMPORTED_MODULE_10__["get"])(this.column, 'colDef.template', null) ? valueToRender : Object(_utils_string__WEBPACK_IMPORTED_MODULE_11__["escapeString"])(valueToRender);
this.tooltip = this.getToolTip();
var tooltipSanitised = Object(_utils_string__WEBPACK_IMPORTED_MODULE_11__["escapeString"])(this.tooltip);
var colIdSanitised = Object(_utils_string__WEBPACK_IMPORTED_MODULE_11__["escapeString"])(col.getId());
var wrapperStartTemplate = '';
var wrapperEndTemplate = '';
var stylesFromColDef = this.preProcessStylesFromColDef();
var cssClasses = this.getInitialCssClasses();
var stylesForRowSpanning = this.getStylesForRowSpanning();
var colIdxSanitised = Object(_utils_string__WEBPACK_IMPORTED_MODULE_11__["escapeString"])(this.beans.columnController.getAriaColumnIndex(this.column).toString());
templateParts.push("
\n ";
wrapperEndTemplate = '
';
}
templateParts.push(" style=\"width: " + Number(width) + "px; left: " + Number(left) + "px; " + Object(_utils_string__WEBPACK_IMPORTED_MODULE_11__["escapeString"])(stylesFromColDef) + " " + Object(_utils_string__WEBPACK_IMPORTED_MODULE_11__["escapeString"])(stylesForRowSpanning) + "\">");
templateParts.push(wrapperStartTemplate);
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_12__["exists"])(valueSanitised, true)) {
templateParts.push(valueSanitised);
}
templateParts.push(wrapperEndTemplate);
templateParts.push("");
return templateParts.join('');
};
CellComp.prototype.getStylesForRowSpanning = function () {
if (this.rowSpan === 1) {
return '';
}
var singleRowHeight = this.beans.gridOptionsWrapper.getRowHeightAsNumber();
var totalRowHeight = singleRowHeight * this.rowSpan;
return "height: " + totalRowHeight + "px; z-index: 1;";
};
CellComp.prototype.afterAttached = function () {
var querySelector = "[comp-id=\"" + this.getCompId() + "\"]";
var eGui = this.eParentRow.querySelector(querySelector);
this.setGui(eGui);
// all of these have dependencies on the eGui, so only do them after eGui is set
this.addDomData();
this.populateTemplate();
this.createCellRendererInstance(true);
this.angular1Compile();
this.refreshHandle();
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_12__["exists"])(this.tooltip)) {
this.createTooltipFeatureIfNeeded();
}
};
CellComp.prototype.createTooltipFeatureIfNeeded = function () {
if (this.beans.gridOptionsWrapper.isEnableBrowserTooltips() ||
this.tooltipFeatureEnabled) {
return;
}
this.createManagedBean(new _widgets_tooltipFeature__WEBPACK_IMPORTED_MODULE_8__["TooltipFeature"](this), this.beans.context);
this.tooltipFeatureEnabled = true;
};
CellComp.prototype.onColumnHover = function () {
var isHovered = this.beans.columnHoverService.isHovered(this.column);
this.addOrRemoveCssClass(CSS_COLUMN_HOVER, isHovered);
};
CellComp.prototype.onCellChanged = function (event) {
var eventImpactsThisCell = event.column === this.column;
if (eventImpactsThisCell) {
this.refreshCell({});
}
};
CellComp.prototype.getCellLeft = function () {
var mostLeftCol;
if (this.beans.gridOptionsWrapper.isEnableRtl() && this.colsSpanning) {
mostLeftCol = Object(_utils_array__WEBPACK_IMPORTED_MODULE_14__["last"])(this.colsSpanning);
}
else {
mostLeftCol = this.column;
}
return mostLeftCol.getLeft();
};
CellComp.prototype.getCellWidth = function () {
if (!this.colsSpanning) {
return this.column.getActualWidth();
}
return this.colsSpanning.reduce(function (width, col) { return width + col.getActualWidth(); }, 0);
};
CellComp.prototype.onFlashCells = function (event) {
var cellId = this.beans.cellPositionUtils.createId(this.cellPosition);
var shouldFlash = event.cells[cellId];
if (shouldFlash) {
this.animateCell('highlight');
}
};
CellComp.prototype.setupColSpan = function () {
// if no col span is active, then we don't set it up, as it would be wasteful of CPU
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_12__["missing"])(this.getComponentHolder().colSpan)) {
return;
}
// because we are col spanning, a reorder of the cols can change what cols we are spanning over
this.addManagedListener(this.beans.eventService, _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_DISPLAYED_COLUMNS_CHANGED, this.onDisplayColumnsChanged.bind(this));
// because we are spanning over multiple cols, we check for width any time any cols width changes.
// this is expensive - really we should be explicitly checking only the cols we are spanning over
// instead of every col, however it would be tricky code to track the cols we are spanning over, so
// because hardly anyone will be using colSpan, am favouring this easier way for more maintainable code.
this.addManagedListener(this.beans.eventService, _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED, this.onWidthChanged.bind(this));
this.colsSpanning = this.getColSpanningList();
};
CellComp.prototype.getColSpanningList = function () {
var colSpan = this.column.getColSpan(this.rowNode);
var colsSpanning = [];
// if just one col, the col span is just the column we are in
if (colSpan === 1) {
colsSpanning.push(this.column);
}
else {
var pointer = this.column;
var pinned = this.column.getPinned();
for (var i = 0; pointer && i < colSpan; i++) {
colsSpanning.push(pointer);
pointer = this.beans.columnController.getDisplayedColAfter(pointer);
if (!pointer || Object(_utils_generic__WEBPACK_IMPORTED_MODULE_12__["missing"])(pointer)) {
break;
}
// we do not allow col spanning to span outside of pinned areas
if (pinned !== pointer.getPinned()) {
break;
}
}
}
return colsSpanning;
};
CellComp.prototype.onDisplayColumnsChanged = function () {
var colsSpanning = this.getColSpanningList();
if (!Object(_utils_array__WEBPACK_IMPORTED_MODULE_14__["areEqual"])(this.colsSpanning, colsSpanning)) {
this.colsSpanning = colsSpanning;
this.onWidthChanged();
this.onLeftChanged(); // left changes when doing RTL
}
};
CellComp.prototype.refreshAriaIndex = function () {
var colIdx = this.beans.columnController.getAriaColumnIndex(this.column);
Object(_utils_aria__WEBPACK_IMPORTED_MODULE_9__["setAriaColIndex"])(this.getGui(), colIdx);
};
CellComp.prototype.getInitialCssClasses = function () {
var cssClasses = [CSS_CELL, CSS_NOT_INLINE_EDITING];
// if we are putting the cell into a dummy container, to work out it's height,
// then we don't put the height css in, as we want cell to fit height in that case.
if (!this.autoHeightCell) {
cssClasses.push(CSS_AUTO_HEIGHT);
}
var doingFocusCss = !this.beans.gridOptionsWrapper.isSuppressCellSelection();
if (doingFocusCss && this.cellFocused) {
// otherwise the class depends on the focus state
cssClasses.push(CSS_CELL_FOCUS);
}
if (this.firstRightPinned) {
cssClasses.push(CSS_FIRST_RIGHT_PINNED);
}
if (this.lastLeftPinned) {
cssClasses.push(CSS_LAST_LEFT_PINNED);
}
if (this.beans.columnHoverService.isHovered(this.column)) {
cssClasses.push(CSS_COLUMN_HOVER);
}
Object(_utils_array__WEBPACK_IMPORTED_MODULE_14__["pushAll"])(cssClasses, this.preProcessClassesFromColDef());
Object(_utils_array__WEBPACK_IMPORTED_MODULE_14__["pushAll"])(cssClasses, this.preProcessCellClassRules());
Object(_utils_array__WEBPACK_IMPORTED_MODULE_14__["pushAll"])(cssClasses, this.getInitialRangeClasses());
// if using the wrapper, this class goes on the wrapper instead
if (!this.usingWrapper) {
cssClasses.push(CSS_CELL_VALUE);
}
this.wrapText = this.column.getColDef().wrapText == true;
if (this.wrapText) {
cssClasses.push(CSS_CELL_WRAP_TEXT);
}
return cssClasses;
};
CellComp.prototype.getInitialValueToRender = function () {
// if using a cellRenderer, then render the html from the cell renderer if it exists
if (this.usingCellRenderer) {
if (typeof this.cellRendererGui === 'string') {
return this.cellRendererGui;
}
return '';
}
var colDef = this.getComponentHolder();
if (colDef.template) {
// template is really only used for angular 1 - as people using ng1 are used to providing templates with
// bindings in it. in ng2, people will hopefully want to provide components, not templates.
return colDef.template;
}
if (colDef.templateUrl) {
// likewise for templateUrl - it's for ng1 really - when we move away from ng1, we can take these out.
// niall was pro angular 1 when writing template and templateUrl, if writing from scratch now, would
// not do these, but would follow a pattern that was friendly towards components, not templates.
var template = this.beans.templateService.getTemplate(colDef.templateUrl, this.refreshCell.bind(this, true));
return template || '';
}
return this.getValueToUse();
};
CellComp.prototype.getRenderedRow = function () {
return this.rowComp;
};
CellComp.prototype.isSuppressNavigable = function () {
return this.column.isSuppressNavigable(this.rowNode);
};
CellComp.prototype.getCellRenderer = function () {
return this.cellRenderer;
};
CellComp.prototype.getCellEditor = function () {
return this.cellEditor;
};
CellComp.prototype.onNewColumnsLoaded = function () {
this.postProcessWrapText();
this.postProcessCellClassRules();
};
CellComp.prototype.postProcessWrapText = function () {
var newValue = this.column.getColDef().wrapText == true;
if (newValue !== this.wrapText) {
this.wrapText = newValue;
this.addOrRemoveCssClass(CSS_CELL_WRAP_TEXT, this.wrapText);
}
};
// + stop editing {forceRefresh: true, suppressFlash: true}
// + event cellChanged {}
// + cellRenderer.params.refresh() {} -> method passes 'as is' to the cellRenderer, so params could be anything
// + rowComp: event dataChanged {animate: update, newData: !update}
// + rowComp: api refreshCells() {animate: true/false}
// + rowRenderer: api softRefreshView() {}
CellComp.prototype.refreshCell = function (params) {
// if we are in the middle of 'stopEditing', then we don't refresh here, as refresh gets called explicitly
if (this.suppressRefreshCell || this.editingCell) {
return;
}
var colDef = this.getComponentHolder();
var newData = params && params.newData;
var suppressFlash = (params && params.suppressFlash) || colDef.suppressCellFlash;
var forceRefresh = params && params.forceRefresh;
var oldValue = this.value;
// get latest value without invoking the value formatter as we may not be updating the cell
this.value = this.getValue();
// for simple values only (not objects), see if the value is the same, and if it is, skip the refresh.
// when never allow skipping after an edit, as after editing, we need to put the GUI back to the way
// if was before the edit.
var valuesDifferent = !this.valuesAreEqual(oldValue, this.value);
var dataNeedsUpdating = forceRefresh || valuesDifferent;
if (dataNeedsUpdating) {
// now invoke the value formatter as we are going to update cell
this.valueFormatted = this.beans.valueFormatterService.formatValue(this.column, this.rowNode, this.scope, this.value);
// if it's 'new data', then we don't refresh the cellRenderer, even if refresh method is available.
// this is because if the whole data is new (ie we are showing stock price 'BBA' now and not 'SSD')
// then we are not showing a movement in the stock price, rather we are showing different stock.
var cellRendererRefreshed = newData ? false : this.attemptCellRendererRefresh();
// we do the replace if not doing refresh, or if refresh was unsuccessful.
// the refresh can be unsuccessful if we are using a framework (eg ng2 or react) and the framework
// wrapper has the refresh method, but the underlying component doesn't
if (!cellRendererRefreshed) {
this.replaceContentsAfterRefresh();
}
// we don't want to flash the cells when processing a filter change, as otherwise the UI would
// be to busy. see comment in FilterManager with regards processingFilterChange
var processingFilterChange = this.beans.filterManager.isSuppressFlashingCellsBecauseFiltering();
var flashCell = !suppressFlash && !processingFilterChange &&
(this.beans.gridOptionsWrapper.isEnableCellChangeFlash() || colDef.enableCellChangeFlash);
if (flashCell) {
this.flashCell();
}
// need to check rules. note, we ignore colDef classes and styles, these are assumed to be static
this.postProcessStylesFromColDef();
this.postProcessClassesFromColDef();
}
// we can't readily determine if the data in an angularjs template has changed, so here we just update
// and recompile (if applicable)
this.updateAngular1ScopeAndCompile();
this.refreshToolTip();
// we do cellClassRules even if the value has not changed, so that users who have rules that
// look at other parts of the row (where the other part of the row might of changed) will work.
this.postProcessCellClassRules();
};
// user can also call this via API
CellComp.prototype.flashCell = function (delays) {
var flashDelay = delays && delays.flashDelay;
var fadeDelay = delays && delays.fadeDelay;
this.animateCell('data-changed', flashDelay, fadeDelay);
};
CellComp.prototype.animateCell = function (cssName, flashDelay, fadeDelay) {
var _this = this;
var fullName = "ag-cell-" + cssName;
var animationFullName = "ag-cell-" + cssName + "-animation";
var element = this.getGui();
var gridOptionsWrapper = this.beans.gridOptionsWrapper;
if (!flashDelay) {
flashDelay = gridOptionsWrapper.getCellFlashDelay();
}
if (!fadeDelay) {
fadeDelay = gridOptionsWrapper.getCellFadeDelay();
}
// we want to highlight the cells, without any animation
this.addCssClass(fullName);
this.removeCssClass(animationFullName);
// then once that is applied, we remove the highlight with animation
window.setTimeout(function () {
_this.removeCssClass(fullName);
_this.addCssClass(animationFullName);
element.style.transition = "background-color " + fadeDelay + "ms";
window.setTimeout(function () {
// and then to leave things as we got them, we remove the animation
_this.removeCssClass(animationFullName);
element.style.transition = null;
}, fadeDelay);
}, flashDelay);
};
CellComp.prototype.replaceContentsAfterRefresh = function () {
// otherwise we rip out the cell and replace it
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_13__["clearElement"])(this.eCellValue);
// remove old renderer component if it exists
this.cellRenderer = this.beans.context.destroyBean(this.cellRenderer);
this.cellRendererGui = null;
// populate
this.putDataIntoCellAfterRefresh();
this.updateAngular1ScopeAndCompile();
};
CellComp.prototype.updateAngular1ScopeAndCompile = function () {
if (this.beans.gridOptionsWrapper.isAngularCompileRows() && this.scope) {
this.scope.data = __assign({}, this.rowNode.data);
this.angular1Compile();
}
};
CellComp.prototype.angular1Compile = function () {
// if angular compiling, then need to also compile the cell again (angular compiling sucks, please wait...)
if (this.beans.gridOptionsWrapper.isAngularCompileRows()) {
var eGui = this.getGui();
// only compile the node if it hasn't already been done
// this prevents "orphaned" node leaks
if (!eGui.classList.contains('ng-scope') || eGui.childElementCount === 0) {
var compiledElement_1 = this.beans.$compile(eGui)(this.scope);
this.addDestroyFunc(function () { return compiledElement_1.remove(); });
}
}
};
CellComp.prototype.postProcessStylesFromColDef = function () {
var stylesToUse = this.processStylesFromColDef();
if (stylesToUse) {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_13__["addStylesToElement"])(this.getGui(), stylesToUse);
}
};
CellComp.prototype.preProcessStylesFromColDef = function () {
return Object(_utils_general__WEBPACK_IMPORTED_MODULE_15__["cssStyleObjectToMarkup"])(this.processStylesFromColDef());
};
CellComp.prototype.processStylesFromColDef = function () {
var colDef = this.getComponentHolder();
if (colDef.cellStyle) {
var cssToUse = void 0;
if (typeof colDef.cellStyle === 'function') {
var cellStyleParams = {
value: this.value,
data: this.rowNode.data,
node: this.rowNode,
colDef: colDef,
column: this.column,
$scope: this.scope,
context: this.beans.gridOptionsWrapper.getContext(),
api: this.beans.gridOptionsWrapper.getApi()
};
var cellStyleFunc = colDef.cellStyle;
cssToUse = cellStyleFunc(cellStyleParams);
}
else {
cssToUse = colDef.cellStyle;
}
return cssToUse;
}
};
CellComp.prototype.postProcessClassesFromColDef = function () {
var _this = this;
this.processClassesFromColDef(function (className) { return _this.addCssClass(className); });
};
CellComp.prototype.preProcessClassesFromColDef = function () {
var res = [];
this.processClassesFromColDef(function (className) { return res.push(className); });
return res;
};
CellComp.prototype.processClassesFromColDef = function (onApplicableClass) {
var colDef = this.getComponentHolder();
this.beans.stylingService.processStaticCellClasses(colDef, {
value: this.value,
data: this.rowNode.data,
node: this.rowNode,
colDef: colDef,
rowIndex: this.rowNode.rowIndex,
$scope: this.scope,
api: this.beans.gridOptionsWrapper.getApi(),
columnApi: this.beans.gridOptionsWrapper.getColumnApi(),
context: this.beans.gridOptionsWrapper.getContext()
}, onApplicableClass);
};
CellComp.prototype.putDataIntoCellAfterRefresh = function () {
// template gets preference, then cellRenderer, then do it ourselves
var colDef = this.getComponentHolder();
if (colDef.template) {
// template is really only used for angular 1 - as people using ng1 are used to providing templates with
// bindings in it. in ng2, people will hopefully want to provide components, not templates.
this.eCellValue.innerHTML = colDef.template;
}
else if (colDef.templateUrl) {
// likewise for templateUrl - it's for ng1 really - when we move away from ng1, we can take these out.
// niall was pro angular 1 when writing template and templateUrl, if writing from scratch now, would
// not do these, but would follow a pattern that was friendly towards components, not templates.
var template = this.beans.templateService.getTemplate(colDef.templateUrl, this.refreshCell.bind(this, true));
if (template) {
this.eCellValue.innerHTML = template;
}
}
else {
// we can switch from using a cell renderer back to the default if a user
// is using cellRendererSelect
this.chooseCellRenderer();
if (this.usingCellRenderer) {
this.createCellRendererInstance();
}
else {
var valueToUse = this.getValueToUse();
if (valueToUse != null) {
this.eCellValue.innerHTML = Object(_utils_string__WEBPACK_IMPORTED_MODULE_11__["escapeString"])(valueToUse);
}
}
}
};
CellComp.prototype.attemptCellRendererRefresh = function () {
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_12__["missing"])(this.cellRenderer) || !this.cellRenderer || Object(_utils_generic__WEBPACK_IMPORTED_MODULE_12__["missing"])(this.cellRenderer.refresh)) {
return false;
}
// if the cell renderer has a refresh method, we call this instead of doing a refresh
var params = this.createCellRendererParams();
// take any custom params off of the user
var finalParams = this.beans.userComponentFactory.createFinalParams(this.getComponentHolder(), this.cellRendererType, params);
var result = this.cellRenderer.refresh(finalParams);
// NOTE on undefined: previous version of the cellRenderer.refresh() interface
// returned nothing, if the method existed, we assumed it refreshed. so for
// backwards compatibility, we assume if method exists and returns nothing,
// that it was successful.
return result === true || result === undefined;
};
CellComp.prototype.refreshToolTip = function () {
var newTooltip = this.getToolTip();
if (this.tooltip === newTooltip) {
return;
}
this.createTooltipFeatureIfNeeded();
var hasNewTooltip = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_12__["exists"])(newTooltip);
if (hasNewTooltip && this.tooltip === newTooltip.toString()) {
return;
}
this.tooltip = newTooltip;
if (this.beans.gridOptionsWrapper.isEnableBrowserTooltips()) {
if (hasNewTooltip) {
this.eCellValue.setAttribute('title', this.tooltip);
}
else {
this.eCellValue.removeAttribute('title');
}
}
};
CellComp.prototype.valuesAreEqual = function (val1, val2) {
// if the user provided an equals method, use that, otherwise do simple comparison
var colDef = this.getComponentHolder();
var equalsMethod = colDef ? colDef.equals : null;
return equalsMethod ? equalsMethod(val1, val2) : val1 === val2;
};
CellComp.prototype.getToolTip = function () {
var colDef = this.getComponentHolder();
var data = this.rowNode.data;
if (colDef.tooltipField && Object(_utils_generic__WEBPACK_IMPORTED_MODULE_12__["exists"])(data)) {
return Object(_utils_object__WEBPACK_IMPORTED_MODULE_10__["getValueUsingField"])(data, colDef.tooltipField, this.column.isTooltipFieldContainsDots());
}
var valueGetter = colDef.tooltipValueGetter;
if (valueGetter) {
return valueGetter(__assign(__assign({ api: this.beans.gridOptionsWrapper.getApi(), columnApi: this.beans.gridOptionsWrapper.getColumnApi(), context: this.beans.gridOptionsWrapper.getContext() }, this.getTooltipParams()), { value: this.value }));
}
return null;
};
CellComp.prototype.getTooltipParams = function () {
return {
location: 'cell',
colDef: this.getComponentHolder(),
column: this.getColumn(),
rowIndex: this.cellPosition.rowIndex,
node: this.rowNode,
data: this.rowNode.data,
value: this.getTooltipText(),
valueFormatted: this.valueFormatted,
};
};
CellComp.prototype.getTooltipText = function (escape) {
if (escape === void 0) { escape = true; }
return escape ? Object(_utils_string__WEBPACK_IMPORTED_MODULE_11__["escapeString"])(this.tooltip) : this.tooltip;
};
CellComp.prototype.processCellClassRules = function (onApplicableClass, onNotApplicableClass) {
var colDef = this.getComponentHolder();
this.beans.stylingService.processClassRules(colDef.cellClassRules, {
value: this.value,
data: this.rowNode.data,
node: this.rowNode,
colDef: colDef,
rowIndex: this.cellPosition.rowIndex,
api: this.beans.gridOptionsWrapper.getApi(),
columnApi: this.beans.gridOptionsWrapper.getColumnApi(),
$scope: this.scope,
context: this.beans.gridOptionsWrapper.getContext()
}, onApplicableClass, onNotApplicableClass);
};
CellComp.prototype.postProcessCellClassRules = function () {
var _this = this;
this.processCellClassRules(function (className) { return _this.addCssClass(className); }, function (className) { return _this.removeCssClass(className); });
};
CellComp.prototype.preProcessCellClassRules = function () {
var res = [];
this.processCellClassRules(function (className) { return res.push(className); }, function (_) {
// not catered for, if creating, no need
// to remove class as it was never there
});
return res;
};
// a wrapper is used when we are putting a selection checkbox in the cell with the value
CellComp.prototype.setUsingWrapper = function () {
var colDef = this.getComponentHolder();
// never allow selection or dragging on pinned rows
if (this.rowNode.rowPinned) {
this.usingWrapper = false;
this.includeSelectionComponent = false;
this.includeRowDraggingComponent = false;
this.includeDndSourceComponent = false;
return;
}
var cbSelectionIsFunc = typeof colDef.checkboxSelection === 'function';
var rowDraggableIsFunc = typeof colDef.rowDrag === 'function';
var dndSourceIsFunc = typeof colDef.dndSource === 'function';
this.includeSelectionComponent = cbSelectionIsFunc || colDef.checkboxSelection === true;
this.includeRowDraggingComponent = rowDraggableIsFunc || colDef.rowDrag === true;
this.includeDndSourceComponent = dndSourceIsFunc || colDef.dndSource === true;
var enableTextSelection = this.beans.gridOptionsWrapper.isEnableCellTextSelection();
this.usingWrapper = enableTextSelection || this.includeRowDraggingComponent || this.includeSelectionComponent || this.includeDndSourceComponent;
};
CellComp.prototype.chooseCellRenderer = function () {
// template gets preference, then cellRenderer, then do it ourselves
var colDef = this.getComponentHolder();
// templates are for ng1, ideally we wouldn't have these, they are ng1 support
// inside the core which is bad
if (colDef.template || colDef.templateUrl) {
this.usingCellRenderer = false;
return;
}
var params = this.createCellRendererParams();
if (this.rowNode.rowPinned &&
this.beans.userComponentFactory.lookupComponentClassDef(colDef, 'pinnedRowCellRenderer', params)) {
this.cellRendererType = CellComp.CELL_RENDERER_TYPE_PINNED;
this.usingCellRenderer = true;
}
else if (this.beans.userComponentFactory.lookupComponentClassDef(colDef, 'cellRenderer', params)) {
this.cellRendererType = CellComp.CELL_RENDERER_TYPE_NORMAL;
this.usingCellRenderer = true;
}
else {
this.usingCellRenderer = false;
}
};
CellComp.prototype.createCellRendererInstance = function (useTaskService) {
var _this = this;
if (useTaskService === void 0) { useTaskService = false; }
if (!this.usingCellRenderer) {
return;
}
// never use task service if angularCompileRows=true, as that assume the cell renderers
// are finished when the row is created. also we never use it if animation frame service
// is turned off.
// and lastly we never use it if doing auto-height, as the auto-height service checks the
// row height directly after the cell is created, it doesn't wait around for the tasks to complete
var angularCompileRows = this.beans.gridOptionsWrapper.isAngularCompileRows();
var suppressAnimationFrame = this.beans.gridOptionsWrapper.isSuppressAnimationFrame();
if (angularCompileRows || suppressAnimationFrame || this.autoHeightCell) {
useTaskService = false;
}
var params = this.createCellRendererParams();
this.cellRendererVersion++;
var callback = this.afterCellRendererCreated.bind(this, this.cellRendererVersion);
var cellRendererTypeNormal = this.cellRendererType === CellComp.CELL_RENDERER_TYPE_NORMAL;
this.createCellRendererFunc = function () {
_this.createCellRendererFunc = null;
// this can return null in the event that the user has switched from a renderer component to nothing, for example
// when using a cellRendererSelect to return a component or null depending on row data etc
var componentPromise = _this.beans.userComponentFactory.newCellRenderer(_this.getComponentHolder(), params, !cellRendererTypeNormal);
if (componentPromise) {
componentPromise.then(callback);
}
};
if (useTaskService) {
this.beans.taskQueue.createTask(this.createCellRendererFunc, this.rowNode.rowIndex, 'createTasksP2');
}
else {
this.createCellRendererFunc();
}
};
CellComp.prototype.afterCellRendererCreated = function (cellRendererVersion, cellRenderer) {
var cellRendererNotRequired = !this.isAlive() || cellRendererVersion !== this.cellRendererVersion;
if (cellRendererNotRequired) {
this.beans.context.destroyBean(cellRenderer);
return;
}
this.cellRenderer = cellRenderer;
this.cellRendererGui = this.cellRenderer.getGui();
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_12__["missing"])(this.cellRendererGui)) {
return;
}
// if async components, then it's possible the user started editing since this call was made
if (!this.editingCell) {
this.eCellValue.appendChild(this.cellRendererGui);
}
};
CellComp.prototype.createCellRendererParams = function () {
var _this = this;
return {
value: this.value,
valueFormatted: this.valueFormatted,
getValue: this.getValue.bind(this),
setValue: function (value) { return _this.beans.valueService.setValue(_this.rowNode, _this.column, value); },
formatValue: this.formatValue.bind(this),
data: this.rowNode.data,
node: this.rowNode,
colDef: this.getComponentHolder(),
column: this.column,
$scope: this.scope,
rowIndex: this.cellPosition.rowIndex,
api: this.beans.gridOptionsWrapper.getApi(),
columnApi: this.beans.gridOptionsWrapper.getColumnApi(),
context: this.beans.gridOptionsWrapper.getContext(),
refreshCell: this.refreshCell.bind(this),
eGridCell: this.getGui(),
eParentOfValue: this.eCellValue,
// these bits are not documented anywhere, so we could drop them?
// it was in the olden days to allow user to register for when rendered
// row was removed (the row comp was removed), however now that the user
// can provide components for cells, the destroy method gets call when this
// happens so no longer need to fire event.
addRowCompListener: this.rowComp ? this.rowComp.addEventListener.bind(this.rowComp) : null,
addRenderedRowListener: function (eventType, listener) {
console.warn('ag-Grid: since ag-Grid .v11, params.addRenderedRowListener() is now params.addRowCompListener()');
if (_this.rowComp) {
_this.rowComp.addEventListener(eventType, listener);
}
}
};
};
CellComp.prototype.formatValue = function (value) {
var valueFormatted = this.beans.valueFormatterService.formatValue(this.column, this.rowNode, this.scope, value);
return valueFormatted != null ? valueFormatted : value;
};
CellComp.prototype.getValueToUse = function () {
return this.valueFormatted != null ? this.valueFormatted : this.value;
};
CellComp.prototype.getValueAndFormat = function () {
this.value = this.getValue();
this.valueFormatted = this.beans.valueFormatterService.formatValue(this.column, this.rowNode, this.scope, this.value);
};
CellComp.prototype.getValue = function () {
// if we don't check this, then the grid will render leaf groups as open even if we are not
// allowing the user to open leaf groups. confused? remember for pivot mode we don't allow
// opening leaf groups, so we have to force leafGroups to be closed in case the user expanded
// them via the API, or user user expanded them in the UI before turning on pivot mode
var lockedClosedGroup = this.rowNode.leafGroup && this.beans.columnController.isPivotMode();
var isOpenGroup = this.rowNode.group && this.rowNode.expanded && !this.rowNode.footer && !lockedClosedGroup;
// are we showing group footers
var groupFootersEnabled = this.beans.gridOptionsWrapper.isGroupIncludeFooter();
// if doing footers, we normally don't show agg data at group level when group is open
var groupAlwaysShowAggData = this.beans.gridOptionsWrapper.isGroupSuppressBlankHeader();
// if doing grouping and footers, we don't want to include the agg value
// in the header when the group is open
var ignoreAggData = (isOpenGroup && groupFootersEnabled) && !groupAlwaysShowAggData;
var value = this.beans.valueService.getValue(this.column, this.rowNode, false, ignoreAggData);
return value;
};
CellComp.prototype.onMouseEvent = function (eventName, mouseEvent) {
if (Object(_utils_event__WEBPACK_IMPORTED_MODULE_16__["isStopPropagationForAgGrid"])(mouseEvent)) {
return;
}
switch (eventName) {
case 'click':
this.onCellClicked(mouseEvent);
break;
case 'mousedown':
this.onMouseDown(mouseEvent);
break;
case 'dblclick':
this.onCellDoubleClicked(mouseEvent);
break;
case 'mouseout':
this.onMouseOut(mouseEvent);
break;
case 'mouseover':
this.onMouseOver(mouseEvent);
break;
}
};
CellComp.prototype.dispatchCellContextMenuEvent = function (event) {
var colDef = this.getComponentHolder();
var cellContextMenuEvent = this.createEvent(event, _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_CELL_CONTEXT_MENU);
this.beans.eventService.dispatchEvent(cellContextMenuEvent);
if (colDef.onCellContextMenu) {
// to make the callback async, do in a timeout
window.setTimeout(function () { return colDef.onCellContextMenu(cellContextMenuEvent); }, 0);
}
};
CellComp.prototype.createEvent = function (domEvent, eventType) {
var event = {
node: this.rowNode,
data: this.rowNode.data,
value: this.value,
column: this.column,
colDef: this.getComponentHolder(),
context: this.beans.gridOptionsWrapper.getContext(),
api: this.beans.gridApi,
columnApi: this.beans.columnApi,
rowPinned: this.rowNode.rowPinned,
event: domEvent,
type: eventType,
rowIndex: this.rowNode.rowIndex
};
// because we are hacking in $scope for angular 1, we have to de-reference
if (this.scope) {
event.$scope = this.scope;
}
return event;
};
CellComp.prototype.onMouseOut = function (mouseEvent) {
var cellMouseOutEvent = this.createEvent(mouseEvent, _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_CELL_MOUSE_OUT);
this.beans.eventService.dispatchEvent(cellMouseOutEvent);
this.beans.columnHoverService.clearMouseOver();
};
CellComp.prototype.onMouseOver = function (mouseEvent) {
var cellMouseOverEvent = this.createEvent(mouseEvent, _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_CELL_MOUSE_OVER);
this.beans.eventService.dispatchEvent(cellMouseOverEvent);
this.beans.columnHoverService.setMouseOver([this.column]);
};
CellComp.prototype.onCellDoubleClicked = function (mouseEvent) {
var colDef = this.getComponentHolder();
// always dispatch event to eventService
var cellDoubleClickedEvent = this.createEvent(mouseEvent, _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_CELL_DOUBLE_CLICKED);
this.beans.eventService.dispatchEvent(cellDoubleClickedEvent);
// check if colDef also wants to handle event
if (typeof colDef.onCellDoubleClicked === 'function') {
// to make the callback async, do in a timeout
window.setTimeout(function () { return colDef.onCellDoubleClicked(cellDoubleClickedEvent); }, 0);
}
var editOnDoubleClick = !this.beans.gridOptionsWrapper.isSingleClickEdit()
&& !this.beans.gridOptionsWrapper.isSuppressClickEdit();
if (editOnDoubleClick) {
this.startRowOrCellEdit();
}
};
// called by rowRenderer when user navigates via tab key
CellComp.prototype.startRowOrCellEdit = function (keyPress, charPress) {
if (this.beans.gridOptionsWrapper.isFullRowEdit()) {
this.rowComp.startRowEditing(keyPress, charPress, this);
}
else {
this.startEditingIfEnabled(keyPress, charPress, true);
}
};
CellComp.prototype.isCellEditable = function () {
return this.column.isCellEditable(this.rowNode);
};
// either called internally if single cell editing, or called by rowRenderer if row editing
CellComp.prototype.startEditingIfEnabled = function (keyPress, charPress, cellStartedEdit) {
if (keyPress === void 0) { keyPress = null; }
if (charPress === void 0) { charPress = null; }
if (cellStartedEdit === void 0) { cellStartedEdit = false; }
// don't do it if not editable
if (!this.isCellEditable()) {
return;
}
// don't do it if already editing
if (this.editingCell) {
return;
}
this.editingCell = true;
this.cellEditorVersion++;
var callback = this.afterCellEditorCreated.bind(this, this.cellEditorVersion);
var params = this.createCellEditorParams(keyPress, charPress, cellStartedEdit);
this.createCellEditor(params).then(callback);
// if we don't do this, and editor component is async, then there will be a period
// when the component isn't present and keyboard navigation won't work - so example
// of user hitting tab quickly (more quickly than renderers getting created) won't work
var cellEditorAsync = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_12__["missing"])(this.cellEditor);
if (cellEditorAsync && cellStartedEdit) {
this.focusCell(true);
}
};
CellComp.prototype.createCellEditor = function (params) {
var _this = this;
var cellEditorPromise = this.beans.userComponentFactory.newCellEditor(this.column.getColDef(), params);
return cellEditorPromise.then(function (cellEditor) {
var isPopup = cellEditor.isPopup && cellEditor.isPopup();
if (!isPopup) {
return cellEditor;
}
if (_this.beans.gridOptionsWrapper.isFullRowEdit()) {
console.warn('ag-Grid: popup cellEditor does not work with fullRowEdit - you cannot use them both ' +
'- either turn off fullRowEdit, or stop using popup editors.');
}
// if a popup, then we wrap in a popup editor and return the popup
var popupEditorWrapper = new _cellEditors_popupEditorWrapper__WEBPACK_IMPORTED_MODULE_6__["PopupEditorWrapper"](cellEditor);
_this.beans.context.createBean(popupEditorWrapper);
popupEditorWrapper.init(params);
return popupEditorWrapper;
});
};
CellComp.prototype.afterCellEditorCreated = function (cellEditorVersion, cellEditor) {
// if editingCell=false, means user cancelled the editor before component was ready.
// if versionMismatch, then user cancelled the edit, then started the edit again, and this
// is the first editor which is now stale.
var versionMismatch = cellEditorVersion !== this.cellEditorVersion;
var cellEditorNotNeeded = versionMismatch || !this.editingCell;
if (cellEditorNotNeeded) {
this.beans.context.destroyBean(cellEditor);
return;
}
var editingCancelledByUserComp = cellEditor.isCancelBeforeStart && cellEditor.isCancelBeforeStart();
if (editingCancelledByUserComp) {
this.beans.context.destroyBean(cellEditor);
this.editingCell = false;
return;
}
if (!cellEditor.getGui) {
console.warn("ag-Grid: cellEditor for column " + this.column.getId() + " is missing getGui() method");
// no getGui, for React guys, see if they attached a react component directly
if (cellEditor.render) {
console.warn("ag-Grid: we found 'render' on the component, are you trying to set a React renderer but added it as colDef.cellEditor instead of colDef.cellEditorFmk?");
}
this.beans.context.destroyBean(cellEditor);
this.editingCell = false;
return;
}
this.cellEditor = cellEditor;
this.cellEditorInPopup = cellEditor.isPopup !== undefined && cellEditor.isPopup();
this.setInlineEditingClass();
if (this.cellEditorInPopup) {
this.addPopupCellEditor();
}
else {
this.addInCellEditor();
}
if (cellEditor.afterGuiAttached) {
cellEditor.afterGuiAttached();
}
var event = this.createEvent(null, _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_CELL_EDITING_STARTED);
this.beans.eventService.dispatchEvent(event);
};
CellComp.prototype.addInCellEditor = function () {
var eGui = this.getGui();
// if focus is inside the cell, we move focus to the cell itself
// before removing it's contents, otherwise errors could be thrown.
if (eGui.contains(document.activeElement)) {
eGui.focus();
}
this.clearCellElement();
if (this.cellEditor) {
eGui.appendChild(this.cellEditor.getGui());
}
this.angular1Compile();
};
CellComp.prototype.addPopupCellEditor = function () {
var _this = this;
var ePopupGui = this.cellEditor && this.cellEditor.getGui();
if (!ePopupGui) {
return;
}
var popupService = this.beans.popupService;
var useModelPopup = this.beans.gridOptionsWrapper.isStopEditingWhenGridLosesFocus();
var position = this.cellEditor && this.cellEditor.getPopupPosition ? this.cellEditor.getPopupPosition() : 'over';
var params = {
column: this.column,
rowNode: this.rowNode,
type: 'popupCellEditor',
eventSource: this.getGui(),
ePopup: ePopupGui,
keepWithinBounds: true
};
var positionCallback = position === 'under' ?
popupService.positionPopupUnderComponent.bind(popupService, params)
: popupService.positionPopupOverComponent.bind(popupService, params);
var addPopupRes = popupService.addPopup({
modal: useModelPopup,
eChild: ePopupGui,
closeOnEsc: true,
closedCallback: function () { _this.onPopupEditorClosed(); },
anchorToElement: this.getGui(),
positionCallback: positionCallback
});
if (addPopupRes) {
this.hideEditorPopup = addPopupRes.hideFunc;
}
this.angular1Compile();
};
CellComp.prototype.onPopupEditorClosed = function () {
// we only call stopEditing if we are editing, as
// it's possible the popup called 'stop editing'
// before this, eg if 'enter key' was pressed on
// the editor.
if (!this.editingCell) {
return;
}
// note: this only happens when use clicks outside of the grid. if use clicks on another
// cell, then the editing will have already stopped on this cell
this.stopRowOrCellEdit();
};
// if we are editing inline, then we don't have the padding in the cell (set in the themes)
// to allow the text editor full access to the entire cell
CellComp.prototype.setInlineEditingClass = function () {
if (!this.isAlive()) {
return;
}
// ag-cell-inline-editing - appears when user is inline editing
// ag-cell-not-inline-editing - appears when user is no inline editing
// ag-cell-popup-editing - appears when user is editing cell in popup (appears on the cell, not on the popup)
// note: one of {ag-cell-inline-editing, ag-cell-not-inline-editing} is always present, they toggle.
// however {ag-cell-popup-editing} shows when popup, so you have both {ag-cell-popup-editing}
// and {ag-cell-not-inline-editing} showing at the same time.
var editingInline = this.editingCell && !this.cellEditorInPopup;
var popupEditorShowing = this.editingCell && this.cellEditorInPopup;
this.addOrRemoveCssClass(CSS_INLINE_EDITING, editingInline);
this.addOrRemoveCssClass(CSS_NOT_INLINE_EDITING, !editingInline);
this.addOrRemoveCssClass(CSS_POPUP_EDITING, popupEditorShowing);
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_13__["addOrRemoveCssClass"])(this.getGui().parentNode, "ag-row-inline-editing", editingInline);
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_13__["addOrRemoveCssClass"])(this.getGui().parentNode, "ag-row-not-inline-editing", !editingInline);
};
CellComp.prototype.createCellEditorParams = function (keyPress, charPress, cellStartedEdit) {
return {
value: this.getValue(),
keyPress: keyPress,
charPress: charPress,
column: this.column,
colDef: this.column.getColDef(),
rowIndex: this.cellPosition.rowIndex,
node: this.rowNode,
data: this.rowNode.data,
api: this.beans.gridOptionsWrapper.getApi(),
cellStartedEdit: cellStartedEdit,
columnApi: this.beans.gridOptionsWrapper.getColumnApi(),
context: this.beans.gridOptionsWrapper.getContext(),
$scope: this.scope,
onKeyDown: this.onKeyDown.bind(this),
stopEditing: this.stopEditingAndFocus.bind(this),
eGridCell: this.getGui(),
parseValue: this.parseValue.bind(this),
formatValue: this.formatValue.bind(this)
};
};
// cell editors call this, when they want to stop for reasons other
// than what we pick up on. eg selecting from a dropdown ends editing.
CellComp.prototype.stopEditingAndFocus = function (suppressNavigateAfterEdit) {
if (suppressNavigateAfterEdit === void 0) { suppressNavigateAfterEdit = false; }
this.stopRowOrCellEdit();
this.focusCell(true);
if (!suppressNavigateAfterEdit) {
this.navigateAfterEdit();
}
};
CellComp.prototype.parseValue = function (newValue) {
var colDef = this.getComponentHolder();
var params = {
node: this.rowNode,
data: this.rowNode.data,
oldValue: this.value,
newValue: newValue,
colDef: colDef,
column: this.column,
api: this.beans.gridOptionsWrapper.getApi(),
columnApi: this.beans.gridOptionsWrapper.getColumnApi(),
context: this.beans.gridOptionsWrapper.getContext()
};
var valueParser = colDef.valueParser;
return Object(_utils_generic__WEBPACK_IMPORTED_MODULE_12__["exists"])(valueParser) ? this.beans.expressionService.evaluate(valueParser, params) : newValue;
};
CellComp.prototype.focusCell = function (forceBrowserFocus) {
if (forceBrowserFocus === void 0) { forceBrowserFocus = false; }
this.beans.focusController.setFocusedCell(this.cellPosition.rowIndex, this.column, this.rowNode.rowPinned, forceBrowserFocus);
};
CellComp.prototype.setFocusInOnEditor = function () {
if (this.editingCell) {
if (this.cellEditor && this.cellEditor.focusIn) {
// if the editor is present, then we just focus it
this.cellEditor.focusIn();
}
else {
// if the editor is not present, it means async cell editor (eg React fibre)
// and we are trying to set focus before the cell editor is present, so we
// focus the cell instead
this.focusCell(true);
}
}
};
CellComp.prototype.isEditing = function () {
return this.editingCell;
};
CellComp.prototype.onKeyDown = function (event) {
var key = event.which || event.keyCode;
switch (key) {
case _constants_keyCode__WEBPACK_IMPORTED_MODULE_20__["KeyCode"].ENTER:
this.onEnterKeyDown(event);
break;
case _constants_keyCode__WEBPACK_IMPORTED_MODULE_20__["KeyCode"].F2:
this.onF2KeyDown();
break;
case _constants_keyCode__WEBPACK_IMPORTED_MODULE_20__["KeyCode"].ESCAPE:
this.onEscapeKeyDown();
break;
case _constants_keyCode__WEBPACK_IMPORTED_MODULE_20__["KeyCode"].TAB:
this.onTabKeyDown(event);
break;
case _constants_keyCode__WEBPACK_IMPORTED_MODULE_20__["KeyCode"].BACKSPACE:
case _constants_keyCode__WEBPACK_IMPORTED_MODULE_20__["KeyCode"].DELETE:
this.onBackspaceOrDeleteKeyPressed(key);
break;
case _constants_keyCode__WEBPACK_IMPORTED_MODULE_20__["KeyCode"].DOWN:
case _constants_keyCode__WEBPACK_IMPORTED_MODULE_20__["KeyCode"].UP:
case _constants_keyCode__WEBPACK_IMPORTED_MODULE_20__["KeyCode"].RIGHT:
case _constants_keyCode__WEBPACK_IMPORTED_MODULE_20__["KeyCode"].LEFT:
this.onNavigationKeyPressed(event, key);
break;
}
};
CellComp.prototype.setFocusOutOnEditor = function () {
if (this.editingCell && this.cellEditor && this.cellEditor.focusOut) {
this.cellEditor.focusOut();
}
};
CellComp.prototype.onNavigationKeyPressed = function (event, key) {
if (this.editingCell) {
return;
}
if (event.shiftKey && this.rangeSelectionEnabled) {
this.onShiftRangeSelect(key);
}
else {
this.beans.rowRenderer.navigateToNextCell(event, key, this.cellPosition, true);
}
// if we don't prevent default, the grid will scroll with the navigation keys
event.preventDefault();
};
CellComp.prototype.onShiftRangeSelect = function (key) {
if (!this.beans.rangeController) {
return;
}
var endCell = this.beans.rangeController.extendLatestRangeInDirection(key);
if (endCell) {
this.beans.rowRenderer.ensureCellVisible(endCell);
}
};
CellComp.prototype.onTabKeyDown = function (event) {
this.beans.rowRenderer.onTabKeyDown(this, event);
};
CellComp.prototype.onBackspaceOrDeleteKeyPressed = function (key) {
if (!this.editingCell) {
this.startRowOrCellEdit(key);
}
};
CellComp.prototype.onEnterKeyDown = function (e) {
if (this.editingCell || this.rowComp.isEditing()) {
this.stopEditingAndFocus();
}
else {
if (this.beans.gridOptionsWrapper.isEnterMovesDown()) {
this.beans.rowRenderer.navigateToNextCell(null, _constants_keyCode__WEBPACK_IMPORTED_MODULE_20__["KeyCode"].DOWN, this.cellPosition, false);
}
else {
this.startRowOrCellEdit(_constants_keyCode__WEBPACK_IMPORTED_MODULE_20__["KeyCode"].ENTER);
if (this.editingCell) {
// if we started editing, then we need to prevent default, otherwise the Enter action can get
// applied to the cell editor. this happened, for example, with largeTextCellEditor where not
// preventing default results in a 'new line' character getting inserted in the text area
// when the editing was started
e.preventDefault();
}
}
}
};
CellComp.prototype.navigateAfterEdit = function () {
var fullRowEdit = this.beans.gridOptionsWrapper.isFullRowEdit();
if (fullRowEdit) {
return;
}
var enterMovesDownAfterEdit = this.beans.gridOptionsWrapper.isEnterMovesDownAfterEdit();
if (enterMovesDownAfterEdit) {
this.beans.rowRenderer.navigateToNextCell(null, _constants_keyCode__WEBPACK_IMPORTED_MODULE_20__["KeyCode"].DOWN, this.cellPosition, false);
}
};
CellComp.prototype.onF2KeyDown = function () {
if (!this.editingCell) {
this.startRowOrCellEdit(_constants_keyCode__WEBPACK_IMPORTED_MODULE_20__["KeyCode"].F2);
}
};
CellComp.prototype.onEscapeKeyDown = function () {
if (this.editingCell) {
this.stopRowOrCellEdit(true);
this.focusCell(true);
}
};
CellComp.prototype.onKeyPress = function (event) {
// check this, in case focus is on a (for example) a text field inside the cell,
// in which cse we should not be listening for these key pressed
var eventTarget = Object(_utils_event__WEBPACK_IMPORTED_MODULE_16__["getTarget"])(event);
var eventOnChildComponent = eventTarget !== this.getGui();
if (eventOnChildComponent || this.editingCell) {
return;
}
var pressedChar = String.fromCharCode(event.charCode);
if (pressedChar === ' ') {
this.onSpaceKeyPressed(event);
}
else if (Object(_utils_keyboard__WEBPACK_IMPORTED_MODULE_17__["isEventFromPrintableCharacter"])(event)) {
this.startRowOrCellEdit(null, pressedChar);
// if we don't prevent default, then the keypress also gets applied to the text field
// (at least when doing the default editor), but we need to allow the editor to decide
// what it wants to do. we only do this IF editing was started - otherwise it messes
// up when the use is not doing editing, but using rendering with text fields in cellRenderer
// (as it would block the the user from typing into text fields).
event.preventDefault();
}
};
CellComp.prototype.onSpaceKeyPressed = function (event) {
var gridOptionsWrapper = this.beans.gridOptionsWrapper;
if (!this.editingCell && gridOptionsWrapper.isRowSelection()) {
var currentSelection = this.rowNode.isSelected();
var newSelection = !currentSelection;
if (newSelection || !gridOptionsWrapper.isSuppressRowDeselection()) {
var groupSelectsFiltered = this.beans.gridOptionsWrapper.isGroupSelectsFiltered();
var updatedCount = this.rowNode.setSelectedParams({
newValue: newSelection,
rangeSelect: event.shiftKey,
groupSelectsFiltered: groupSelectsFiltered
});
if (currentSelection === undefined && updatedCount === 0) {
this.rowNode.setSelectedParams({
newValue: false,
rangeSelect: event.shiftKey,
groupSelectsFiltered: groupSelectsFiltered
});
}
}
}
// prevent default as space key, by default, moves browser scroll down
event.preventDefault();
};
CellComp.prototype.onMouseDown = function (mouseEvent) {
var ctrlKey = mouseEvent.ctrlKey, metaKey = mouseEvent.metaKey, shiftKey = mouseEvent.shiftKey;
var target = mouseEvent.target;
var _a = this.beans, eventService = _a.eventService, rangeController = _a.rangeController;
// do not change the range for right-clicks inside an existing range
if (this.isRightClickInExistingRange(mouseEvent)) {
return;
}
if (!shiftKey || (rangeController && !rangeController.getCellRanges().length)) {
// We only need to pass true to focusCell when the browser is IE/Edge and we are trying
// to focus the cell itself. This should never be true if the mousedown was triggered
// due to a click on a cell editor for example.
var forceBrowserFocus = (Object(_utils_browser__WEBPACK_IMPORTED_MODULE_18__["isBrowserIE"])() || Object(_utils_browser__WEBPACK_IMPORTED_MODULE_18__["isBrowserEdge"])()) && !this.editingCell && !Object(_utils_dom__WEBPACK_IMPORTED_MODULE_13__["isFocusableFormField"])(target);
this.focusCell(forceBrowserFocus);
}
else if (rangeController) {
// if a range is being changed, we need to make sure the focused cell does not change.
mouseEvent.preventDefault();
}
// if we are clicking on a checkbox, we need to make sure the cell wrapping that checkbox
// is focused but we don't want to change the range selection, so return here.
if (this.containsWidget(target)) {
return;
}
if (rangeController) {
var thisCell = this.cellPosition;
if (shiftKey) {
rangeController.extendLatestRangeToCell(thisCell);
}
else {
var ctrlKeyPressed = ctrlKey || metaKey;
rangeController.setRangeToCell(thisCell, ctrlKeyPressed);
}
}
eventService.dispatchEvent(this.createEvent(mouseEvent, _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_CELL_MOUSE_DOWN));
};
CellComp.prototype.isRightClickInExistingRange = function (mouseEvent) {
var rangeController = this.beans.rangeController;
if (rangeController) {
var cellInRange = rangeController.isCellInAnyRange(this.getCellPosition());
if (cellInRange && mouseEvent.button === 2) {
return true;
}
}
return false;
};
CellComp.prototype.containsWidget = function (target) {
return Object(_utils_dom__WEBPACK_IMPORTED_MODULE_13__["isElementChildOfClass"])(target, 'ag-selection-checkbox', 3);
};
// returns true if on iPad and this is second 'click' event in 200ms
CellComp.prototype.isDoubleClickOnIPad = function () {
if (!Object(_utils_browser__WEBPACK_IMPORTED_MODULE_18__["isIOSUserAgent"])() || Object(_utils_event__WEBPACK_IMPORTED_MODULE_16__["isEventSupported"])('dblclick')) {
return false;
}
var nowMillis = new Date().getTime();
var res = nowMillis - this.lastIPadMouseClickEvent < 200;
this.lastIPadMouseClickEvent = nowMillis;
return res;
};
CellComp.prototype.onCellClicked = function (mouseEvent) {
// iPad doesn't have double click - so we need to mimic it to enable editing for iPad.
if (this.isDoubleClickOnIPad()) {
this.onCellDoubleClicked(mouseEvent);
mouseEvent.preventDefault(); // if we don't do this, then iPad zooms in
return;
}
var _a = this.beans, eventService = _a.eventService, gridOptionsWrapper = _a.gridOptionsWrapper;
var cellClickedEvent = this.createEvent(mouseEvent, _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_CELL_CLICKED);
eventService.dispatchEvent(cellClickedEvent);
var colDef = this.getComponentHolder();
if (colDef.onCellClicked) {
// to make callback async, do in a timeout
window.setTimeout(function () { return colDef.onCellClicked(cellClickedEvent); }, 0);
}
var editOnSingleClick = (gridOptionsWrapper.isSingleClickEdit() || colDef.singleClickEdit)
&& !gridOptionsWrapper.isSuppressClickEdit();
if (editOnSingleClick) {
this.startRowOrCellEdit();
}
};
CellComp.prototype.createGridCellVo = function () {
this.cellPosition = {
rowIndex: this.rowNode.rowIndex,
rowPinned: this.rowNode.rowPinned,
column: this.column
};
};
CellComp.prototype.getCellPosition = function () {
return this.cellPosition;
};
CellComp.prototype.getParentRow = function () {
return this.eParentRow;
};
CellComp.prototype.setParentRow = function (eParentRow) {
this.eParentRow = eParentRow;
};
CellComp.prototype.getColumn = function () {
return this.column;
};
CellComp.prototype.getComponentHolder = function () {
return this.column.getColDef();
};
CellComp.prototype.detach = function () {
this.eParentRow.removeChild(this.getGui());
};
// if the row is also getting destroyed, then we don't need to remove from dom,
// as the row will also get removed, so no need to take out the cells from the row
// if the row is going (removing is an expensive operation, so only need to remove
// the top part)
//
// note - this is NOT called by context, as we don't wire / unwire the CellComp for performance reasons.
CellComp.prototype.destroy = function () {
if (this.createCellRendererFunc) {
this.beans.taskQueue.cancelTask(this.createCellRendererFunc);
}
this.stopEditing();
this.cellRenderer = this.beans.context.destroyBean(this.cellRenderer);
this.beans.context.destroyBean(this.selectionHandle);
_super.prototype.destroy.call(this);
};
CellComp.prototype.onLeftChanged = function () {
var left = this.modifyLeftForPrintLayout(this.getCellLeft());
this.getGui().style.left = left + 'px';
this.refreshAriaIndex();
};
CellComp.prototype.modifyLeftForPrintLayout = function (leftPosition) {
if (!this.printLayout || this.column.getPinned() === _constants_constants__WEBPACK_IMPORTED_MODULE_0__["Constants"].PINNED_LEFT) {
return leftPosition;
}
if (this.column.getPinned() === _constants_constants__WEBPACK_IMPORTED_MODULE_0__["Constants"].PINNED_RIGHT) {
var leftWidth_1 = this.beans.columnController.getPinnedLeftContainerWidth();
var bodyWidth = this.beans.columnController.getBodyContainerWidth();
return leftWidth_1 + bodyWidth + leftPosition;
}
// is in body
var leftWidth = this.beans.columnController.getPinnedLeftContainerWidth();
return leftWidth + leftPosition;
};
CellComp.prototype.onWidthChanged = function () {
var width = this.getCellWidth();
this.getGui().style.width = width + 'px';
};
CellComp.prototype.getRangeBorders = function () {
var _this = this;
var isRtl = this.beans.gridOptionsWrapper.isEnableRtl();
var top = false;
var right = false;
var bottom = false;
var left = false;
var thisCol = this.cellPosition.column;
var _a = this.beans, rangeController = _a.rangeController, columnController = _a.columnController;
var leftCol;
var rightCol;
if (isRtl) {
leftCol = columnController.getDisplayedColAfter(thisCol);
rightCol = columnController.getDisplayedColBefore(thisCol);
}
else {
leftCol = columnController.getDisplayedColBefore(thisCol);
rightCol = columnController.getDisplayedColAfter(thisCol);
}
var ranges = rangeController.getCellRanges().filter(function (range) { return rangeController.isCellInSpecificRange(_this.cellPosition, range); });
// this means we are the first column in the grid
if (!leftCol) {
left = true;
}
// this means we are the last column in the grid
if (!rightCol) {
right = true;
}
for (var i = 0; i < ranges.length; i++) {
if (top && right && bottom && left) {
break;
}
var range = ranges[i];
var startRow = rangeController.getRangeStartRow(range);
var endRow = rangeController.getRangeEndRow(range);
if (!top && this.beans.rowPositionUtils.sameRow(startRow, this.cellPosition)) {
top = true;
}
if (!bottom && this.beans.rowPositionUtils.sameRow(endRow, this.cellPosition)) {
bottom = true;
}
if (!left && range.columns.indexOf(leftCol) < 0) {
left = true;
}
if (!right && range.columns.indexOf(rightCol) < 0) {
right = true;
}
}
return { top: top, right: right, bottom: bottom, left: left };
};
CellComp.prototype.getInitialRangeClasses = function () {
var classes = [];
if (!this.rangeSelectionEnabled || !this.rangeCount) {
return classes;
}
classes.push(CSS_RANGE_SELECTED);
if (this.hasChartRange) {
classes.push(CSS_RANGE_CHART);
}
var count = Math.min(this.rangeCount, 4);
classes.push(CSS_RANGE_SELECTED + "-" + count);
if (this.isSingleCell()) {
classes.push(CSS_RANGE_SINGLE_CELL);
}
if (this.rangeCount > 0) {
var borders = this.getRangeBorders();
if (borders.top) {
classes.push(CSS_RANGE_TOP);
}
if (borders.right) {
classes.push(CSS_RANGE_RIGHT);
}
if (borders.bottom) {
classes.push(CSS_RANGE_BOTTOM);
}
if (borders.left) {
classes.push(CSS_RANGE_LEFT);
}
}
if (!!this.selectionHandle) {
classes.push(CSS_RANGE_HANDLE);
}
return classes;
};
CellComp.prototype.onRowIndexChanged = function () {
// when index changes, this influences items that need the index, so we update the
// grid cell so they are working off the new index.
this.createGridCellVo();
// when the index of the row changes, ie means the cell may have lost or gained focus
this.onCellFocused();
// check range selection
this.onRangeSelectionChanged();
};
CellComp.prototype.onRangeSelectionChanged = function () {
var rangeController = this.beans.rangeController;
if (!rangeController) {
return;
}
var _a = this, cellPosition = _a.cellPosition, rangeCount = _a.rangeCount;
var newRangeCount = rangeController.getCellRangeCount(cellPosition);
var element = this.getGui();
if (rangeCount !== newRangeCount) {
this.addOrRemoveCssClass(CSS_RANGE_SELECTED, newRangeCount !== 0);
this.addOrRemoveCssClass(CSS_RANGE_SELECTED + "-1", newRangeCount === 1);
this.addOrRemoveCssClass(CSS_RANGE_SELECTED + "-2", newRangeCount === 2);
this.addOrRemoveCssClass(CSS_RANGE_SELECTED + "-3", newRangeCount === 3);
this.addOrRemoveCssClass(CSS_RANGE_SELECTED + "-4", newRangeCount >= 4);
this.rangeCount = newRangeCount;
}
Object(_utils_aria__WEBPACK_IMPORTED_MODULE_9__["setAriaSelected"])(element, this.rangeCount > 0);
var hasChartRange = this.getHasChartRange();
if (hasChartRange !== this.hasChartRange) {
this.hasChartRange = hasChartRange;
this.addOrRemoveCssClass(CSS_RANGE_CHART, this.hasChartRange);
}
this.updateRangeBorders();
this.addOrRemoveCssClass(CSS_RANGE_SINGLE_CELL, this.isSingleCell());
this.refreshHandle();
};
CellComp.prototype.getHasChartRange = function () {
var rangeController = this.beans.rangeController;
if (!this.rangeCount || !rangeController) {
return false;
}
var cellRanges = rangeController.getCellRanges();
return cellRanges.length > 0 && cellRanges.every(function (range) { return Object(_utils_array__WEBPACK_IMPORTED_MODULE_14__["includes"])([_interfaces_iRangeController__WEBPACK_IMPORTED_MODULE_4__["CellRangeType"].DIMENSION, _interfaces_iRangeController__WEBPACK_IMPORTED_MODULE_4__["CellRangeType"].VALUE], range.type); });
};
CellComp.prototype.shouldHaveSelectionHandle = function () {
var _a = this.beans, gridOptionsWrapper = _a.gridOptionsWrapper, rangeController = _a.rangeController;
var cellRanges = rangeController.getCellRanges();
var rangesLen = cellRanges.length;
if (this.rangeCount < 1 || rangesLen < 1) {
return false;
}
var cellRange = Object(_utils_array__WEBPACK_IMPORTED_MODULE_14__["last"])(cellRanges);
var cellPosition = this.getCellPosition();
var fillHandleIsAvailable = rangesLen === 1 &&
(gridOptionsWrapper.isEnableFillHandle() || gridOptionsWrapper.isEnableRangeHandle()) &&
!this.editingCell;
if (this.hasChartRange) {
var hasCategoryRange = cellRanges[0].type === _interfaces_iRangeController__WEBPACK_IMPORTED_MODULE_4__["CellRangeType"].DIMENSION;
var isCategoryCell = hasCategoryRange && rangeController.isCellInSpecificRange(cellPosition, cellRanges[0]);
this.addOrRemoveCssClass(CSS_RANGE_CHART_CATEGORY, isCategoryCell);
fillHandleIsAvailable = cellRange.type === _interfaces_iRangeController__WEBPACK_IMPORTED_MODULE_4__["CellRangeType"].VALUE;
}
return fillHandleIsAvailable &&
cellRange.endRow != null &&
rangeController.isContiguousRange(cellRange) &&
rangeController.isBottomRightCell(cellRange, cellPosition);
};
CellComp.prototype.addSelectionHandle = function () {
var _a = this.beans, gridOptionsWrapper = _a.gridOptionsWrapper, context = _a.context, rangeController = _a.rangeController;
var cellRangeType = Object(_utils_array__WEBPACK_IMPORTED_MODULE_14__["last"])(rangeController.getCellRanges()).type;
var selectionHandleFill = gridOptionsWrapper.isEnableFillHandle() && Object(_utils_generic__WEBPACK_IMPORTED_MODULE_12__["missing"])(cellRangeType);
var type = selectionHandleFill ? _interfaces_iRangeController__WEBPACK_IMPORTED_MODULE_4__["SelectionHandleType"].FILL : _interfaces_iRangeController__WEBPACK_IMPORTED_MODULE_4__["SelectionHandleType"].RANGE;
if (this.selectionHandle && this.selectionHandle.getType() !== type) {
this.selectionHandle = this.beans.context.destroyBean(this.selectionHandle);
}
if (!this.selectionHandle) {
this.selectionHandle = this.beans.selectionHandleFactory.createSelectionHandle(type);
}
this.selectionHandle.refresh(this);
};
CellComp.prototype.updateRangeBordersIfRangeCount = function () {
// we only need to update range borders if we are in a range
if (this.rangeCount > 0) {
this.updateRangeBorders();
this.refreshHandle();
}
};
CellComp.prototype.refreshHandle = function () {
if (!this.beans.rangeController) {
return;
}
var shouldHaveSelectionHandle = this.shouldHaveSelectionHandle();
if (this.selectionHandle && !shouldHaveSelectionHandle) {
this.selectionHandle = this.beans.context.destroyBean(this.selectionHandle);
}
if (shouldHaveSelectionHandle) {
this.addSelectionHandle();
}
this.addOrRemoveCssClass(CSS_RANGE_HANDLE, !!this.selectionHandle);
};
CellComp.prototype.updateRangeBorders = function () {
var rangeBorders = this.getRangeBorders();
var isSingleCell = this.isSingleCell();
var isTop = !isSingleCell && rangeBorders.top;
var isRight = !isSingleCell && rangeBorders.right;
var isBottom = !isSingleCell && rangeBorders.bottom;
var isLeft = !isSingleCell && rangeBorders.left;
this.addOrRemoveCssClass(CSS_RANGE_TOP, isTop);
this.addOrRemoveCssClass(CSS_RANGE_RIGHT, isRight);
this.addOrRemoveCssClass(CSS_RANGE_BOTTOM, isBottom);
this.addOrRemoveCssClass(CSS_RANGE_LEFT, isLeft);
};
CellComp.prototype.onFirstRightPinnedChanged = function () {
var firstRightPinned = this.column.isFirstRightPinned();
if (this.firstRightPinned !== firstRightPinned) {
this.firstRightPinned = firstRightPinned;
this.addOrRemoveCssClass(CSS_FIRST_RIGHT_PINNED, firstRightPinned);
}
};
CellComp.prototype.onLastLeftPinnedChanged = function () {
var lastLeftPinned = this.column.isLastLeftPinned();
if (this.lastLeftPinned !== lastLeftPinned) {
this.lastLeftPinned = lastLeftPinned;
this.addOrRemoveCssClass(CSS_LAST_LEFT_PINNED, lastLeftPinned);
}
};
CellComp.prototype.populateTemplate = function () {
if (this.usingWrapper) {
this.eCellValue = this.getRefElement('eCellValue');
this.eCellWrapper = this.getRefElement('eCellWrapper');
if (this.includeRowDraggingComponent) {
this.addRowDragging();
}
if (this.includeDndSourceComponent) {
this.addDndSource();
}
if (this.includeSelectionComponent) {
this.addSelectionCheckbox();
}
}
else {
this.eCellValue = this.getGui();
}
};
CellComp.prototype.getFrameworkOverrides = function () {
return this.beans.frameworkOverrides;
};
CellComp.prototype.addRowDragging = function () {
var _this = this;
var pagination = this.beans.gridOptionsWrapper.isPagination();
var rowDragManaged = this.beans.gridOptionsWrapper.isRowDragManaged();
var clientSideRowModelActive = this.beans.gridOptionsWrapper.isRowModelDefault();
if (rowDragManaged) {
// row dragging only available in default row model
if (!clientSideRowModelActive) {
Object(_utils_function__WEBPACK_IMPORTED_MODULE_19__["doOnce"])(function () { return console.warn('ag-Grid: managed row dragging is only allowed in the Client Side Row Model'); }, 'CellComp.addRowDragging');
return;
}
if (pagination) {
Object(_utils_function__WEBPACK_IMPORTED_MODULE_19__["doOnce"])(function () { return console.warn('ag-Grid: managed row dragging is not possible when doing pagination'); }, 'CellComp.addRowDragging');
return;
}
}
var rowDraggingComp = new _row_rowDragComp__WEBPACK_IMPORTED_MODULE_5__["RowDragComp"](this.rowNode, this.column, function () { return _this.value; }, this.beans);
this.createManagedBean(rowDraggingComp, this.beans.context);
// put the checkbox in before the value
this.eCellWrapper.insertBefore(rowDraggingComp.getGui(), this.eCellValue);
};
CellComp.prototype.addDndSource = function () {
var dndSourceComp = new _dndSourceComp__WEBPACK_IMPORTED_MODULE_7__["DndSourceComp"](this.rowNode, this.column, this.getValueToUse(), this.beans, this.getGui());
this.createManagedBean(dndSourceComp, this.beans.context);
// put the checkbox in before the value
this.eCellWrapper.insertBefore(dndSourceComp.getGui(), this.eCellValue);
};
CellComp.prototype.addSelectionCheckbox = function () {
var _this = this;
var cbSelectionComponent = new _checkboxSelectionComponent__WEBPACK_IMPORTED_MODULE_3__["CheckboxSelectionComponent"]();
this.beans.context.createBean(cbSelectionComponent);
var visibleFunc = this.getComponentHolder().checkboxSelection;
visibleFunc = typeof visibleFunc === 'function' ? visibleFunc : null;
cbSelectionComponent.init({ rowNode: this.rowNode, column: this.column, visibleFunc: visibleFunc });
this.addDestroyFunc(function () { return _this.beans.context.destroyBean(cbSelectionComponent); });
// put the checkbox in before the value
this.eCellWrapper.insertBefore(cbSelectionComponent.getGui(), this.eCellValue);
};
CellComp.prototype.addDomData = function () {
var _this = this;
var element = this.getGui();
this.beans.gridOptionsWrapper.setDomData(element, CellComp.DOM_DATA_KEY_CELL_COMP, this);
this.addDestroyFunc(function () { return _this.beans.gridOptionsWrapper.setDomData(element, CellComp.DOM_DATA_KEY_CELL_COMP, null); });
};
CellComp.prototype.isSingleCell = function () {
var rangeController = this.beans.rangeController;
return this.rangeCount === 1 && rangeController && !rangeController.isMoreThanOneCell();
};
CellComp.prototype.onCellFocused = function (event) {
var cellFocused = this.beans.focusController.isCellFocused(this.cellPosition);
// see if we need to change the classes on this cell
if (cellFocused !== this.cellFocused) {
// if we are not doing cell selection, then the focus class does not change
var doingFocusCss = !this.beans.gridOptionsWrapper.isSuppressCellSelection();
if (doingFocusCss) {
this.addOrRemoveCssClass(CSS_CELL_FOCUS, cellFocused);
}
this.cellFocused = cellFocused;
}
// see if we need to force browser focus - this can happen if focus is programmatically set
if (cellFocused && event && event.forceBrowserFocus) {
var focusEl = this.getFocusableElement();
focusEl.focus();
// Fix for AG-3465 "IE11 - After editing cell's content, selection doesn't go one cell below on enter"
// IE can fail to focus the cell after the first call to focus(), and needs a second call
if (!document.activeElement || document.activeElement === document.body) {
focusEl.focus();
}
}
// if another cell was focused, and we are editing, then stop editing
var fullRowEdit = this.beans.gridOptionsWrapper.isFullRowEdit();
if (!cellFocused && !fullRowEdit && this.editingCell) {
this.stopRowOrCellEdit();
}
};
// pass in 'true' to cancel the editing.
CellComp.prototype.stopRowOrCellEdit = function (cancel) {
if (cancel === void 0) { cancel = false; }
if (this.beans.gridOptionsWrapper.isFullRowEdit()) {
this.rowComp.stopRowEditing(cancel);
}
else {
this.stopEditing(cancel);
}
};
CellComp.prototype.stopEditing = function (cancel) {
if (cancel === void 0) { cancel = false; }
if (!this.editingCell) {
return;
}
// if no cell editor, this means due to async, that the cell editor never got initialised,
// so we just carry on regardless as if the editing was never started.
if (!this.cellEditor) {
this.editingCell = false;
return;
}
var oldValue = this.getValue();
var newValueExists = false;
var newValue;
if (!cancel) {
// also have another option here to cancel after editing, so for example user could have a popup editor and
// it is closed by user clicking outside the editor. then the editor will close automatically (with false
// passed above) and we need to see if the editor wants to accept the new value.
var userWantsToCancel = this.cellEditor.isCancelAfterEnd && this.cellEditor.isCancelAfterEnd();
if (!userWantsToCancel) {
newValue = this.cellEditor.getValue();
newValueExists = true;
}
}
// it is important we set this after setValue() above, as otherwise the cell will flash
// when editing stops. the 'refresh' method checks editing, and doesn't refresh editing cells.
// thus it will skip the refresh on this cell until the end of this method where we call
// refresh directly and we suppress the flash.
this.editingCell = false;
// important to clear this out - as parts of the code will check for
// this to see if an async cellEditor has yet to be created
this.cellEditor = this.beans.context.destroyBean(this.cellEditor);
this.cellEditor = null;
if (this.cellEditorInPopup && this.hideEditorPopup) {
this.hideEditorPopup();
this.hideEditorPopup = null;
}
else {
this.clearCellElement();
var eGui = this.getGui();
// put the cell back the way it was before editing
if (this.usingWrapper) {
// if wrapper, then put the wrapper back
eGui.appendChild(this.eCellWrapper);
}
else if (this.cellRenderer) {
// if cellRenderer, then put the gui back in. if the renderer has
// a refresh, it will be called. however if it doesn't, then later
// the renderer will be destroyed and a new one will be created.
// we know it's a dom element (not a string) because we converted
// it after the gui was attached if it was a string.
var eCell = this.cellRendererGui;
// can be null if cell was previously null / contained empty string,
// this will result in new value not being rendered.
if (eCell) {
eGui.appendChild(eCell);
}
}
}
this.setInlineEditingClass();
this.refreshHandle();
if (newValueExists && newValue !== oldValue) {
// we suppressRefreshCell because the call to rowNode.setDataValue() results in change detection
// getting triggered, which results in all cells getting refreshed. we do not want this refresh
// to happen on this call as we want to call it explicitly below. otherwise refresh gets called twice.
// if we only did this refresh (and not the one below) then the cell would flash and not be forced.
this.suppressRefreshCell = true;
this.rowNode.setDataValue(this.column, newValue);
this.suppressRefreshCell = false;
}
// we suppress the flash, as it is not correct to flash the cell the user has finished editing,
// the user doesn't need to flash as they were the one who did the edit, the flash is pointless
// (as the flash is meant to draw the user to a change that they didn't manually do themselves).
this.refreshCell({ forceRefresh: true, suppressFlash: true });
var editingStoppedEvent = __assign(__assign({}, this.createEvent(null, _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_CELL_EDITING_STOPPED)), { oldValue: oldValue,
newValue: newValue });
this.beans.eventService.dispatchEvent(editingStoppedEvent);
};
CellComp.prototype.clearCellElement = function () {
var eGui = this.getGui();
// if focus is inside the cell, we move focus to the cell itself
// before removing it's contents, otherwise errors could be thrown.
if (eGui.contains(document.activeElement) && !Object(_utils_browser__WEBPACK_IMPORTED_MODULE_18__["isBrowserIE"])()) {
eGui.focus({
preventScroll: true
});
}
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_13__["clearElement"])(eGui);
};
CellComp.DOM_DATA_KEY_CELL_COMP = 'cellComp';
CellComp.CELL_RENDERER_TYPE_NORMAL = 'cellRenderer';
CellComp.CELL_RENDERER_TYPE_PINNED = 'pinnedRowCellRenderer';
return CellComp;
}(_widgets_component__WEBPACK_IMPORTED_MODULE_2__["Component"]));
/***/ }),
/* 103 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SelectionHandleType", function() { return SelectionHandleType; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CellRangeType", function() { return CellRangeType; });
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var SelectionHandleType;
(function (SelectionHandleType) {
SelectionHandleType[SelectionHandleType["FILL"] = 0] = "FILL";
SelectionHandleType[SelectionHandleType["RANGE"] = 1] = "RANGE";
})(SelectionHandleType || (SelectionHandleType = {}));
var CellRangeType;
(function (CellRangeType) {
CellRangeType[CellRangeType["VALUE"] = 0] = "VALUE";
CellRangeType[CellRangeType["DIMENSION"] = 1] = "DIMENSION";
})(CellRangeType || (CellRangeType = {}));
/***/ }),
/* 104 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RowDragComp", function() { return RowDragComp; });
/* harmony import */ var _widgets_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(36);
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12);
/* harmony import */ var _entities_rowNode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71);
/* harmony import */ var _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(105);
/* harmony import */ var _eventKeys__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(24);
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(20);
/* harmony import */ var _utils_icon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(47);
/* harmony import */ var _utils_function__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(15);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 RowDragComp = /** @class */ (function (_super) {
__extends(RowDragComp, _super);
function RowDragComp(rowNode, column, cellValueFn, beans) {
var _this = _super.call(this, /* html */ "") || this;
_this.rowNode = rowNode;
_this.column = column;
_this.cellValueFn = cellValueFn;
_this.beans = beans;
return _this;
}
RowDragComp.prototype.postConstruct = function () {
var eGui = this.getGui();
eGui.appendChild(Object(_utils_icon__WEBPACK_IMPORTED_MODULE_6__["createIconNoSpan"])('rowDrag', this.beans.gridOptionsWrapper, null));
this.addDragSource();
this.checkCompatibility();
var strategy = this.beans.gridOptionsWrapper.isRowDragManaged() ?
new ManagedVisibilityStrategy(this, this.beans, this.rowNode, this.column) :
new NonManagedVisibilityStrategy(this, this.beans, this.rowNode, this.column);
this.createManagedBean(strategy, this.beans.context);
};
RowDragComp.prototype.getSelectedCount = function () {
var multiRowEnabled = this.beans.gridOptionsWrapper.isEnableMultiRowDragging();
if (!multiRowEnabled) {
return 1;
}
var selection = this.beans.selectionController.getSelectedNodes();
return selection.indexOf(this.rowNode) !== -1 ? selection.length : 1;
};
// returns true if all compatibility items work out
RowDragComp.prototype.checkCompatibility = function () {
var managed = this.beans.gridOptionsWrapper.isRowDragManaged();
var treeData = this.beans.gridOptionsWrapper.isTreeData();
if (treeData && managed) {
Object(_utils_function__WEBPACK_IMPORTED_MODULE_7__["doOnce"])(function () {
return console.warn('ag-Grid: If using row drag with tree data, you cannot have rowDragManaged=true');
}, 'RowDragComp.managedAndTreeData');
}
};
RowDragComp.prototype.addDragSource = function () {
var _this = this;
var dragItem = {
rowNode: this.rowNode,
columns: [this.column],
defaultTextValue: this.cellValueFn(),
};
var rowDragText = this.column.getColDef().rowDragText;
var dragSource = {
type: _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_3__["DragSourceType"].RowDrag,
eElement: this.getGui(),
dragItemName: function () {
var dragItemCount = _this.getSelectedCount();
if (rowDragText) {
return rowDragText(dragItem, dragItemCount);
}
return dragItemCount === 1 ? _this.cellValueFn() : dragItemCount + " rows";
},
getDragItem: function () { return dragItem; },
dragStartPixels: 0,
dragSourceDomDataKey: this.beans.gridOptionsWrapper.getDomDataKey()
};
this.beans.dragAndDropService.addDragSource(dragSource, true);
this.addDestroyFunc(function () { return _this.beans.dragAndDropService.removeDragSource(dragSource); });
};
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_1__["PostConstruct"]
], RowDragComp.prototype, "postConstruct", null);
return RowDragComp;
}(_widgets_component__WEBPACK_IMPORTED_MODULE_0__["Component"]));
var VisibilityStrategy = /** @class */ (function (_super) {
__extends(VisibilityStrategy, _super);
function VisibilityStrategy(parent, rowNode, column) {
var _this = _super.call(this) || this;
_this.parent = parent;
_this.column = column;
_this.rowNode = rowNode;
return _this;
}
VisibilityStrategy.prototype.setDisplayedOrVisible = function (neverDisplayed) {
if (neverDisplayed) {
this.parent.setDisplayed(false);
}
else {
var shown = this.column.isRowDrag(this.rowNode);
var isShownSometimes = Object(_utils_function__WEBPACK_IMPORTED_MODULE_7__["isFunction"])(this.column.getColDef().rowDrag);
// if shown sometimes, them some rows can have drag handle while other don't,
// so we use setVisible to keep the handles horizontally aligned (as setVisible
// keeps the empty space, whereas setDisplayed looses the space)
if (isShownSometimes) {
this.parent.setDisplayed(true);
this.parent.setVisible(shown);
}
else {
this.parent.setDisplayed(shown);
}
}
};
return VisibilityStrategy;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_5__["BeanStub"]));
// when non managed, the visibility depends on suppressRowDrag property only
var NonManagedVisibilityStrategy = /** @class */ (function (_super) {
__extends(NonManagedVisibilityStrategy, _super);
function NonManagedVisibilityStrategy(parent, beans, rowNode, column) {
var _this = _super.call(this, parent, rowNode, column) || this;
_this.beans = beans;
return _this;
}
NonManagedVisibilityStrategy.prototype.postConstruct = function () {
this.addManagedListener(this.beans.gridOptionsWrapper, 'suppressRowDrag', this.onSuppressRowDrag.bind(this));
// in case data changes, then we need to update visibility of drag item
this.addManagedListener(this.rowNode, _entities_rowNode__WEBPACK_IMPORTED_MODULE_2__["RowNode"].EVENT_DATA_CHANGED, this.workOutVisibility.bind(this));
this.addManagedListener(this.rowNode, _entities_rowNode__WEBPACK_IMPORTED_MODULE_2__["RowNode"].EVENT_CELL_CHANGED, this.workOutVisibility.bind(this));
this.workOutVisibility();
};
NonManagedVisibilityStrategy.prototype.onSuppressRowDrag = function () {
this.workOutVisibility();
};
NonManagedVisibilityStrategy.prototype.workOutVisibility = function () {
// only show the drag if both sort and filter are not present
var neverDisplayed = this.beans.gridOptionsWrapper.isSuppressRowDrag();
this.setDisplayedOrVisible(neverDisplayed);
};
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_1__["PostConstruct"]
], NonManagedVisibilityStrategy.prototype, "postConstruct", null);
return NonManagedVisibilityStrategy;
}(VisibilityStrategy));
// when managed, the visibility depends on sort, filter and row group, as well as suppressRowDrag property
var ManagedVisibilityStrategy = /** @class */ (function (_super) {
__extends(ManagedVisibilityStrategy, _super);
function ManagedVisibilityStrategy(parent, beans, rowNode, column) {
var _this = _super.call(this, parent, rowNode, column) || this;
_this.beans = beans;
return _this;
}
ManagedVisibilityStrategy.prototype.postConstruct = function () {
// we do not show the component if sort, filter or grouping is active
this.addManagedListener(this.beans.eventService, _eventKeys__WEBPACK_IMPORTED_MODULE_4__["Events"].EVENT_SORT_CHANGED, this.workOutVisibility.bind(this));
this.addManagedListener(this.beans.eventService, _eventKeys__WEBPACK_IMPORTED_MODULE_4__["Events"].EVENT_FILTER_CHANGED, this.workOutVisibility.bind(this));
this.addManagedListener(this.beans.eventService, _eventKeys__WEBPACK_IMPORTED_MODULE_4__["Events"].EVENT_COLUMN_ROW_GROUP_CHANGED, this.workOutVisibility.bind(this));
// in case data changes, then we need to update visibility of drag item
this.addManagedListener(this.rowNode, _entities_rowNode__WEBPACK_IMPORTED_MODULE_2__["RowNode"].EVENT_DATA_CHANGED, this.workOutVisibility.bind(this));
this.addManagedListener(this.rowNode, _entities_rowNode__WEBPACK_IMPORTED_MODULE_2__["RowNode"].EVENT_CELL_CHANGED, this.workOutVisibility.bind(this));
this.addManagedListener(this.beans.gridOptionsWrapper, 'suppressRowDrag', this.onSuppressRowDrag.bind(this));
this.workOutVisibility();
};
ManagedVisibilityStrategy.prototype.onSuppressRowDrag = function () {
this.workOutVisibility();
};
ManagedVisibilityStrategy.prototype.workOutVisibility = function () {
// only show the drag if both sort and filter are not present
var rowDragFeature = this.beans.gridPanel.getRowDragFeature();
var shouldPreventRowMove = rowDragFeature && rowDragFeature.shouldPreventRowMove();
var suppressRowDrag = this.beans.gridOptionsWrapper.isSuppressRowDrag();
var hasExternalDropZones = this.beans.dragAndDropService.hasExternalDropZones();
var neverDisplayed = (shouldPreventRowMove && !hasExternalDropZones) || suppressRowDrag;
this.setDisplayedOrVisible(neverDisplayed);
};
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_1__["PostConstruct"]
], ManagedVisibilityStrategy.prototype, "postConstruct", null);
return ManagedVisibilityStrategy;
}(VisibilityStrategy));
/***/ }),
/* 105 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DragSourceType", function() { return DragSourceType; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VerticalDirection", function() { return VerticalDirection; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HorizontalDirection", function() { return HorizontalDirection; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DragAndDropService", function() { return DragAndDropService; });
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20);
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12);
/* harmony import */ var _utils_string__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(26);
/* harmony import */ var _utils_icon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(47);
/* harmony import */ var _utils_array__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(14);
/* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7);
/* harmony import */ var _utils_browser__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(43);
/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(42);
/* harmony import */ var _utils_function__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(15);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 DragSourceType;
(function (DragSourceType) {
DragSourceType[DragSourceType["ToolPanel"] = 0] = "ToolPanel";
DragSourceType[DragSourceType["HeaderCell"] = 1] = "HeaderCell";
DragSourceType[DragSourceType["RowDrag"] = 2] = "RowDrag";
DragSourceType[DragSourceType["ChartPanel"] = 3] = "ChartPanel";
})(DragSourceType || (DragSourceType = {}));
var VerticalDirection;
(function (VerticalDirection) {
VerticalDirection[VerticalDirection["Up"] = 0] = "Up";
VerticalDirection[VerticalDirection["Down"] = 1] = "Down";
})(VerticalDirection || (VerticalDirection = {}));
var HorizontalDirection;
(function (HorizontalDirection) {
HorizontalDirection[HorizontalDirection["Left"] = 0] = "Left";
HorizontalDirection[HorizontalDirection["Right"] = 1] = "Right";
})(HorizontalDirection || (HorizontalDirection = {}));
var DragAndDropService = /** @class */ (function (_super) {
__extends(DragAndDropService, _super);
function DragAndDropService() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.dragSourceAndParamsList = [];
_this.dropTargets = [];
return _this;
}
DragAndDropService_1 = DragAndDropService;
DragAndDropService.prototype.init = function () {
this.ePinnedIcon = Object(_utils_icon__WEBPACK_IMPORTED_MODULE_3__["createIcon"])('columnMovePin', this.gridOptionsWrapper, null);
this.eHideIcon = Object(_utils_icon__WEBPACK_IMPORTED_MODULE_3__["createIcon"])('columnMoveHide', this.gridOptionsWrapper, null);
this.eMoveIcon = Object(_utils_icon__WEBPACK_IMPORTED_MODULE_3__["createIcon"])('columnMoveMove', this.gridOptionsWrapper, null);
this.eLeftIcon = Object(_utils_icon__WEBPACK_IMPORTED_MODULE_3__["createIcon"])('columnMoveLeft', this.gridOptionsWrapper, null);
this.eRightIcon = Object(_utils_icon__WEBPACK_IMPORTED_MODULE_3__["createIcon"])('columnMoveRight', this.gridOptionsWrapper, null);
this.eGroupIcon = Object(_utils_icon__WEBPACK_IMPORTED_MODULE_3__["createIcon"])('columnMoveGroup', this.gridOptionsWrapper, null);
this.eAggregateIcon = Object(_utils_icon__WEBPACK_IMPORTED_MODULE_3__["createIcon"])('columnMoveValue', this.gridOptionsWrapper, null);
this.ePivotIcon = Object(_utils_icon__WEBPACK_IMPORTED_MODULE_3__["createIcon"])('columnMovePivot', this.gridOptionsWrapper, null);
this.eDropNotAllowedIcon = Object(_utils_icon__WEBPACK_IMPORTED_MODULE_3__["createIcon"])('dropNotAllowed', this.gridOptionsWrapper, null);
};
DragAndDropService.prototype.addDragSource = function (dragSource, allowTouch) {
if (allowTouch === void 0) { allowTouch = false; }
var params = {
eElement: dragSource.eElement,
dragStartPixels: dragSource.dragStartPixels,
onDragStart: this.onDragStart.bind(this, dragSource),
onDragStop: this.onDragStop.bind(this),
onDragging: this.onDragging.bind(this)
};
this.dragSourceAndParamsList.push({ params: params, dragSource: dragSource });
this.dragService.addDragSource(params, allowTouch);
};
DragAndDropService.prototype.removeDragSource = function (dragSource) {
var sourceAndParams = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_5__["find"])(this.dragSourceAndParamsList, function (item) { return item.dragSource === dragSource; });
if (sourceAndParams) {
this.dragService.removeDragSource(sourceAndParams.params);
Object(_utils_array__WEBPACK_IMPORTED_MODULE_4__["removeFromArray"])(this.dragSourceAndParamsList, sourceAndParams);
}
};
DragAndDropService.prototype.clearDragSourceParamsList = function () {
var _this = this;
this.dragSourceAndParamsList.forEach(function (sourceAndParams) { return _this.dragService.removeDragSource(sourceAndParams.params); });
this.dragSourceAndParamsList.length = 0;
};
DragAndDropService.prototype.nudge = function () {
if (this.dragging) {
this.onDragging(this.eventLastTime, true);
}
};
DragAndDropService.prototype.onDragStart = function (dragSource, mouseEvent) {
this.dragging = true;
this.dragSource = dragSource;
this.eventLastTime = mouseEvent;
this.dragItem = this.dragSource.getDragItem();
this.lastDropTarget = this.dragSource.dragSourceDropTarget;
if (this.dragSource.onDragStarted) {
this.dragSource.onDragStarted();
}
this.createGhost();
};
DragAndDropService.prototype.onDragStop = function (mouseEvent) {
this.eventLastTime = null;
this.dragging = false;
if (this.dragSource.onDragStopped) {
this.dragSource.onDragStopped();
}
if (this.lastDropTarget && this.lastDropTarget.onDragStop) {
var draggingEvent = this.createDropTargetEvent(this.lastDropTarget, mouseEvent, null, null, false);
this.lastDropTarget.onDragStop(draggingEvent);
}
this.lastDropTarget = null;
this.dragItem = null;
this.removeGhost();
};
DragAndDropService.prototype.onDragging = function (mouseEvent, fromNudge) {
var _this = this;
var hDirection = this.getHorizontalDirection(mouseEvent);
var vDirection = this.getVerticalDirection(mouseEvent);
this.eventLastTime = mouseEvent;
this.positionGhost(mouseEvent);
// check if mouseEvent intersects with any of the drop targets
var validDropTargets = this.dropTargets.filter(function (dropTarget) { return _this.isMouseOnDropTarget(mouseEvent, dropTarget); });
var len = validDropTargets.length;
if (len === 0) {
return;
}
var dropTarget = len === 1
? validDropTargets[0]
// the current mouse position could intersect with more than 1 element
// if they are nested. In that case we need to get the most specific
// container, which is the one that does not contain any other targets.
: validDropTargets.reduce(function (prevTarget, currTarget) {
if (!prevTarget) {
return currTarget;
}
var prevContainer = prevTarget.getContainer();
var currContainer = currTarget.getContainer();
if (prevContainer.contains(currContainer)) {
return currTarget;
}
return prevTarget;
});
if (dropTarget !== this.lastDropTarget) {
this.leaveLastTargetIfExists(mouseEvent, hDirection, vDirection, fromNudge);
this.enterDragTargetIfExists(dropTarget, mouseEvent, hDirection, vDirection, fromNudge);
this.lastDropTarget = dropTarget;
}
else if (dropTarget && dropTarget.onDragging) {
var draggingEvent = this.createDropTargetEvent(dropTarget, mouseEvent, hDirection, vDirection, fromNudge);
dropTarget.onDragging(draggingEvent);
}
};
DragAndDropService.prototype.enterDragTargetIfExists = function (dropTarget, mouseEvent, hDirection, vDirection, fromNudge) {
if (!dropTarget) {
return;
}
if (dropTarget.onDragEnter) {
var dragEnterEvent = this.createDropTargetEvent(dropTarget, mouseEvent, hDirection, vDirection, fromNudge);
dropTarget.onDragEnter(dragEnterEvent);
}
this.setGhostIcon(dropTarget.getIconName ? dropTarget.getIconName() : null);
};
DragAndDropService.prototype.leaveLastTargetIfExists = function (mouseEvent, hDirection, vDirection, fromNudge) {
if (!this.lastDropTarget) {
return;
}
if (this.lastDropTarget.onDragLeave) {
var dragLeaveEvent = this.createDropTargetEvent(this.lastDropTarget, mouseEvent, hDirection, vDirection, fromNudge);
this.lastDropTarget.onDragLeave(dragLeaveEvent);
}
this.setGhostIcon(null);
};
DragAndDropService.prototype.getAllContainersFromDropTarget = function (dropTarget) {
var containers = [dropTarget.getContainer()];
var secondaryContainers = dropTarget.getSecondaryContainers ? dropTarget.getSecondaryContainers() : null;
if (secondaryContainers) {
containers = containers.concat(secondaryContainers);
}
return containers;
};
// checks if the mouse is on the drop target. it checks eContainer and eSecondaryContainers
DragAndDropService.prototype.isMouseOnDropTarget = function (mouseEvent, dropTarget) {
var mouseOverTarget = false;
this.getAllContainersFromDropTarget(dropTarget)
.filter(function (eContainer) { return eContainer; }) // secondary can be missing
.forEach(function (eContainer) {
var rect = eContainer.getBoundingClientRect();
// if element is not visible, then width and height are zero
if (rect.width === 0 || rect.height === 0) {
return;
}
var horizontalFit = mouseEvent.clientX >= rect.left && mouseEvent.clientX <= rect.right;
var verticalFit = mouseEvent.clientY >= rect.top && mouseEvent.clientY <= rect.bottom;
if (horizontalFit && verticalFit) {
mouseOverTarget = true;
}
});
return mouseOverTarget && dropTarget.isInterestedIn(this.dragSource.type);
};
DragAndDropService.prototype.addDropTarget = function (dropTarget) {
this.dropTargets.push(dropTarget);
};
DragAndDropService.prototype.removeDropTarget = function (dropTarget) {
this.dropTargets = this.dropTargets.filter(function (target) { return target.getContainer() !== dropTarget.getContainer(); });
};
DragAndDropService.prototype.hasExternalDropZones = function () {
return this.dropTargets.some(function (zones) { return zones.external; });
};
DragAndDropService.prototype.findExternalZone = function (params) {
var externalTargets = this.dropTargets.filter(function (target) { return target.external; });
return Object(_utils_generic__WEBPACK_IMPORTED_MODULE_5__["find"])(externalTargets, function (zone) { return zone.getContainer() === params.getContainer(); });
};
DragAndDropService.prototype.getHorizontalDirection = function (event) {
var clientX = this.eventLastTime.clientX;
var eClientX = event.clientX;
if (clientX === eClientX) {
return null;
}
return clientX > eClientX ? HorizontalDirection.Left : HorizontalDirection.Right;
};
DragAndDropService.prototype.getVerticalDirection = function (event) {
var clientY = this.eventLastTime.clientY;
var eClientY = event.clientY;
if (clientY === eClientY) {
return null;
}
return clientY > eClientY ? VerticalDirection.Up : VerticalDirection.Down;
};
DragAndDropService.prototype.createDropTargetEvent = function (dropTarget, event, hDirection, vDirection, fromNudge) {
// localise x and y to the target
var dropZoneTarget = dropTarget.getContainer();
var rect = dropZoneTarget.getBoundingClientRect();
var _a = this, api = _a.gridApi, columnApi = _a.columnApi, dragItem = _a.dragItem, dragSource = _a.dragSource;
var x = event.clientX - rect.left;
var y = event.clientY - rect.top;
return { event: event, x: x, y: y, vDirection: vDirection, hDirection: hDirection, dragSource: dragSource, fromNudge: fromNudge, dragItem: dragItem, api: api, columnApi: columnApi, dropZoneTarget: dropZoneTarget };
};
DragAndDropService.prototype.positionGhost = function (event) {
var ghost = this.eGhost;
var ghostRect = ghost.getBoundingClientRect();
var ghostHeight = ghostRect.height;
// for some reason, without the '-2', it still overlapped by 1 or 2 pixels, which
// then brought in scrollbars to the browser. no idea why, but putting in -2 here
// works around it which is good enough for me.
var browserWidth = Object(_utils_browser__WEBPACK_IMPORTED_MODULE_6__["getBodyWidth"])() - 2;
var browserHeight = Object(_utils_browser__WEBPACK_IMPORTED_MODULE_6__["getBodyHeight"])() - 2;
var top = event.pageY - (ghostHeight / 2);
var left = event.pageX - 10;
var usrDocument = this.gridOptionsWrapper.getDocument();
var windowScrollY = window.pageYOffset || usrDocument.documentElement.scrollTop;
var windowScrollX = window.pageXOffset || usrDocument.documentElement.scrollLeft;
// check ghost is not positioned outside of the browser
if (browserWidth > 0 && ((left + ghost.clientWidth) > (browserWidth + windowScrollX))) {
left = browserWidth + windowScrollX - ghost.clientWidth;
}
if (left < 0) {
left = 0;
}
if (browserHeight > 0 && ((top + ghost.clientHeight) > (browserHeight + windowScrollY))) {
top = browserHeight + windowScrollY - ghost.clientHeight;
}
if (top < 0) {
top = 0;
}
ghost.style.left = left + "px";
ghost.style.top = top + "px";
};
DragAndDropService.prototype.removeGhost = function () {
if (this.eGhost && this.eGhostParent) {
this.eGhostParent.removeChild(this.eGhost);
}
this.eGhost = null;
};
DragAndDropService.prototype.createGhost = function () {
this.eGhost = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_7__["loadTemplate"])(DragAndDropService_1.GHOST_TEMPLATE);
var theme = this.environment.getTheme().theme;
if (theme) {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_7__["addCssClass"])(this.eGhost, theme);
}
this.eGhostIcon = this.eGhost.querySelector('.ag-dnd-ghost-icon');
this.setGhostIcon(null);
var eText = this.eGhost.querySelector('.ag-dnd-ghost-label');
var dragItemName = this.dragSource.dragItemName;
if (Object(_utils_function__WEBPACK_IMPORTED_MODULE_8__["isFunction"])(dragItemName)) {
dragItemName = dragItemName();
}
eText.innerHTML = Object(_utils_string__WEBPACK_IMPORTED_MODULE_2__["escapeString"])(dragItemName);
this.eGhost.style.height = '25px';
this.eGhost.style.top = '20px';
this.eGhost.style.left = '20px';
var usrDocument = this.gridOptionsWrapper.getDocument();
this.eGhostParent = usrDocument.querySelector('body');
if (!this.eGhostParent) {
console.warn('ag-Grid: could not find document body, it is needed for dragging columns');
}
else {
this.eGhostParent.appendChild(this.eGhost);
}
};
DragAndDropService.prototype.setGhostIcon = function (iconName, shake) {
if (shake === void 0) { shake = false; }
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_7__["clearElement"])(this.eGhostIcon);
var eIcon;
if (!iconName) {
iconName = this.dragSource.defaultIconName || DragAndDropService_1.ICON_NOT_ALLOWED;
}
switch (iconName) {
case DragAndDropService_1.ICON_PINNED:
eIcon = this.ePinnedIcon;
break;
case DragAndDropService_1.ICON_MOVE:
eIcon = this.eMoveIcon;
break;
case DragAndDropService_1.ICON_LEFT:
eIcon = this.eLeftIcon;
break;
case DragAndDropService_1.ICON_RIGHT:
eIcon = this.eRightIcon;
break;
case DragAndDropService_1.ICON_GROUP:
eIcon = this.eGroupIcon;
break;
case DragAndDropService_1.ICON_AGGREGATE:
eIcon = this.eAggregateIcon;
break;
case DragAndDropService_1.ICON_PIVOT:
eIcon = this.ePivotIcon;
break;
case DragAndDropService_1.ICON_NOT_ALLOWED:
eIcon = this.eDropNotAllowedIcon;
break;
case DragAndDropService_1.ICON_HIDE:
eIcon = this.eHideIcon;
break;
}
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_7__["addOrRemoveCssClass"])(this.eGhostIcon, 'ag-shake-left-to-right', shake);
if (eIcon === this.eHideIcon && this.gridOptionsWrapper.isSuppressDragLeaveHidesColumns()) {
return;
}
if (eIcon) {
this.eGhostIcon.appendChild(eIcon);
}
};
var DragAndDropService_1;
DragAndDropService.ICON_PINNED = 'pinned';
DragAndDropService.ICON_MOVE = 'move';
DragAndDropService.ICON_LEFT = 'left';
DragAndDropService.ICON_RIGHT = 'right';
DragAndDropService.ICON_GROUP = 'group';
DragAndDropService.ICON_AGGREGATE = 'aggregate';
DragAndDropService.ICON_PIVOT = 'pivot';
DragAndDropService.ICON_NOT_ALLOWED = 'notAllowed';
DragAndDropService.ICON_HIDE = 'hide';
DragAndDropService.GHOST_TEMPLATE = "
\n \n \n
";
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('dragService')
], DragAndDropService.prototype, "dragService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('environment')
], DragAndDropService.prototype, "environment", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('columnApi')
], DragAndDropService.prototype, "columnApi", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('gridApi')
], DragAndDropService.prototype, "gridApi", void 0);
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_1__["PostConstruct"]
], DragAndDropService.prototype, "init", null);
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_1__["PreDestroy"]
], DragAndDropService.prototype, "clearDragSourceParamsList", null);
DragAndDropService = DragAndDropService_1 = __decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Bean"])('dragAndDropService')
], DragAndDropService);
return DragAndDropService;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_0__["BeanStub"]));
/***/ }),
/* 106 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PopupEditorWrapper", function() { return PopupEditorWrapper; });
/* harmony import */ var _widgets_popupComponent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(35);
/* harmony import */ var _utils_keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(48);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var PopupEditorWrapper = /** @class */ (function (_super) {
__extends(PopupEditorWrapper, _super);
function PopupEditorWrapper(cellEditor) {
var _this = _super.call(this, "
") || this;
_this.getGuiCalledOnChild = false;
_this.cellEditor = cellEditor;
return _this;
}
PopupEditorWrapper.prototype.onKeyDown = function (event) {
if (!Object(_utils_keyboard__WEBPACK_IMPORTED_MODULE_1__["isUserSuppressingKeyboardEvent"])(this.gridOptionsWrapper, event, this.params.node, this.params.column, true)) {
this.params.onKeyDown(event);
}
};
PopupEditorWrapper.prototype.getGui = function () {
// we call getGui() on child here (rather than in the constructor)
// as we should wait for 'init' to be called on child first.
if (!this.getGuiCalledOnChild) {
this.appendChild(this.cellEditor.getGui());
this.getGuiCalledOnChild = true;
}
return _super.prototype.getGui.call(this);
};
PopupEditorWrapper.prototype.init = function (params) {
var _this = this;
this.params = params;
this.gridOptionsWrapper.setDomData(this.getGui(), PopupEditorWrapper.DOM_KEY_POPUP_EDITOR_WRAPPER, true);
this.addDestroyFunc(function () { return _this.destroyBean(_this.cellEditor); });
this.addManagedListener(
// this needs to be 'super' and not 'this' as if we call 'this',
// it ends up called 'getGui()' on the child before 'init' was called,
// which is not good
_super.prototype.getGui.call(this), 'keydown', this.onKeyDown.bind(this));
};
PopupEditorWrapper.prototype.afterGuiAttached = function () {
if (this.cellEditor.afterGuiAttached) {
this.cellEditor.afterGuiAttached();
}
};
PopupEditorWrapper.prototype.getValue = function () {
return this.cellEditor.getValue();
};
PopupEditorWrapper.prototype.isCancelBeforeStart = function () {
if (this.cellEditor.isCancelBeforeStart) {
return this.cellEditor.isCancelBeforeStart();
}
};
PopupEditorWrapper.prototype.isCancelAfterEnd = function () {
if (this.cellEditor.isCancelAfterEnd) {
return this.cellEditor.isCancelAfterEnd();
}
};
PopupEditorWrapper.prototype.getPopupPosition = function () {
if (this.cellEditor.getPopupPosition) {
return this.cellEditor.getPopupPosition();
}
};
PopupEditorWrapper.prototype.focusIn = function () {
if (this.cellEditor.focusIn) {
this.cellEditor.focusIn();
}
};
PopupEditorWrapper.prototype.focusOut = function () {
if (this.cellEditor.focusOut) {
this.cellEditor.focusOut();
}
};
PopupEditorWrapper.DOM_KEY_POPUP_EDITOR_WRAPPER = 'popupEditorWrapper';
return PopupEditorWrapper;
}(_widgets_popupComponent__WEBPACK_IMPORTED_MODULE_0__["PopupComponent"]));
/***/ }),
/* 107 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DndSourceComp", function() { return DndSourceComp; });
/* harmony import */ var _widgets_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(36);
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12);
/* harmony import */ var _utils_icon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(47);
/* harmony import */ var _utils_browser__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(43);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 DndSourceComp = /** @class */ (function (_super) {
__extends(DndSourceComp, _super);
function DndSourceComp(rowNode, column, cellValue, beans, eCell) {
var _this = _super.call(this, "") || this;
_this.rowNode = rowNode;
_this.column = column;
_this.cellValue = cellValue;
_this.beans = beans;
_this.eCell = eCell;
return _this;
}
DndSourceComp.prototype.postConstruct = function () {
var eGui = this.getGui();
eGui.appendChild(Object(_utils_icon__WEBPACK_IMPORTED_MODULE_2__["createIconNoSpan"])('rowDrag', this.beans.gridOptionsWrapper, null));
// we need to stop the event propagation here to avoid starting a range selection while dragging
this.addGuiEventListener('mousedown', function (e) {
e.stopPropagation();
});
this.addDragSource();
this.checkVisibility();
};
DndSourceComp.prototype.addDragSource = function () {
this.addGuiEventListener('dragstart', this.onDragStart.bind(this));
};
DndSourceComp.prototype.onDragStart = function (dragEvent) {
var _this = this;
var providedOnRowDrag = this.column.getColDef().dndSourceOnRowDrag;
var isIE = Object(_utils_browser__WEBPACK_IMPORTED_MODULE_3__["isBrowserIE"])();
if (!isIE) {
dragEvent.dataTransfer.setDragImage(this.eCell, 0, 0);
}
// default behaviour is to convert data to json and set into drag component
var defaultOnRowDrag = function () {
try {
var jsonData = JSON.stringify(_this.rowNode.data);
if (isIE) {
dragEvent.dataTransfer.setData('text', jsonData);
}
else {
dragEvent.dataTransfer.setData('application/json', jsonData);
dragEvent.dataTransfer.setData('text/plain', jsonData);
}
}
catch (e) {
// if we cannot convert the data to json, then we do not set the type
}
};
if (providedOnRowDrag) {
providedOnRowDrag({ rowNode: this.rowNode, dragEvent: dragEvent });
}
else {
defaultOnRowDrag();
}
};
DndSourceComp.prototype.checkVisibility = function () {
var visible = this.column.isDndSource(this.rowNode);
this.setDisplayed(visible);
};
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_1__["PostConstruct"]
], DndSourceComp.prototype, "postConstruct", null);
return DndSourceComp;
}(_widgets_component__WEBPACK_IMPORTED_MODULE_0__["Component"]));
/***/ }),
/* 108 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AngularRowUtils", function() { return AngularRowUtils; });
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __assign = (undefined && undefined.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var AngularRowUtils = /** @class */ (function () {
function AngularRowUtils() {
}
AngularRowUtils.createChildScopeOrNull = function (rowNode, parentScope, gridOptionsWrapper) {
var isAngularCompileRows = gridOptionsWrapper.isAngularCompileRows();
if (!isAngularCompileRows) {
return null;
}
var newChildScope = parentScope.$new();
newChildScope.data = __assign({}, rowNode.data);
newChildScope.rowNode = rowNode;
newChildScope.context = gridOptionsWrapper.getContext();
var destroyFunc = function () {
newChildScope.$destroy();
newChildScope.data = null;
newChildScope.rowNode = null;
newChildScope.context = null;
};
return {
scope: newChildScope,
scopeDestroyFunc: destroyFunc
};
};
return AngularRowUtils;
}());
/***/ }),
/* 109 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HeaderRootComp", function() { return HeaderRootComp; });
/* harmony import */ var _gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(95);
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12);
/* harmony import */ var _headerContainer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(110);
/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(23);
/* harmony import */ var _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(57);
/* harmony import */ var _constants_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(16);
/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(42);
/* harmony import */ var _widgets_managedFocusComponent__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(65);
/* harmony import */ var _header_headerNavigationService__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(129);
/* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(7);
/* harmony import */ var _constants_keyName__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(130);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 HeaderRootComp = /** @class */ (function (_super) {
__extends(HeaderRootComp, _super);
function HeaderRootComp() {
var _this = _super.call(this, HeaderRootComp.TEMPLATE) || this;
_this.headerContainers = new Map();
return _this;
}
HeaderRootComp.prototype.postConstruct = function () {
var _this = this;
_super.prototype.postConstruct.call(this);
this.printLayout = this.gridOptionsWrapper.getDomLayout() === _constants_constants__WEBPACK_IMPORTED_MODULE_5__["Constants"].DOM_LAYOUT_PRINT;
this.gridApi.registerHeaderRootComp(this);
this.autoWidthCalculator.registerHeaderRootComp(this);
this.registerHeaderContainer(new _headerContainer__WEBPACK_IMPORTED_MODULE_2__["HeaderContainer"](this.eHeaderContainer, this.eHeaderViewport, null), 'center');
this.registerHeaderContainer(new _headerContainer__WEBPACK_IMPORTED_MODULE_2__["HeaderContainer"](this.ePinnedLeftHeader, null, _constants_constants__WEBPACK_IMPORTED_MODULE_5__["Constants"].PINNED_LEFT), 'left');
this.registerHeaderContainer(new _headerContainer__WEBPACK_IMPORTED_MODULE_2__["HeaderContainer"](this.ePinnedRightHeader, null, _constants_constants__WEBPACK_IMPORTED_MODULE_5__["Constants"].PINNED_RIGHT), 'right');
this.headerContainers.forEach(function (container) { return _this.createManagedBean(container); });
this.headerNavigationService.registerHeaderRoot(this);
// shotgun way to get labels to change, eg from sum(amount) to avg(amount)
this.addManagedListener(this.gridOptionsWrapper, _gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__["GridOptionsWrapper"].PROP_DOM_LAYOUT, this.onDomLayoutChanged.bind(this));
// for setting ag-pivot-on / ag-pivot-off CSS classes
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_COLUMN_PIVOT_MODE_CHANGED, this.onPivotModeChanged.bind(this));
this.onPivotModeChanged();
this.addPreventHeaderScroll();
if (this.columnController.isReady()) {
this.refreshHeader();
}
};
HeaderRootComp.prototype.registerGridComp = function (gridPanel) {
this.gridPanel = gridPanel;
this.headerContainers.forEach(function (c) { return c.setupDragAndDrop(gridPanel); });
};
HeaderRootComp.prototype.registerHeaderContainer = function (headerContainer, type) {
this.headerContainers.set(type, headerContainer);
};
HeaderRootComp.prototype.onTabKeyDown = function (e) {
var isRtl = this.gridOptionsWrapper.isEnableRtl();
var direction = e.shiftKey !== isRtl
? _header_headerNavigationService__WEBPACK_IMPORTED_MODULE_8__["HeaderNavigationDirection"].LEFT
: _header_headerNavigationService__WEBPACK_IMPORTED_MODULE_8__["HeaderNavigationDirection"].RIGHT;
if (this.headerNavigationService.navigateHorizontally(direction, true, e) ||
this.focusController.focusNextGridCoreContainer(e.shiftKey)) {
e.preventDefault();
}
};
HeaderRootComp.prototype.handleKeyDown = function (e) {
var direction = null;
switch (e.key) {
case _constants_keyName__WEBPACK_IMPORTED_MODULE_10__["KeyName"].LEFT:
direction = _header_headerNavigationService__WEBPACK_IMPORTED_MODULE_8__["HeaderNavigationDirection"].LEFT;
case _constants_keyName__WEBPACK_IMPORTED_MODULE_10__["KeyName"].RIGHT:
if (!Object(_utils_generic__WEBPACK_IMPORTED_MODULE_9__["exists"])(direction)) {
direction = _header_headerNavigationService__WEBPACK_IMPORTED_MODULE_8__["HeaderNavigationDirection"].RIGHT;
}
this.headerNavigationService.navigateHorizontally(direction, false, e);
break;
case _constants_keyName__WEBPACK_IMPORTED_MODULE_10__["KeyName"].UP:
direction = _header_headerNavigationService__WEBPACK_IMPORTED_MODULE_8__["HeaderNavigationDirection"].UP;
case _constants_keyName__WEBPACK_IMPORTED_MODULE_10__["KeyName"].DOWN:
if (!Object(_utils_generic__WEBPACK_IMPORTED_MODULE_9__["exists"])(direction)) {
direction = _header_headerNavigationService__WEBPACK_IMPORTED_MODULE_8__["HeaderNavigationDirection"].DOWN;
}
if (this.headerNavigationService.navigateVertically(direction, null, e)) {
e.preventDefault();
}
break;
default:
return;
}
};
HeaderRootComp.prototype.onFocusOut = function (e) {
var relatedTarget = e.relatedTarget;
var eGui = this.getGui();
if (!relatedTarget && eGui.contains(document.activeElement)) {
return;
}
if (!eGui.contains(relatedTarget)) {
this.focusController.clearFocusedHeader();
}
};
HeaderRootComp.prototype.onDomLayoutChanged = function () {
var newValue = this.gridOptionsWrapper.getDomLayout() === _constants_constants__WEBPACK_IMPORTED_MODULE_5__["Constants"].DOM_LAYOUT_PRINT;
if (this.printLayout !== newValue) {
this.printLayout = newValue;
this.refreshHeader();
}
};
HeaderRootComp.prototype.setHorizontalScroll = function (offset) {
this.eHeaderContainer.style.transform = "translateX(" + offset + "px)";
};
HeaderRootComp.prototype.forEachHeaderElement = function (callback) {
this.headerContainers.forEach(function (childContainer) { return childContainer.forEachHeaderElement(callback); });
};
HeaderRootComp.prototype.refreshHeader = function () {
this.headerContainers.forEach(function (container) { return container.refresh(); });
};
HeaderRootComp.prototype.onPivotModeChanged = function () {
var pivotMode = this.columnController.isPivotMode();
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_6__["addOrRemoveCssClass"])(this.getGui(), 'ag-pivot-on', pivotMode);
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_6__["addOrRemoveCssClass"])(this.getGui(), 'ag-pivot-off', !pivotMode);
};
HeaderRootComp.prototype.setHeight = function (height) {
// one extra pixel is needed here to account for the
// height of the border
var px = height + 1 + "px";
this.getGui().style.height = px;
this.getGui().style.minHeight = px;
};
// if the user is in floating filter and hits tab a few times, the header can
// end up scrolling to show items off the screen, leaving the grid and header
// and the grid columns no longer in sync.
HeaderRootComp.prototype.addPreventHeaderScroll = function () {
var _this = this;
this.addManagedListener(this.eHeaderViewport, 'scroll', function () {
// if the header scrolls, the header will be out of sync. so we reset the
// header scroll, and then scroll the body, which will in turn set the offset
// on the header, giving the impression that the header scrolled as expected.
var scrollLeft = _this.eHeaderViewport.scrollLeft;
if (scrollLeft !== 0) {
_this.gridPanel.scrollHorizontally(scrollLeft);
_this.eHeaderViewport.scrollLeft = 0;
}
});
};
HeaderRootComp.prototype.getHeaderContainers = function () {
return this.headerContainers;
};
HeaderRootComp.prototype.setHeaderContainerWidth = function (width) {
this.eHeaderContainer.style.width = width + "px";
};
HeaderRootComp.prototype.setLeftVisible = function (visible) {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_6__["setDisplayed"])(this.ePinnedLeftHeader, visible);
};
HeaderRootComp.prototype.setRightVisible = function (visible) {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_6__["setDisplayed"])(this.ePinnedRightHeader, visible);
};
HeaderRootComp.TEMPLATE = "
\n \n
\n \n
\n \n
";
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_4__["RefSelector"])('ePinnedLeftHeader')
], HeaderRootComp.prototype, "ePinnedLeftHeader", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_4__["RefSelector"])('ePinnedRightHeader')
], HeaderRootComp.prototype, "ePinnedRightHeader", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_4__["RefSelector"])('eHeaderContainer')
], HeaderRootComp.prototype, "eHeaderContainer", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_4__["RefSelector"])('eHeaderViewport')
], HeaderRootComp.prototype, "eHeaderViewport", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('columnController')
], HeaderRootComp.prototype, "columnController", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('gridApi')
], HeaderRootComp.prototype, "gridApi", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('autoWidthCalculator')
], HeaderRootComp.prototype, "autoWidthCalculator", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('headerNavigationService')
], HeaderRootComp.prototype, "headerNavigationService", void 0);
return HeaderRootComp;
}(_widgets_managedFocusComponent__WEBPACK_IMPORTED_MODULE_7__["ManagedFocusComponent"]));
/***/ }),
/* 110 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HeaderContainer", function() { return HeaderContainer; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23);
/* harmony import */ var _headerRowComp__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(111);
/* harmony import */ var _bodyDropTarget__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(126);
/* harmony import */ var _constants_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(16);
/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(42);
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(20);
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(37);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 HeaderContainer = /** @class */ (function (_super) {
__extends(HeaderContainer, _super);
function HeaderContainer(eContainer, eViewport, pinned) {
var _this = _super.call(this) || this;
_this.groupsRowComps = [];
_this.eContainer = eContainer;
_this.pinned = pinned;
_this.eViewport = eViewport;
return _this;
}
HeaderContainer.prototype.forEachHeaderElement = function (callback) {
if (this.groupsRowComps) {
this.groupsRowComps.forEach(function (c) { return c.forEachHeaderElement(callback); });
}
if (this.columnsRowComp) {
this.columnsRowComp.forEachHeaderElement(callback);
}
if (this.filtersRowComp) {
this.columnsRowComp.forEachHeaderElement(callback);
}
};
HeaderContainer.prototype.init = function () {
// if value changes, then if not pivoting, we at least need to change the label eg from sum() to avg(),
// if pivoting, then the columns have changed
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_GRID_COLUMNS_CHANGED, this.onGridColumnsChanged.bind(this));
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_SCROLL_VISIBILITY_CHANGED, this.onScrollVisibilityChanged.bind(this));
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_COLUMN_RESIZED, this.onColumnResized.bind(this));
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_DISPLAYED_COLUMNS_CHANGED, this.onDisplayedColumnsChanged.bind(this));
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_SCROLLBAR_WIDTH_CHANGED, this.onScrollbarWidthChanged.bind(this));
};
HeaderContainer.prototype.onColumnResized = function () {
this.setWidthOfPinnedContainer();
};
HeaderContainer.prototype.onDisplayedColumnsChanged = function () {
this.setWidthOfPinnedContainer();
};
HeaderContainer.prototype.onScrollVisibilityChanged = function () {
this.setWidthOfPinnedContainer();
};
HeaderContainer.prototype.onScrollbarWidthChanged = function () {
this.setWidthOfPinnedContainer();
};
HeaderContainer.prototype.setWidthOfPinnedContainer = function () {
var pinningLeft = this.pinned === _constants_constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].PINNED_LEFT;
var pinningRight = this.pinned === _constants_constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].PINNED_RIGHT;
var controller = this.columnController;
var isRtl = this.gridOptionsWrapper.isEnableRtl();
var scrollbarWidth = this.gridOptionsWrapper.getScrollbarWidth();
if (pinningLeft || pinningRight) {
// size to fit all columns
var width = controller[pinningLeft ? 'getPinnedLeftContainerWidth' : 'getPinnedRightContainerWidth']();
// if there is a scroll showing (and taking up space, so Windows, and not iOS)
// in the body, then we add extra space to keep header aligned with the body,
// as body width fits the cols and the scrollbar
var addPaddingForScrollbar = this.scrollVisibleService.isVerticalScrollShowing() && ((isRtl && pinningLeft) || (!isRtl && pinningRight));
if (addPaddingForScrollbar) {
width += scrollbarWidth;
}
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_5__["setFixedWidth"])(this.eContainer, width);
}
};
HeaderContainer.prototype.getRowComps = function () {
var res = [];
if (this.groupsRowComps) {
res = res.concat(this.groupsRowComps);
}
if (this.columnsRowComp) {
res.push(this.columnsRowComp);
}
if (this.filtersRowComp) {
res.push(this.filtersRowComp);
}
return res;
};
// grid cols have changed - this also means the number of rows in the header can have
// changed. so we remove all the old rows and insert new ones for a complete refresh
HeaderContainer.prototype.onGridColumnsChanged = function () {
this.refresh(true);
};
// we expose this for gridOptions.api.refreshHeader() to call
HeaderContainer.prototype.refresh = function (keepColumns) {
if (keepColumns === void 0) { keepColumns = false; }
this.refreshRowComps(keepColumns);
};
HeaderContainer.prototype.setupDragAndDrop = function (gridComp) {
// center section has viewport, but pinned sections do not
var dropContainer = this.eViewport ? this.eViewport : this.eContainer;
var bodyDropTarget = new _bodyDropTarget__WEBPACK_IMPORTED_MODULE_3__["BodyDropTarget"](this.pinned, dropContainer);
this.createManagedBean(bodyDropTarget);
bodyDropTarget.registerGridComp(gridComp);
};
HeaderContainer.prototype.destroyRowComps = function (keepColumns) {
if (keepColumns === void 0) { keepColumns = false; }
this.groupsRowComps.forEach(this.destroyRowComp.bind(this));
this.groupsRowComps = [];
this.destroyRowComp(this.filtersRowComp);
this.filtersRowComp = undefined;
if (!keepColumns) {
this.destroyRowComp(this.columnsRowComp);
this.columnsRowComp = undefined;
}
};
HeaderContainer.prototype.destroyRowComp = function (rowComp) {
if (rowComp) {
this.destroyBean(rowComp);
this.eContainer.removeChild(rowComp.getGui());
}
};
HeaderContainer.prototype.refreshRowComps = function (keepColumns) {
var _this = this;
if (keepColumns === void 0) { keepColumns = false; }
var sequence = new _utils__WEBPACK_IMPORTED_MODULE_7__["NumberSequence"]();
var refreshColumnGroups = function () {
var groupRowCount = _this.columnController.getHeaderRowCount() - 1;
_this.groupsRowComps.forEach(_this.destroyRowComp.bind(_this));
_this.groupsRowComps = [];
for (var i = 0; i < groupRowCount; i++) {
var rowComp = _this.createBean(new _headerRowComp__WEBPACK_IMPORTED_MODULE_2__["HeaderRowComp"](sequence.next(), _headerRowComp__WEBPACK_IMPORTED_MODULE_2__["HeaderRowType"].COLUMN_GROUP, _this.pinned));
_this.groupsRowComps.push(rowComp);
}
};
var refreshColumns = function () {
var rowIndex = sequence.next();
if (_this.columnsRowComp) {
var rowIndexMismatch = _this.columnsRowComp.getRowIndex() !== rowIndex;
if (!keepColumns || rowIndexMismatch) {
_this.destroyRowComp(_this.columnsRowComp);
_this.columnsRowComp = undefined;
}
}
if (!_this.columnsRowComp) {
_this.columnsRowComp = _this.createBean(new _headerRowComp__WEBPACK_IMPORTED_MODULE_2__["HeaderRowComp"](rowIndex, _headerRowComp__WEBPACK_IMPORTED_MODULE_2__["HeaderRowType"].COLUMN, _this.pinned));
}
};
var refreshFilters = function () {
_this.destroyRowComp(_this.filtersRowComp);
_this.filtersRowComp = undefined;
var includeFloatingFilter = !_this.columnController.isPivotMode() && _this.columnController.hasFloatingFilters();
if (includeFloatingFilter) {
_this.filtersRowComp = _this.createBean(new _headerRowComp__WEBPACK_IMPORTED_MODULE_2__["HeaderRowComp"](sequence.next(), _headerRowComp__WEBPACK_IMPORTED_MODULE_2__["HeaderRowType"].FLOATING_FILTER, _this.pinned));
}
};
refreshColumnGroups();
refreshColumns();
refreshFilters();
// this re-adds the this.columnsRowComp, which is fine, it just means the DOM will rearrange then,
// taking it out of the last position and re-inserting relative to the other rows.
this.getRowComps().forEach(function (rowComp) { return _this.eContainer.appendChild(rowComp.getGui()); });
};
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnController')
], HeaderContainer.prototype, "columnController", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('scrollVisibleService')
], HeaderContainer.prototype, "scrollVisibleService", void 0);
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_0__["PostConstruct"]
], HeaderContainer.prototype, "init", null);
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_0__["PreDestroy"]
], HeaderContainer.prototype, "destroyRowComps", null);
return HeaderContainer;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_6__["BeanStub"]));
/***/ }),
/* 111 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HeaderRowType", function() { return HeaderRowType; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HeaderRowComp", function() { return HeaderRowComp; });
/* harmony import */ var _widgets_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(36);
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12);
/* harmony import */ var _gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(95);
/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(23);
/* harmony import */ var _header_headerWrapperComp__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(112);
/* harmony import */ var _headerGroup_headerGroupWrapperComp__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(122);
/* harmony import */ var _constants_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(16);
/* harmony import */ var _filter_floating_floatingFilterWrapper__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(123);
/* harmony import */ var _utils_browser__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(43);
/* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(7);
/* harmony import */ var _utils_array__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(14);
/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(42);
/* harmony import */ var _utils_aria__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(44);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 HeaderRowType;
(function (HeaderRowType) {
HeaderRowType[HeaderRowType["COLUMN_GROUP"] = 0] = "COLUMN_GROUP";
HeaderRowType[HeaderRowType["COLUMN"] = 1] = "COLUMN";
HeaderRowType[HeaderRowType["FLOATING_FILTER"] = 2] = "FLOATING_FILTER";
})(HeaderRowType || (HeaderRowType = {}));
var HeaderRowComp = /** @class */ (function (_super) {
__extends(HeaderRowComp, _super);
function HeaderRowComp(dept, type, pinned) {
var _this = _super.call(this, /* html */ "") || this;
_this.headerComps = {};
_this.setRowIndex(dept);
_this.type = type;
_this.pinned = pinned;
var niceClassName = HeaderRowType[type].toLowerCase().replace(/_/g, '-');
_this.addCssClass("ag-header-row-" + niceClassName);
if (Object(_utils_browser__WEBPACK_IMPORTED_MODULE_8__["isBrowserSafari"])()) {
// fix for a Safari rendering bug that caused the header to flicker above chart panels
// as you move the mouse over the header
_this.getGui().style.transform = 'translateZ(0)';
}
return _this;
}
HeaderRowComp.prototype.forEachHeaderElement = function (callback) {
var _this = this;
Object.keys(this.headerComps).forEach(function (key) {
callback(_this.headerComps[key]);
});
};
HeaderRowComp.prototype.setRowIndex = function (rowIndex) {
this.dept = rowIndex;
Object(_utils_aria__WEBPACK_IMPORTED_MODULE_12__["setAriaRowIndex"])(this.getGui(), rowIndex + 1);
};
HeaderRowComp.prototype.getRowIndex = function () {
return this.dept;
};
HeaderRowComp.prototype.getType = function () {
return this.type;
};
HeaderRowComp.prototype.destroyAllChildComponents = function () {
var idsOfAllChildren = Object.keys(this.headerComps);
this.destroyChildComponents(idsOfAllChildren);
};
HeaderRowComp.prototype.destroyChildComponents = function (idsToDestroy, keepFocused) {
var _this = this;
idsToDestroy.forEach(function (id) {
var childHeaderWrapper = _this.headerComps[id];
if (keepFocused &&
!childHeaderWrapper.getColumn().isMoving() &&
_this.focusController.isHeaderWrapperFocused(childHeaderWrapper)) {
return;
}
_this.getGui().removeChild(childHeaderWrapper.getGui());
_this.destroyBean(childHeaderWrapper);
delete _this.headerComps[id];
});
};
HeaderRowComp.prototype.onRowHeightChanged = function () {
var headerRowCount = this.columnController.getHeaderRowCount();
var sizes = [];
var numberOfFloating = 0;
var groupHeight;
var headerHeight;
if (this.columnController.isPivotMode()) {
groupHeight = this.gridOptionsWrapper.getPivotGroupHeaderHeight();
headerHeight = this.gridOptionsWrapper.getPivotHeaderHeight();
}
else {
if (this.columnController.hasFloatingFilters()) {
headerRowCount++;
numberOfFloating = 1;
}
groupHeight = this.gridOptionsWrapper.getGroupHeaderHeight();
headerHeight = this.gridOptionsWrapper.getHeaderHeight();
}
var numberOfNonGroups = 1 + numberOfFloating;
var numberOfGroups = headerRowCount - numberOfNonGroups;
for (var i = 0; i < numberOfGroups; i++) {
sizes.push(groupHeight);
}
sizes.push(headerHeight);
for (var i = 0; i < numberOfFloating; i++) {
sizes.push(this.gridOptionsWrapper.getFloatingFiltersHeight());
}
var rowHeight = 0;
for (var i = 0; i < this.dept; i++) {
rowHeight += sizes[i];
}
this.getGui().style.top = rowHeight + 'px';
this.getGui().style.height = sizes[this.dept] + 'px';
};
//noinspection JSUnusedLocalSymbols
HeaderRowComp.prototype.init = function () {
this.onRowHeightChanged();
this.onVirtualColumnsChanged();
this.setWidth();
this.addManagedListener(this.gridOptionsWrapper, _gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_2__["GridOptionsWrapper"].PROP_HEADER_HEIGHT, this.onRowHeightChanged.bind(this));
this.addManagedListener(this.gridOptionsWrapper, _gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_2__["GridOptionsWrapper"].PROP_PIVOT_HEADER_HEIGHT, this.onRowHeightChanged.bind(this));
this.addManagedListener(this.gridOptionsWrapper, _gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_2__["GridOptionsWrapper"].PROP_GROUP_HEADER_HEIGHT, this.onRowHeightChanged.bind(this));
this.addManagedListener(this.gridOptionsWrapper, _gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_2__["GridOptionsWrapper"].PROP_PIVOT_GROUP_HEADER_HEIGHT, this.onRowHeightChanged.bind(this));
this.addManagedListener(this.gridOptionsWrapper, _gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_2__["GridOptionsWrapper"].PROP_FLOATING_FILTERS_HEIGHT, this.onRowHeightChanged.bind(this));
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_VIRTUAL_COLUMNS_CHANGED, this.onVirtualColumnsChanged.bind(this));
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_DISPLAYED_COLUMNS_CHANGED, this.onDisplayedColumnsChanged.bind(this));
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_COLUMN_RESIZED, this.onColumnResized.bind(this));
// this.addManagedListener(this.eventService, Events.EVENT_GRID_COLUMNS_CHANGED, this.onGridColumnsChanged.bind(this));
};
HeaderRowComp.prototype.onColumnResized = function () {
this.setWidth();
};
HeaderRowComp.prototype.setWidth = function () {
var width = this.getWidthForRow();
this.getGui().style.width = width + 'px';
};
HeaderRowComp.prototype.getWidthForRow = function () {
var printLayout = this.gridOptionsWrapper.getDomLayout() === _constants_constants__WEBPACK_IMPORTED_MODULE_6__["Constants"].DOM_LAYOUT_PRINT;
if (printLayout) {
var centerRow = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_9__["missing"])(this.pinned);
if (centerRow) {
return this.columnController.getContainerWidth(_constants_constants__WEBPACK_IMPORTED_MODULE_6__["Constants"].PINNED_RIGHT)
+ this.columnController.getContainerWidth(_constants_constants__WEBPACK_IMPORTED_MODULE_6__["Constants"].PINNED_LEFT)
+ this.columnController.getContainerWidth(null);
}
return 0;
}
// if not printing, just return the width as normal
return this.columnController.getContainerWidth(this.pinned);
};
// private onGridColumnsChanged(): void {
// this.removeAndDestroyAllChildComponents();
// }
// private removeAndDestroyAllChildComponents(): void {
// const idsOfAllChildren = Object.keys(this.headerComps);
// this.destroyChildComponents(idsOfAllChildren);
// }
HeaderRowComp.prototype.onDisplayedColumnsChanged = function () {
this.onVirtualColumnsChanged();
this.setWidth();
};
HeaderRowComp.prototype.getItemsAtDepth = function () {
var _this = this;
var printLayout = this.gridOptionsWrapper.getDomLayout() === _constants_constants__WEBPACK_IMPORTED_MODULE_6__["Constants"].DOM_LAYOUT_PRINT;
if (printLayout) {
// for print layout, we add all columns into the center
var centerContainer = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_9__["missing"])(this.pinned);
if (centerContainer) {
var result_1 = [];
[_constants_constants__WEBPACK_IMPORTED_MODULE_6__["Constants"].PINNED_LEFT, null, _constants_constants__WEBPACK_IMPORTED_MODULE_6__["Constants"].PINNED_RIGHT].forEach(function (pinned) {
var items = _this.columnController.getVirtualHeaderGroupRow(pinned, _this.type == HeaderRowType.FLOATING_FILTER ?
_this.dept - 1 :
_this.dept);
result_1 = result_1.concat(items);
});
return result_1;
}
return [];
}
// when in normal layout, we add the columns for that container only
return this.columnController.getVirtualHeaderGroupRow(this.pinned, this.type == HeaderRowType.FLOATING_FILTER ?
this.dept - 1 :
this.dept);
};
HeaderRowComp.prototype.onVirtualColumnsChanged = function () {
var _this = this;
var compIdsToRemove = Object.keys(this.headerComps);
var compIdsWanted = [];
var itemsAtDepth = this.getItemsAtDepth();
itemsAtDepth.forEach(function (child) {
// skip groups that have no displayed children. this can happen when the group is broken,
// and this section happens to have nothing to display for the open / closed state.
// (a broken group is one that is split, ie columns in the group have a non-group column
// in between them)
if (child.isEmptyGroup()) {
return;
}
var idOfChild = child.getUniqueId();
var eParentContainer = _this.getGui();
// if we already have this cell rendered, do nothing
var previousComp = _this.headerComps[idOfChild];
// it's possible there is a new Column with the same ID, but it's for a different Column.
// this is common with pivoting, where the pivot cols change, but the id's are still pivot_0,
// pivot_1 etc. so if new col but same ID, need to remove the old col here first as we are
// about to replace it in the this.headerComps map.
var previousCompForOldColumn = previousComp && previousComp.getColumn() != child;
if (previousCompForOldColumn) {
_this.destroyChildComponents([idOfChild]);
Object(_utils_array__WEBPACK_IMPORTED_MODULE_10__["removeFromArray"])(compIdsToRemove, idOfChild);
previousComp = undefined;
}
if (previousComp) {
// already have comp for this column, so do nothing
Object(_utils_array__WEBPACK_IMPORTED_MODULE_10__["removeFromArray"])(compIdsToRemove, idOfChild);
}
else {
// don't have comp, need to create one
var headerComp = _this.createHeaderComp(child);
_this.headerComps[idOfChild] = headerComp;
eParentContainer.appendChild(headerComp.getGui());
}
compIdsWanted.push(idOfChild);
});
// at this point, anything left in currentChildIds is an element that is no longer in the viewport
this.destroyChildComponents(compIdsToRemove, true);
var ensureDomOrder = this.gridOptionsWrapper.isEnsureDomOrder();
if (ensureDomOrder) {
var correctChildOrder = compIdsWanted.map(function (id) { return _this.headerComps[id].getGui(); });
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_11__["setDomChildOrder"])(this.getGui(), correctChildOrder);
}
};
HeaderRowComp.prototype.createHeaderComp = function (columnGroupChild) {
var result;
switch (this.type) {
case HeaderRowType.COLUMN:
result = new _header_headerWrapperComp__WEBPACK_IMPORTED_MODULE_4__["HeaderWrapperComp"](columnGroupChild, this.pinned);
break;
case HeaderRowType.COLUMN_GROUP:
result = new _headerGroup_headerGroupWrapperComp__WEBPACK_IMPORTED_MODULE_5__["HeaderGroupWrapperComp"](columnGroupChild, this.pinned);
break;
case HeaderRowType.FLOATING_FILTER:
result = new _filter_floating_floatingFilterWrapper__WEBPACK_IMPORTED_MODULE_7__["FloatingFilterWrapper"](columnGroupChild, this.pinned);
break;
}
this.createBean(result);
result.setParentComponent(this);
return result;
};
HeaderRowComp.prototype.getHeaderComps = function () {
return this.headerComps;
};
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('columnController')
], HeaderRowComp.prototype, "columnController", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('focusController')
], HeaderRowComp.prototype, "focusController", void 0);
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_1__["PreDestroy"]
], HeaderRowComp.prototype, "destroyAllChildComponents", null);
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_1__["PostConstruct"]
], HeaderRowComp.prototype, "init", null);
return HeaderRowComp;
}(_widgets_component__WEBPACK_IMPORTED_MODULE_0__["Component"]));
/***/ }),
/* 112 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HeaderWrapperComp", function() { return HeaderWrapperComp; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _entities_column__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(10);
/* harmony import */ var _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(105);
/* harmony import */ var _constants_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(16);
/* harmony import */ var _cssClassApplier__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(113);
/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(23);
/* harmony import */ var _hoverFeature__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(114);
/* harmony import */ var _rendering_features_setLeftFeature__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(115);
/* harmony import */ var _selectAllFeature__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(116);
/* harmony import */ var _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(57);
/* harmony import */ var _widgets_touchListener__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(68);
/* harmony import */ var _abstractHeaderWrapper__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(121);
/* harmony import */ var _utils_aria__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(44);
/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(42);
/* harmony import */ var _constants_keyCode__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(58);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 HeaderWrapperComp = /** @class */ (function (_super) {
__extends(HeaderWrapperComp, _super);
function HeaderWrapperComp(column, pinned) {
var _this = _super.call(this, HeaderWrapperComp.TEMPLATE) || this;
_this.headerCompVersion = 0;
_this.refreshFunctions = [];
_this.column = column;
_this.pinned = pinned;
return _this;
}
HeaderWrapperComp.prototype.postConstruct = function () {
_super.prototype.postConstruct.call(this);
this.colDefVersion = this.columnController.getColDefVersion();
this.updateState();
this.setupWidth();
this.setupMovingCss();
this.setupTooltip();
this.setupResize();
this.setupMenuClass();
this.setupSortableClass();
this.addColumnHoverListener();
this.addActiveHeaderMouseListeners();
this.createManagedBean(new _hoverFeature__WEBPACK_IMPORTED_MODULE_6__["HoverFeature"]([this.column], this.getGui()));
this.addManagedListener(this.column, _entities_column__WEBPACK_IMPORTED_MODULE_1__["Column"].EVENT_FILTER_ACTIVE_CHANGED, this.onFilterChanged.bind(this));
this.onFilterChanged();
this.createManagedBean(new _selectAllFeature__WEBPACK_IMPORTED_MODULE_8__["SelectAllFeature"](this.cbSelectAll, this.column));
this.createManagedBean(new _rendering_features_setLeftFeature__WEBPACK_IMPORTED_MODULE_7__["SetLeftFeature"](this.column, this.getGui(), this.beans));
this.addAttributes();
_cssClassApplier__WEBPACK_IMPORTED_MODULE_4__["CssClassApplier"].addHeaderClassesFromColDef(this.column.getColDef(), this.getGui(), this.gridOptionsWrapper, this.column, null);
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_5__["Events"].EVENT_NEW_COLUMNS_LOADED, this.onNewColumnsLoaded.bind(this));
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_5__["Events"].EVENT_COLUMN_VALUE_CHANGED, this.onColumnValueChanged.bind(this));
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_5__["Events"].EVENT_COLUMN_ROW_GROUP_CHANGED, this.onColumnRowGroupChanged.bind(this));
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_5__["Events"].EVENT_COLUMN_PIVOT_CHANGED, this.onColumnPivotChanged.bind(this));
this.appendHeaderComp();
};
HeaderWrapperComp.prototype.onColumnRowGroupChanged = function () {
this.checkDisplayName();
};
HeaderWrapperComp.prototype.onColumnPivotChanged = function () {
this.checkDisplayName();
};
HeaderWrapperComp.prototype.onColumnValueChanged = function () {
this.checkDisplayName();
};
HeaderWrapperComp.prototype.checkDisplayName = function () {
// display name can change if aggFunc different, eg sum(Gold) is now max(Gold)
if (this.displayName !== this.calculateDisplayName()) {
this.refresh();
}
};
HeaderWrapperComp.prototype.updateState = function () {
var colDef = this.column.getColDef();
this.sortable = colDef.sortable;
this.displayName = this.calculateDisplayName();
this.draggable = this.workOutDraggable();
};
HeaderWrapperComp.prototype.calculateDisplayName = function () {
return this.columnController.getDisplayNameForColumn(this.column, 'header', true);
};
HeaderWrapperComp.prototype.onNewColumnsLoaded = function () {
var colDefVersionNow = this.columnController.getColDefVersion();
if (colDefVersionNow != this.colDefVersion) {
this.colDefVersion = colDefVersionNow;
this.refresh();
}
};
HeaderWrapperComp.prototype.refresh = function () {
this.updateState();
var colDef = this.column.getColDef();
var newHeaderCompConfigured = this.colDefHeaderComponent != colDef.headerComponent
|| this.colDefHeaderComponentFramework != colDef.headerComponentFramework;
var headerCompRefreshed = newHeaderCompConfigured ? false : this.attemptHeaderCompRefresh();
if (headerCompRefreshed) {
var dragSourceIsMissing = this.draggable && !this.dragAndDropService;
var dragSourceNeedsRemoving = !this.draggable && this.dragAndDropService;
if (dragSourceIsMissing || dragSourceNeedsRemoving) {
this.attachDraggingToHeaderComp();
}
}
else {
this.appendHeaderComp();
}
this.refreshFunctions.forEach(function (f) { return f(); });
};
HeaderWrapperComp.prototype.destroyHeaderComp = function () {
if (this.headerComp) {
this.getGui().removeChild(this.headerCompGui);
this.headerComp = this.destroyBean(this.headerComp);
this.headerCompGui = undefined;
}
this.removeMoveDragSource();
};
HeaderWrapperComp.prototype.removeMoveDragSource = function () {
if (this.moveDragSource) {
this.dragAndDropService.removeDragSource(this.moveDragSource);
this.moveDragSource = undefined;
}
};
HeaderWrapperComp.prototype.attemptHeaderCompRefresh = function () {
// if no header comp created yet, it's cos of async creation, so first version is yet
// to get here, in which case we return true to say 'no need to refresh'.
if (!this.headerComp) {
return true;
}
// if no refresh method, then we want to replace the headerComp
if (!this.headerComp.refresh) {
return false;
}
// if the cell renderer has a refresh method, we call this instead of doing a refresh
var params = this.createParams();
// take any custom params off of the user
var finalParams = this.userComponentFactory.createFinalParams(this.getComponentHolder(), 'headerComponent', params);
var res = this.headerComp.refresh(finalParams);
return res;
};
HeaderWrapperComp.prototype.addActiveHeaderMouseListeners = function () {
var _this = this;
var listener = function (e) { return _this.setActiveHeader(e.type === 'mouseenter'); };
this.addManagedListener(this.getGui(), 'mouseenter', listener);
this.addManagedListener(this.getGui(), 'mouseleave', listener);
};
HeaderWrapperComp.prototype.setActiveHeader = function (active) {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_13__["addOrRemoveCssClass"])(this.getGui(), 'ag-header-active', active);
};
HeaderWrapperComp.prototype.onFocusIn = function (e) {
if (!this.getGui().contains(e.relatedTarget)) {
var headerRow = this.getParentComponent();
this.focusController.setFocusedHeader(headerRow.getRowIndex(), this.getColumn());
}
this.setActiveHeader(true);
};
HeaderWrapperComp.prototype.onFocusOut = function (e) {
if (this.getGui().contains(e.relatedTarget)) {
return;
}
this.setActiveHeader(false);
};
HeaderWrapperComp.prototype.handleKeyDown = function (e) {
var headerComp = this.headerComp;
if (!headerComp) {
return;
}
if (e.keyCode === _constants_keyCode__WEBPACK_IMPORTED_MODULE_14__["KeyCode"].SPACE) {
var checkbox = this.cbSelectAll;
if (checkbox.isDisplayed() && !checkbox.getGui().contains(document.activeElement)) {
e.preventDefault();
checkbox.setValue(!checkbox.getValue());
}
}
if (e.keyCode === _constants_keyCode__WEBPACK_IMPORTED_MODULE_14__["KeyCode"].ENTER) {
if (e.ctrlKey || e.metaKey) {
if (this.menuEnabled && headerComp.showMenu) {
e.preventDefault();
headerComp.showMenu();
}
}
else if (this.sortable) {
var multiSort = e.shiftKey;
this.sortController.progressSort(this.column, multiSort, "uiColumnSorted");
}
}
};
HeaderWrapperComp.prototype.onTabKeyDown = function () { };
HeaderWrapperComp.prototype.getComponentHolder = function () {
return this.column.getColDef();
};
HeaderWrapperComp.prototype.addColumnHoverListener = function () {
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_5__["Events"].EVENT_COLUMN_HOVER_CHANGED, this.onColumnHover.bind(this));
this.onColumnHover();
};
HeaderWrapperComp.prototype.onColumnHover = function () {
var isHovered = this.columnHoverService.isHovered(this.column);
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_13__["addOrRemoveCssClass"])(this.getGui(), 'ag-column-hover', isHovered);
};
HeaderWrapperComp.prototype.setupSortableClass = function () {
var _this = this;
var eGui = this.getGui();
var updateSortableCssClass = function () {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_13__["addOrRemoveCssClass"])(eGui, 'ag-header-cell-sortable', !!_this.sortable);
};
var updateAriaSort = function () {
if (_this.sortable) {
Object(_utils_aria__WEBPACK_IMPORTED_MODULE_12__["setAriaSort"])(eGui, Object(_utils_aria__WEBPACK_IMPORTED_MODULE_12__["getAriaSortState"])(_this.column));
}
else {
Object(_utils_aria__WEBPACK_IMPORTED_MODULE_12__["removeAriaSort"])(eGui);
}
};
updateSortableCssClass();
updateAriaSort();
this.refreshFunctions.push(updateSortableCssClass);
this.refreshFunctions.push(updateAriaSort);
this.addManagedListener(this.column, _entities_column__WEBPACK_IMPORTED_MODULE_1__["Column"].EVENT_SORT_CHANGED, updateAriaSort.bind(this));
};
HeaderWrapperComp.prototype.onFilterChanged = function () {
var filterPresent = this.column.isFilterActive();
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_13__["addOrRemoveCssClass"])(this.getGui(), 'ag-header-cell-filtered', filterPresent);
};
HeaderWrapperComp.prototype.appendHeaderComp = function () {
this.headerCompVersion++;
var colDef = this.column.getColDef();
this.colDefHeaderComponent = colDef.headerComponent;
this.colDefHeaderComponentFramework = colDef.headerComponentFramework;
var params = this.createParams();
var callback = this.afterHeaderCompCreated.bind(this, this.headerCompVersion);
this.userComponentFactory.newHeaderComponent(params).then(callback);
};
HeaderWrapperComp.prototype.createParams = function () {
var _this = this;
var colDef = this.column.getColDef();
this.menuEnabled = this.menuFactory.isMenuEnabled(this.column) && !colDef.suppressMenu;
var params = {
column: this.column,
displayName: this.displayName,
enableSorting: colDef.sortable,
enableMenu: this.menuEnabled,
showColumnMenu: function (source) {
_this.gridApi.showColumnMenuAfterButtonClick(_this.column, source);
},
progressSort: function (multiSort) {
_this.sortController.progressSort(_this.column, !!multiSort, "uiColumnSorted");
},
setSort: function (sort, multiSort) {
_this.sortController.setSortForColumn(_this.column, sort, !!multiSort, "uiColumnSorted");
},
api: this.gridApi,
columnApi: this.columnApi,
context: this.gridOptionsWrapper.getContext(),
eGridHeader: this.getGui()
};
return params;
};
HeaderWrapperComp.prototype.afterHeaderCompCreated = function (version, headerComp) {
if (version != this.headerCompVersion || !this.isAlive()) {
this.destroyBean(headerComp);
return;
}
this.destroyHeaderComp();
this.headerComp = headerComp;
this.headerCompGui = headerComp.getGui();
this.getGui().appendChild(this.headerCompGui);
this.attachDraggingToHeaderComp();
};
HeaderWrapperComp.prototype.onColumnMovingChanged = function () {
// this function adds or removes the moving css, based on if the col is moving.
// this is what makes the header go dark when it is been moved (gives impression to
// user that the column was picked up).
if (this.column.isMoving()) {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_13__["addCssClass"])(this.getGui(), 'ag-header-cell-moving');
}
else {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_13__["removeCssClass"])(this.getGui(), 'ag-header-cell-moving');
}
};
HeaderWrapperComp.prototype.workOutDraggable = function () {
var colDef = this.column.getColDef();
var isSuppressMovableColumns = this.gridOptionsWrapper.isSuppressMovableColumns();
var colCanMove = !isSuppressMovableColumns && !colDef.suppressMovable && !colDef.lockPosition;
// we should still be allowed drag the column, even if it can't be moved, if the column
// can be dragged to a rowGroup or pivot drop zone
return colCanMove || colDef.enableRowGroup || colDef.enablePivot;
};
HeaderWrapperComp.prototype.attachDraggingToHeaderComp = function () {
var _this = this;
this.removeMoveDragSource();
if (!this.draggable) {
return;
}
this.moveDragSource = {
type: _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_2__["DragSourceType"].HeaderCell,
eElement: this.headerCompGui,
defaultIconName: _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_2__["DragAndDropService"].ICON_HIDE,
getDragItem: function () { return _this.createDragItem(); },
dragItemName: this.displayName,
onDragStarted: function () { return _this.column.setMoving(true, "uiColumnMoved"); },
onDragStopped: function () { return _this.column.setMoving(false, "uiColumnMoved"); }
};
this.dragAndDropService.addDragSource(this.moveDragSource, true);
};
HeaderWrapperComp.prototype.createDragItem = function () {
var visibleState = {};
visibleState[this.column.getId()] = this.column.isVisible();
return {
columns: [this.column],
visibleState: visibleState
};
};
HeaderWrapperComp.prototype.setupResize = function () {
var _this = this;
var colDef = this.getComponentHolder();
var destroyResizeFuncs = [];
var canResize;
var canAutosize;
var addResize = function () {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_13__["setDisplayed"])(_this.eResize, canResize);
if (!canResize) {
return;
}
var finishedWithResizeFunc = _this.horizontalResizeService.addResizeBar({
eResizeBar: _this.eResize,
onResizeStart: _this.onResizeStart.bind(_this),
onResizing: _this.onResizing.bind(_this, false),
onResizeEnd: _this.onResizing.bind(_this, true)
});
destroyResizeFuncs.push(finishedWithResizeFunc);
if (canAutosize) {
var skipHeaderOnAutoSize_1 = _this.gridOptionsWrapper.isSkipHeaderOnAutoSize();
var autoSizeColListener_1 = function () {
_this.columnController.autoSizeColumn(_this.column, skipHeaderOnAutoSize_1, "uiColumnResized");
};
_this.eResize.addEventListener('dblclick', autoSizeColListener_1);
var touchListener_1 = new _widgets_touchListener__WEBPACK_IMPORTED_MODULE_10__["TouchListener"](_this.eResize);
touchListener_1.addEventListener(_widgets_touchListener__WEBPACK_IMPORTED_MODULE_10__["TouchListener"].EVENT_DOUBLE_TAP, autoSizeColListener_1);
_this.addDestroyFunc(function () {
_this.eResize.removeEventListener('dblclick', autoSizeColListener_1);
touchListener_1.removeEventListener(_widgets_touchListener__WEBPACK_IMPORTED_MODULE_10__["TouchListener"].EVENT_DOUBLE_TAP, autoSizeColListener_1);
touchListener_1.destroy();
});
}
};
var removeResize = function () {
destroyResizeFuncs.forEach(function (f) { return f(); });
destroyResizeFuncs.length = 0;
};
var refresh = function () {
var resize = _this.column.isResizable();
var autoSize = !_this.gridOptionsWrapper.isSuppressAutoSize() && !colDef.suppressAutoSize;
var propertyChange = resize !== canResize || autoSize !== canAutosize;
if (propertyChange) {
canResize = resize;
canAutosize = autoSize;
removeResize();
addResize();
}
};
refresh();
this.addDestroyFunc(removeResize);
this.refreshFunctions.push(refresh);
};
HeaderWrapperComp.prototype.onResizing = function (finished, resizeAmount) {
var resizeAmountNormalised = this.normaliseResizeAmount(resizeAmount);
var columnWidths = [{ key: this.column, newWidth: this.resizeStartWidth + resizeAmountNormalised }];
this.columnController.setColumnWidths(columnWidths, this.resizeWithShiftKey, finished, "uiColumnDragged");
if (finished) {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_13__["removeCssClass"])(this.getGui(), 'ag-column-resizing');
}
};
HeaderWrapperComp.prototype.onResizeStart = function (shiftKey) {
this.resizeStartWidth = this.column.getActualWidth();
this.resizeWithShiftKey = shiftKey;
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_13__["addCssClass"])(this.getGui(), 'ag-column-resizing');
};
HeaderWrapperComp.prototype.getTooltipParams = function () {
var res = _super.prototype.getTooltipParams.call(this);
res.location = 'header';
res.colDef = this.column.getColDef();
return res;
};
HeaderWrapperComp.prototype.setupTooltip = function () {
var _this = this;
var refresh = function () {
var newTooltipText = _this.column.getColDef().headerTooltip;
_this.setTooltip(newTooltipText);
};
refresh();
this.refreshFunctions.push(refresh);
};
HeaderWrapperComp.prototype.setupMovingCss = function () {
this.addManagedListener(this.column, _entities_column__WEBPACK_IMPORTED_MODULE_1__["Column"].EVENT_MOVING_CHANGED, this.onColumnMovingChanged.bind(this));
this.onColumnMovingChanged();
};
HeaderWrapperComp.prototype.addAttributes = function () {
this.getGui().setAttribute("col-id", this.column.getColId());
};
HeaderWrapperComp.prototype.setupWidth = function () {
this.addManagedListener(this.column, _entities_column__WEBPACK_IMPORTED_MODULE_1__["Column"].EVENT_WIDTH_CHANGED, this.onColumnWidthChanged.bind(this));
this.onColumnWidthChanged();
};
HeaderWrapperComp.prototype.setupMenuClass = function () {
this.addManagedListener(this.column, _entities_column__WEBPACK_IMPORTED_MODULE_1__["Column"].EVENT_MENU_VISIBLE_CHANGED, this.onMenuVisible.bind(this));
};
HeaderWrapperComp.prototype.onMenuVisible = function () {
this.addOrRemoveCssClass('ag-column-menu-visible', this.column.isMenuVisible());
};
HeaderWrapperComp.prototype.onColumnWidthChanged = function () {
this.getGui().style.width = this.column.getActualWidth() + 'px';
};
// optionally inverts the drag, depending on pinned and RTL
// note - this method is duplicated in RenderedHeaderGroupCell - should refactor out?
HeaderWrapperComp.prototype.normaliseResizeAmount = function (dragChange) {
var result = dragChange;
if (this.gridOptionsWrapper.isEnableRtl()) {
// for RTL, dragging left makes the col bigger, except when pinning left
if (this.pinned !== _constants_constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].PINNED_LEFT) {
result *= -1;
}
}
else {
// for LTR (ie normal), dragging left makes the col smaller, except when pinning right
if (this.pinned === _constants_constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].PINNED_RIGHT) {
result *= -1;
}
}
return result;
};
HeaderWrapperComp.TEMPLATE = "
\n \n \n
";
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('dragAndDropService')
], HeaderWrapperComp.prototype, "dragAndDropService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnController')
], HeaderWrapperComp.prototype, "columnController", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('horizontalResizeService')
], HeaderWrapperComp.prototype, "horizontalResizeService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('menuFactory')
], HeaderWrapperComp.prototype, "menuFactory", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridApi')
], HeaderWrapperComp.prototype, "gridApi", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnApi')
], HeaderWrapperComp.prototype, "columnApi", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('sortController')
], HeaderWrapperComp.prototype, "sortController", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('userComponentFactory')
], HeaderWrapperComp.prototype, "userComponentFactory", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnHoverService')
], HeaderWrapperComp.prototype, "columnHoverService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('beans')
], HeaderWrapperComp.prototype, "beans", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eResize')
], HeaderWrapperComp.prototype, "eResize", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('cbSelectAll')
], HeaderWrapperComp.prototype, "cbSelectAll", void 0);
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_0__["PreDestroy"]
], HeaderWrapperComp.prototype, "destroyHeaderComp", null);
return HeaderWrapperComp;
}(_abstractHeaderWrapper__WEBPACK_IMPORTED_MODULE_11__["AbstractHeaderWrapper"]));
/***/ }),
/* 113 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CssClassApplier", function() { return CssClassApplier; });
/* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7);
/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(42);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var CssClassApplier = /** @class */ (function () {
function CssClassApplier() {
}
CssClassApplier.addHeaderClassesFromColDef = function (abstractColDef, eHeaderCell, gridOptionsWrapper, column, columnGroup) {
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_0__["missing"])(abstractColDef)) {
return;
}
this.addColumnClassesFromCollDef(abstractColDef.headerClass, abstractColDef, eHeaderCell, gridOptionsWrapper, column, columnGroup);
};
CssClassApplier.addToolPanelClassesFromColDef = function (abstractColDef, eHeaderCell, gridOptionsWrapper, column, columnGroup) {
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_0__["missing"])(abstractColDef)) {
return;
}
this.addColumnClassesFromCollDef(abstractColDef.toolPanelClass, abstractColDef, eHeaderCell, gridOptionsWrapper, column, columnGroup);
};
CssClassApplier.addColumnClassesFromCollDef = function (classesOrFunc, abstractColDef, eHeaderCell, gridOptionsWrapper, column, columnGroup) {
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_0__["missing"])(classesOrFunc)) {
return;
}
var classToUse;
if (typeof classesOrFunc === 'function') {
var params = {
// bad naming, as colDef here can be a group or a column,
// however most people won't appreciate the difference,
// so keeping it as colDef to avoid confusion.
colDef: abstractColDef,
column: column,
columnGroup: columnGroup,
context: gridOptionsWrapper.getContext(),
api: gridOptionsWrapper.getApi()
};
var headerClassFunc = classesOrFunc;
classToUse = headerClassFunc(params);
}
else {
classToUse = classesOrFunc;
}
if (typeof classToUse === 'string') {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_1__["addCssClass"])(eHeaderCell, classToUse);
}
else if (Array.isArray(classToUse)) {
classToUse.forEach(function (cssClassItem) {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_1__["addCssClass"])(eHeaderCell, cssClassItem);
});
}
};
return CssClassApplier;
}());
/***/ }),
/* 114 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HoverFeature", function() { return HoverFeature; });
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20);
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 HoverFeature = /** @class */ (function (_super) {
__extends(HoverFeature, _super);
function HoverFeature(columns, element) {
var _this = _super.call(this) || this;
_this.columns = columns;
_this.element = element;
return _this;
}
HoverFeature.prototype.postConstruct = function () {
this.addMouseHoverListeners();
};
HoverFeature.prototype.addMouseHoverListeners = function () {
this.addManagedListener(this.element, 'mouseout', this.onMouseOut.bind(this));
this.addManagedListener(this.element, 'mouseover', this.onMouseOver.bind(this));
};
HoverFeature.prototype.onMouseOut = function () {
this.columnHoverService.clearMouseOver();
};
HoverFeature.prototype.onMouseOver = function () {
this.columnHoverService.setMouseOver(this.columns);
};
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('columnHoverService')
], HoverFeature.prototype, "columnHoverService", void 0);
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_1__["PostConstruct"]
], HoverFeature.prototype, "postConstruct", null);
return HoverFeature;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_0__["BeanStub"]));
/***/ }),
/* 115 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SetLeftFeature", function() { return SetLeftFeature; });
/* harmony import */ var _entities_column__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(10);
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20);
/* harmony import */ var _constants_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(16);
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(12);
/* harmony import */ var _utils_aria__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(44);
/* harmony import */ var _utils_array__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(14);
/* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 SetLeftFeature = /** @class */ (function (_super) {
__extends(SetLeftFeature, _super);
function SetLeftFeature(columnOrGroup, eCell, beans, colsSpanning) {
var _this = _super.call(this) || this;
_this.columnOrGroup = columnOrGroup;
_this.eCell = eCell;
_this.ariaEl = _this.eCell.querySelector('[role=columnheader]') || _this.eCell;
_this.colsSpanning = colsSpanning;
_this.beans = beans;
_this.printLayout = beans.gridOptionsWrapper.getDomLayout() === _constants_constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].DOM_LAYOUT_PRINT;
return _this;
}
SetLeftFeature.prototype.setColsSpanning = function (colsSpanning) {
this.colsSpanning = colsSpanning;
this.onLeftChanged();
};
SetLeftFeature.prototype.getColumnOrGroup = function () {
if (this.beans.gridOptionsWrapper.isEnableRtl() && this.colsSpanning) {
return Object(_utils_array__WEBPACK_IMPORTED_MODULE_5__["last"])(this.colsSpanning);
}
return this.columnOrGroup;
};
SetLeftFeature.prototype.postConstruct = function () {
this.addManagedListener(this.columnOrGroup, _entities_column__WEBPACK_IMPORTED_MODULE_0__["Column"].EVENT_LEFT_CHANGED, this.onLeftChanged.bind(this));
this.setLeftFirstTime();
};
SetLeftFeature.prototype.setLeftFirstTime = function () {
var suppressMoveAnimation = this.beans.gridOptionsWrapper.isSuppressColumnMoveAnimation();
var oldLeftExists = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_6__["exists"])(this.columnOrGroup.getOldLeft());
var animateColumnMove = this.beans.columnAnimationService.isActive() && oldLeftExists && !suppressMoveAnimation;
if (animateColumnMove) {
this.animateInLeft();
}
else {
this.onLeftChanged();
}
};
SetLeftFeature.prototype.animateInLeft = function () {
var _this = this;
var left = this.getColumnOrGroup().getLeft();
var oldLeft = this.getColumnOrGroup().getOldLeft();
this.setLeft(oldLeft);
// we must keep track of the left we want to set to, as this would otherwise lead to a race
// condition, if the user changed the left value many times in one VM turn, then we want to make
// make sure the actualLeft we set in the timeout below (in the next VM turn) is the correct left
// position. eg if user changes column position twice, then setLeft() below executes twice in next
// VM turn, but only one (the correct one) should get applied.
this.actualLeft = left;
this.beans.columnAnimationService.executeNextVMTurn(function () {
// test this left value is the latest one to be applied, and if not, do nothing
if (_this.actualLeft === left) {
_this.setLeft(left);
}
});
};
SetLeftFeature.prototype.onLeftChanged = function () {
var colOrGroup = this.getColumnOrGroup();
var left = colOrGroup.getLeft();
this.actualLeft = this.modifyLeftForPrintLayout(colOrGroup, left);
this.setLeft(this.actualLeft);
};
SetLeftFeature.prototype.modifyLeftForPrintLayout = function (colOrGroup, leftPosition) {
if (!this.printLayout) {
return leftPosition;
}
if (colOrGroup.getPinned() === _constants_constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_LEFT) {
return leftPosition;
}
if (colOrGroup.getPinned() === _constants_constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_RIGHT) {
var leftWidth_1 = this.beans.columnController.getPinnedLeftContainerWidth();
var bodyWidth = this.beans.columnController.getBodyContainerWidth();
return leftWidth_1 + bodyWidth + leftPosition;
}
// is in body
var leftWidth = this.beans.columnController.getPinnedLeftContainerWidth();
return leftWidth + leftPosition;
};
SetLeftFeature.prototype.setLeft = function (value) {
// if the value is null, then that means the column is no longer
// displayed. there is logic in the rendering to fade these columns
// out, so we don't try and change their left positions.
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_6__["exists"])(value)) {
this.eCell.style.left = value + "px";
}
var indexColumn;
if (this.columnOrGroup instanceof _entities_column__WEBPACK_IMPORTED_MODULE_0__["Column"]) {
indexColumn = this.columnOrGroup;
}
else {
var columnGroup = this.columnOrGroup;
var children = columnGroup.getLeafColumns();
if (!children.length) {
return;
}
if (children.length > 1) {
Object(_utils_aria__WEBPACK_IMPORTED_MODULE_4__["setAriaColSpan"])(this.ariaEl, children.length);
}
indexColumn = children[0];
}
var index = this.beans.columnController.getAriaColumnIndex(indexColumn);
Object(_utils_aria__WEBPACK_IMPORTED_MODULE_4__["setAriaColIndex"])(this.ariaEl, index);
};
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_3__["PostConstruct"]
], SetLeftFeature.prototype, "postConstruct", null);
return SetLeftFeature;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
/***/ }),
/* 116 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SelectAllFeature", function() { return SelectAllFeature; });
/* harmony import */ var _widgets_agCheckbox__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(117);
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20);
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12);
/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(23);
/* harmony import */ var _constants_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(16);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 SelectAllFeature = /** @class */ (function (_super) {
__extends(SelectAllFeature, _super);
function SelectAllFeature(cbSelectAll, column) {
var _this = _super.call(this) || this;
_this.cbSelectAllVisible = false;
_this.processingEventFromCheckbox = false;
_this.cbSelectAll = cbSelectAll;
_this.column = column;
var colDef = column.getColDef();
_this.filteredOnly = colDef ? !!colDef.headerCheckboxSelectionFilteredOnly : false;
return _this;
}
SelectAllFeature.prototype.postConstruct = function () {
this.showOrHideSelectAll();
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_NEW_COLUMNS_LOADED, this.showOrHideSelectAll.bind(this));
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_DISPLAYED_COLUMNS_CHANGED, this.showOrHideSelectAll.bind(this));
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_SELECTION_CHANGED, this.onSelectionChanged.bind(this));
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_MODEL_UPDATED, this.onModelChanged.bind(this));
this.addManagedListener(this.cbSelectAll, _widgets_agCheckbox__WEBPACK_IMPORTED_MODULE_0__["AgCheckbox"].EVENT_CHANGED, this.onCbSelectAll.bind(this));
this.cbSelectAll.getInputElement().setAttribute('tabindex', '-1');
this.refreshSelectAllLabel();
};
SelectAllFeature.prototype.showOrHideSelectAll = function () {
this.cbSelectAllVisible = this.isCheckboxSelection();
this.cbSelectAll.setDisplayed(this.cbSelectAllVisible);
if (this.cbSelectAllVisible) {
// in case user is trying this feature with the wrong model type
this.checkRightRowModelType();
// make sure checkbox is showing the right state
this.updateStateOfCheckbox();
}
};
SelectAllFeature.prototype.onModelChanged = function () {
if (!this.cbSelectAllVisible) {
return;
}
this.updateStateOfCheckbox();
};
SelectAllFeature.prototype.onSelectionChanged = function () {
if (!this.cbSelectAllVisible) {
return;
}
this.updateStateOfCheckbox();
};
SelectAllFeature.prototype.getNextCheckboxState = function (selectionCount) {
// if no rows, always have it unselected
if (selectionCount.selected === 0 && selectionCount.notSelected === 0) {
return false;
}
// if mix of selected and unselected, this is the tri-state
if (selectionCount.selected > 0 && selectionCount.notSelected > 0) {
return null;
}
// only selected
if (selectionCount.selected > 0) {
return true;
}
// nothing selected
return false;
};
SelectAllFeature.prototype.updateStateOfCheckbox = function () {
if (this.processingEventFromCheckbox) {
return;
}
this.processingEventFromCheckbox = true;
var selectionCount = this.getSelectionCount();
var allSelected = this.getNextCheckboxState(selectionCount);
this.cbSelectAll.setValue(allSelected);
this.refreshSelectAllLabel();
this.processingEventFromCheckbox = false;
};
SelectAllFeature.prototype.refreshSelectAllLabel = function () {
var translate = this.gridOptionsWrapper.getLocaleTextFunc();
var checked = this.cbSelectAll.getValue();
var ariaStatus = checked ? translate('ariaChecked', 'checked') : translate('ariaUnchecked', 'unchecked');
var ariaLabel = translate('ariaRowSelectAll', 'Press Space to toggle all rows selection');
this.cbSelectAll.setInputAriaLabel(ariaLabel + " (" + ariaStatus + ")");
};
SelectAllFeature.prototype.getSelectionCount = function () {
var _this = this;
var selectedCount = 0;
var notSelectedCount = 0;
var callback = function (node) {
if (_this.gridOptionsWrapper.isGroupSelectsChildren() && node.group) {
return;
}
if (node.isSelected()) {
selectedCount++;
}
else if (!node.selectable) {
// don't count non-selectable nodes!
}
else {
notSelectedCount++;
}
};
if (this.filteredOnly) {
this.gridApi.forEachNodeAfterFilter(callback);
}
else {
this.gridApi.forEachNode(callback);
}
return {
notSelected: notSelectedCount,
selected: selectedCount
};
};
SelectAllFeature.prototype.checkRightRowModelType = function () {
var rowModelType = this.rowModel.getType();
var rowModelMatches = rowModelType === _constants_constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].ROW_MODEL_TYPE_CLIENT_SIDE;
if (!rowModelMatches) {
console.warn("ag-Grid: selectAllCheckbox is only available if using normal row model, you are using " + rowModelType);
}
};
SelectAllFeature.prototype.onCbSelectAll = function () {
if (this.processingEventFromCheckbox) {
return;
}
if (!this.cbSelectAllVisible) {
return;
}
var value = this.cbSelectAll.getValue();
if (value) {
this.selectionController.selectAllRowNodes(this.filteredOnly);
}
else {
this.selectionController.deselectAllRowNodes(this.filteredOnly);
}
};
SelectAllFeature.prototype.isCheckboxSelection = function () {
var result = this.column.getColDef().headerCheckboxSelection;
if (typeof result === 'function') {
var func = result;
result = func({
column: this.column,
colDef: this.column.getColDef(),
columnApi: this.columnApi,
api: this.gridApi
});
}
if (result) {
if (this.gridOptionsWrapper.isRowModelServerSide()) {
console.warn('headerCheckboxSelection is not supported for Server Side Row Model');
return false;
}
if (this.gridOptionsWrapper.isRowModelInfinite()) {
console.warn('headerCheckboxSelection is not supported for Infinite Row Model');
return false;
}
if (this.gridOptionsWrapper.isRowModelViewport()) {
console.warn('headerCheckboxSelection is not supported for Viewport Row Model');
return false;
}
// otherwise the row model is compatible, so return true
return true;
}
return false;
};
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('gridApi')
], SelectAllFeature.prototype, "gridApi", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('columnApi')
], SelectAllFeature.prototype, "columnApi", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('rowModel')
], SelectAllFeature.prototype, "rowModel", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('selectionController')
], SelectAllFeature.prototype, "selectionController", void 0);
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_2__["PostConstruct"]
], SelectAllFeature.prototype, "postConstruct", null);
return SelectAllFeature;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
/***/ }),
/* 117 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgCheckbox", function() { return AgCheckbox; });
/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23);
/* harmony import */ var _agAbstractInputField__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(118);
/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(42);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var AgCheckbox = /** @class */ (function (_super) {
__extends(AgCheckbox, _super);
function AgCheckbox(config, className, inputType) {
if (className === void 0) { className = 'ag-checkbox'; }
if (inputType === void 0) { inputType = 'checkbox'; }
var _this = _super.call(this, config, className, inputType) || this;
_this.labelAlignment = 'right';
_this.selected = false;
_this.readOnly = false;
_this.passive = false;
return _this;
}
AgCheckbox.prototype.addInputListeners = function () {
this.addManagedListener(this.eInput, 'click', this.onCheckboxClick.bind(this));
this.addManagedListener(this.eLabel, 'click', this.toggle.bind(this));
};
AgCheckbox.prototype.getNextValue = function () {
return this.selected === undefined ? true : !this.selected;
};
AgCheckbox.prototype.setPassive = function (passive) {
this.passive = passive;
};
AgCheckbox.prototype.isReadOnly = function () {
return this.readOnly;
};
AgCheckbox.prototype.setReadOnly = function (readOnly) {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_2__["addOrRemoveCssClass"])(this.eWrapper, 'ag-disabled', readOnly);
this.eInput.disabled = readOnly;
this.readOnly = readOnly;
};
AgCheckbox.prototype.setDisabled = function (disabled) {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_2__["addOrRemoveCssClass"])(this.eWrapper, 'ag-disabled', disabled);
return _super.prototype.setDisabled.call(this, disabled);
};
AgCheckbox.prototype.toggle = function () {
var previousValue = this.isSelected();
var nextValue = this.getNextValue();
if (this.passive) {
this.dispatchChange(nextValue, previousValue);
}
else {
this.setValue(nextValue);
}
};
AgCheckbox.prototype.getValue = function () {
return this.isSelected();
};
AgCheckbox.prototype.setValue = function (value, silent) {
this.refreshSelectedClass(value);
this.setSelected(value, silent);
return this;
};
AgCheckbox.prototype.setName = function (name) {
var input = this.getInputElement();
input.name = name;
return this;
};
AgCheckbox.prototype.isSelected = function () {
return this.selected;
};
AgCheckbox.prototype.setSelected = function (selected, silent) {
if (this.isSelected() === selected) {
return;
}
this.previousValue = this.isSelected();
selected = this.selected = typeof selected === 'boolean' ? selected : undefined;
this.eInput.checked = selected;
this.eInput.indeterminate = selected === undefined;
if (!silent) {
this.dispatchChange(this.selected, this.previousValue);
}
};
AgCheckbox.prototype.dispatchChange = function (selected, previousValue, event) {
this.dispatchEvent({ type: AgCheckbox.EVENT_CHANGED, selected: selected, previousValue: previousValue, event: event });
var input = this.getInputElement();
var checkboxChangedEvent = {
type: _events__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_CHECKBOX_CHANGED,
id: input.id,
name: input.name,
selected: selected,
previousValue: previousValue
};
this.eventService.dispatchEvent(checkboxChangedEvent);
};
AgCheckbox.prototype.onCheckboxClick = function (e) {
if (this.passive) {
return;
}
var previousValue = this.isSelected();
var selected = this.selected = e.target.checked;
this.refreshSelectedClass(selected);
this.dispatchChange(selected, previousValue, e);
};
AgCheckbox.prototype.refreshSelectedClass = function (value) {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_2__["addOrRemoveCssClass"])(this.eWrapper, 'ag-checked', value === true);
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_2__["addOrRemoveCssClass"])(this.eWrapper, 'ag-indeterminate', value == null);
};
return AgCheckbox;
}(_agAbstractInputField__WEBPACK_IMPORTED_MODULE_1__["AgAbstractInputField"]));
/***/ }),
/* 118 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgAbstractInputField", function() { return AgAbstractInputField; });
/* harmony import */ var _componentAnnotations__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57);
/* harmony import */ var _agAbstractField__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(119);
/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(42);
/* harmony import */ var _utils_aria__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(44);
/* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 AgAbstractInputField = /** @class */ (function (_super) {
__extends(AgAbstractInputField, _super);
function AgAbstractInputField(config, className, inputType, displayFieldTag) {
if (inputType === void 0) { inputType = 'text'; }
if (displayFieldTag === void 0) { displayFieldTag = 'input'; }
var _this = _super.call(this, config, /* html */ "\n
", className) || this;
_this.inputType = inputType;
_this.displayFieldTag = displayFieldTag;
return _this;
}
AgAbstractInputField.prototype.postConstruct = function () {
_super.prototype.postConstruct.call(this);
this.setInputType();
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_2__["addCssClass"])(this.eLabel, this.className + "-label");
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_2__["addCssClass"])(this.eWrapper, this.className + "-input-wrapper");
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_2__["addCssClass"])(this.eInput, this.className + "-input");
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_2__["addCssClass"])(this.getGui(), 'ag-input-field');
this.eInput.id = this.eInput.id || "ag-" + this.getCompId() + "-input";
var _a = this.config, width = _a.width, value = _a.value;
if (width != null) {
this.setWidth(width);
}
if (value != null) {
this.setValue(value);
}
this.addInputListeners();
};
AgAbstractInputField.prototype.refreshLabel = function () {
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_4__["exists"])(this.getLabel())) {
Object(_utils_aria__WEBPACK_IMPORTED_MODULE_3__["setAriaLabelledBy"])(this.eInput, this.getLabelId());
}
else {
this.eInput.removeAttribute('aria-labelledby');
}
_super.prototype.refreshLabel.call(this);
};
AgAbstractInputField.prototype.addInputListeners = function () {
var _this = this;
this.addManagedListener(this.eInput, 'input', function (e) { return _this.setValue(e.target.value); });
};
AgAbstractInputField.prototype.setInputType = function () {
if (this.displayFieldTag === 'input') {
this.eInput.setAttribute('type', this.inputType);
}
};
AgAbstractInputField.prototype.getInputElement = function () {
return this.eInput;
};
AgAbstractInputField.prototype.setInputWidth = function (width) {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_2__["setElementWidth"])(this.eWrapper, width);
return this;
};
AgAbstractInputField.prototype.setInputName = function (name) {
this.getInputElement().setAttribute('name', name);
return this;
};
AgAbstractInputField.prototype.getFocusableElement = function () {
return this.eInput;
};
AgAbstractInputField.prototype.setMaxLength = function (length) {
var eInput = this.eInput;
eInput.maxLength = length;
return this;
};
AgAbstractInputField.prototype.setInputPlaceholder = function (placeholder) {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_2__["addOrRemoveAttribute"])(this.eInput, 'placeholder', placeholder);
return this;
};
AgAbstractInputField.prototype.setInputAriaLabel = function (label) {
Object(_utils_aria__WEBPACK_IMPORTED_MODULE_3__["setAriaLabel"])(this.eInput, label);
return this;
};
AgAbstractInputField.prototype.setDisabled = function (disabled) {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_2__["setDisabled"])(this.eInput, disabled);
return _super.prototype.setDisabled.call(this, disabled);
};
__decorate([
Object(_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__["RefSelector"])('eLabel')
], AgAbstractInputField.prototype, "eLabel", void 0);
__decorate([
Object(_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__["RefSelector"])('eWrapper')
], AgAbstractInputField.prototype, "eWrapper", void 0);
__decorate([
Object(_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__["RefSelector"])('eInput')
], AgAbstractInputField.prototype, "eInput", void 0);
return AgAbstractInputField;
}(_agAbstractField__WEBPACK_IMPORTED_MODULE_1__["AgAbstractField"]));
/***/ }),
/* 119 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgAbstractField", function() { return AgAbstractField; });
/* harmony import */ var _agAbstractLabel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(120);
/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(42);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var AgAbstractField = /** @class */ (function (_super) {
__extends(AgAbstractField, _super);
function AgAbstractField(config, template, className) {
var _this = _super.call(this, config, template) || this;
_this.className = className;
_this.disabled = false;
return _this;
}
AgAbstractField.prototype.postConstruct = function () {
_super.prototype.postConstruct.call(this);
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_1__["addCssClass"])(this.getGui(), this.className);
};
AgAbstractField.prototype.onValueChange = function (callbackFn) {
var _this = this;
this.addManagedListener(this, AgAbstractField.EVENT_CHANGED, function () { return callbackFn(_this.getValue()); });
return this;
};
AgAbstractField.prototype.getWidth = function () {
return this.getGui().clientWidth;
};
AgAbstractField.prototype.setWidth = function (width) {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_1__["setFixedWidth"])(this.getGui(), width);
return this;
};
AgAbstractField.prototype.getPreviousValue = function () {
return this.previousValue;
};
AgAbstractField.prototype.getValue = function () {
return this.value;
};
AgAbstractField.prototype.setValue = function (value, silent) {
if (this.value === value) {
return this;
}
this.previousValue = this.value;
this.value = value;
if (!silent) {
this.dispatchEvent({ type: AgAbstractField.EVENT_CHANGED });
}
return this;
};
AgAbstractField.prototype.setDisabled = function (disabled) {
disabled = !!disabled;
var element = this.getGui();
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_1__["setDisabled"])(element, disabled);
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_1__["addOrRemoveCssClass"])(element, 'ag-disabled', disabled);
this.disabled = disabled;
return this;
};
AgAbstractField.prototype.isDisabled = function () {
return !!this.disabled;
};
AgAbstractField.EVENT_CHANGED = 'valueChange';
return AgAbstractField;
}(_agAbstractLabel__WEBPACK_IMPORTED_MODULE_0__["AgAbstractLabel"]));
/***/ }),
/* 120 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgAbstractLabel", function() { return AgAbstractLabel; });
/* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(36);
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12);
/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(42);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 AgAbstractLabel = /** @class */ (function (_super) {
__extends(AgAbstractLabel, _super);
function AgAbstractLabel(config, template) {
var _this = _super.call(this, template) || this;
_this.labelSeparator = '';
_this.labelAlignment = 'left';
_this.label = '';
_this.config = config || {};
return _this;
}
AgAbstractLabel.prototype.postConstruct = function () {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_2__["addCssClass"])(this.getGui(), 'ag-labeled');
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_2__["addCssClass"])(this.eLabel, 'ag-label');
var _a = this.config, labelSeparator = _a.labelSeparator, label = _a.label, labelWidth = _a.labelWidth, labelAlignment = _a.labelAlignment;
if (labelSeparator != null) {
this.setLabelSeparator(labelSeparator);
}
if (label != null) {
this.setLabel(label);
}
if (labelWidth != null) {
this.setLabelWidth(labelWidth);
}
this.setLabelAlignment(labelAlignment || this.labelAlignment);
this.refreshLabel();
};
AgAbstractLabel.prototype.refreshLabel = function () {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_2__["clearElement"])(this.eLabel);
if (typeof this.label === 'string') {
this.eLabel.innerText = this.label + this.labelSeparator;
}
else {
this.eLabel.appendChild(this.label);
}
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_2__["addOrRemoveCssClass"])(this.eLabel, 'ag-hidden', this.label === '');
};
AgAbstractLabel.prototype.setLabelSeparator = function (labelSeparator) {
if (this.labelSeparator === labelSeparator) {
return this;
}
this.labelSeparator = labelSeparator;
if (this.label != null) {
this.refreshLabel();
}
return this;
};
AgAbstractLabel.prototype.getLabelId = function () {
this.eLabel.id = this.eLabel.id || "ag-" + this.getCompId() + "-label";
return this.eLabel.id;
};
AgAbstractLabel.prototype.getLabel = function () {
return this.label;
};
AgAbstractLabel.prototype.setLabel = function (label) {
if (this.label === label) {
return this;
}
this.label = label;
this.refreshLabel();
return this;
};
AgAbstractLabel.prototype.setLabelAlignment = function (alignment) {
var eGui = this.getGui();
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_2__["addOrRemoveCssClass"])(eGui, 'ag-label-align-left', alignment === 'left');
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_2__["addOrRemoveCssClass"])(eGui, 'ag-label-align-right', alignment === 'right');
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_2__["addOrRemoveCssClass"])(eGui, 'ag-label-align-top', alignment === 'top');
return this;
};
AgAbstractLabel.prototype.setLabelWidth = function (width) {
if (this.label == null) {
return this;
}
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_2__["setElementWidth"])(this.eLabel, width);
return this;
};
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_1__["PostConstruct"]
], AgAbstractLabel.prototype, "postConstruct", null);
return AgAbstractLabel;
}(_component__WEBPACK_IMPORTED_MODULE_0__["Component"]));
/***/ }),
/* 121 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AbstractHeaderWrapper", function() { return AbstractHeaderWrapper; });
/* harmony import */ var _widgets_managedFocusComponent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(65);
/* harmony import */ var _utils_keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(48);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var AbstractHeaderWrapper = /** @class */ (function (_super) {
__extends(AbstractHeaderWrapper, _super);
function AbstractHeaderWrapper() {
return _super !== null && _super.apply(this, arguments) || this;
}
AbstractHeaderWrapper.prototype.shouldStopEventPropagation = function (e) {
var _a = this.focusController.getFocusedHeader(), headerRowIndex = _a.headerRowIndex, column = _a.column;
return Object(_utils_keyboard__WEBPACK_IMPORTED_MODULE_1__["isUserSuppressingHeaderKeyboardEvent"])(this.gridOptionsWrapper, e, headerRowIndex, column);
};
AbstractHeaderWrapper.prototype.getColumn = function () {
return this.column;
};
AbstractHeaderWrapper.prototype.getPinned = function () {
return this.pinned;
};
return AbstractHeaderWrapper;
}(_widgets_managedFocusComponent__WEBPACK_IMPORTED_MODULE_0__["ManagedFocusComponent"]));
/***/ }),
/* 122 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HeaderGroupWrapperComp", function() { return HeaderGroupWrapperComp; });
/* harmony import */ var _entities_column__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(10);
/* harmony import */ var _entities_columnGroup__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9);
/* harmony import */ var _constants_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(16);
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(12);
/* harmony import */ var _cssClassApplier__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(113);
/* harmony import */ var _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(105);
/* harmony import */ var _rendering_features_setLeftFeature__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(115);
/* harmony import */ var _hoverFeature__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(114);
/* harmony import */ var _header_abstractHeaderWrapper__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(121);
/* harmony import */ var _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(8);
/* harmony import */ var _utils_aria__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(44);
/* harmony import */ var _utils_array__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(14);
/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(42);
/* harmony import */ var _constants_keyCode__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(58);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 HeaderGroupWrapperComp = /** @class */ (function (_super) {
__extends(HeaderGroupWrapperComp, _super);
function HeaderGroupWrapperComp(columnGroup, pinned) {
var _this = _super.call(this, HeaderGroupWrapperComp.TEMPLATE) || this;
// the children can change, we keep destroy functions related to listening to the children here
_this.removeChildListenersFuncs = [];
_this.column = columnGroup;
_this.pinned = pinned;
return _this;
}
HeaderGroupWrapperComp.prototype.postConstruct = function () {
_super.prototype.postConstruct.call(this);
_cssClassApplier__WEBPACK_IMPORTED_MODULE_4__["CssClassApplier"].addHeaderClassesFromColDef(this.getComponentHolder(), this.getGui(), this.gridOptionsWrapper, null, this.column);
var displayName = this.columnController.getDisplayNameForColumnGroup(this.column, 'header');
this.appendHeaderGroupComp(displayName);
this.setupResize();
this.addClasses();
this.setupWidth();
this.addAttributes();
this.setupMovingCss();
this.setupTooltip();
this.setupExpandable();
this.createManagedBean(new _hoverFeature__WEBPACK_IMPORTED_MODULE_7__["HoverFeature"](this.column.getOriginalColumnGroup().getLeafColumns(), this.getGui()));
this.createManagedBean(new _rendering_features_setLeftFeature__WEBPACK_IMPORTED_MODULE_6__["SetLeftFeature"](this.column, this.getGui(), this.beans));
};
HeaderGroupWrapperComp.prototype.onFocusIn = function (e) {
if (!this.getGui().contains(e.relatedTarget)) {
var headerRow = this.getParentComponent();
this.beans.focusController.setFocusedHeader(headerRow.getRowIndex(), this.getColumn());
}
};
HeaderGroupWrapperComp.prototype.handleKeyDown = function (e) {
var activeEl = document.activeElement;
var eGui = this.getGui();
var wrapperHasFocus = activeEl === eGui;
if (!this.expandable || !wrapperHasFocus) {
return;
}
if (e.keyCode === _constants_keyCode__WEBPACK_IMPORTED_MODULE_13__["KeyCode"].ENTER) {
var column = this.getColumn();
var newExpandedValue = !column.isExpanded();
this.columnController.setColumnGroupOpened(column.getOriginalColumnGroup(), newExpandedValue, "uiColumnExpanded");
}
};
HeaderGroupWrapperComp.prototype.onTabKeyDown = function () { };
HeaderGroupWrapperComp.prototype.setupExpandable = function () {
var column = this.getColumn();
var originalColumnGroup = column.getOriginalColumnGroup();
this.refreshExpanded();
this.addManagedListener(originalColumnGroup, _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_9__["OriginalColumnGroup"].EVENT_EXPANDABLE_CHANGED, this.refreshExpanded.bind(this));
this.addManagedListener(originalColumnGroup, _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_9__["OriginalColumnGroup"].EVENT_EXPANDED_CHANGED, this.refreshExpanded.bind(this));
};
HeaderGroupWrapperComp.prototype.refreshExpanded = function () {
var column = this.getColumn();
var eGui = this.getGui();
var expandable = column.isExpandable();
var expanded = column.isExpanded();
this.expandable = expandable;
if (!expandable) {
eGui.removeAttribute('aria-expanded');
}
else {
Object(_utils_aria__WEBPACK_IMPORTED_MODULE_10__["setAriaExpanded"])(eGui, expanded);
}
};
HeaderGroupWrapperComp.prototype.setupMovingCss = function () {
var _this = this;
var originalColumnGroup = this.column.getOriginalColumnGroup();
var leafColumns = originalColumnGroup.getLeafColumns();
leafColumns.forEach(function (col) {
_this.addManagedListener(col, _entities_column__WEBPACK_IMPORTED_MODULE_0__["Column"].EVENT_MOVING_CHANGED, _this.onColumnMovingChanged.bind(_this));
});
this.onColumnMovingChanged();
};
HeaderGroupWrapperComp.prototype.getComponentHolder = function () {
return this.column.getColGroupDef();
};
HeaderGroupWrapperComp.prototype.getTooltipParams = function () {
var res = _super.prototype.getTooltipParams.call(this);
res.location = 'headerGroup';
// this is wrong, but leaving it as i don't want to change code,
// but the ColumnGroup does not have a ColDef or a Column (although it does have GroupDef and ColumnGroup)
res.colDef = this.getComponentHolder();
res.column = this.getColumn();
return res;
};
HeaderGroupWrapperComp.prototype.setupTooltip = function () {
var colGroupDef = this.getComponentHolder();
var tooltipText = colGroupDef && colGroupDef.headerTooltip;
if (tooltipText != null) {
this.setTooltip(tooltipText);
}
};
HeaderGroupWrapperComp.prototype.onColumnMovingChanged = function () {
// this function adds or removes the moving css, based on if the col is moving.
// this is what makes the header go dark when it is been moved (gives impression to
// user that the column was picked up).
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_12__["addOrRemoveCssClass"])(this.getGui(), 'ag-header-cell-moving', this.column.isMoving());
};
HeaderGroupWrapperComp.prototype.addAttributes = function () {
this.getGui().setAttribute("col-id", this.column.getUniqueId());
};
HeaderGroupWrapperComp.prototype.appendHeaderGroupComp = function (displayName) {
var _this = this;
var params = {
displayName: displayName,
columnGroup: this.column,
setExpanded: function (expanded) {
_this.columnController.setColumnGroupOpened(_this.column.getOriginalColumnGroup(), expanded, "gridInitializing");
},
api: this.gridApi,
columnApi: this.columnApi,
context: this.gridOptionsWrapper.getContext()
};
if (!displayName) {
var columnGroup = this.column;
var leafCols = columnGroup.getLeafColumns();
// find the top most column group that represents the same columns. so if we are dragging a group, we also
// want to visually show the parent groups dragging for the same column set. for example imaging 5 levels
// of grouping, with each group only containing the next group, and the last group containing three columns,
// then when you move any group (even the lowest level group) you are in-fact moving all the groups, as all
// the groups represent the same column set.
while (columnGroup.getParent() && columnGroup.getParent().getLeafColumns().length === leafCols.length) {
columnGroup = columnGroup.getParent();
}
var colGroupDef = columnGroup.getColGroupDef();
if (colGroupDef) {
displayName = colGroupDef.headerName;
}
if (!displayName) {
displayName = leafCols ? this.columnController.getDisplayNameForColumn(leafCols[0], 'header', true) : '';
}
}
var callback = this.afterHeaderCompCreated.bind(this, displayName);
this.userComponentFactory.newHeaderGroupComponent(params).then(callback);
};
HeaderGroupWrapperComp.prototype.afterHeaderCompCreated = function (displayName, headerGroupComp) {
var _this = this;
this.getGui().appendChild(headerGroupComp.getGui());
this.addDestroyFunc(function () {
_this.getContext().destroyBean(headerGroupComp);
});
this.setupMove(headerGroupComp.getGui(), displayName);
};
HeaderGroupWrapperComp.prototype.addClasses = function () {
// having different classes below allows the style to not have a bottom border
// on the group header, if no group is specified
// columnGroup.getColGroupDef
var style = this.column.isPadding() ? 'no' : 'with';
this.addCssClass("ag-header-group-cell-" + style + "-group");
};
HeaderGroupWrapperComp.prototype.setupMove = function (eHeaderGroup, displayName) {
var _this = this;
if (!eHeaderGroup) {
return;
}
if (this.isSuppressMoving()) {
return;
}
var allLeafColumns = this.column.getOriginalColumnGroup().getLeafColumns();
var dragSource = {
type: _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_5__["DragSourceType"].HeaderCell,
eElement: eHeaderGroup,
defaultIconName: _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_5__["DragAndDropService"].ICON_HIDE,
dragItemName: displayName,
// we add in the original group leaf columns, so we move both visible and non-visible items
getDragItem: this.getDragItemForGroup.bind(this),
onDragStarted: function () { return allLeafColumns.forEach(function (col) { return col.setMoving(true, "uiColumnDragged"); }); },
onDragStopped: function () { return allLeafColumns.forEach(function (col) { return col.setMoving(false, "uiColumnDragged"); }); }
};
this.dragAndDropService.addDragSource(dragSource, true);
this.addDestroyFunc(function () { return _this.dragAndDropService.removeDragSource(dragSource); });
};
// when moving the columns, we want to move all the columns (contained within the DragItem) in this group in one go,
// and in the order they are currently in the screen.
HeaderGroupWrapperComp.prototype.getDragItemForGroup = function () {
var allColumnsOriginalOrder = this.column.getOriginalColumnGroup().getLeafColumns();
// capture visible state, used when re-entering grid to dictate which columns should be visible
var visibleState = {};
allColumnsOriginalOrder.forEach(function (column) { return visibleState[column.getId()] = column.isVisible(); });
var allColumnsCurrentOrder = [];
this.columnController.getAllDisplayedColumns().forEach(function (column) {
if (allColumnsOriginalOrder.indexOf(column) >= 0) {
allColumnsCurrentOrder.push(column);
Object(_utils_array__WEBPACK_IMPORTED_MODULE_11__["removeFromArray"])(allColumnsOriginalOrder, column);
}
});
// we are left with non-visible columns, stick these in at the end
allColumnsOriginalOrder.forEach(function (column) { return allColumnsCurrentOrder.push(column); });
// create and return dragItem
return {
columns: allColumnsCurrentOrder,
visibleState: visibleState
};
};
HeaderGroupWrapperComp.prototype.isSuppressMoving = function () {
// if any child is fixed, then don't allow moving
var childSuppressesMoving = false;
this.column.getLeafColumns().forEach(function (column) {
if (column.getColDef().suppressMovable || column.getColDef().lockPosition) {
childSuppressesMoving = true;
}
});
var result = childSuppressesMoving || this.gridOptionsWrapper.isSuppressMovableColumns();
return result;
};
HeaderGroupWrapperComp.prototype.setupWidth = function () {
// we need to listen to changes in child columns, as they impact our width
this.addListenersToChildrenColumns();
// the children belonging to this group can change, so we need to add and remove listeners as they change
this.addManagedListener(this.column, _entities_columnGroup__WEBPACK_IMPORTED_MODULE_1__["ColumnGroup"].EVENT_DISPLAYED_CHILDREN_CHANGED, this.onDisplayedChildrenChanged.bind(this));
this.onWidthChanged();
// the child listeners are not tied to this components life-cycle, as children can get added and removed
// to the group - hence they are on a different life-cycle. so we must make sure the existing children
// listeners are removed when we finally get destroyed
this.addDestroyFunc(this.removeListenersOnChildrenColumns.bind(this));
};
HeaderGroupWrapperComp.prototype.onDisplayedChildrenChanged = function () {
this.addListenersToChildrenColumns();
this.onWidthChanged();
};
HeaderGroupWrapperComp.prototype.addListenersToChildrenColumns = function () {
var _this = this;
// first destroy any old listeners
this.removeListenersOnChildrenColumns();
// now add new listeners to the new set of children
var widthChangedListener = this.onWidthChanged.bind(this);
this.column.getLeafColumns().forEach(function (column) {
column.addEventListener(_entities_column__WEBPACK_IMPORTED_MODULE_0__["Column"].EVENT_WIDTH_CHANGED, widthChangedListener);
column.addEventListener(_entities_column__WEBPACK_IMPORTED_MODULE_0__["Column"].EVENT_VISIBLE_CHANGED, widthChangedListener);
_this.removeChildListenersFuncs.push(function () {
column.removeEventListener(_entities_column__WEBPACK_IMPORTED_MODULE_0__["Column"].EVENT_WIDTH_CHANGED, widthChangedListener);
column.removeEventListener(_entities_column__WEBPACK_IMPORTED_MODULE_0__["Column"].EVENT_VISIBLE_CHANGED, widthChangedListener);
});
});
};
HeaderGroupWrapperComp.prototype.removeListenersOnChildrenColumns = function () {
this.removeChildListenersFuncs.forEach(function (func) { return func(); });
this.removeChildListenersFuncs = [];
};
HeaderGroupWrapperComp.prototype.onWidthChanged = function () {
this.getGui().style.width = this.column.getActualWidth() + 'px';
};
HeaderGroupWrapperComp.prototype.setupResize = function () {
var _this = this;
this.eHeaderCellResize = this.getRefElement('agResize');
if (!this.column.isResizable()) {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_12__["removeFromParent"])(this.eHeaderCellResize);
return;
}
var finishedWithResizeFunc = this.horizontalResizeService.addResizeBar({
eResizeBar: this.eHeaderCellResize,
onResizeStart: this.onResizeStart.bind(this),
onResizing: this.onResizing.bind(this, false),
onResizeEnd: this.onResizing.bind(this, true)
});
this.addDestroyFunc(finishedWithResizeFunc);
if (!this.gridOptionsWrapper.isSuppressAutoSize()) {
var skipHeaderOnAutoSize_1 = this.gridOptionsWrapper.isSkipHeaderOnAutoSize();
this.eHeaderCellResize.addEventListener('dblclick', function (event) {
// get list of all the column keys we are responsible for
var keys = [];
_this.column.getDisplayedLeafColumns().forEach(function (column) {
// not all cols in the group may be participating with auto-resize
if (!column.getColDef().suppressAutoSize) {
keys.push(column.getColId());
}
});
if (keys.length > 0) {
_this.columnController.autoSizeColumns(keys, skipHeaderOnAutoSize_1, "uiColumnResized");
}
});
}
};
HeaderGroupWrapperComp.prototype.onResizeStart = function (shiftKey) {
var _this = this;
var leafCols = this.column.getDisplayedLeafColumns();
this.resizeCols = leafCols.filter(function (col) { return col.isResizable(); });
this.resizeStartWidth = 0;
this.resizeCols.forEach(function (col) { return _this.resizeStartWidth += col.getActualWidth(); });
this.resizeRatios = [];
this.resizeCols.forEach(function (col) { return _this.resizeRatios.push(col.getActualWidth() / _this.resizeStartWidth); });
var takeFromGroup = null;
if (shiftKey) {
takeFromGroup = this.columnController.getDisplayedGroupAfter(this.column);
}
if (takeFromGroup) {
var takeFromLeafCols = takeFromGroup.getDisplayedLeafColumns();
this.resizeTakeFromCols = takeFromLeafCols.filter(function (col) { return col.isResizable(); });
this.resizeTakeFromStartWidth = 0;
this.resizeTakeFromCols.forEach(function (col) { return _this.resizeTakeFromStartWidth += col.getActualWidth(); });
this.resizeTakeFromRatios = [];
this.resizeTakeFromCols.forEach(function (col) { return _this.resizeTakeFromRatios.push(col.getActualWidth() / _this.resizeTakeFromStartWidth); });
}
else {
this.resizeTakeFromCols = null;
this.resizeTakeFromStartWidth = null;
this.resizeTakeFromRatios = null;
}
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_12__["addCssClass"])(this.getGui(), 'ag-column-resizing');
};
HeaderGroupWrapperComp.prototype.onResizing = function (finished, resizeAmount) {
var resizeSets = [];
var resizeAmountNormalised = this.normaliseDragChange(resizeAmount);
resizeSets.push({
columns: this.resizeCols,
ratios: this.resizeRatios,
width: this.resizeStartWidth + resizeAmountNormalised
});
if (this.resizeTakeFromCols) {
resizeSets.push({
columns: this.resizeTakeFromCols,
ratios: this.resizeTakeFromRatios,
width: this.resizeTakeFromStartWidth - resizeAmountNormalised
});
}
this.columnController.resizeColumnSets(resizeSets, finished, 'uiColumnDragged');
if (finished) {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_12__["removeCssClass"])(this.getGui(), 'ag-column-resizing');
}
};
// optionally inverts the drag, depending on pinned and RTL
// note - this method is duplicated in RenderedHeaderCell - should refactor out?
HeaderGroupWrapperComp.prototype.normaliseDragChange = function (dragChange) {
var result = dragChange;
if (this.gridOptionsWrapper.isEnableRtl()) {
// for RTL, dragging left makes the col bigger, except when pinning left
if (this.pinned !== _constants_constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_LEFT) {
result *= -1;
}
}
else if (this.pinned === _constants_constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_RIGHT) {
// for LTR (ie normal), dragging left makes the col smaller, except when pinning right
result *= -1;
}
return result;
};
HeaderGroupWrapperComp.TEMPLATE = "
\n \n
";
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_3__["Autowired"])('columnController')
], HeaderGroupWrapperComp.prototype, "columnController", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_3__["Autowired"])('horizontalResizeService')
], HeaderGroupWrapperComp.prototype, "horizontalResizeService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_3__["Autowired"])('dragAndDropService')
], HeaderGroupWrapperComp.prototype, "dragAndDropService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_3__["Autowired"])('userComponentFactory')
], HeaderGroupWrapperComp.prototype, "userComponentFactory", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_3__["Autowired"])('beans')
], HeaderGroupWrapperComp.prototype, "beans", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_3__["Autowired"])('gridApi')
], HeaderGroupWrapperComp.prototype, "gridApi", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_3__["Autowired"])('columnApi')
], HeaderGroupWrapperComp.prototype, "columnApi", void 0);
return HeaderGroupWrapperComp;
}(_header_abstractHeaderWrapper__WEBPACK_IMPORTED_MODULE_8__["AbstractHeaderWrapper"]));
/***/ }),
/* 123 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FloatingFilterWrapper", function() { return FloatingFilterWrapper; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _entities_column__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(10);
/* harmony import */ var _rendering_features_setLeftFeature__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(115);
/* harmony import */ var _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(57);
/* harmony import */ var _headerRendering_hoverFeature__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(114);
/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(23);
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(37);
/* harmony import */ var _provided_readOnlyFloatingFilter__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(124);
/* harmony import */ var _modules_moduleNames__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(17);
/* harmony import */ var _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(18);
/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(42);
/* harmony import */ var _utils_icon__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(47);
/* harmony import */ var _headerRendering_header_abstractHeaderWrapper__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(121);
/* harmony import */ var _floatingFilterMapper__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(125);
/* harmony import */ var _constants_keyCode__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(58);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 FloatingFilterWrapper = /** @class */ (function (_super) {
__extends(FloatingFilterWrapper, _super);
function FloatingFilterWrapper(column, pinned) {
var _this = _super.call(this, FloatingFilterWrapper.TEMPLATE) || this;
_this.column = column;
_this.pinned = pinned;
return _this;
}
FloatingFilterWrapper.prototype.postConstruct = function () {
_super.prototype.postConstruct.call(this);
this.setupFloatingFilter();
this.setupWidth();
this.setupLeftPositioning();
this.setupColumnHover();
this.createManagedBean(new _headerRendering_hoverFeature__WEBPACK_IMPORTED_MODULE_4__["HoverFeature"]([this.column], this.getGui()));
this.addManagedListener(this.eButtonShowMainFilter, 'click', this.showParentFilter.bind(this));
};
FloatingFilterWrapper.prototype.onTabKeyDown = function (e) {
var activeEl = document.activeElement;
var eGui = this.getGui();
var wrapperHasFocus = activeEl === eGui;
if (wrapperHasFocus) {
return;
}
e.preventDefault();
var nextFocusableEl = this.focusController.findNextFocusableElement(eGui, null, e.shiftKey);
if (nextFocusableEl) {
nextFocusableEl.focus();
}
else {
eGui.focus();
}
};
FloatingFilterWrapper.prototype.handleKeyDown = function (e) {
var activeEl = document.activeElement;
var eGui = this.getGui();
var wrapperHasFocus = activeEl === eGui;
switch (e.keyCode) {
case _constants_keyCode__WEBPACK_IMPORTED_MODULE_14__["KeyCode"].UP:
case _constants_keyCode__WEBPACK_IMPORTED_MODULE_14__["KeyCode"].DOWN:
if (!wrapperHasFocus) {
e.preventDefault();
}
case _constants_keyCode__WEBPACK_IMPORTED_MODULE_14__["KeyCode"].LEFT:
case _constants_keyCode__WEBPACK_IMPORTED_MODULE_14__["KeyCode"].RIGHT:
if (wrapperHasFocus) {
return;
}
e.stopPropagation();
case _constants_keyCode__WEBPACK_IMPORTED_MODULE_14__["KeyCode"].ENTER:
if (wrapperHasFocus) {
if (this.focusController.focusInto(eGui)) {
e.preventDefault();
}
}
break;
case _constants_keyCode__WEBPACK_IMPORTED_MODULE_14__["KeyCode"].ESCAPE:
if (!wrapperHasFocus) {
this.getGui().focus();
}
}
};
FloatingFilterWrapper.prototype.onFocusIn = function (e) {
var eGui = this.getGui();
if (!eGui.contains(e.relatedTarget)) {
var headerRow = this.getParentComponent();
this.beans.focusController.setFocusedHeader(headerRow.getRowIndex(), this.getColumn());
}
};
FloatingFilterWrapper.prototype.setupFloatingFilter = function () {
var _this = this;
var colDef = this.column.getColDef();
if (!colDef.filter || !colDef.floatingFilter) {
return;
}
this.floatingFilterCompPromise = this.getFloatingFilterInstance();
if (!this.floatingFilterCompPromise) {
return;
}
this.floatingFilterCompPromise.then(function (compInstance) {
if (compInstance) {
_this.setupWithFloatingFilter(compInstance);
_this.setupSyncWithFilter();
}
});
};
FloatingFilterWrapper.prototype.setupLeftPositioning = function () {
var setLeftFeature = new _rendering_features_setLeftFeature__WEBPACK_IMPORTED_MODULE_2__["SetLeftFeature"](this.column, this.getGui(), this.beans);
this.createManagedBean(setLeftFeature);
};
FloatingFilterWrapper.prototype.setupSyncWithFilter = function () {
var _this = this;
var syncWithFilter = function (filterChangedEvent) {
_this.onParentModelChanged(_this.currentParentModel(), filterChangedEvent);
};
this.addManagedListener(this.column, _entities_column__WEBPACK_IMPORTED_MODULE_1__["Column"].EVENT_FILTER_CHANGED, syncWithFilter);
if (this.filterManager.isFilterActive(this.column)) {
syncWithFilter(null);
}
};
// linked to event listener in template
FloatingFilterWrapper.prototype.showParentFilter = function () {
var eventSource = this.suppressFilterButton ? this.eFloatingFilterBody : this.eButtonShowMainFilter;
this.menuFactory.showMenuAfterButtonClick(this.column, eventSource, 'filterMenuTab', ['filterMenuTab']);
};
FloatingFilterWrapper.prototype.setupColumnHover = function () {
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_5__["Events"].EVENT_COLUMN_HOVER_CHANGED, this.onColumnHover.bind(this));
this.onColumnHover();
};
FloatingFilterWrapper.prototype.onColumnHover = function () {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_10__["addOrRemoveCssClass"])(this.getGui(), 'ag-column-hover', this.columnHoverService.isHovered(this.column));
};
FloatingFilterWrapper.prototype.setupWidth = function () {
this.addManagedListener(this.column, _entities_column__WEBPACK_IMPORTED_MODULE_1__["Column"].EVENT_WIDTH_CHANGED, this.onColumnWidthChanged.bind(this));
this.onColumnWidthChanged();
};
FloatingFilterWrapper.prototype.onColumnWidthChanged = function () {
this.getGui().style.width = this.column.getActualWidth() + "px";
};
FloatingFilterWrapper.prototype.setupWithFloatingFilter = function (floatingFilterComp) {
var _this = this;
var disposeFunc = function () {
_this.getContext().destroyBean(floatingFilterComp);
};
if (!this.isAlive()) {
disposeFunc();
return;
}
this.addDestroyFunc(disposeFunc);
var floatingFilterCompUi = floatingFilterComp.getGui();
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_10__["addOrRemoveCssClass"])(this.eFloatingFilterBody, 'ag-floating-filter-full-body', this.suppressFilterButton);
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_10__["addOrRemoveCssClass"])(this.eFloatingFilterBody, 'ag-floating-filter-body', !this.suppressFilterButton);
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_10__["setDisplayed"])(this.eButtonWrapper, !this.suppressFilterButton);
var eIcon = Object(_utils_icon__WEBPACK_IMPORTED_MODULE_11__["createIconNoSpan"])('filter', this.gridOptionsWrapper, this.column);
this.eButtonShowMainFilter.appendChild(eIcon);
this.eFloatingFilterBody.appendChild(floatingFilterCompUi);
if (floatingFilterComp.afterGuiAttached) {
floatingFilterComp.afterGuiAttached();
}
};
FloatingFilterWrapper.prototype.parentFilterInstance = function (callback) {
this.getFilterComponent().then(callback);
};
FloatingFilterWrapper.prototype.getFilterComponent = function (createIfDoesNotExist) {
if (createIfDoesNotExist === void 0) { createIfDoesNotExist = true; }
return this.filterManager.getFilterComponent(this.column, 'NO_UI', createIfDoesNotExist);
};
FloatingFilterWrapper.getDefaultFloatingFilterType = function (def) {
if (def == null) {
return null;
}
var defaultFloatingFilterType = null;
if (typeof def.filter === 'string') {
// will be undefined if not in the map
defaultFloatingFilterType = _floatingFilterMapper__WEBPACK_IMPORTED_MODULE_13__["FloatingFilterMapper"].getFloatingFilterType(def.filter);
}
else if (def.filterFramework) {
// If filterFramework, then grid is NOT using one of the provided filters, hence no default.
// Note: We could combine this with another part of the 'if' statement, however explicitly
// having this section makes the code easier to read.
}
else if (def.filter === true) {
var setFilterModuleLoaded = _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_9__["ModuleRegistry"].isRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_8__["ModuleNames"].SetFilterModule);
defaultFloatingFilterType = setFilterModuleLoaded ? 'agSetColumnFloatingFilter' : 'agTextColumnFloatingFilter';
}
return defaultFloatingFilterType;
};
FloatingFilterWrapper.prototype.getFloatingFilterInstance = function () {
var colDef = this.column.getColDef();
var defaultFloatingFilterType = FloatingFilterWrapper.getDefaultFloatingFilterType(colDef);
var filterParams = this.filterManager.createFilterParams(this.column, colDef);
var finalFilterParams = this.userComponentFactory.createFinalParams(colDef, 'filter', filterParams);
var params = {
api: this.gridApi,
column: this.column,
filterParams: finalFilterParams,
currentParentModel: this.currentParentModel.bind(this),
parentFilterInstance: this.parentFilterInstance.bind(this),
showParentFilter: this.showParentFilter.bind(this),
onFloatingFilterChanged: this.onFloatingFilterChanged.bind(this),
suppressFilterButton: false // This one might be overridden from the colDef
};
// this is unusual - we need a params value OUTSIDE the component the params are for.
// the params are for the floating filter component, but this property is actually for the wrapper.
this.suppressFilterButton = colDef.floatingFilterComponentParams ? !!colDef.floatingFilterComponentParams.suppressFilterButton : false;
var promise = this.userComponentFactory.newFloatingFilterComponent(colDef, params, defaultFloatingFilterType);
if (!promise) {
var filterComponent = this.getFilterComponentPrototype(colDef);
var getModelAsStringExists = filterComponent && filterComponent.prototype && filterComponent.prototype.getModelAsString;
if (getModelAsStringExists) {
var compInstance = this.userComponentFactory.createUserComponentFromConcreteClass(_provided_readOnlyFloatingFilter__WEBPACK_IMPORTED_MODULE_7__["ReadOnlyFloatingFilter"], params);
promise = _utils__WEBPACK_IMPORTED_MODULE_6__["AgPromise"].resolve(compInstance);
}
}
return promise;
};
FloatingFilterWrapper.prototype.createDynamicParams = function () {
return {
column: this.column,
colDef: this.column.getColDef(),
api: this.gridApi,
columnApi: this.columnApi
};
};
FloatingFilterWrapper.prototype.getFilterComponentPrototype = function (colDef) {
var resolvedComponent = this.userComponentFactory.lookupComponentClassDef(colDef, 'filter', this.createDynamicParams());
return resolvedComponent ? resolvedComponent.component : null;
};
FloatingFilterWrapper.prototype.currentParentModel = function () {
var filterComponent = this.getFilterComponent(false);
return filterComponent ? filterComponent.resolveNow(null, function (filter) { return filter.getModel(); }) : null;
};
FloatingFilterWrapper.prototype.onParentModelChanged = function (model, filterChangedEvent) {
if (!this.floatingFilterCompPromise) {
return;
}
this.floatingFilterCompPromise.then(function (comp) { return comp.onParentModelChanged(model, filterChangedEvent); });
};
FloatingFilterWrapper.prototype.onFloatingFilterChanged = function () {
console.warn('ag-Grid: since version 21.x, how floating filters are implemented has changed. ' +
'Instead of calling params.onFloatingFilterChanged(), get a reference to the main filter via ' +
'params.parentFilterInstance() and then set a value on the parent filter directly.');
};
FloatingFilterWrapper.TEMPLATE = "
\n \n
\n \n
\n
";
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnHoverService')
], FloatingFilterWrapper.prototype, "columnHoverService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('userComponentFactory')
], FloatingFilterWrapper.prototype, "userComponentFactory", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridApi')
], FloatingFilterWrapper.prototype, "gridApi", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnApi')
], FloatingFilterWrapper.prototype, "columnApi", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('filterManager')
], FloatingFilterWrapper.prototype, "filterManager", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('menuFactory')
], FloatingFilterWrapper.prototype, "menuFactory", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('beans')
], FloatingFilterWrapper.prototype, "beans", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_3__["RefSelector"])('eFloatingFilterBody')
], FloatingFilterWrapper.prototype, "eFloatingFilterBody", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_3__["RefSelector"])('eButtonWrapper')
], FloatingFilterWrapper.prototype, "eButtonWrapper", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_3__["RefSelector"])('eButtonShowMainFilter')
], FloatingFilterWrapper.prototype, "eButtonShowMainFilter", void 0);
return FloatingFilterWrapper;
}(_headerRendering_header_abstractHeaderWrapper__WEBPACK_IMPORTED_MODULE_12__["AbstractHeaderWrapper"]));
/***/ }),
/* 124 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReadOnlyFloatingFilter", function() { return ReadOnlyFloatingFilter; });
/* harmony import */ var _widgets_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(36);
/* harmony import */ var _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(57);
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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;
};
// optional floating filter for user provided filters - instead of providing a floating filter,
// they can provide a getModelAsString() method on the filter instead. this class just displays
// the string returned from getModelAsString()
var ReadOnlyFloatingFilter = /** @class */ (function (_super) {
__extends(ReadOnlyFloatingFilter, _super);
function ReadOnlyFloatingFilter() {
return _super.call(this, /* html */ "\n
\n \n
") || this;
}
// this is a user component, and IComponent has "public destroy()" as part of the interface.
// so we need to override destroy() just to make the method public.
ReadOnlyFloatingFilter.prototype.destroy = function () {
_super.prototype.destroy.call(this);
};
ReadOnlyFloatingFilter.prototype.init = function (params) {
this.params = params;
var displayName = this.columnController.getDisplayNameForColumn(params.column, 'header', true);
var translate = this.gridOptionsWrapper.getLocaleTextFunc();
this.eFloatingFilterText
.setDisabled(true)
.setInputAriaLabel(displayName + " " + translate('ariaFilterInput', 'Filter Input'));
};
ReadOnlyFloatingFilter.prototype.onParentModelChanged = function (parentModel) {
var _this = this;
if (!parentModel) {
this.eFloatingFilterText.setValue('');
return;
}
this.params.parentFilterInstance(function (filterInstance) {
// getModelAsString should be present, as we check this
// in floatingFilterWrapper
if (filterInstance.getModelAsString) {
var modelAsString = filterInstance.getModelAsString(parentModel);
_this.eFloatingFilterText.setValue(modelAsString);
}
});
};
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_1__["RefSelector"])('eFloatingFilterText')
], ReadOnlyFloatingFilter.prototype, "eFloatingFilterText", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('columnController')
], ReadOnlyFloatingFilter.prototype, "columnController", void 0);
return ReadOnlyFloatingFilter;
}(_widgets_component__WEBPACK_IMPORTED_MODULE_0__["Component"]));
/***/ }),
/* 125 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FloatingFilterMapper", function() { return FloatingFilterMapper; });
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var FloatingFilterMapper = /** @class */ (function () {
function FloatingFilterMapper() {
}
FloatingFilterMapper.getFloatingFilterType = function (filterType) {
return this.filterToFloatingFilterMapping[filterType];
};
FloatingFilterMapper.filterToFloatingFilterMapping = {
set: 'agSetColumnFloatingFilter',
agSetColumnFilter: 'agSetColumnFloatingFilter',
multi: 'agMultiColumnFloatingFilter',
agMultiColumnFilter: 'agMultiColumnFloatingFilter',
number: 'agNumberColumnFloatingFilter',
agNumberColumnFilter: 'agNumberColumnFloatingFilter',
date: 'agDateColumnFloatingFilter',
agDateColumnFilter: 'agDateColumnFloatingFilter',
text: 'agTextColumnFloatingFilter',
agTextColumnFilter: 'agTextColumnFloatingFilter'
};
return FloatingFilterMapper;
}());
/***/ }),
/* 126 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BodyDropTarget", function() { return BodyDropTarget; });
/* harmony import */ var _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(105);
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12);
/* harmony import */ var _moveColumnController__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(127);
/* harmony import */ var _bodyDropPivotTarget__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(128);
/* harmony import */ var _constants_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(16);
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(20);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 DropType;
(function (DropType) {
DropType[DropType["ColumnMove"] = 0] = "ColumnMove";
DropType[DropType["Pivot"] = 1] = "Pivot";
})(DropType || (DropType = {}));
var BodyDropTarget = /** @class */ (function (_super) {
__extends(BodyDropTarget, _super);
function BodyDropTarget(pinned, eContainer) {
var _this = _super.call(this) || this;
_this.dropListeners = {};
_this.pinned = pinned;
_this.eContainer = eContainer;
return _this;
}
BodyDropTarget.prototype.registerGridComp = function (gridPanel) {
this.gridPanel = gridPanel;
this.moveColumnController.registerGridComp(gridPanel);
switch (this.pinned) {
case _constants_constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].PINNED_LEFT:
this.eSecondaryContainers = this.gridPanel.getDropTargetLeftContainers();
break;
case _constants_constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].PINNED_RIGHT:
this.eSecondaryContainers = this.gridPanel.getDropTargetRightContainers();
break;
default:
this.eSecondaryContainers = this.gridPanel.getDropTargetBodyContainers();
break;
}
};
BodyDropTarget.prototype.isInterestedIn = function (type) {
return type === _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_0__["DragSourceType"].HeaderCell ||
(type === _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_0__["DragSourceType"].ToolPanel && this.gridOptionsWrapper.isAllowDragFromColumnsToolPanel());
};
BodyDropTarget.prototype.getSecondaryContainers = function () {
return this.eSecondaryContainers;
};
BodyDropTarget.prototype.getContainer = function () {
return this.eContainer;
};
BodyDropTarget.prototype.init = function () {
this.moveColumnController = this.createBean(new _moveColumnController__WEBPACK_IMPORTED_MODULE_2__["MoveColumnController"](this.pinned, this.eContainer));
var bodyDropPivotTarget = new _bodyDropPivotTarget__WEBPACK_IMPORTED_MODULE_3__["BodyDropPivotTarget"](this.pinned);
this.createBean(bodyDropPivotTarget);
this.dropListeners[DropType.ColumnMove] = this.moveColumnController;
this.dropListeners[DropType.Pivot] = bodyDropPivotTarget;
this.dragAndDropService.addDropTarget(this);
};
BodyDropTarget.prototype.getIconName = function () {
return this.currentDropListener.getIconName();
};
// we want to use the bodyPivotTarget if the user is dragging columns in from the toolPanel
// and we are in pivot mode, as it has to logic to set pivot/value/group on the columns when
// dropped into the grid's body.
BodyDropTarget.prototype.getDropType = function (draggingEvent) {
if (this.columnController.isPivotMode()) {
// in pivot mode, then if moving a column (ie didn't come from toolpanel) then it's
// a standard column move, however if it came from the toolpanel, then we are introducing
// dimensions or values to the grid
if (draggingEvent.dragSource.type === _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_0__["DragSourceType"].ToolPanel) {
return DropType.Pivot;
}
return DropType.ColumnMove;
}
// it's a column, and not pivot mode, so always moving
return DropType.ColumnMove;
};
BodyDropTarget.prototype.onDragEnter = function (draggingEvent) {
// we pick the drop listener depending on whether we are in pivot mode are not. if we are
// in pivot mode, then dropping cols changes the row group, pivot, value stats. otherwise
// we change visibility state and position.
// if (this.columnController.isPivotMode()) {
var dropType = this.getDropType(draggingEvent);
this.currentDropListener = this.dropListeners[dropType];
this.currentDropListener.onDragEnter(draggingEvent);
};
BodyDropTarget.prototype.onDragLeave = function (params) {
this.currentDropListener.onDragLeave(params);
};
BodyDropTarget.prototype.onDragging = function (params) {
this.currentDropListener.onDragging(params);
};
BodyDropTarget.prototype.onDragStop = function (params) {
this.currentDropListener.onDragStop(params);
};
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('dragAndDropService')
], BodyDropTarget.prototype, "dragAndDropService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('columnController')
], BodyDropTarget.prototype, "columnController", void 0);
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_1__["PostConstruct"]
], BodyDropTarget.prototype, "init", null);
return BodyDropTarget;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_5__["BeanStub"]));
/***/ }),
/* 127 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MoveColumnController", function() { return MoveColumnController; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _constants_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16);
/* harmony import */ var _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(105);
/* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7);
/* harmony import */ var _utils_array__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(14);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (undefined && undefined.__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 MoveColumnController = /** @class */ (function () {
function MoveColumnController(pinned, eContainer) {
this.needToMoveLeft = false;
this.needToMoveRight = false;
this.pinned = pinned;
this.eContainer = eContainer;
this.centerContainer = !Object(_utils_generic__WEBPACK_IMPORTED_MODULE_3__["exists"])(pinned);
}
MoveColumnController.prototype.registerGridComp = function (gridPanel) {
this.gridPanel = gridPanel;
};
MoveColumnController.prototype.init = function () {
this.logger = this.loggerFactory.create('MoveColumnController');
};
MoveColumnController.prototype.getIconName = function () {
return this.pinned ? _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_2__["DragAndDropService"].ICON_PINNED : _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_2__["DragAndDropService"].ICON_MOVE;
};
MoveColumnController.prototype.onDragEnter = function (draggingEvent) {
// we do dummy drag, so make sure column appears in the right location when first placed
var columns = draggingEvent.dragItem.columns;
var dragCameFromToolPanel = draggingEvent.dragSource.type === _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_2__["DragSourceType"].ToolPanel;
if (dragCameFromToolPanel) {
// the if statement doesn't work if drag leaves grid, then enters again
this.setColumnsVisible(columns, true, "uiColumnDragged");
}
else {
// restore previous state of visible columns upon re-entering. this means if the user drags
// a group out, and then drags the group back in, only columns that were originally visible
// will be visible again. otherwise a group with three columns (but only two visible) could
// be dragged out, then when it's dragged in again, all three are visible. this stops that.
var visibleState_1 = draggingEvent.dragItem.visibleState;
var visibleColumns = columns.filter(function (column) { return visibleState_1[column.getId()]; });
this.setColumnsVisible(visibleColumns, true, "uiColumnDragged");
}
this.setColumnsPinned(columns, this.pinned, "uiColumnDragged");
this.onDragging(draggingEvent, true);
};
MoveColumnController.prototype.onDragLeave = function (draggingEvent) {
var hideColumnOnExit = !this.gridOptionsWrapper.isSuppressDragLeaveHidesColumns() && !draggingEvent.fromNudge;
if (hideColumnOnExit) {
var dragItem = draggingEvent.dragSource.getDragItem();
var columns = dragItem.columns;
this.setColumnsVisible(columns, false, "uiColumnDragged");
}
this.ensureIntervalCleared();
};
MoveColumnController.prototype.setColumnsVisible = function (columns, visible, source) {
if (source === void 0) { source = "api"; }
if (columns) {
var allowedCols = columns.filter(function (c) { return !c.getColDef().lockVisible; });
this.columnController.setColumnsVisible(allowedCols, visible, source);
}
};
MoveColumnController.prototype.setColumnsPinned = function (columns, pinned, source) {
if (source === void 0) { source = "api"; }
if (columns) {
var allowedCols = columns.filter(function (c) { return !c.getColDef().lockPinned; });
this.columnController.setColumnsPinned(allowedCols, pinned, source);
}
};
MoveColumnController.prototype.onDragStop = function () {
this.ensureIntervalCleared();
};
MoveColumnController.prototype.normaliseX = function (x) {
// flip the coordinate if doing RTL
if (this.gridOptionsWrapper.isEnableRtl()) {
var clientWidth = this.eContainer.clientWidth;
x = clientWidth - x;
}
// adjust for scroll only if centre container (the pinned containers don't scroll)
if (this.centerContainer) {
x += this.gridPanel.getCenterViewportScrollLeft();
}
return x;
};
MoveColumnController.prototype.checkCenterForScrolling = function (xAdjustedForScroll) {
if (this.centerContainer) {
// scroll if the mouse has gone outside the grid (or just outside the scrollable part if pinning)
// putting in 50 buffer, so even if user gets to edge of grid, a scroll will happen
var firstVisiblePixel = this.gridPanel.getCenterViewportScrollLeft();
var lastVisiblePixel = firstVisiblePixel + this.gridPanel.getCenterWidth();
if (this.gridOptionsWrapper.isEnableRtl()) {
this.needToMoveRight = xAdjustedForScroll < (firstVisiblePixel + 50);
this.needToMoveLeft = xAdjustedForScroll > (lastVisiblePixel - 50);
}
else {
this.needToMoveLeft = xAdjustedForScroll < (firstVisiblePixel + 50);
this.needToMoveRight = xAdjustedForScroll > (lastVisiblePixel - 50);
}
if (this.needToMoveLeft || this.needToMoveRight) {
this.ensureIntervalStarted();
}
else {
this.ensureIntervalCleared();
}
}
};
MoveColumnController.prototype.onDragging = function (draggingEvent, fromEnter) {
var _this = this;
if (fromEnter === void 0) { fromEnter = false; }
this.lastDraggingEvent = draggingEvent;
// if moving up or down (ie not left or right) then do nothing
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_3__["missing"])(draggingEvent.hDirection)) {
return;
}
var mouseXNormalised = this.normaliseX(draggingEvent.x);
// if the user is dragging into the panel, ie coming from the side panel into the main grid,
// we don't want to scroll the grid this time, it would appear like the table is jumping
// each time a column is dragged in.
if (!fromEnter) {
this.checkCenterForScrolling(mouseXNormalised);
}
var hDirectionNormalised = this.normaliseDirection(draggingEvent.hDirection);
var dragSourceType = draggingEvent.dragSource.type;
var columnsToMove = draggingEvent.dragSource.getDragItem().columns;
columnsToMove = columnsToMove.filter(function (col) {
if (col.getColDef().lockPinned) {
// if locked return true only if both col and container are same pin type.
// double equals (==) here on purpose so that null==undefined is true (for not pinned options)
return col.getPinned() == _this.pinned;
}
else {
// if not pin locked, then always allowed to be in this container
return true;
}
});
this.attemptMoveColumns(dragSourceType, columnsToMove, hDirectionNormalised, mouseXNormalised, fromEnter);
};
MoveColumnController.prototype.normaliseDirection = function (hDirection) {
if (this.gridOptionsWrapper.isEnableRtl()) {
switch (hDirection) {
case _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_2__["HorizontalDirection"].Left: return _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_2__["HorizontalDirection"].Right;
case _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_2__["HorizontalDirection"].Right: return _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_2__["HorizontalDirection"].Left;
default: console.error("ag-Grid: Unknown direction " + hDirection);
}
}
else {
return hDirection;
}
};
// returns the index of the first column in the list ONLY if the cols are all beside
// each other. if the cols are not beside each other, then returns null
MoveColumnController.prototype.calculateOldIndex = function (movingCols) {
var gridCols = this.columnController.getAllGridColumns();
var indexes = Object(_utils_array__WEBPACK_IMPORTED_MODULE_4__["sortNumerically"])(movingCols.map(function (col) { return gridCols.indexOf(col); }));
var firstIndex = indexes[0];
var lastIndex = Object(_utils_array__WEBPACK_IMPORTED_MODULE_4__["last"])(indexes);
var spread = lastIndex - firstIndex;
var gapsExist = spread !== indexes.length - 1;
return gapsExist ? null : firstIndex;
};
MoveColumnController.prototype.attemptMoveColumns = function (dragSourceType, allMovingColumns, hDirection, mouseX, fromEnter) {
var draggingLeft = hDirection === _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_2__["HorizontalDirection"].Left;
var draggingRight = hDirection === _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_2__["HorizontalDirection"].Right;
// it is important to sort the moving columns as they are in grid columns, as the list of moving columns
// could themselves be part of 'married children' groups, which means we need to maintain the order within
// the moving list.
var allMovingColumnsOrdered = allMovingColumns.slice();
this.columnController.sortColumnsLikeGridColumns(allMovingColumnsOrdered);
var validMoves = this.calculateValidMoves(allMovingColumnsOrdered, draggingRight, mouseX);
// if cols are not adjacent, then this returns null. when moving, we constrain the direction of the move
// (ie left or right) to the mouse direction. however
var oldIndex = this.calculateOldIndex(allMovingColumnsOrdered);
if (validMoves.length === 0) {
return;
}
var firstValidMove = validMoves[0];
// the two check below stop an error when the user grabs a group my a middle column, then
// it is possible the mouse pointer is to the right of a column while been dragged left.
// so we need to make sure that the mouse pointer is actually left of the left most column
// if moving left, and right of the right most column if moving right
// we check 'fromEnter' below so we move the column to the new spot if the mouse is coming from
// outside the grid, eg if the column is moving from side panel, mouse is moving left, then we should
// place the column to the RHS even if the mouse is moving left and the column is already on
// the LHS. otherwise we stick to the rule described above.
var constrainDirection = oldIndex !== null && !fromEnter;
// don't consider 'fromEnter' when dragging header cells, otherwise group can jump to opposite direction of drag
if (dragSourceType == _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_2__["DragSourceType"].HeaderCell) {
constrainDirection = oldIndex !== null;
}
if (constrainDirection) {
// only allow left drag if this column is moving left
if (draggingLeft && firstValidMove >= oldIndex) {
return;
}
// only allow right drag if this column is moving right
if (draggingRight && firstValidMove <= oldIndex) {
return;
}
}
for (var i = 0; i < validMoves.length; i++) {
var move = validMoves[i];
if (!this.columnController.doesMovePassRules(allMovingColumnsOrdered, move)) {
continue;
}
this.columnController.moveColumns(allMovingColumnsOrdered, move, "uiColumnDragged");
// important to return here, so once we do the first valid move, we don't try do any more
return;
}
};
MoveColumnController.prototype.calculateValidMoves = function (movingCols, draggingRight, mouseX) {
var isMoveBlocked = this.gridOptionsWrapper.isSuppressMovableColumns() || movingCols.some(function (col) { return col.getColDef().suppressMovable; });
if (isMoveBlocked) {
return [];
}
// this is the list of cols on the screen, so it's these we use when comparing the x mouse position
var allDisplayedCols = this.columnController.getDisplayedColumns(this.pinned);
// but this list is the list of all cols, when we move a col it's the index within this list that gets used,
// so the result we return has to be and index location for this list
var allGridCols = this.columnController.getAllGridColumns();
var movingDisplayedCols = allDisplayedCols.filter(function (col) { return Object(_utils_array__WEBPACK_IMPORTED_MODULE_4__["includes"])(movingCols, col); });
var otherDisplayedCols = allDisplayedCols.filter(function (col) { return !Object(_utils_array__WEBPACK_IMPORTED_MODULE_4__["includes"])(movingCols, col); });
var otherGridCols = allGridCols.filter(function (col) { return !Object(_utils_array__WEBPACK_IMPORTED_MODULE_4__["includes"])(movingCols, col); });
// work out how many DISPLAYED columns fit before the 'x' position. this gives us the displayIndex.
// for example, if cols are a,b,c,d and we find a,b fit before 'x', then we want to place the moving
// col between b and c (so that it is under the mouse position).
var displayIndex = 0;
var availableWidth = mouseX;
// if we are dragging right, then the columns will be to the left of the mouse, so we also want to
// include the width of the moving columns
if (draggingRight) {
var widthOfMovingDisplayedCols_1 = 0;
movingDisplayedCols.forEach(function (col) { return widthOfMovingDisplayedCols_1 += col.getActualWidth(); });
availableWidth -= widthOfMovingDisplayedCols_1;
}
if (availableWidth > 0) {
// now count how many of the displayed columns will fit to the left
for (var i = 0; i < otherDisplayedCols.length; i++) {
var col = otherDisplayedCols[i];
availableWidth -= col.getActualWidth();
if (availableWidth < 0) {
break;
}
displayIndex++;
}
// trial and error, if going right, we adjust by one, i didn't manage to quantify why, but it works
if (draggingRight) {
displayIndex++;
}
}
// the display index is with respect to all the showing columns, however when we move, it's with
// respect to all grid columns, so we need to translate from display index to grid index
var firstValidMove;
if (displayIndex > 0) {
var leftColumn = otherDisplayedCols[displayIndex - 1];
firstValidMove = otherGridCols.indexOf(leftColumn) + 1;
}
else {
firstValidMove = otherGridCols.indexOf(otherDisplayedCols[0]);
if (firstValidMove === -1) {
firstValidMove = 0;
}
}
var validMoves = [firstValidMove];
var numberComparator = function (a, b) { return a - b; };
// add in other valid moves due to hidden columns and married children. for example, a particular
// move might break a group that has married children (so move isn't valid), however there could
// be hidden columns (not displayed) that we could jump over to make the move valid. because
// they are hidden, user doesn't see any different, however it allows moves that would otherwise
// not work. for example imagine a group with 9 columns and all columns are hidden except the
// middle one (so 4 hidden to left, 4 hidden to right), then when moving 'firstValidMove' will
// be relative to the not-shown column, however we need to consider the move jumping over all the
// hidden children. if we didn't do this, then if the group just described was at the end (RHS) of the
// grid, there would be no way to put a column after it (as the grid would only consider beside the
// visible column, which would fail valid move rules).
if (draggingRight) {
// if dragging right, then we add all the additional moves to the right. so in other words
// if the next move is not valid, find the next move to the right that is valid.
var pointer = firstValidMove + 1;
var lastIndex = allGridCols.length - 1;
while (pointer <= lastIndex) {
validMoves.push(pointer);
pointer++;
}
// adding columns here means the order is now messed up
validMoves.sort(numberComparator);
}
else {
// if dragging left we do the reverse of dragging right, we add in all the valid moves to the
// left. however we also have to consider moves to the right for all hidden columns first.
// (this logic is hard to reason with, it was worked out with trial and error,
// more observation rather than science).
// add moves to the right
var pointer = firstValidMove;
var lastIndex = allGridCols.length - 1;
var displacedCol = allGridCols[pointer];
while (pointer <= lastIndex && this.isColumnHidden(allDisplayedCols, displacedCol)) {
pointer++;
validMoves.push(pointer);
displacedCol = allGridCols[pointer];
}
// add moves to the left
pointer = firstValidMove - 1;
var firstDisplayIndex = 0;
while (pointer >= firstDisplayIndex) {
validMoves.push(pointer);
pointer--;
}
// adding columns here means the order is now messed up
validMoves.sort(numberComparator).reverse();
}
return validMoves;
};
// isHidden takes into account visible=false and group=closed, ie it is not displayed
MoveColumnController.prototype.isColumnHidden = function (displayedColumns, col) {
return displayedColumns.indexOf(col) < 0;
};
MoveColumnController.prototype.ensureIntervalStarted = function () {
if (!this.movingIntervalId) {
this.intervalCount = 0;
this.failedMoveAttempts = 0;
this.movingIntervalId = window.setInterval(this.moveInterval.bind(this), 100);
if (this.needToMoveLeft) {
this.dragAndDropService.setGhostIcon(_dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_2__["DragAndDropService"].ICON_LEFT, true);
}
else {
this.dragAndDropService.setGhostIcon(_dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_2__["DragAndDropService"].ICON_RIGHT, true);
}
}
};
MoveColumnController.prototype.ensureIntervalCleared = function () {
if (this.moveInterval) {
window.clearInterval(this.movingIntervalId);
this.movingIntervalId = null;
this.dragAndDropService.setGhostIcon(_dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_2__["DragAndDropService"].ICON_MOVE);
}
};
MoveColumnController.prototype.moveInterval = function () {
// the amounts we move get bigger at each interval, so the speed accelerates, starting a bit slow
// and getting faster. this is to give smoother user experience. we max at 100px to limit the speed.
var pixelsToMove;
this.intervalCount++;
pixelsToMove = 10 + (this.intervalCount * 5);
if (pixelsToMove > 100) {
pixelsToMove = 100;
}
var pixelsMoved;
if (this.needToMoveLeft) {
pixelsMoved = this.gridPanel.scrollHorizontally(-pixelsToMove);
}
else if (this.needToMoveRight) {
pixelsMoved = this.gridPanel.scrollHorizontally(pixelsToMove);
}
if (pixelsMoved !== 0) {
this.onDragging(this.lastDraggingEvent);
this.failedMoveAttempts = 0;
}
else {
// we count the failed move attempts. if we fail to move 7 times, then we pin the column.
// this is how we achieve pining by dragging the column to the edge of the grid.
this.failedMoveAttempts++;
var columns = this.lastDraggingEvent.dragItem.columns;
var columnsThatCanPin = columns.filter(function (c) { return !c.getColDef().lockPinned; });
if (columnsThatCanPin.length > 0) {
this.dragAndDropService.setGhostIcon(_dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_2__["DragAndDropService"].ICON_PINNED);
if (this.failedMoveAttempts > 7) {
var pinType = this.needToMoveLeft ? _constants_constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].PINNED_LEFT : _constants_constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].PINNED_RIGHT;
this.setColumnsPinned(columnsThatCanPin, pinType, "uiColumnDragged");
this.dragAndDropService.nudge();
}
}
}
};
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('loggerFactory')
], MoveColumnController.prototype, "loggerFactory", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnController')
], MoveColumnController.prototype, "columnController", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('dragAndDropService')
], MoveColumnController.prototype, "dragAndDropService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
], MoveColumnController.prototype, "gridOptionsWrapper", void 0);
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_0__["PostConstruct"]
], MoveColumnController.prototype, "init", null);
return MoveColumnController;
}());
/***/ }),
/* 128 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BodyDropPivotTarget", function() { return BodyDropPivotTarget; });
/* harmony import */ var _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(105);
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (undefined && undefined.__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 BodyDropPivotTarget = /** @class */ (function () {
function BodyDropPivotTarget(pinned) {
this.columnsToAggregate = [];
this.columnsToGroup = [];
this.columnsToPivot = [];
this.pinned = pinned;
}
/** Callback for when drag enters */
BodyDropPivotTarget.prototype.onDragEnter = function (draggingEvent) {
var _this = this;
this.clearColumnsList();
// in pivot mode, we don't accept any drops if functions are read only
if (this.gridOptionsWrapper.isFunctionsReadOnly()) {
return;
}
var dragColumns = draggingEvent.dragItem.columns;
dragColumns.forEach(function (column) {
// we don't allow adding secondary columns
if (!column.isPrimary()) {
return;
}
if (column.isAnyFunctionActive()) {
return;
}
if (column.isAllowValue()) {
_this.columnsToAggregate.push(column);
}
else if (column.isAllowRowGroup()) {
_this.columnsToGroup.push(column);
}
else if (column.isAllowPivot()) {
_this.columnsToPivot.push(column);
}
});
};
BodyDropPivotTarget.prototype.getIconName = function () {
var totalColumns = this.columnsToAggregate.length + this.columnsToGroup.length + this.columnsToPivot.length;
if (totalColumns > 0) {
return this.pinned ? _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_0__["DragAndDropService"].ICON_PINNED : _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_0__["DragAndDropService"].ICON_MOVE;
}
else {
return null;
}
};
/** Callback for when drag leaves */
BodyDropPivotTarget.prototype.onDragLeave = function (draggingEvent) {
// if we are taking columns out of the center, then we remove them from the report
this.clearColumnsList();
};
BodyDropPivotTarget.prototype.clearColumnsList = function () {
this.columnsToAggregate.length = 0;
this.columnsToGroup.length = 0;
this.columnsToPivot.length = 0;
};
/** Callback for when dragging */
BodyDropPivotTarget.prototype.onDragging = function (draggingEvent) {
};
/** Callback for when drag stops */
BodyDropPivotTarget.prototype.onDragStop = function (draggingEvent) {
if (this.columnsToAggregate.length > 0) {
this.columnController.addValueColumns(this.columnsToAggregate, "toolPanelDragAndDrop");
}
if (this.columnsToGroup.length > 0) {
this.columnController.addRowGroupColumns(this.columnsToGroup, "toolPanelDragAndDrop");
}
if (this.columnsToPivot.length > 0) {
this.columnController.addPivotColumns(this.columnsToPivot, "toolPanelDragAndDrop");
}
};
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('columnController')
], BodyDropPivotTarget.prototype, "columnController", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('gridOptionsWrapper')
], BodyDropPivotTarget.prototype, "gridOptionsWrapper", void 0);
return BodyDropPivotTarget;
}());
/***/ }),
/* 129 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HeaderNavigationDirection", function() { return HeaderNavigationDirection; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HeaderNavigationService", function() { return HeaderNavigationService; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20);
/* harmony import */ var _entities_columnGroup__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9);
/* harmony import */ var _headerRowComp__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(111);
/* harmony import */ var _utils_array__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(14);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 HeaderNavigationDirection;
(function (HeaderNavigationDirection) {
HeaderNavigationDirection[HeaderNavigationDirection["UP"] = 0] = "UP";
HeaderNavigationDirection[HeaderNavigationDirection["DOWN"] = 1] = "DOWN";
HeaderNavigationDirection[HeaderNavigationDirection["LEFT"] = 2] = "LEFT";
HeaderNavigationDirection[HeaderNavigationDirection["RIGHT"] = 3] = "RIGHT";
})(HeaderNavigationDirection || (HeaderNavigationDirection = {}));
var HeaderNavigationService = /** @class */ (function (_super) {
__extends(HeaderNavigationService, _super);
function HeaderNavigationService() {
return _super !== null && _super.apply(this, arguments) || this;
}
HeaderNavigationService.prototype.registerGridComp = function (gridPanel) {
this.gridPanel = gridPanel;
};
HeaderNavigationService.prototype.registerHeaderRoot = function (headerRoot) {
this.headerRoot = headerRoot;
};
HeaderNavigationService.prototype.getHeaderRowCount = function () {
var headerContainers = this.headerRoot.getHeaderContainers();
return headerContainers.size === 0 ? 0 : this.getHeaderContainer().getRowComps().length;
};
HeaderNavigationService.prototype.getHeaderRowType = function (idx) {
if (this.getHeaderRowCount()) {
return this.getHeaderContainer().getRowComps()[idx].getType();
}
};
HeaderNavigationService.prototype.getHeaderContainer = function (position) {
if (position === void 0) { position = 'center'; }
if (position === null) {
position = 'center';
}
return this.headerRoot.getHeaderContainers().get(position);
};
/*
* This method navigates grid header vertically
* @return {boolean} true to preventDefault on the event that caused this navigation.
*/
HeaderNavigationService.prototype.navigateVertically = function (direction, fromHeader, event) {
if (!fromHeader) {
fromHeader = this.focusController.getFocusedHeader();
}
if (!fromHeader) {
return false;
}
var headerRowIndex = fromHeader.headerRowIndex, column = fromHeader.column;
var rowLen = this.getHeaderRowCount();
var isUp = direction === HeaderNavigationDirection.UP;
var nextRow = isUp ? headerRowIndex - 1 : headerRowIndex + 1;
var nextFocusColumn;
var skipColumn = false;
if (nextRow < 0) {
nextRow = 0;
nextFocusColumn = column;
skipColumn = true;
}
if (nextRow >= rowLen) {
nextRow = -1; // -1 indicates the focus should move to grid rows.
}
var currentRowType = this.getHeaderRowType(headerRowIndex);
if (!skipColumn) {
if (currentRowType === _headerRowComp__WEBPACK_IMPORTED_MODULE_3__["HeaderRowType"].COLUMN_GROUP) {
var currentColumn = column;
nextFocusColumn = isUp ? column.getParent() : currentColumn.getDisplayedChildren()[0];
}
else if (currentRowType === _headerRowComp__WEBPACK_IMPORTED_MODULE_3__["HeaderRowType"].FLOATING_FILTER) {
nextFocusColumn = column;
}
else {
var currentColumn = column;
nextFocusColumn = isUp ? currentColumn.getParent() : currentColumn;
}
if (!nextFocusColumn) {
return false;
}
}
return this.focusController.focusHeaderPosition({ headerRowIndex: nextRow, column: nextFocusColumn }, undefined, false, true, event);
};
/*
* This method navigates grid header horizontally
* @return {boolean} true to preventDefault on the event that caused this navigation.
*/
HeaderNavigationService.prototype.navigateHorizontally = function (direction, fromTab, event) {
if (fromTab === void 0) { fromTab = false; }
var focusedHeader = this.focusController.getFocusedHeader();
var isLeft = direction === HeaderNavigationDirection.LEFT;
var isRtl = this.gridOptionsWrapper.isEnableRtl();
var nextHeader;
var normalisedDirection;
// either navigating to the left or isRtl (cannot be both)
if (isLeft !== isRtl) {
normalisedDirection = 'Before';
nextHeader = this.headerPositionUtils.findHeader(focusedHeader, normalisedDirection);
}
else {
normalisedDirection = 'After';
nextHeader = this.headerPositionUtils.findHeader(focusedHeader, normalisedDirection);
}
if (nextHeader) {
return this.focusController.focusHeaderPosition(nextHeader, normalisedDirection, fromTab, true, event);
}
if (!fromTab) {
return true;
}
return this.focusNextHeaderRow(focusedHeader, normalisedDirection, event);
};
HeaderNavigationService.prototype.focusNextHeaderRow = function (focusedHeader, direction, event) {
var currentIndex = focusedHeader.headerRowIndex;
var nextPosition;
var nextRowIndex;
if (direction === 'Before') {
if (currentIndex > 0) {
nextRowIndex = currentIndex - 1;
nextPosition = this.headerPositionUtils.findColAtEdgeForHeaderRow(nextRowIndex, 'end');
}
}
else {
nextRowIndex = currentIndex + 1;
nextPosition = this.headerPositionUtils.findColAtEdgeForHeaderRow(nextRowIndex, 'start');
}
return this.focusController.focusHeaderPosition(nextPosition, direction, true, true, event);
};
HeaderNavigationService.prototype.scrollToColumn = function (column, direction) {
if (direction === void 0) { direction = 'After'; }
if (column.getPinned()) {
return;
}
var columnToScrollTo;
if (column instanceof _entities_columnGroup__WEBPACK_IMPORTED_MODULE_2__["ColumnGroup"]) {
var columns = column.getDisplayedLeafColumns();
columnToScrollTo = direction === 'Before' ? Object(_utils_array__WEBPACK_IMPORTED_MODULE_4__["last"])(columns) : columns[0];
}
else {
columnToScrollTo = column;
}
this.gridPanel.ensureColumnVisible(columnToScrollTo);
// need to nudge the scrolls for the floating items. otherwise when we set focus on a non-visible
// floating cell, the scrolls get out of sync
this.gridPanel.horizontallyScrollHeaderCenterAndFloatingCenter();
// need to flush frames, to make sure the correct cells are rendered
this.animationFrameService.flushAllFrames();
};
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('focusController')
], HeaderNavigationService.prototype, "focusController", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('headerPositionUtils')
], HeaderNavigationService.prototype, "headerPositionUtils", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('animationFrameService')
], HeaderNavigationService.prototype, "animationFrameService", void 0);
HeaderNavigationService = __decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('headerNavigationService')
], HeaderNavigationService);
return HeaderNavigationService;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
/***/ }),
/* 130 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyName", function() { return KeyName; });
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var KeyName = /** @class */ (function () {
function KeyName() {
}
KeyName.BACKSPACE = 'Backspace';
KeyName.TAB = 'Tab';
KeyName.ENTER = 'Enter';
KeyName.SHIFT = 'Shift';
KeyName.ESCAPE = 'Escape';
KeyName.SPACE = ' ';
KeyName.LEFT = 'ArrowLeft';
KeyName.UP = 'ArrowUp';
KeyName.RIGHT = 'ArrowRight';
KeyName.DOWN = 'ArrowDown';
KeyName.DELETE = 'Delete';
// IE11 & Edge treat the numpad del key differently - with numlock on we get "Del" for key
KeyName.NUM_PAD_DELETE = 'Del';
KeyName.A = 'a';
KeyName.C = 'c';
KeyName.V = 'v';
KeyName.D = 'd';
KeyName.Z = 'z';
KeyName.Y = 'y';
KeyName.F2 = 'F2';
KeyName.PAGE_UP = 'PageUp';
KeyName.PAGE_DOWN = 'PageDown';
KeyName.PAGE_HOME = 'Home';
KeyName.PAGE_END = 'End';
return KeyName;
}());
/***/ }),
/* 131 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FilterManager", function() { return FilterManager; });
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12);
/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(23);
/* harmony import */ var _modules_moduleNames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(17);
/* harmony import */ var _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(18);
/* harmony import */ var _utils_array__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(14);
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(20);
/* harmony import */ var _utils_set__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(52);
/* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(7);
/* harmony import */ var _utils_object__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(13);
/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(42);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __assign = (undefined && undefined.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __decorate = (undefined && undefined.__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 FilterManager = /** @class */ (function (_super) {
__extends(FilterManager, _super);
function FilterManager() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.allAdvancedFilters = new Map();
_this.activeAdvancedFilters = [];
_this.quickFilter = null;
_this.quickFilterParts = null;
// this is true when the grid is processing the filter change. this is used by the cell comps, so that they
// don't flash when data changes due to filter changes. there is no need to flash when filter changes as the
// user is in control, so doesn't make sense to show flashing changes. for example, go to main demo where
// this feature is turned off (hack code to always return false for isSuppressFlashingCellsBecauseFiltering(), put in)
// 100,000 rows and group by country. then do some filtering. all the cells flash, which is silly.
_this.processingFilterChange = false;
return _this;
}
FilterManager_1 = FilterManager;
FilterManager.prototype.init = function () {
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_ROW_DATA_CHANGED, this.onNewRowsLoaded.bind(this));
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_NEW_COLUMNS_LOADED, this.onNewColumnsLoaded.bind(this));
this.quickFilter = this.parseQuickFilter(this.gridOptionsWrapper.getQuickFilterText());
this.setQuickFilterParts();
this.allowShowChangeAfterFilter = this.gridOptionsWrapper.isAllowShowChangeAfterFilter();
// check this here, in case there is a filter from the start
this.checkExternalFilter();
};
FilterManager.prototype.setQuickFilterParts = function () {
this.quickFilterParts = this.quickFilter ? this.quickFilter.split(' ') : null;
};
FilterManager.prototype.setFilterModel = function (model) {
var _this = this;
var allPromises = [];
if (model) {
// mark the filters as we set them, so any active filters left over we stop
var modelKeys_1 = Object(_utils_set__WEBPACK_IMPORTED_MODULE_7__["convertToSet"])(Object.keys(model));
this.allAdvancedFilters.forEach(function (filterWrapper, colId) {
var newModel = model[colId];
allPromises.push(_this.setModelOnFilterWrapper(filterWrapper.filterPromise, newModel));
modelKeys_1.delete(colId);
});
// at this point, processedFields contains data for which we don't have a filter working yet
modelKeys_1.forEach(function (colId) {
var column = _this.columnController.getPrimaryColumn(colId);
if (!column) {
console.warn('Warning ag-grid setFilterModel - no column found for colId ' + colId);
return;
}
var filterWrapper = _this.getOrCreateFilterWrapper(column, 'NO_UI');
allPromises.push(_this.setModelOnFilterWrapper(filterWrapper.filterPromise, model[colId]));
});
}
else {
this.allAdvancedFilters.forEach(function (filterWrapper) {
allPromises.push(_this.setModelOnFilterWrapper(filterWrapper.filterPromise, null));
});
}
_utils__WEBPACK_IMPORTED_MODULE_0__["AgPromise"].all(allPromises).then(function () { return _this.onFilterChanged(); });
};
FilterManager.prototype.setModelOnFilterWrapper = function (filterPromise, newModel) {
return new _utils__WEBPACK_IMPORTED_MODULE_0__["AgPromise"](function (resolve) {
filterPromise.then(function (filter) {
if (typeof filter.setModel !== 'function') {
console.warn('Warning ag-grid - filter missing setModel method, which is needed for setFilterModel');
resolve();
}
(filter.setModel(newModel) || _utils__WEBPACK_IMPORTED_MODULE_0__["AgPromise"].resolve()).then(function () { return resolve(); });
});
});
};
FilterManager.prototype.getFilterModel = function () {
var result = {};
this.allAdvancedFilters.forEach(function (filterWrapper, key) {
// because user can provide filters, we provide useful error checking and messages
var filterPromise = filterWrapper.filterPromise;
var filter = filterPromise.resolveNow(null, function (filter) { return filter; });
if (filter == null) {
return null;
}
if (typeof filter.getModel !== 'function') {
console.warn('Warning ag-grid - filter API missing getModel method, which is needed for getFilterModel');
return;
}
var model = filter.getModel();
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_8__["exists"])(model)) {
result[key] = model;
}
});
return result;
};
// returns true if any advanced filter (ie not quick filter) active
FilterManager.prototype.isAdvancedFilterPresent = function () {
return this.activeAdvancedFilters.length > 0;
};
// called by:
// 1) onFilterChanged()
// 2) onNewRowsLoaded()
FilterManager.prototype.updateActiveFilters = function () {
var _this = this;
this.activeAdvancedFilters.length = 0;
this.allAdvancedFilters.forEach(function (filterWrapper) {
if (filterWrapper.filterPromise.resolveNow(false, function (filter) { return filter.isFilterActive(); })) {
_this.activeAdvancedFilters.push(filterWrapper.filterPromise.resolveNow(null, function (filter) { return filter; }));
}
});
};
FilterManager.prototype.updateFilterFlagInColumns = function (source, additionalEventAttributes) {
this.allAdvancedFilters.forEach(function (filterWrapper) {
var isFilterActive = filterWrapper.filterPromise.resolveNow(false, function (filter) { return filter.isFilterActive(); });
filterWrapper.column.setFilterActive(isFilterActive, source, additionalEventAttributes);
});
};
FilterManager.prototype.isAnyFilterPresent = function () {
return this.isQuickFilterPresent() || this.isAdvancedFilterPresent() || this.externalFilterPresent;
};
FilterManager.prototype.doAdvancedFiltersPass = function (node, filterToSkip) {
var data = node.data;
for (var i = 0; i < this.activeAdvancedFilters.length; i++) {
var filter = this.activeAdvancedFilters[i];
if (filter == null || filter === filterToSkip) {
continue;
}
if (typeof filter.doesFilterPass !== 'function') {
// because users can do custom filters, give nice error message
throw new Error('Filter is missing method doesFilterPass');
}
if (!filter.doesFilterPass({ node: node, data: data })) {
return false;
}
}
return true;
};
FilterManager.prototype.parseQuickFilter = function (newFilter) {
if (!Object(_utils_generic__WEBPACK_IMPORTED_MODULE_8__["exists"])(newFilter)) {
return null;
}
if (!this.gridOptionsWrapper.isRowModelDefault()) {
console.warn('ag-grid: quick filtering only works with the Client-Side Row Model');
return null;
}
return newFilter.toUpperCase();
};
FilterManager.prototype.setQuickFilter = function (newFilter) {
var parsedFilter = this.parseQuickFilter(newFilter);
if (this.quickFilter !== parsedFilter) {
this.quickFilter = parsedFilter;
this.setQuickFilterParts();
this.onFilterChanged();
}
};
FilterManager.prototype.checkExternalFilter = function () {
this.externalFilterPresent = this.gridOptionsWrapper.isExternalFilterPresent();
};
FilterManager.prototype.onFilterChanged = function (filterInstance, additionalEventAttributes) {
this.updateActiveFilters();
this.updateFilterFlagInColumns('filterChanged', additionalEventAttributes);
this.checkExternalFilter();
this.allAdvancedFilters.forEach(function (filterWrapper) {
filterWrapper.filterPromise.then(function (filter) {
if (filter !== filterInstance && filter.onAnyFilterChanged) {
filter.onAnyFilterChanged();
}
});
});
var filterChangedEvent = {
type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_FILTER_CHANGED,
api: this.gridApi,
columnApi: this.columnApi
};
if (additionalEventAttributes) {
Object(_utils_object__WEBPACK_IMPORTED_MODULE_9__["mergeDeep"])(filterChangedEvent, additionalEventAttributes);
}
// because internal events are not async in ag-grid, when the dispatchEvent
// method comes back, we know all listeners have finished executing.
this.processingFilterChange = true;
this.eventService.dispatchEvent(filterChangedEvent);
this.processingFilterChange = false;
};
FilterManager.prototype.isSuppressFlashingCellsBecauseFiltering = function () {
// if user has elected to always flash cell changes, then always return false, otherwise we suppress flashing
// changes when filtering
return !this.allowShowChangeAfterFilter && this.processingFilterChange;
};
FilterManager.prototype.isQuickFilterPresent = function () {
return this.quickFilter !== null;
};
FilterManager.prototype.doesRowPassOtherFilters = function (filterToSkip, node) {
return this.doesRowPassFilter(node, filterToSkip);
};
FilterManager.prototype.doesRowPassQuickFilterNoCache = function (node, filterPart) {
var _this = this;
var columns = this.columnController.getAllColumnsForQuickFilter();
return Object(_utils_array__WEBPACK_IMPORTED_MODULE_5__["some"])(columns, function (column) {
var part = _this.getQuickFilterTextForColumn(column, node);
return Object(_utils_generic__WEBPACK_IMPORTED_MODULE_8__["exists"])(part) && part.indexOf(filterPart) >= 0;
});
};
FilterManager.prototype.doesRowPassQuickFilterCache = function (node, filterPart) {
if (!node.quickFilterAggregateText) {
this.aggregateRowForQuickFilter(node);
}
return node.quickFilterAggregateText.indexOf(filterPart) >= 0;
};
FilterManager.prototype.doesRowPassQuickFilter = function (node) {
var _this = this;
var usingCache = this.gridOptionsWrapper.isCacheQuickFilter();
// each part must pass, if any fails, then the whole filter fails
return Object(_utils_array__WEBPACK_IMPORTED_MODULE_5__["every"])(this.quickFilterParts, function (part) {
return usingCache ? _this.doesRowPassQuickFilterCache(node, part) : _this.doesRowPassQuickFilterNoCache(node, part);
});
};
FilterManager.prototype.doesRowPassFilter = function (node, filterToSkip) {
// the row must pass ALL of the filters, so if any of them fail,
// we return true. that means if a row passes the quick filter,
// but fails the column filter, it fails overall
// first up, check quick filter
if (this.isQuickFilterPresent() && !this.doesRowPassQuickFilter(node)) {
return false;
}
// secondly, give the client a chance to reject this row
if (this.externalFilterPresent && !this.gridOptionsWrapper.doesExternalFilterPass(node)) {
return false;
}
// lastly, check our internal advanced filter
if (this.isAdvancedFilterPresent() && !this.doAdvancedFiltersPass(node, filterToSkip)) {
return false;
}
// got this far, all filters pass
return true;
};
FilterManager.prototype.getQuickFilterTextForColumn = function (column, node) {
var value = this.valueService.getValue(column, node, true);
var colDef = column.getColDef();
if (colDef.getQuickFilterText) {
var params = {
value: value,
node: node,
data: node.data,
column: column,
colDef: colDef,
context: this.gridOptionsWrapper.getContext()
};
value = colDef.getQuickFilterText(params);
}
return Object(_utils_generic__WEBPACK_IMPORTED_MODULE_8__["exists"])(value) ? value.toString().toUpperCase() : null;
};
FilterManager.prototype.aggregateRowForQuickFilter = function (node) {
var _this = this;
var stringParts = [];
var columns = this.columnController.getAllColumnsForQuickFilter();
Object(_utils_array__WEBPACK_IMPORTED_MODULE_5__["forEach"])(columns, function (column) {
var part = _this.getQuickFilterTextForColumn(column, node);
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_8__["exists"])(part)) {
stringParts.push(part);
}
});
node.quickFilterAggregateText = stringParts.join(FilterManager_1.QUICK_FILTER_SEPARATOR);
};
FilterManager.prototype.onNewRowsLoaded = function (source) {
this.allAdvancedFilters.forEach(function (filterWrapper) {
filterWrapper.filterPromise.then(function (filter) {
if (filter.onNewRowsLoaded) {
filter.onNewRowsLoaded();
}
});
});
this.updateFilterFlagInColumns(source);
this.updateActiveFilters();
};
FilterManager.prototype.createValueGetter = function (column) {
var _this = this;
return function (node) { return _this.valueService.getValue(column, node, true); };
};
FilterManager.prototype.getFilterComponent = function (column, source, createIfDoesNotExist) {
if (createIfDoesNotExist === void 0) { createIfDoesNotExist = true; }
if (createIfDoesNotExist) {
return this.getOrCreateFilterWrapper(column, source).filterPromise;
}
var filterWrapper = this.cachedFilter(column);
return filterWrapper ? filterWrapper.filterPromise : null;
};
FilterManager.prototype.isFilterActive = function (column) {
var filterWrapper = this.cachedFilter(column);
return filterWrapper && filterWrapper.filterPromise.resolveNow(false, function (filter) { return filter.isFilterActive(); });
};
FilterManager.prototype.getOrCreateFilterWrapper = function (column, source) {
var filterWrapper = this.cachedFilter(column);
if (!filterWrapper) {
filterWrapper = this.createFilterWrapper(column, source);
this.allAdvancedFilters.set(column.getColId(), filterWrapper);
}
else if (source !== 'NO_UI') {
this.putIntoGui(filterWrapper, source);
}
return filterWrapper;
};
FilterManager.prototype.cachedFilter = function (column) {
return this.allAdvancedFilters.get(column.getColId());
};
FilterManager.prototype.createFilterInstance = function (column, $scope) {
var _this = this;
var defaultFilter = _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_4__["ModuleRegistry"].isRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_3__["ModuleNames"].SetFilterModule) ? 'agSetColumnFilter' : 'agTextColumnFilter';
var colDef = column.getColDef();
var filterInstance;
var params = __assign(__assign({}, this.createFilterParams(column, colDef, $scope)), { filterModifiedCallback: function () {
var event = {
type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_FILTER_MODIFIED,
api: _this.gridApi,
columnApi: _this.columnApi,
column: column,
filterInstance: filterInstance
};
_this.eventService.dispatchEvent(event);
}, filterChangedCallback: function (additionalEventAttributes) {
return _this.onFilterChanged(filterInstance, additionalEventAttributes);
}, doesRowPassOtherFilter: function (node) { return _this.doesRowPassOtherFilters(filterInstance, node); } });
var res = this.userComponentFactory.newFilterComponent(colDef, params, defaultFilter);
if (res) {
res.then(function (r) { return filterInstance = r; });
}
return res;
};
FilterManager.prototype.createFilterParams = function (column, colDef, $scope) {
if ($scope === void 0) { $scope = null; }
var params = {
api: this.gridOptionsWrapper.getApi(),
column: column,
colDef: Object(_utils_object__WEBPACK_IMPORTED_MODULE_9__["cloneObject"])(colDef),
rowModel: this.rowModel,
filterChangedCallback: null,
filterModifiedCallback: null,
valueGetter: this.createValueGetter(column),
context: this.gridOptionsWrapper.getContext(),
doesRowPassOtherFilter: null
};
// hack in scope if using AngularJS
if ($scope) {
params.$scope = $scope;
}
return params;
};
FilterManager.prototype.createFilterWrapper = function (column, source) {
var filterWrapper = {
column: column,
filterPromise: null,
scope: null,
compiledElement: null,
guiPromise: _utils__WEBPACK_IMPORTED_MODULE_0__["AgPromise"].resolve(null)
};
filterWrapper.scope = this.gridOptionsWrapper.isAngularCompileFilters() ? this.$scope.$new() : null;
filterWrapper.filterPromise = this.createFilterInstance(column, filterWrapper.scope);
if (filterWrapper.filterPromise) {
this.putIntoGui(filterWrapper, source);
}
return filterWrapper;
};
FilterManager.prototype.putIntoGui = function (filterWrapper, source) {
var _this = this;
var eFilterGui = document.createElement('div');
eFilterGui.className = 'ag-filter';
filterWrapper.guiPromise = new _utils__WEBPACK_IMPORTED_MODULE_0__["AgPromise"](function (resolve) {
filterWrapper.filterPromise.then(function (filter) {
var guiFromFilter = filter.getGui();
if (!Object(_utils_generic__WEBPACK_IMPORTED_MODULE_8__["exists"])(guiFromFilter)) {
console.warn("getGui method from filter returned " + guiFromFilter + ", it should be a DOM element or an HTML template string.");
}
// for backwards compatibility with Angular 1 - we
// used to allow providing back HTML from getGui().
// once we move away from supporting Angular 1
// directly, we can change this.
if (typeof guiFromFilter === 'string') {
guiFromFilter = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_10__["loadTemplate"])(guiFromFilter);
}
eFilterGui.appendChild(guiFromFilter);
if (filterWrapper.scope) {
var compiledElement = _this.$compile(eFilterGui)(filterWrapper.scope);
filterWrapper.compiledElement = compiledElement;
window.setTimeout(function () { return filterWrapper.scope.$apply(); }, 0);
}
resolve(eFilterGui);
_this.eventService.dispatchEvent({
type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_FILTER_OPENED,
column: filterWrapper.column,
source: source,
eGui: eFilterGui,
api: _this.gridApi,
columnApi: _this.columnApi
});
});
});
};
FilterManager.prototype.onNewColumnsLoaded = function () {
var _this = this;
var atLeastOneFilterGone = false;
this.allAdvancedFilters.forEach(function (filterWrapper) {
var oldColumn = !_this.columnController.getPrimaryColumn(filterWrapper.column);
if (oldColumn) {
atLeastOneFilterGone = true;
_this.disposeFilterWrapper(filterWrapper, 'filterDestroyed');
}
});
if (atLeastOneFilterGone) {
this.onFilterChanged();
}
};
// destroys the filter, so it not longer takes part
FilterManager.prototype.destroyFilter = function (column, source) {
if (source === void 0) { source = 'api'; }
var filterWrapper = this.allAdvancedFilters.get(column.getColId());
if (filterWrapper) {
this.disposeFilterWrapper(filterWrapper, source);
this.onFilterChanged();
}
};
FilterManager.prototype.disposeFilterWrapper = function (filterWrapper, source) {
var _this = this;
filterWrapper.filterPromise.then(function (filter) {
(filter.setModel(null) || _utils__WEBPACK_IMPORTED_MODULE_0__["AgPromise"].resolve()).then(function () {
_this.getContext().destroyBean(filter);
filterWrapper.column.setFilterActive(false, source);
if (filterWrapper.scope) {
if (filterWrapper.compiledElement) {
filterWrapper.compiledElement.remove();
}
filterWrapper.scope.$destroy();
}
_this.allAdvancedFilters.delete(filterWrapper.column.getColId());
});
});
};
FilterManager.prototype.destroy = function () {
var _this = this;
_super.prototype.destroy.call(this);
this.allAdvancedFilters.forEach(function (filterWrapper) { return _this.disposeFilterWrapper(filterWrapper, 'filterDestroyed'); });
};
var FilterManager_1;
FilterManager.QUICK_FILTER_SEPARATOR = '\n';
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('$compile')
], FilterManager.prototype, "$compile", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('$scope')
], FilterManager.prototype, "$scope", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('valueService')
], FilterManager.prototype, "valueService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('columnController')
], FilterManager.prototype, "columnController", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('rowModel')
], FilterManager.prototype, "rowModel", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('columnApi')
], FilterManager.prototype, "columnApi", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('gridApi')
], FilterManager.prototype, "gridApi", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('userComponentFactory')
], FilterManager.prototype, "userComponentFactory", void 0);
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_1__["PostConstruct"]
], FilterManager.prototype, "init", null);
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_1__["PreDestroy"]
], FilterManager.prototype, "destroy", null);
FilterManager = FilterManager_1 = __decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Bean"])('filterManager')
], FilterManager);
return FilterManager;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_6__["BeanStub"]));
/***/ }),
/* 132 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ValueService", function() { return ValueService; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23);
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(20);
/* harmony import */ var _utils_object__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(13);
/* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7);
/* harmony import */ var _utils_function__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(15);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 ValueService = /** @class */ (function (_super) {
__extends(ValueService, _super);
function ValueService() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.initialised = false;
return _this;
}
ValueService.prototype.init = function () {
this.cellExpressions = this.gridOptionsWrapper.isEnableCellExpressions();
this.initialised = true;
};
ValueService.prototype.getValue = function (column, rowNode, forFilter, ignoreAggData) {
if (forFilter === void 0) { forFilter = false; }
if (ignoreAggData === void 0) { ignoreAggData = false; }
// hack - the grid is getting refreshed before this bean gets initialised, race condition.
// really should have a way so they get initialised in the right order???
if (!this.initialised) {
this.init();
}
if (!rowNode) {
return;
}
// pull these out to make code below easier to read
var colDef = column.getColDef();
var field = colDef.field;
var colId = column.getId();
var data = rowNode.data;
var result;
// if there is a value getter, this gets precedence over a field
var groupDataExists = rowNode.groupData && rowNode.groupData[colId] !== undefined;
var aggDataExists = !ignoreAggData && rowNode.aggData && rowNode.aggData[colId] !== undefined;
if (forFilter && colDef.filterValueGetter) {
result = this.executeFilterValueGetter(colDef.filterValueGetter, data, column, rowNode);
}
else if (this.gridOptionsWrapper.isTreeData() && aggDataExists) {
result = rowNode.aggData[colId];
}
else if (this.gridOptionsWrapper.isTreeData() && colDef.valueGetter) {
result = this.executeValueGetter(colDef.valueGetter, data, column, rowNode);
}
else if (this.gridOptionsWrapper.isTreeData() && (field && data)) {
result = Object(_utils_object__WEBPACK_IMPORTED_MODULE_3__["getValueUsingField"])(data, field, column.isFieldContainsDots());
}
else if (groupDataExists) {
result = rowNode.groupData[colId];
}
else if (aggDataExists) {
result = rowNode.aggData[colId];
}
else if (colDef.valueGetter) {
result = this.executeValueGetter(colDef.valueGetter, data, column, rowNode);
}
else if (field && data) {
result = Object(_utils_object__WEBPACK_IMPORTED_MODULE_3__["getValueUsingField"])(data, field, column.isFieldContainsDots());
}
// the result could be an expression itself, if we are allowing cell values to be expressions
if (this.cellExpressions && (typeof result === 'string') && result.indexOf('=') === 0) {
var cellValueGetter = result.substring(1);
result = this.executeValueGetter(cellValueGetter, data, column, rowNode);
}
if (result == null) {
var openedGroup = this.getOpenedGroup(rowNode, column);
if (openedGroup != null) {
return openedGroup;
}
}
return result;
};
ValueService.prototype.getOpenedGroup = function (rowNode, column) {
if (!this.gridOptionsWrapper.isShowOpenedGroup()) {
return;
}
var colDef = column.getColDef();
if (!colDef.showRowGroup) {
return;
}
var showRowGroup = column.getColDef().showRowGroup;
var pointer = rowNode.parent;
while (pointer != null) {
if (pointer.rowGroupColumn && (showRowGroup === true || showRowGroup === pointer.rowGroupColumn.getId())) {
return pointer.key;
}
pointer = pointer.parent;
}
return undefined;
};
ValueService.prototype.setValue = function (rowNode, colKey, newValue, eventSource) {
var column = this.columnController.getPrimaryColumn(colKey);
if (!rowNode || !column) {
return;
}
// this will only happen if user is trying to paste into a group row, which doesn't make sense
// the user should not be trying to paste into group rows
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_4__["missing"])(rowNode.data)) {
rowNode.data = {};
}
// for backwards compatibility we are also retrieving the newValueHandler as well as the valueSetter
var _a = column.getColDef(), field = _a.field, newValueHandler = _a.newValueHandler, valueSetter = _a.valueSetter;
// need either a field or a newValueHandler for this to work
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_4__["missing"])(field) && Object(_utils_generic__WEBPACK_IMPORTED_MODULE_4__["missing"])(newValueHandler) && Object(_utils_generic__WEBPACK_IMPORTED_MODULE_4__["missing"])(valueSetter)) {
// we don't tell user about newValueHandler, as that is deprecated
console.warn("ag-Grid: you need either field or valueSetter set on colDef for editing to work");
return;
}
var params = {
node: rowNode,
data: rowNode.data,
oldValue: this.getValue(column, rowNode),
newValue: newValue,
colDef: column.getColDef(),
column: column,
api: this.gridOptionsWrapper.getApi(),
columnApi: this.gridOptionsWrapper.getColumnApi(),
context: this.gridOptionsWrapper.getContext()
};
params.newValue = newValue;
var valueWasDifferent;
if (newValueHandler && Object(_utils_generic__WEBPACK_IMPORTED_MODULE_4__["exists"])(newValueHandler)) {
valueWasDifferent = newValueHandler(params);
}
else if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_4__["exists"])(valueSetter)) {
valueWasDifferent = this.expressionService.evaluate(valueSetter, params);
}
else {
valueWasDifferent = this.setValueUsingField(rowNode.data, field, newValue, column.isFieldContainsDots());
}
// in case user forgot to return something (possible if they are not using TypeScript
// and just forgot, or using an old newValueHandler we didn't always expect a return
// value here), we default the return value to true, so we always refresh.
if (valueWasDifferent === undefined) {
valueWasDifferent = true;
}
// if no change to the value, then no need to do the updating, or notifying via events.
// otherwise the user could be tabbing around the grid, and cellValueChange would get called
// all the time.
if (!valueWasDifferent) {
return;
}
// reset quick filter on this row
rowNode.resetQuickFilterAggregateText();
this.valueCache.onDataChanged();
params.newValue = this.getValue(column, rowNode);
var onCellValueChanged = column.getColDef().onCellValueChanged;
if (typeof onCellValueChanged === 'function') {
// to make callback async, do in a timeout
setTimeout(function () { return onCellValueChanged(params); }, 0);
}
var event = {
type: _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_CELL_VALUE_CHANGED,
event: null,
rowIndex: rowNode.rowIndex,
rowPinned: rowNode.rowPinned,
column: params.column,
api: params.api,
colDef: params.colDef,
columnApi: params.columnApi,
context: params.context,
data: rowNode.data,
node: rowNode,
oldValue: params.oldValue,
newValue: params.newValue,
value: params.newValue,
source: eventSource
};
this.eventService.dispatchEvent(event);
};
ValueService.prototype.setValueUsingField = function (data, field, newValue, isFieldContainsDots) {
if (!field) {
return false;
}
// if no '.', then it's not a deep value
var valuesAreSame = false;
if (!isFieldContainsDots) {
data[field] = newValue;
}
else {
// otherwise it is a deep value, so need to dig for it
var fieldPieces = field.split('.');
var currentObject = data;
while (fieldPieces.length > 0 && currentObject) {
var fieldPiece = fieldPieces.shift();
if (fieldPieces.length === 0) {
currentObject[fieldPiece] = newValue;
}
else {
currentObject = currentObject[fieldPiece];
}
}
}
return !valuesAreSame;
};
ValueService.prototype.executeFilterValueGetter = function (valueGetter, data, column, rowNode) {
var params = {
data: data,
node: rowNode,
column: column,
colDef: column.getColDef(),
api: this.gridOptionsWrapper.getApi(),
columnApi: this.gridOptionsWrapper.getColumnApi(),
context: this.gridOptionsWrapper.getContext(),
getValue: this.getValueCallback.bind(this, rowNode)
};
return this.expressionService.evaluate(valueGetter, params);
};
ValueService.prototype.executeValueGetter = function (valueGetter, data, column, rowNode) {
var colId = column.getId();
// if inside the same turn, just return back the value we got last time
var valueFromCache = this.valueCache.getValue(rowNode, colId);
if (valueFromCache !== undefined) {
return valueFromCache;
}
var params = {
data: data,
node: rowNode,
column: column,
colDef: column.getColDef(),
api: this.gridOptionsWrapper.getApi(),
columnApi: this.gridOptionsWrapper.getColumnApi(),
context: this.gridOptionsWrapper.getContext(),
getValue: this.getValueCallback.bind(this, rowNode)
};
var result = this.expressionService.evaluate(valueGetter, params);
// if a turn is active, store the value in case the grid asks for it again
this.valueCache.setValue(rowNode, colId, result);
return result;
};
ValueService.prototype.getValueCallback = function (node, field) {
var otherColumn = this.columnController.getPrimaryColumn(field);
if (otherColumn) {
return this.getValue(otherColumn, node);
}
return null;
};
// used by row grouping and pivot, to get key for a row. col can be a pivot col or a row grouping col
ValueService.prototype.getKeyForNode = function (col, rowNode) {
var value = this.getValue(col, rowNode);
var keyCreator = col.getColDef().keyCreator;
var result = keyCreator ? keyCreator({ value: value }) : value;
// if already a string, or missing, just return it
if (typeof result === 'string' || result == null) {
return result;
}
result = String(result);
if (result === '[object Object]') {
Object(_utils_function__WEBPACK_IMPORTED_MODULE_5__["doOnce"])(function () {
console.warn('ag-Grid: a column you are grouping or pivoting by has objects as values. If you want to group by complex objects then either a) use a colDef.keyCreator (se ag-Grid docs) or b) to toString() on the object to return a key');
}, 'getKeyForNode - warn about [object,object]');
}
return result;
};
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('expressionService')
], ValueService.prototype, "expressionService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnController')
], ValueService.prototype, "columnController", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('valueCache')
], ValueService.prototype, "valueCache", void 0);
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_0__["PostConstruct"]
], ValueService.prototype, "init", null);
ValueService = __decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('valueService')
], ValueService);
return ValueService;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_2__["BeanStub"]));
/***/ }),
/* 133 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GridPanel", function() { return GridPanel; });
/* harmony import */ var _gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(95);
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12);
/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(23);
/* harmony import */ var _constants_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(16);
/* harmony import */ var _rendering_row_rowContainerComponent__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(134);
/* harmony import */ var _rendering_row_rowComp__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(101);
/* harmony import */ var _widgets_touchListener__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(68);
/* harmony import */ var _rowDragFeature__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(135);
/* harmony import */ var _widgets_component__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(36);
/* harmony import */ var _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(57);
/* harmony import */ var _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(18);
/* harmony import */ var _modules_moduleNames__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(17);
/* harmony import */ var _utils_aria__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(44);
/* harmony import */ var _utils_function__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(15);
/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(42);
/* harmony import */ var _utils_browser__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(43);
/* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(7);
/* harmony import */ var _utils_event__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(21);
/* harmony import */ var _utils_keyboard__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(48);
/* harmony import */ var _utils_array__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14);
/* harmony import */ var _utils_object__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(13);
/* harmony import */ var _constants_keyCode__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(58);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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;
};
// 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 GRID_PANEL_NORMAL_TEMPLATE = /* html */ "
\n \n
\n \n
\n \n
\n \n \n
\n
\n \n
\n
\n \n
\n
\n \n \n
\n
\n \n
\n \n
\n \n \n
\n
\n \n
\n \n
\n \n
\n \n
";
var GridPanel = /** @class */ (function (_super) {
__extends(GridPanel, _super);
function GridPanel() {
var _this = _super.call(this, GRID_PANEL_NORMAL_TEMPLATE) || this;
_this.scrollLeft = -1;
_this.scrollTop = -1;
_this.resetLastHorizontalScrollElementDebounced = Object(_utils_function__WEBPACK_IMPORTED_MODULE_13__["debounce"])(_this.resetLastHorizontalScrollElement.bind(_this), 500);
return _this;
}
GridPanel.prototype.getVScrollPosition = function () {
var result = {
top: this.eBodyViewport.scrollTop,
bottom: this.eBodyViewport.scrollTop + this.eBodyViewport.offsetHeight
};
return result;
};
GridPanel.prototype.getHScrollPosition = function () {
var result = {
left: this.eCenterViewport.scrollLeft,
right: this.eCenterViewport.scrollLeft + this.eCenterViewport.offsetWidth
};
return result;
};
GridPanel.prototype.onRowDataChanged = function () {
this.showOrHideOverlay();
};
GridPanel.prototype.showOrHideOverlay = function () {
var isEmpty = this.paginationProxy.isEmpty();
var isSuppressNoRowsOverlay = this.gridOptionsWrapper.isSuppressNoRowsOverlay();
var method = isEmpty && !isSuppressNoRowsOverlay ? 'showNoRowsOverlay' : 'hideOverlay';
this[method]();
};
GridPanel.prototype.onNewColumnsLoaded = function () {
// hide overlay if columns and rows exist, this can happen if columns are loaded after data.
// this problem exists before of the race condition between the services (column controller in this case)
// and the view (grid panel). if the model beans were all initialised first, and then the view beans second,
// this race condition would not happen.
if (this.columnController.isReady() && !this.paginationProxy.isEmpty()) {
this.hideOverlay();
}
// we don't want each cellComp to register for events, as would increase rendering time.
// so for newColumnsLoaded, we register once here (in rowRenderer) and then inform
// each cell if / when event was fired.
this.rowRenderer.forEachCellComp(function (cellComp) { return cellComp.onNewColumnsLoaded(); });
};
GridPanel.prototype.init = function () {
var _this = this;
this.enableRtl = this.gridOptionsWrapper.isEnableRtl();
this.printLayout = this.gridOptionsWrapper.getDomLayout() === _constants_constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].DOM_LAYOUT_PRINT;
// these elements have different CSS when layout changes
this.gridOptionsWrapper.addLayoutElement(this.getGui());
this.gridOptionsWrapper.addLayoutElement(this.eBodyViewport);
this.suppressScrollOnFloatingRow();
this.setupRowAnimationCssClass();
this.buildRowContainerComponents();
this.addEventListeners();
this.addDragListeners();
this.addScrollListener();
if (this.gridOptionsWrapper.isRowModelDefault() && !this.gridOptionsWrapper.getRowData()) {
this.showLoadingOverlay();
}
this.setCellTextSelection(this.gridOptionsWrapper.isEnableCellTextSelect());
this.setPinnedContainerSize();
this.setHeaderAndFloatingHeights();
this.disableBrowserDragging();
this.addMouseListeners();
this.addPreventScrollWhileDragging();
this.addKeyboardEvents();
this.addBodyViewportListener();
this.addStopEditingWhenGridLosesFocus();
this.mockContextMenuForIPad();
this.addRowDragListener();
if (this.$scope) {
this.addAngularApplyCheck();
}
this.onDisplayedColumnsWidthChanged();
this.gridApi.registerGridComp(this);
this.alignedGridsService.registerGridComp(this);
this.headerRootComp.registerGridComp(this);
this.navigationService.registerGridComp(this);
this.headerNavigationService.registerGridComp(this);
this.heightScaler.registerGridComp(this);
this.autoHeightCalculator.registerGridComp(this);
this.columnAnimationService.registerGridComp(this);
this.autoWidthCalculator.registerGridComp(this);
this.paginationAutoPageSizeService.registerGridComp(this);
this.mouseEventService.registerGridComp(this);
this.beans.registerGridComp(this);
this.rowRenderer.registerGridComp(this);
if (this.contextMenuFactory) {
this.contextMenuFactory.registerGridComp(this);
}
if (this.menuFactory) {
this.menuFactory.registerGridComp(this);
}
if (this.rangeController || this.gridOptionsWrapper.isRowSelectionMulti()) {
Object(_utils_aria__WEBPACK_IMPORTED_MODULE_12__["setAriaMultiSelectable"])(this.getGui(), true);
if (this.rangeController) {
this.rangeController.registerGridComp(this);
}
}
[this.eCenterViewport, this.eBodyViewport].forEach(function (viewport) {
var unsubscribeFromResize = _this.resizeObserverService.observeResize(viewport, _this.onCenterViewportResized.bind(_this));
_this.addDestroyFunc(function () { return unsubscribeFromResize(); });
});
[this.eTop, this.eBodyViewport, this.eBottom].forEach(function (element) {
_this.addManagedListener(element, 'focusin', function () {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_14__["addCssClass"])(element, 'ag-has-focus');
});
_this.addManagedListener(element, 'focusout', function (e) {
if (!element.contains(e.relatedTarget)) {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_14__["removeCssClass"])(element, 'ag-has-focus');
}
});
});
};
GridPanel.prototype.onDomLayoutChanged = function () {
var newPrintLayout = this.gridOptionsWrapper.getDomLayout() === _constants_constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].DOM_LAYOUT_PRINT;
if (this.printLayout !== newPrintLayout) {
this.printLayout = newPrintLayout;
this.setWidthsOfContainers();
// pinned containers are always hidden for print layout
this.setPinnedContainerSize();
}
};
GridPanel.prototype.onCenterViewportResized = function () {
if (Object(_utils_dom__WEBPACK_IMPORTED_MODULE_14__["isVisible"])(this.eCenterViewport)) {
this.checkViewportAndScrolls();
var newWidth = this.getCenterWidth();
if (newWidth !== this.centerWidth) {
this.centerWidth = newWidth;
this.columnController.refreshFlexedColumns({ viewportWidth: this.centerWidth, updateBodyWidths: true, fireResizedEvent: true });
}
}
else {
this.bodyHeight = 0;
}
};
// used by ColumnAnimationService
GridPanel.prototype.setColumnMovingCss = function (moving) {
this.addOrRemoveCssClass('ag-column-moving', moving);
};
GridPanel.prototype.setCellTextSelection = function (selectable) {
if (selectable === void 0) { selectable = false; }
[this.eTop, this.eBodyViewport, this.eBottom]
.forEach(function (ct) { return Object(_utils_dom__WEBPACK_IMPORTED_MODULE_14__["addOrRemoveCssClass"])(ct, 'ag-selectable', selectable); });
};
GridPanel.prototype.addRowDragListener = function () {
this.rowDragFeature = this.createManagedBean(new _rowDragFeature__WEBPACK_IMPORTED_MODULE_7__["RowDragFeature"](this.eBodyViewport, this));
this.dragAndDropService.addDropTarget(this.rowDragFeature);
};
GridPanel.prototype.getRowDragFeature = function () {
return this.rowDragFeature;
};
GridPanel.prototype.addStopEditingWhenGridLosesFocus = function () {
var _this = this;
if (!this.gridOptionsWrapper.isStopEditingWhenGridLosesFocus()) {
return;
}
var viewports = [this.eBodyViewport, this.eBottom, this.eTop];
var focusOutListener = function (event) {
// this is the element the focus is moving to
var elementWithFocus = event.relatedTarget;
if (Object(_utils_browser__WEBPACK_IMPORTED_MODULE_15__["getTabIndex"])(elementWithFocus) === null) {
_this.rowRenderer.stopEditing();
return;
}
var clickInsideGrid = viewports.some(function (viewport) { return viewport.contains(elementWithFocus); });
if (!clickInsideGrid) {
var popupService = _this.popupService;
clickInsideGrid =
popupService.getActivePopups().some(function (popup) { return popup.contains(elementWithFocus); }) ||
popupService.isElementWithinCustomPopup(elementWithFocus);
}
if (!clickInsideGrid) {
_this.rowRenderer.stopEditing();
}
};
viewports.forEach(function (viewport) { return _this.addManagedListener(viewport, 'focusout', focusOutListener); });
};
GridPanel.prototype.addAngularApplyCheck = function () {
var _this = this;
// this makes sure if we queue up requests, we only execute oe
var applyTriggered = false;
var listener = function () {
// only need to do one apply at a time
if (applyTriggered) {
return;
}
applyTriggered = true; // mark 'need apply' to true
window.setTimeout(function () {
applyTriggered = false;
_this.$scope.$apply();
}, 0);
};
// these are the events we need to do an apply after - these are the ones that can end up
// with columns added or removed
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_DISPLAYED_COLUMNS_CHANGED, listener);
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_VIRTUAL_COLUMNS_CHANGED, listener);
};
// if we do not do this, then the user can select a pic in the grid (eg an image in a custom cell renderer)
// and then that will start the browser native drag n' drop, which messes up with our own drag and drop.
GridPanel.prototype.disableBrowserDragging = function () {
this.addGuiEventListener('dragstart', function (event) {
if (event.target instanceof HTMLImageElement) {
event.preventDefault();
return false;
}
});
};
GridPanel.prototype.addEventListeners = function () {
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_DISPLAYED_COLUMNS_CHANGED, this.onDisplayedColumnsChanged.bind(this));
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED, this.onDisplayedColumnsWidthChanged.bind(this));
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_PINNED_ROW_DATA_CHANGED, this.setHeaderAndFloatingHeights.bind(this));
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_ROW_DATA_CHANGED, this.onRowDataChanged.bind(this));
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_ROW_DATA_UPDATED, this.onRowDataChanged.bind(this));
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_NEW_COLUMNS_LOADED, this.onNewColumnsLoaded.bind(this));
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_SCROLLBAR_WIDTH_CHANGED, this.onScrollbarWidthChanged.bind(this));
this.addManagedListener(this.gridOptionsWrapper, _gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__["GridOptionsWrapper"].PROP_HEADER_HEIGHT, this.setHeaderAndFloatingHeights.bind(this));
this.addManagedListener(this.gridOptionsWrapper, _gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__["GridOptionsWrapper"].PROP_PIVOT_HEADER_HEIGHT, this.setHeaderAndFloatingHeights.bind(this));
this.addManagedListener(this.gridOptionsWrapper, _gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__["GridOptionsWrapper"].PROP_GROUP_HEADER_HEIGHT, this.setHeaderAndFloatingHeights.bind(this));
this.addManagedListener(this.gridOptionsWrapper, _gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__["GridOptionsWrapper"].PROP_PIVOT_GROUP_HEADER_HEIGHT, this.setHeaderAndFloatingHeights.bind(this));
this.addManagedListener(this.gridOptionsWrapper, _gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__["GridOptionsWrapper"].PROP_FLOATING_FILTERS_HEIGHT, this.setHeaderAndFloatingHeights.bind(this));
this.addManagedListener(this.gridOptionsWrapper, _gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__["GridOptionsWrapper"].PROP_DOM_LAYOUT, this.onDomLayoutChanged.bind(this));
};
GridPanel.prototype.addDragListeners = function () {
var _this = this;
if (!this.gridOptionsWrapper.isEnableRangeSelection() || // no range selection if no property
Object(_utils_generic__WEBPACK_IMPORTED_MODULE_16__["missing"])(this.rangeController) // no range selection if not enterprise version
) {
return;
}
var containers = [
this.eLeftContainer,
this.eRightContainer,
this.eCenterContainer,
this.eTop,
this.eBottom
];
containers.forEach(function (container) {
var params = {
eElement: container,
onDragStart: _this.rangeController.onDragStart.bind(_this.rangeController),
onDragStop: _this.rangeController.onDragStop.bind(_this.rangeController),
onDragging: _this.rangeController.onDragging.bind(_this.rangeController)
};
_this.dragService.addDragSource(params);
_this.addDestroyFunc(function () { return _this.dragService.removeDragSource(params); });
});
};
GridPanel.prototype.addMouseListeners = function () {
var _this = this;
var eventNames = ['dblclick', 'contextmenu', 'mouseover', 'mouseout', 'click', 'mousedown'];
eventNames.forEach(function (eventName) {
var listener = _this.processMouseEvent.bind(_this, eventName);
_this.eAllCellContainers.forEach(function (container) {
return _this.addManagedListener(container, eventName, listener);
});
});
};
// this methods prevents the grid views from being scrolled while the dragService is being used
// eg. the view should not scroll up and down while dragging rows using the rowDragComp.
GridPanel.prototype.addPreventScrollWhileDragging = function () {
var _this = this;
var preventScroll = function (e) {
if (_this.dragService.isDragging()) {
if (e.cancelable) {
e.preventDefault();
}
}
};
this.eAllCellContainers.forEach(function (container) {
container.addEventListener('touchmove', preventScroll, { passive: false });
});
this.addDestroyFunc(function () {
_this.eAllCellContainers.forEach(function (container) {
container.removeEventListener('touchmove', preventScroll);
});
});
};
GridPanel.prototype.addKeyboardEvents = function () {
var _this = this;
var eventNames = ['keydown', 'keypress'];
eventNames.forEach(function (eventName) {
var listener = _this.processKeyboardEvent.bind(_this, eventName);
_this.eAllCellContainers.forEach(function (container) {
_this.addManagedListener(container, eventName, listener);
});
});
};
GridPanel.prototype.addBodyViewportListener = function () {
var _this = this;
// we want to listen for clicks directly on the eBodyViewport, so the user has a way of showing
// the context menu if no rows or columns are displayed, or user simply clicks outside of a cell
var listener = function (mouseEvent) {
var target = Object(_utils_event__WEBPACK_IMPORTED_MODULE_17__["getTarget"])(mouseEvent);
if (target === _this.eBodyViewport || target === _this.eCenterViewport) {
// show it
_this.onContextMenu(mouseEvent, null, null, null, null, _this.getGui());
_this.preventDefaultOnContextMenu(mouseEvent);
}
};
this.addManagedListener(this.eBodyViewport, 'contextmenu', listener);
};
// + rangeController - used to know when to scroll when user is dragging outside the
// main viewport while doing a range selection
GridPanel.prototype.getBodyClientRect = function () {
if (!this.eBodyViewport) {
return;
}
return this.eBodyViewport.getBoundingClientRect();
};
GridPanel.prototype.getRowForEvent = function (event) {
var sourceElement = Object(_utils_event__WEBPACK_IMPORTED_MODULE_17__["getTarget"])(event);
while (sourceElement) {
var renderedRow = this.gridOptionsWrapper.getDomData(sourceElement, _rendering_row_rowComp__WEBPACK_IMPORTED_MODULE_5__["RowComp"].DOM_DATA_KEY_RENDERED_ROW);
if (renderedRow) {
return renderedRow;
}
sourceElement = sourceElement.parentElement;
}
return null;
};
GridPanel.prototype.processKeyboardEvent = function (eventName, keyboardEvent) {
var cellComp = Object(_utils_event__WEBPACK_IMPORTED_MODULE_17__["getCellCompForEvent"])(this.gridOptionsWrapper, keyboardEvent);
if (!cellComp || keyboardEvent.defaultPrevented) {
return;
}
var rowNode = cellComp.getRenderedRow().getRowNode();
var column = cellComp.getColumn();
var editing = cellComp.isEditing();
var gridProcessingAllowed = !Object(_utils_keyboard__WEBPACK_IMPORTED_MODULE_18__["isUserSuppressingKeyboardEvent"])(this.gridOptionsWrapper, keyboardEvent, rowNode, column, editing);
if (gridProcessingAllowed) {
switch (eventName) {
case 'keydown':
// first see if it's a scroll key, page up / down, home / end etc
var wasScrollKey = !editing && this.navigationService.handlePageScrollingKey(keyboardEvent);
// if not a scroll key, then we pass onto cell
if (!wasScrollKey) {
cellComp.onKeyDown(keyboardEvent);
}
// perform clipboard and undo / redo operations
this.doGridOperations(keyboardEvent, cellComp);
break;
case 'keypress':
cellComp.onKeyPress(keyboardEvent);
break;
}
}
if (eventName === 'keydown') {
var cellKeyDownEvent = cellComp.createEvent(keyboardEvent, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_CELL_KEY_DOWN);
this.eventService.dispatchEvent(cellKeyDownEvent);
}
if (eventName === 'keypress') {
var cellKeyPressEvent = cellComp.createEvent(keyboardEvent, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_CELL_KEY_PRESS);
this.eventService.dispatchEvent(cellKeyPressEvent);
}
};
GridPanel.prototype.doGridOperations = function (keyboardEvent, cellComp) {
// check if ctrl or meta key pressed
if (!keyboardEvent.ctrlKey && !keyboardEvent.metaKey) {
return;
}
// if the cell the event came from is editing, then we do not
// want to do the default shortcut keys, otherwise the editor
// (eg a text field) would not be able to do the normal cut/copy/paste
if (cellComp.isEditing()) {
return;
}
// for copy / paste, we don't want to execute when the event
// was from a child grid (happens in master detail)
if (!this.mouseEventService.isEventFromThisGrid(keyboardEvent)) {
return;
}
switch (keyboardEvent.which) {
case _constants_keyCode__WEBPACK_IMPORTED_MODULE_21__["KeyCode"].A:
return this.onCtrlAndA(keyboardEvent);
case _constants_keyCode__WEBPACK_IMPORTED_MODULE_21__["KeyCode"].C:
return this.onCtrlAndC(keyboardEvent);
case _constants_keyCode__WEBPACK_IMPORTED_MODULE_21__["KeyCode"].V:
return this.onCtrlAndV();
case _constants_keyCode__WEBPACK_IMPORTED_MODULE_21__["KeyCode"].D:
return this.onCtrlAndD(keyboardEvent);
case _constants_keyCode__WEBPACK_IMPORTED_MODULE_21__["KeyCode"].Z:
return keyboardEvent.shiftKey ? this.undoRedoService.redo() : this.undoRedoService.undo();
case _constants_keyCode__WEBPACK_IMPORTED_MODULE_21__["KeyCode"].Y:
return this.undoRedoService.redo();
}
};
// gets called by rowRenderer when new data loaded, as it will want to scroll to the top
GridPanel.prototype.scrollToTop = function () {
this.eBodyViewport.scrollTop = 0;
};
GridPanel.prototype.processMouseEvent = function (eventName, mouseEvent) {
if (!this.mouseEventService.isEventFromThisGrid(mouseEvent) ||
Object(_utils_event__WEBPACK_IMPORTED_MODULE_17__["isStopPropagationForAgGrid"])(mouseEvent)) {
return;
}
var rowComp = this.getRowForEvent(mouseEvent);
var cellComp = this.mouseEventService.getRenderedCellForEvent(mouseEvent);
if (eventName === "contextmenu") {
this.preventDefaultOnContextMenu(mouseEvent);
this.handleContextMenuMouseEvent(mouseEvent, null, rowComp, cellComp);
}
else {
if (cellComp) {
cellComp.onMouseEvent(eventName, mouseEvent);
}
if (rowComp) {
rowComp.onMouseEvent(eventName, mouseEvent);
}
}
};
GridPanel.prototype.mockContextMenuForIPad = function () {
var _this = this;
// we do NOT want this when not in iPad, otherwise we will be doing
if (!Object(_utils_browser__WEBPACK_IMPORTED_MODULE_15__["isIOSUserAgent"])()) {
return;
}
this.eAllCellContainers.forEach(function (container) {
var touchListener = new _widgets_touchListener__WEBPACK_IMPORTED_MODULE_6__["TouchListener"](container);
var longTapListener = function (event) {
var rowComp = _this.getRowForEvent(event.touchEvent);
var cellComp = _this.mouseEventService.getRenderedCellForEvent(event.touchEvent);
_this.handleContextMenuMouseEvent(null, event.touchEvent, rowComp, cellComp);
};
_this.addManagedListener(touchListener, _widgets_touchListener__WEBPACK_IMPORTED_MODULE_6__["TouchListener"].EVENT_LONG_TAP, longTapListener);
_this.addDestroyFunc(function () { return touchListener.destroy(); });
});
};
GridPanel.prototype.handleContextMenuMouseEvent = function (mouseEvent, touchEvent, rowComp, cellComp) {
var rowNode = rowComp ? rowComp.getRowNode() : null;
var column = cellComp ? cellComp.getColumn() : null;
var value = null;
if (column) {
var event_1 = mouseEvent ? mouseEvent : touchEvent;
cellComp.dispatchCellContextMenuEvent(event_1);
value = this.valueService.getValue(column, rowNode);
}
// if user clicked on a cell, anchor to that cell, otherwise anchor to the grid panel
var anchorToElement = cellComp ? cellComp.getGui() : this.getGui();
this.onContextMenu(mouseEvent, touchEvent, rowNode, column, value, anchorToElement);
};
GridPanel.prototype.onContextMenu = function (mouseEvent, touchEvent, rowNode, column, value, anchorToElement) {
// to allow us to debug in chrome, we ignore the event if ctrl is pressed.
// not everyone wants this, so first 'if' below allows to turn this hack off.
if (!this.gridOptionsWrapper.isAllowContextMenuWithControlKey()) {
// then do the check
if (mouseEvent && (mouseEvent.ctrlKey || mouseEvent.metaKey)) {
return;
}
}
if (this.contextMenuFactory && !this.gridOptionsWrapper.isSuppressContextMenu()) {
var eventOrTouch = mouseEvent ? mouseEvent : touchEvent.touches[0];
if (this.contextMenuFactory.showMenu(rowNode, column, value, eventOrTouch, anchorToElement)) {
var event_2 = mouseEvent ? mouseEvent : touchEvent;
event_2.preventDefault();
}
}
};
GridPanel.prototype.preventDefaultOnContextMenu = function (mouseEvent) {
// if we don't do this, then middle click will never result in a 'click' event, as 'mousedown'
// will be consumed by the browser to mean 'scroll' (as you can scroll with the middle mouse
// button in the browser). so this property allows the user to receive middle button clicks if
// they want.
var gridOptionsWrapper = this.gridOptionsWrapper;
var which = mouseEvent.which;
if (gridOptionsWrapper.isPreventDefaultOnContextMenu() ||
(gridOptionsWrapper.isSuppressMiddleClickScrolls() && which === 2)) {
mouseEvent.preventDefault();
}
};
GridPanel.prototype.onCtrlAndA = function (event) {
var _a = this, pinnedRowModel = _a.pinnedRowModel, paginationProxy = _a.paginationProxy, rangeController = _a.rangeController;
var PINNED_BOTTOM = _constants_constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].PINNED_BOTTOM, PINNED_TOP = _constants_constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].PINNED_TOP;
if (rangeController && paginationProxy.isRowsToRender()) {
var _b = [
pinnedRowModel.isEmpty(PINNED_TOP),
pinnedRowModel.isEmpty(PINNED_BOTTOM)
], isEmptyPinnedTop = _b[0], isEmptyPinnedBottom = _b[1];
var floatingStart = isEmptyPinnedTop ? null : PINNED_TOP;
var floatingEnd = void 0;
var rowEnd = void 0;
if (isEmptyPinnedBottom) {
floatingEnd = null;
rowEnd = this.paginationProxy.getRowCount() - 1;
}
else {
floatingEnd = PINNED_BOTTOM;
rowEnd = pinnedRowModel.getPinnedBottomRowData().length - 1;
}
var allDisplayedColumns = this.columnController.getAllDisplayedColumns();
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_16__["missingOrEmpty"])(allDisplayedColumns)) {
return;
}
rangeController.setCellRange({
rowStartIndex: 0,
rowStartPinned: floatingStart,
rowEndIndex: rowEnd,
rowEndPinned: floatingEnd,
columnStart: allDisplayedColumns[0],
columnEnd: Object(_utils_array__WEBPACK_IMPORTED_MODULE_19__["last"])(allDisplayedColumns)
});
}
event.preventDefault();
};
GridPanel.prototype.onCtrlAndC = function (event) {
if (!this.clipboardService || this.gridOptionsWrapper.isEnableCellTextSelection()) {
return;
}
this.clipboardService.copyToClipboard();
event.preventDefault();
};
GridPanel.prototype.onCtrlAndV = function () {
if (_modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_10__["ModuleRegistry"].isRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_11__["ModuleNames"].ClipboardModule) && !this.gridOptionsWrapper.isSuppressClipboardPaste()) {
this.clipboardService.pasteFromClipboard();
}
};
GridPanel.prototype.onCtrlAndD = function (event) {
if (_modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_10__["ModuleRegistry"].isRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_11__["ModuleNames"].ClipboardModule) && !this.gridOptionsWrapper.isSuppressClipboardPaste()) {
this.clipboardService.copyRangeDown();
}
event.preventDefault();
};
// Valid values for position are bottom, middle and top
// position should be {'top','middle','bottom', or undefined/null}.
// if undefined/null, then the grid will to the minimal amount of scrolling,
// eg if grid needs to scroll up, it scrolls until row is on top,
// if grid needs to scroll down, it scrolls until row is on bottom,
// if row is already in view, grid does not scroll
GridPanel.prototype.ensureIndexVisible = function (index, position) {
// if for print or auto height, everything is always visible
if (this.printLayout) {
return;
}
var rowCount = this.paginationProxy.getRowCount();
if (typeof index !== 'number' || index < 0 || index >= rowCount) {
console.warn('invalid row index for ensureIndexVisible: ' + index);
return;
}
var isPaging = this.gridOptionsWrapper.isPagination();
var paginationPanelEnabled = isPaging && !this.gridOptionsWrapper.isSuppressPaginationPanel();
if (!paginationPanelEnabled) {
this.paginationProxy.goToPageWithIndex(index);
}
var rowNode = this.paginationProxy.getRow(index);
var rowGotShiftedDuringOperation;
do {
var startingRowTop = rowNode.rowTop;
var startingRowHeight = rowNode.rowHeight;
var paginationOffset = this.paginationProxy.getPixelOffset();
var rowTopPixel = rowNode.rowTop - paginationOffset;
var rowBottomPixel = rowTopPixel + rowNode.rowHeight;
var scrollPosition = this.getVScrollPosition();
var heightOffset = this.heightScaler.getOffset();
var vScrollTop = scrollPosition.top + heightOffset;
var vScrollBottom = scrollPosition.bottom + heightOffset;
var viewportHeight = vScrollBottom - vScrollTop;
// work out the pixels for top, middle and bottom up front,
// make the if/else below easier to read
var pxTop = this.heightScaler.getScrollPositionForPixel(rowTopPixel);
var pxBottom = this.heightScaler.getScrollPositionForPixel(rowBottomPixel - viewportHeight);
// make sure if middle, the row is not outside the top of the grid
var pxMiddle = Math.min((pxTop + pxBottom) / 2, rowTopPixel);
var rowBelowViewport = vScrollTop > rowTopPixel;
var rowAboveViewport = vScrollBottom < rowBottomPixel;
var newScrollPosition = null;
if (position === 'top') {
newScrollPosition = pxTop;
}
else if (position === 'bottom') {
newScrollPosition = pxBottom;
}
else if (position === 'middle') {
newScrollPosition = pxMiddle;
}
else if (rowBelowViewport) {
// if row is before, scroll up with row at top
newScrollPosition = pxTop;
}
else if (rowAboveViewport) {
// if row is below, scroll down with row at bottom
newScrollPosition = pxBottom;
}
if (newScrollPosition !== null) {
this.eBodyViewport.scrollTop = newScrollPosition;
this.rowRenderer.redrawAfterScroll();
}
// the row can get shifted if during the rendering (during rowRenderer.redrawAfterScroll()),
// the height of a row changes due to lazy calculation of row heights when using
// colDef.autoHeight or gridOptions.getRowHeight.
// if row was shifted, then the position we scrolled to is incorrect.
rowGotShiftedDuringOperation = (startingRowTop !== rowNode.rowTop)
|| (startingRowHeight !== rowNode.rowHeight);
} while (rowGotShiftedDuringOperation);
// so when we return back to user, the cells have rendered
this.animationFrameService.flushAllFrames();
};
// + moveColumnController
GridPanel.prototype.getCenterWidth = function () {
return this.eCenterViewport.clientWidth;
};
GridPanel.prototype.isVerticalScrollShowing = function () {
var isAlwaysShowVerticalScroll = this.gridOptionsWrapper.isAlwaysShowVerticalScroll();
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_14__["addOrRemoveCssClass"])(this.eBodyViewport, 'ag-force-vertical-scroll', isAlwaysShowVerticalScroll);
return isAlwaysShowVerticalScroll || Object(_utils_dom__WEBPACK_IMPORTED_MODULE_14__["isVerticalScrollShowing"])(this.eBodyViewport);
};
GridPanel.prototype.isHorizontalScrollShowing = function () {
return Object(_utils_dom__WEBPACK_IMPORTED_MODULE_14__["isHorizontalScrollShowing"])(this.eCenterViewport);
};
GridPanel.prototype.onScrollbarWidthChanged = function () {
this.checkViewportAndScrolls();
};
// gets called every time the viewport size changes. we use this to check visibility of scrollbars
// in the grid panel, and also to check size and position of viewport for row and column virtualisation.
GridPanel.prototype.checkViewportAndScrolls = function () {
// results in updating anything that depends on scroll showing
this.updateScrollVisibleService();
// fires event if height changes, used by PaginationService, HeightScalerService, RowRenderer
this.checkBodyHeight();
// check for virtual columns for ColumnController
this.onHorizontalViewportChanged();
this.setPinnedContainerSize();
// this is to cater for AG-3274, where grid is removed from the dom and then inserted back in again.
// (which happens with some implementations of tabbing). this can result in horizontal scroll getting
// reset back to the left, however no scroll event is fired. so we need to get header to also scroll
// back to the left to be kept in sync.
// adding and removing the grid from the DOM both resets the scroll position and
// triggers a resize event, so notify listeners if the scroll position has changed
if (this.scrollLeft !== this.getCenterViewportScrollLeft()) {
this.onBodyHorizontalScroll(this.eCenterViewport);
}
};
GridPanel.prototype.updateScrollVisibleService = function () {
// because of column animation (which takes 200ms), we have to do this twice.
// eg if user removes cols anywhere except at the RHS, then the cols on the RHS
// will animate to the left to fill the gap. this animation means just after
// the cols are removed, the remaining cols are still in the original location
// at the start of the animation, so pre animation the H scrollbar is still needed,
// but post animation it is not.
this.updateScrollVisibleServiceImpl();
setTimeout(this.updateScrollVisibleServiceImpl.bind(this), 500);
};
GridPanel.prototype.updateScrollVisibleServiceImpl = function () {
var params = {
horizontalScrollShowing: false,
verticalScrollShowing: false
};
params.verticalScrollShowing = this.isVerticalScrollShowing();
params.horizontalScrollShowing = this.isHorizontalScrollShowing();
this.scrollVisibleService.setScrollsVisible(params);
this.setHorizontalScrollVisible(params.horizontalScrollShowing);
this.setVerticalScrollPaddingVisible(params.verticalScrollShowing);
};
GridPanel.prototype.setHorizontalScrollVisible = function (visible) {
var isSuppressHorizontalScroll = this.gridOptionsWrapper.isSuppressHorizontalScroll();
var scrollbarWidth = visible ? (this.gridOptionsWrapper.getScrollbarWidth() || 0) : 0;
var scrollContainerSize = !isSuppressHorizontalScroll ? scrollbarWidth : 0;
var addIEPadding = Object(_utils_browser__WEBPACK_IMPORTED_MODULE_15__["isBrowserIE"])() && visible;
this.eCenterViewport.style.height = "calc(100% + " + scrollbarWidth + "px)";
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_14__["setFixedHeight"])(this.eHorizontalScrollBody, scrollContainerSize);
// we have to add an extra pixel to the scroller viewport on IE because
// if the container has the same size as the scrollbar, the scroll button won't work
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_14__["setFixedHeight"])(this.eBodyHorizontalScrollViewport, scrollContainerSize + (addIEPadding ? 1 : 0));
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_14__["setFixedHeight"])(this.eBodyHorizontalScrollContainer, scrollContainerSize);
};
GridPanel.prototype.setVerticalScrollPaddingVisible = function (show) {
var scroller = show ? 'scroll' : 'hidden';
this.eTop.style.overflowY = this.eBottom.style.overflowY = scroller;
this.setFakeHScrollSpacerWidths();
};
GridPanel.prototype.updateRowCount = function () {
var headerCount = this.headerNavigationService.getHeaderRowCount();
var modelType = this.paginationProxy.getType();
var rowCount = -1;
if (modelType === _constants_constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].ROW_MODEL_TYPE_CLIENT_SIDE) {
rowCount = 0;
this.paginationProxy.forEachNode(function (node) {
if (!node.group) {
rowCount++;
}
});
}
var total = rowCount === -1 ? -1 : (headerCount + rowCount);
Object(_utils_aria__WEBPACK_IMPORTED_MODULE_12__["setAriaRowCount"])(this.getGui(), total);
};
GridPanel.prototype.updateColumnCount = function () {
var columns = this.columnController.getAllGridColumns();
Object(_utils_aria__WEBPACK_IMPORTED_MODULE_12__["setAriaColCount"])(this.getGui(), columns.length);
};
GridPanel.prototype.ensureColumnVisible = function (key) {
var column = this.columnController.getGridColumn(key);
if (!column) {
return;
}
if (column.isPinned()) {
console.warn('calling ensureIndexVisible on a ' + column.getPinned() + ' pinned column doesn\'t make sense for column ' + column.getColId());
return;
}
if (!this.columnController.isColumnDisplayed(column)) {
console.warn('column is not currently visible');
return;
}
var colLeftPixel = column.getLeft();
var colRightPixel = colLeftPixel + column.getActualWidth();
var viewportWidth = this.eCenterViewport.clientWidth;
var scrollPosition = this.getCenterViewportScrollLeft();
var bodyWidth = this.columnController.getBodyContainerWidth();
var viewportLeftPixel;
var viewportRightPixel;
// the logic of working out left and right viewport px is both here and in the ColumnController,
// need to refactor it out to one place
if (this.enableRtl) {
viewportLeftPixel = bodyWidth - scrollPosition - viewportWidth;
viewportRightPixel = bodyWidth - scrollPosition;
}
else {
viewportLeftPixel = scrollPosition;
viewportRightPixel = viewportWidth + scrollPosition;
}
var viewportScrolledPastCol = viewportLeftPixel > colLeftPixel;
var viewportScrolledBeforeCol = viewportRightPixel < colRightPixel;
var colToSmallForViewport = viewportWidth < column.getActualWidth();
var alignColToLeft = viewportScrolledPastCol || colToSmallForViewport;
var alignColToRight = viewportScrolledBeforeCol;
var newScrollPosition = this.getCenterViewportScrollLeft();
if (alignColToLeft || alignColToRight) {
if (this.enableRtl) {
newScrollPosition = alignColToLeft ? (bodyWidth - viewportWidth - colLeftPixel) : (bodyWidth - colRightPixel);
}
else {
newScrollPosition = alignColToLeft ? colLeftPixel : (colRightPixel - viewportWidth);
}
this.setCenterViewportScrollLeft(newScrollPosition);
}
else {
// otherwise, col is already in view, so do nothing
}
// this will happen anyway, as the move will cause a 'scroll' event on the body, however
// it is possible that the ensureColumnVisible method is called from within ag-Grid and
// the caller will need to have the columns rendered to continue, which will be before
// the event has been worked on (which is the case for cell navigation).
this.onHorizontalViewportChanged();
// so when we return back to user, the cells have rendered
this.animationFrameService.flushAllFrames();
};
GridPanel.prototype.showLoadingOverlay = function () {
if (!this.gridOptionsWrapper.isSuppressLoadingOverlay()) {
this.overlayWrapper.showLoadingOverlay();
}
};
GridPanel.prototype.showNoRowsOverlay = function () {
if (!this.gridOptionsWrapper.isSuppressNoRowsOverlay()) {
this.overlayWrapper.showNoRowsOverlay();
}
};
GridPanel.prototype.hideOverlay = function () {
this.overlayWrapper.hideOverlay();
};
// method will call itself if no available width. this covers if the grid
// isn't visible, but is just about to be visible.
GridPanel.prototype.sizeColumnsToFit = function (nextTimeout) {
var _this = this;
var availableWidth = this.eBodyViewport.clientWidth;
if (availableWidth > 0) {
this.columnController.sizeColumnsToFit(availableWidth, "sizeColumnsToFit");
return;
}
if (nextTimeout === undefined) {
window.setTimeout(function () {
_this.sizeColumnsToFit(100);
}, 0);
}
else if (nextTimeout === 100) {
window.setTimeout(function () {
_this.sizeColumnsToFit(500);
}, 100);
}
else if (nextTimeout === 500) {
window.setTimeout(function () {
_this.sizeColumnsToFit(-1);
}, 500);
}
else {
console.warn('ag-Grid: tried to call sizeColumnsToFit() but the grid is coming back with ' +
'zero width, maybe the grid is not visible yet on the screen?');
}
};
// used by autoWidthCalculator and autoHeightCalculator
GridPanel.prototype.getCenterContainer = function () {
return this.eCenterContainer;
};
GridPanel.prototype.getDropTargetBodyContainers = function () {
return [this.eBodyViewport, this.eTopViewport, this.eBottomViewport];
};
GridPanel.prototype.getDropTargetLeftContainers = function () {
return [this.eLeftContainer, this.eLeftBottom, this.eLeftTop];
};
GridPanel.prototype.getDropTargetRightContainers = function () {
return [this.eRightContainer, this.eRightBottom, this.eRightTop];
};
GridPanel.prototype.buildRowContainerComponents = function () {
var _this = this;
this.eAllCellContainers = [
this.eLeftContainer, this.eRightContainer, this.eCenterContainer,
this.eTop, this.eBottom, this.eFullWidthContainer
];
this.rowContainerComponents = {
body: new _rendering_row_rowContainerComponent__WEBPACK_IMPORTED_MODULE_4__["RowContainerComponent"]({
eContainer: this.eCenterContainer,
eWrapper: this.eCenterColsClipper,
eViewport: this.eBodyViewport
}),
fullWidth: new _rendering_row_rowContainerComponent__WEBPACK_IMPORTED_MODULE_4__["RowContainerComponent"]({
eContainer: this.eFullWidthContainer
}),
pinnedLeft: new _rendering_row_rowContainerComponent__WEBPACK_IMPORTED_MODULE_4__["RowContainerComponent"]({ eContainer: this.eLeftContainer }),
pinnedRight: new _rendering_row_rowContainerComponent__WEBPACK_IMPORTED_MODULE_4__["RowContainerComponent"]({ eContainer: this.eRightContainer }),
floatingTop: new _rendering_row_rowContainerComponent__WEBPACK_IMPORTED_MODULE_4__["RowContainerComponent"]({ eContainer: this.eTopContainer }),
floatingTopPinnedLeft: new _rendering_row_rowContainerComponent__WEBPACK_IMPORTED_MODULE_4__["RowContainerComponent"]({ eContainer: this.eLeftTop }),
floatingTopPinnedRight: new _rendering_row_rowContainerComponent__WEBPACK_IMPORTED_MODULE_4__["RowContainerComponent"]({ eContainer: this.eRightTop }),
floatingTopFullWidth: new _rendering_row_rowContainerComponent__WEBPACK_IMPORTED_MODULE_4__["RowContainerComponent"]({
eContainer: this.eTopFullWidthContainer,
hideWhenNoChildren: true
}),
floatingBottom: new _rendering_row_rowContainerComponent__WEBPACK_IMPORTED_MODULE_4__["RowContainerComponent"]({ eContainer: this.eBottomContainer }),
floatingBottomPinnedLeft: new _rendering_row_rowContainerComponent__WEBPACK_IMPORTED_MODULE_4__["RowContainerComponent"]({ eContainer: this.eLeftBottom }),
floatingBottomPinnedRight: new _rendering_row_rowContainerComponent__WEBPACK_IMPORTED_MODULE_4__["RowContainerComponent"]({ eContainer: this.eRightBottom }),
floatingBottomFullWidth: new _rendering_row_rowContainerComponent__WEBPACK_IMPORTED_MODULE_4__["RowContainerComponent"]({
eContainer: this.eBottomFullWidthContainer,
hideWhenNoChildren: true
}),
};
Object(_utils_object__WEBPACK_IMPORTED_MODULE_20__["iterateObject"])(this.rowContainerComponents, function (key, container) {
if (container) {
_this.getContext().createBean(container);
}
});
};
GridPanel.prototype.setupRowAnimationCssClass = function () {
var _this = this;
var listener = function () {
// we don't want to use row animation if scaling, as rows jump strangely as you scroll,
// when scaling and doing row animation.
var animateRows = _this.gridOptionsWrapper.isAnimateRows() && !_this.heightScaler.isScaling();
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_14__["addOrRemoveCssClass"])(_this.eBodyViewport, 'ag-row-animation', animateRows);
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_14__["addOrRemoveCssClass"])(_this.eBodyViewport, 'ag-row-no-animation', !animateRows);
};
listener();
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_HEIGHT_SCALE_CHANGED, listener);
};
// when editing a pinned row, if the cell is half outside the scrollable area, the browser can
// scroll the column into view. we do not want this, the pinned sections should never scroll.
// so we listen to scrolls on these containers and reset the scroll if we find one.
GridPanel.prototype.suppressScrollOnFloatingRow = function () {
var _this = this;
var resetTopScroll = function () { return _this.eTopViewport.scrollLeft = 0; };
var resetBottomScroll = function () { return _this.eTopViewport.scrollLeft = 0; };
this.addManagedListener(this.eTopViewport, 'scroll', resetTopScroll);
this.addManagedListener(this.eBottomViewport, 'scroll', resetBottomScroll);
};
GridPanel.prototype.getRowContainers = function () {
return this.rowContainerComponents;
};
GridPanel.prototype.getFloatingTopBottom = function () {
return [this.eTop, this.eBottom];
};
GridPanel.prototype.onDisplayedColumnsChanged = function () {
this.setPinnedContainerSize();
this.setHeaderAndFloatingHeights();
this.onHorizontalViewportChanged();
this.updateScrollVisibleService();
this.updateColumnCount();
};
GridPanel.prototype.onDisplayedColumnsWidthChanged = function () {
this.setWidthsOfContainers();
this.onHorizontalViewportChanged();
this.updateScrollVisibleService();
if (this.enableRtl) {
// because RTL is all backwards, a change in the width of the row
// can cause a change in the scroll position, without a scroll event,
// because the scroll position in RTL is a function that depends on
// the width. to be convinced of this, take out this line, enable RTL,
// scroll all the way to the left and then resize a column
this.horizontallyScrollHeaderCenterAndFloatingCenter();
}
};
GridPanel.prototype.setWidthsOfContainers = function () {
this.setCenterWidth();
this.setPinnedContainerSize();
};
GridPanel.prototype.setCenterWidth = function () {
var _a = this, headerRootComp = _a.headerRootComp, columnController = _a.columnController;
var width = columnController.getBodyContainerWidth();
if (this.printLayout) {
var pinnedContainerWidths = columnController.getPinnedLeftContainerWidth()
+ columnController.getPinnedRightContainerWidth();
width += pinnedContainerWidths;
}
headerRootComp.setHeaderContainerWidth(width);
var widthPx = width + "px";
this.eCenterContainer.style.width = widthPx;
this.eBottomContainer.style.width = widthPx;
this.eTopContainer.style.width = widthPx;
if (!this.printLayout) {
this.eBodyHorizontalScrollContainer.style.width = widthPx;
}
};
GridPanel.prototype.setPinnedLeftWidth = function () {
var _this = this;
var oldPinning = this.pinningLeft;
var widthOfCols = this.columnController.getPinnedLeftContainerWidth();
var newPinning = this.pinningLeft = !this.printLayout && widthOfCols > 0;
var containers = [this.eLeftContainer, this.eLeftTop, this.eLeftBottom];
if (oldPinning !== newPinning) {
this.headerRootComp.setLeftVisible(newPinning);
}
containers.forEach(function (e) { return Object(_utils_dom__WEBPACK_IMPORTED_MODULE_14__["setDisplayed"])(e, _this.pinningLeft); });
if (newPinning) {
containers.forEach(function (ct) { return Object(_utils_dom__WEBPACK_IMPORTED_MODULE_14__["setFixedWidth"])(ct, widthOfCols); });
}
};
GridPanel.prototype.setPinnedRightWidth = function () {
var oldPinning = this.pinningRight;
var widthOfCols = this.columnController.getPinnedRightContainerWidth();
var newPinning = this.pinningRight = !this.printLayout && widthOfCols > 0;
var containers = [this.eRightContainer, this.eRightTop, this.eRightBottom];
if (oldPinning !== newPinning) {
this.headerRootComp.setRightVisible(newPinning);
}
containers.forEach(function (ct) { return Object(_utils_dom__WEBPACK_IMPORTED_MODULE_14__["setDisplayed"])(ct, newPinning); });
if (newPinning) {
containers.forEach(function (ct) { return Object(_utils_dom__WEBPACK_IMPORTED_MODULE_14__["setFixedWidth"])(ct, widthOfCols); });
}
};
GridPanel.prototype.setPinnedContainerSize = function () {
this.setPinnedLeftWidth();
this.setPinnedRightWidth();
this.setFakeHScrollSpacerWidths();
};
GridPanel.prototype.setFakeHScrollSpacerWidths = function () {
// we pad the right based on a) if cols are pinned to the right and
// b) if v scroll is showing on the right (normal position of scroll)
var rightSpacing = this.columnController.getPinnedRightContainerWidth();
var scrollOnRight = !this.enableRtl && this.isVerticalScrollShowing();
var scrollbarWidth = this.gridOptionsWrapper.getScrollbarWidth();
if (scrollOnRight) {
rightSpacing += scrollbarWidth;
}
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_14__["setFixedWidth"])(this.eHorizontalRightSpacer, rightSpacing);
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_14__["addOrRemoveCssClass"])(this.eHorizontalRightSpacer, 'ag-scroller-corner', rightSpacing <= scrollbarWidth);
// we pad the left based on a) if cols are pinned to the left and
// b) if v scroll is showing on the left (happens in LTR layout only)
var leftSpacing = this.columnController.getPinnedLeftContainerWidth();
var scrollOnLeft = this.enableRtl && this.isVerticalScrollShowing();
if (scrollOnLeft) {
leftSpacing += scrollbarWidth;
}
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_14__["setFixedWidth"])(this.eHorizontalLeftSpacer, leftSpacing);
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_14__["addOrRemoveCssClass"])(this.eHorizontalLeftSpacer, 'ag-scroller-corner', leftSpacing <= scrollbarWidth);
};
GridPanel.prototype.checkBodyHeight = function () {
var bodyHeight = this.eBodyViewport.clientHeight;
if (this.bodyHeight !== bodyHeight) {
this.bodyHeight = bodyHeight;
var event_3 = {
type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_BODY_HEIGHT_CHANGED,
api: this.gridApi,
columnApi: this.columnApi
};
this.eventService.dispatchEvent(event_3);
}
};
GridPanel.prototype.setHeaderAndFloatingHeights = function () {
var _a = this, columnController = _a.columnController, gridOptionsWrapper = _a.gridOptionsWrapper, pinnedRowModel = _a.pinnedRowModel, eTop = _a.eTop, eBottom = _a.eBottom;
var numberOfFloating = 0;
var headerRowCount = columnController.getHeaderRowCount();
var totalHeaderHeight;
var groupHeight;
var headerHeight;
if (columnController.isPivotMode()) {
groupHeight = gridOptionsWrapper.getPivotGroupHeaderHeight();
headerHeight = gridOptionsWrapper.getPivotHeaderHeight();
}
else {
var hasFloatingFilters = columnController.hasFloatingFilters();
if (hasFloatingFilters) {
headerRowCount++;
numberOfFloating = 1;
}
groupHeight = gridOptionsWrapper.getGroupHeaderHeight();
headerHeight = gridOptionsWrapper.getHeaderHeight();
}
var numberOfNonGroups = 1 + numberOfFloating;
var numberOfGroups = headerRowCount - numberOfNonGroups;
totalHeaderHeight = numberOfFloating * gridOptionsWrapper.getFloatingFiltersHeight();
totalHeaderHeight += numberOfGroups * groupHeight;
totalHeaderHeight += headerHeight;
this.headerRootComp.setHeight(totalHeaderHeight);
var floatingTopHeight = pinnedRowModel.getPinnedTopTotalHeight();
if (floatingTopHeight) {
// adding 1px for cell bottom border
floatingTopHeight += 1;
}
var floatingBottomHeight = pinnedRowModel.getPinnedBottomTotalHeight();
if (floatingBottomHeight) {
// adding 1px for cell bottom border
floatingBottomHeight += 1;
}
var floatingTopHeightString = floatingTopHeight + "px";
var floatingBottomHeightString = floatingBottomHeight + "px";
eTop.style.minHeight = floatingTopHeightString;
eTop.style.height = floatingTopHeightString;
eTop.style.display = floatingTopHeight ? 'inherit' : 'none';
eBottom.style.minHeight = floatingBottomHeightString;
eBottom.style.height = floatingBottomHeightString;
eBottom.style.display = floatingBottomHeight ? 'inherit' : 'none';
this.checkBodyHeight();
};
GridPanel.prototype.getBodyHeight = function () {
return this.bodyHeight;
};
// called by scrollHorizontally method and alignedGridsService
GridPanel.prototype.setHorizontalScrollPosition = function (hScrollPosition) {
var minScrollLeft = 0;
var maxScrollLeft = this.eCenterViewport.scrollWidth - this.eCenterViewport.clientWidth;
if (this.shouldBlockScrollUpdate('horizontal', hScrollPosition)) {
hScrollPosition = Math.min(Math.max(hScrollPosition, minScrollLeft), maxScrollLeft);
}
this.eCenterViewport.scrollLeft = hScrollPosition;
// we need to manually do the event handling (rather than wait for the event)
// for the alignedGridsService, as if we don't, the aligned grid service gets
// notified async, and then it's 'consuming' flag doesn't get used right, and
// we can end up with an infinite loop
this.doHorizontalScroll(hScrollPosition);
};
GridPanel.prototype.setVerticalScrollPosition = function (vScrollPosition) {
this.eBodyViewport.scrollTop = vScrollPosition;
};
// called by the headerRootComp and moveColumnController
GridPanel.prototype.scrollHorizontally = function (pixels) {
var oldScrollPosition = this.eCenterViewport.scrollLeft;
this.setHorizontalScrollPosition(oldScrollPosition + pixels);
return this.eCenterViewport.scrollLeft - oldScrollPosition;
};
// called by rowDragFeature
GridPanel.prototype.scrollVertically = function (pixels) {
var oldScrollPosition = this.eBodyViewport.scrollTop;
this.setVerticalScrollPosition(oldScrollPosition + pixels);
return this.eBodyViewport.scrollTop - oldScrollPosition;
};
GridPanel.prototype.addScrollListener = function () {
this.addManagedListener(this.eCenterViewport, 'scroll', this.onCenterViewportScroll.bind(this));
this.addManagedListener(this.eBodyHorizontalScrollViewport, 'scroll', this.onFakeHorizontalScroll.bind(this));
var onVerticalScroll = this.gridOptionsWrapper.isDebounceVerticalScrollbar() ?
Object(_utils_function__WEBPACK_IMPORTED_MODULE_13__["debounce"])(this.onVerticalScroll.bind(this), 100)
: this.onVerticalScroll.bind(this);
this.addManagedListener(this.eBodyViewport, 'scroll', onVerticalScroll);
};
GridPanel.prototype.onVerticalScroll = function () {
var scrollTop = this.eBodyViewport.scrollTop;
if (this.shouldBlockScrollUpdate('vertical', scrollTop, true)) {
return;
}
this.animationFrameService.setScrollTop(scrollTop);
this.scrollTop = scrollTop;
this.redrawRowsAfterScroll();
};
GridPanel.prototype.shouldBlockScrollUpdate = function (direction, scrollTo, touchOnly) {
// touch devices allow elastic scroll - which temporally scrolls the panel outside of the viewport
// (eg user uses touch to go to the left of the grid, but drags past the left, the rows will actually
// scroll past the left until the user releases the mouse). when this happens, we want ignore the scroll,
// as otherwise it was causing the rows and header to flicker.
if (touchOnly === void 0) { touchOnly = false; }
// sometimes when scrolling, we got values that extended the maximum scroll allowed. we used to
// ignore these scrolls. problem is the max scroll position could be skipped (eg the previous scroll event
// could be 10px before the max position, and then current scroll event could be 20px after the max position).
// if we just ignored the last event, we would be setting the scroll to 10px before the max position, when in
// actual fact the user has exceeded the max scroll and thus scroll should be set to the max.
if (touchOnly && !Object(_utils_browser__WEBPACK_IMPORTED_MODULE_15__["isIOSUserAgent"])()) {
return false;
}
if (direction === 'vertical') {
var _a = this.eBodyViewport, clientHeight = _a.clientHeight, scrollHeight = _a.scrollHeight;
if (scrollTo < 0 || (scrollTo + clientHeight > scrollHeight)) {
return true;
}
}
if (direction === 'horizontal') {
var _b = this.eCenterViewport, clientWidth = _b.clientWidth, scrollWidth = _b.scrollWidth;
if (this.enableRtl && Object(_utils_dom__WEBPACK_IMPORTED_MODULE_14__["isRtlNegativeScroll"])()) {
if (scrollTo > 0) {
return true;
}
}
else if (scrollTo < 0) {
return true;
}
if (Math.abs(scrollTo) + clientWidth > scrollWidth) {
return true;
}
}
return false;
};
GridPanel.prototype.isControllingScroll = function (eDiv) {
if (!this.lastHorizontalScrollElement) {
this.lastHorizontalScrollElement = eDiv;
return true;
}
return eDiv === this.lastHorizontalScrollElement;
};
GridPanel.prototype.onFakeHorizontalScroll = function () {
if (!this.isControllingScroll(this.eBodyHorizontalScrollViewport)) {
return;
}
this.onBodyHorizontalScroll(this.eBodyHorizontalScrollViewport);
};
GridPanel.prototype.onCenterViewportScroll = function () {
if (!this.isControllingScroll(this.eCenterViewport)) {
return;
}
this.onBodyHorizontalScroll(this.eCenterViewport);
};
GridPanel.prototype.onBodyHorizontalScroll = function (eSource) {
var scrollLeft = this.eCenterViewport.scrollLeft;
if (this.shouldBlockScrollUpdate('horizontal', scrollLeft, true)) {
return;
}
this.doHorizontalScroll(Math.floor(Object(_utils_dom__WEBPACK_IMPORTED_MODULE_14__["getScrollLeft"])(eSource, this.enableRtl)));
this.resetLastHorizontalScrollElementDebounced();
};
GridPanel.prototype.resetLastHorizontalScrollElement = function () {
this.lastHorizontalScrollElement = null;
};
GridPanel.prototype.doHorizontalScroll = function (scrollLeft) {
this.scrollLeft = scrollLeft;
var event = {
type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_BODY_SCROLL,
api: this.gridApi,
columnApi: this.columnApi,
direction: 'horizontal',
left: this.scrollLeft,
top: this.scrollTop
};
this.eventService.dispatchEvent(event);
this.horizontallyScrollHeaderCenterAndFloatingCenter(scrollLeft);
this.onHorizontalViewportChanged();
};
GridPanel.prototype.redrawRowsAfterScroll = function () {
var event = {
type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_BODY_SCROLL,
direction: 'vertical',
api: this.gridApi,
columnApi: this.columnApi,
left: this.scrollLeft,
top: this.scrollTop
};
this.eventService.dispatchEvent(event);
};
// this gets called whenever a change in the viewport, so we can inform column controller it has to work
// out the virtual columns again. gets called from following locations:
// + ensureColVisible, scroll, init, layoutChanged, displayedColumnsChanged, API (doLayout)
GridPanel.prototype.onHorizontalViewportChanged = function () {
var scrollWidth = this.eCenterViewport.clientWidth;
var scrollPosition = this.getCenterViewportScrollLeft();
this.columnController.setVirtualViewportPosition(scrollWidth, scrollPosition);
};
GridPanel.prototype.getCenterViewportScrollLeft = function () {
// we defer to a util, as how you calculated scrollLeft when doing RTL depends on the browser
return Object(_utils_dom__WEBPACK_IMPORTED_MODULE_14__["getScrollLeft"])(this.eCenterViewport, this.enableRtl);
};
GridPanel.prototype.setCenterViewportScrollLeft = function (value) {
// we defer to a util, as how you calculated scrollLeft when doing RTL depends on the browser
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_14__["setScrollLeft"])(this.eCenterViewport, value, this.enableRtl);
};
GridPanel.prototype.horizontallyScrollHeaderCenterAndFloatingCenter = function (scrollLeft) {
if (scrollLeft === undefined) {
scrollLeft = this.getCenterViewportScrollLeft();
}
var offset = this.enableRtl ? scrollLeft : -scrollLeft;
this.headerRootComp.setHorizontalScroll(offset);
this.eBottomContainer.style.transform = "translateX(" + offset + "px)";
this.eTopContainer.style.transform = "translateX(" + offset + "px)";
var partner = this.lastHorizontalScrollElement === this.eCenterViewport ? this.eBodyHorizontalScrollViewport : this.eCenterViewport;
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_14__["setScrollLeft"])(partner, scrollLeft, this.enableRtl);
};
// + rangeController
GridPanel.prototype.addScrollEventListener = function (listener) {
this.eBodyViewport.addEventListener('scroll', listener);
};
// + rangeController
GridPanel.prototype.removeScrollEventListener = function (listener) {
this.eBodyViewport.removeEventListener('scroll', listener);
};
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('alignedGridsService')
], GridPanel.prototype, "alignedGridsService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('rowRenderer')
], GridPanel.prototype, "rowRenderer", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('pinnedRowModel')
], GridPanel.prototype, "pinnedRowModel", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('animationFrameService')
], GridPanel.prototype, "animationFrameService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('navigationService')
], GridPanel.prototype, "navigationService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('autoHeightCalculator')
], GridPanel.prototype, "autoHeightCalculator", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('columnAnimationService')
], GridPanel.prototype, "columnAnimationService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('autoWidthCalculator')
], GridPanel.prototype, "autoWidthCalculator", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('paginationAutoPageSizeService')
], GridPanel.prototype, "paginationAutoPageSizeService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('beans')
], GridPanel.prototype, "beans", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('paginationProxy')
], GridPanel.prototype, "paginationProxy", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('columnApi')
], GridPanel.prototype, "columnApi", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('gridApi')
], GridPanel.prototype, "gridApi", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('dragService')
], GridPanel.prototype, "dragService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('mouseEventService')
], GridPanel.prototype, "mouseEventService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('$scope')
], GridPanel.prototype, "$scope", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('scrollVisibleService')
], GridPanel.prototype, "scrollVisibleService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('valueService')
], GridPanel.prototype, "valueService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('dragAndDropService')
], GridPanel.prototype, "dragAndDropService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('maxDivHeightScaler')
], GridPanel.prototype, "heightScaler", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('resizeObserverService')
], GridPanel.prototype, "resizeObserverService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('undoRedoService')
], GridPanel.prototype, "undoRedoService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('columnController')
], GridPanel.prototype, "columnController", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('headerNavigationService')
], GridPanel.prototype, "headerNavigationService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('popupService')
], GridPanel.prototype, "popupService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Optional"])('rangeController')
], GridPanel.prototype, "rangeController", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Optional"])('contextMenuFactory')
], GridPanel.prototype, "contextMenuFactory", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Optional"])('menuFactory')
], GridPanel.prototype, "menuFactory", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Optional"])('clipboardService')
], GridPanel.prototype, "clipboardService", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eBodyViewport')
], GridPanel.prototype, "eBodyViewport", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eCenterContainer')
], GridPanel.prototype, "eCenterContainer", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eCenterViewport')
], GridPanel.prototype, "eCenterViewport", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eLeftContainer')
], GridPanel.prototype, "eLeftContainer", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eRightContainer')
], GridPanel.prototype, "eRightContainer", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eCenterColsClipper')
], GridPanel.prototype, "eCenterColsClipper", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eHorizontalScrollBody')
], GridPanel.prototype, "eHorizontalScrollBody", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eHorizontalLeftSpacer')
], GridPanel.prototype, "eHorizontalLeftSpacer", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eHorizontalRightSpacer')
], GridPanel.prototype, "eHorizontalRightSpacer", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eBodyHorizontalScrollViewport')
], GridPanel.prototype, "eBodyHorizontalScrollViewport", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eBodyHorizontalScrollContainer')
], GridPanel.prototype, "eBodyHorizontalScrollContainer", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eFullWidthContainer')
], GridPanel.prototype, "eFullWidthContainer", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eTop')
], GridPanel.prototype, "eTop", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eLeftTop')
], GridPanel.prototype, "eLeftTop", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eRightTop')
], GridPanel.prototype, "eRightTop", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eTopContainer')
], GridPanel.prototype, "eTopContainer", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eTopViewport')
], GridPanel.prototype, "eTopViewport", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eTopFullWidthContainer')
], GridPanel.prototype, "eTopFullWidthContainer", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eBottom')
], GridPanel.prototype, "eBottom", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eLeftBottom')
], GridPanel.prototype, "eLeftBottom", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eRightBottom')
], GridPanel.prototype, "eRightBottom", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eBottomContainer')
], GridPanel.prototype, "eBottomContainer", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eBottomViewport')
], GridPanel.prototype, "eBottomViewport", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eBottomFullWidthContainer')
], GridPanel.prototype, "eBottomFullWidthContainer", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('headerRoot')
], GridPanel.prototype, "headerRootComp", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('overlayWrapper')
], GridPanel.prototype, "overlayWrapper", void 0);
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_1__["PostConstruct"]
], GridPanel.prototype, "init", null);
return GridPanel;
}(_widgets_component__WEBPACK_IMPORTED_MODULE_8__["Component"]));
/***/ }),
/* 134 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RowContainerComponent", function() { return RowContainerComponent; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(95);
/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(42);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (undefined && undefined.__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;
};
/**
* There are many instances of this component covering each of the areas a row can be entered
* eg body, pinned left, fullWidth. The component differs from others in that it's given the
* elements, there is no template. All of the elements are part of the GridPanel.
*/
var RowContainerComponent = /** @class */ (function () {
function RowContainerComponent(params) {
this.childCount = 0;
this.rowTemplatesToAdd = [];
this.afterGuiAttachedCallbacks = [];
// this is to cater for a 'strange behaviour' where when a panel is made visible, it is firing a scroll
// event which we want to ignore. see gridPanel.onAnyBodyScroll()
this.lastMadeVisibleTime = 0;
this.eContainer = params.eContainer;
this.eViewport = params.eViewport;
if (params.eWrapper) {
this.eWrapper = params.eWrapper;
}
this.hideWhenNoChildren = params.hideWhenNoChildren;
}
RowContainerComponent.prototype.setVerticalScrollPosition = function (verticalScrollPosition) {
this.scrollTop = verticalScrollPosition;
};
RowContainerComponent.prototype.postConstruct = function () {
this.checkDomOrder();
this.checkVisibility();
this.gridOptionsWrapper.addEventListener(_gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_1__["GridOptionsWrapper"].PROP_DOM_LAYOUT, this.checkDomOrder.bind(this));
};
RowContainerComponent.prototype.checkDomOrder = function () {
this.domOrder = this.gridOptionsWrapper.isEnsureDomOrder();
};
RowContainerComponent.prototype.getRowElement = function (compId) {
return this.eContainer.querySelector("[comp-id=\"" + compId + "\"]");
};
RowContainerComponent.prototype.setHeight = function (height) {
if (height == null) {
this.eContainer.style.height = '';
return;
}
this.eContainer.style.height = height + "px";
if (this.eWrapper) {
this.eWrapper.style.height = height + "px";
}
};
RowContainerComponent.prototype.flushRowTemplates = function () {
// if doing dom order, then rowTemplates will be empty,
// or if no rows added since last time also empty.
if (this.rowTemplatesToAdd.length !== 0) {
var htmlToAdd = this.rowTemplatesToAdd.join('');
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_2__["appendHtml"])(this.eContainer, htmlToAdd);
this.rowTemplatesToAdd.length = 0;
}
// this only empty if no rows since last time, as when
// doing dom order, we still have callbacks to process
this.afterGuiAttachedCallbacks.forEach(function (func) { return func(); });
this.afterGuiAttachedCallbacks.length = 0;
this.lastPlacedElement = null;
};
RowContainerComponent.prototype.appendRowTemplate = function (rowTemplate, callback) {
if (this.domOrder) {
this.lastPlacedElement = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_2__["insertTemplateWithDomOrder"])(this.eContainer, rowTemplate, this.lastPlacedElement);
}
else {
this.rowTemplatesToAdd.push(rowTemplate);
}
this.afterGuiAttachedCallbacks.push(callback);
// it is important we put items in in order, so that when we open a row group,
// the new rows are inserted after the opened group, but before the rows below.
// that way, the rows below are over the new rows (as dom renders last in dom over
// items previous in dom), otherwise the child rows would cover the row below and
// that meant the user doesn't see the rows below slide away.
this.childCount++;
this.checkVisibility();
};
RowContainerComponent.prototype.ensureDomOrder = function (eRow) {
if (this.domOrder) {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_2__["ensureDomOrder"])(this.eContainer, eRow, this.lastPlacedElement);
this.lastPlacedElement = eRow;
}
};
RowContainerComponent.prototype.removeRowElement = function (eRow) {
this.eContainer.removeChild(eRow);
this.childCount--;
this.checkVisibility();
};
RowContainerComponent.prototype.checkVisibility = function () {
if (!this.hideWhenNoChildren) {
return;
}
var eGui = this.eViewport ? this.eViewport : this.eContainer;
var visible = this.childCount > 0;
if (this.visible !== visible) {
this.visible = visible;
this.lastMadeVisibleTime = new Date().getTime();
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_2__["setDisplayed"])(eGui, visible);
// if we are showing the viewport, then the scroll is always zero,
// so we need to align with the other sections (ie if this is full
// width container, and first time showing a full width row, we need to
// scroll it so full width rows are show in right place alongside the
// body rows). without this, there was an issue with 'loading rows' for
// server side row model, as loading rows are full width, and they were
// not getting displayed in the right location when rows were expanded.
if (visible && this.eViewport) {
this.eViewport.scrollTop = this.scrollTop;
}
}
};
RowContainerComponent.prototype.isMadeVisibleRecently = function () {
var now = new Date().getTime();
var millisSinceVisible = now - this.lastMadeVisibleTime;
return millisSinceVisible < 500;
};
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
], RowContainerComponent.prototype, "gridOptionsWrapper", void 0);
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_0__["PostConstruct"]
], RowContainerComponent.prototype, "postConstruct", null);
return RowContainerComponent;
}());
/***/ }),
/* 135 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RowDragFeature", function() { return RowDragFeature; });
/* harmony import */ var _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(105);
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12);
/* harmony import */ var _eventKeys__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(24);
/* harmony import */ var _utils_array__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(14);
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(20);
/* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7);
/* harmony import */ var _utils_function__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(15);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __assign = (undefined && undefined.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __decorate = (undefined && undefined.__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 __spreadArrays = (undefined && undefined.__spreadArrays) || function () {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
};
var RowDragFeature = /** @class */ (function (_super) {
__extends(RowDragFeature, _super);
function RowDragFeature(eContainer, gridPanel) {
var _this = _super.call(this) || this;
_this.isMultiRowDrag = false;
_this.isGridSorted = false;
_this.isGridFiltered = false;
_this.isRowGroupActive = false;
_this.eContainer = eContainer;
_this.gridPanel = gridPanel;
return _this;
}
RowDragFeature.prototype.postConstruct = function () {
if (this.gridOptionsWrapper.isRowModelDefault()) {
this.clientSideRowModel = this.rowModel;
}
this.addManagedListener(this.eventService, _eventKeys__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_SORT_CHANGED, this.onSortChanged.bind(this));
this.addManagedListener(this.eventService, _eventKeys__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_FILTER_CHANGED, this.onFilterChanged.bind(this));
this.addManagedListener(this.eventService, _eventKeys__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_ROW_GROUP_CHANGED, this.onRowGroupChanged.bind(this));
this.onSortChanged();
this.onFilterChanged();
this.onRowGroupChanged();
};
RowDragFeature.prototype.onSortChanged = function () {
this.isGridSorted = this.sortController.isSortActive();
};
RowDragFeature.prototype.onFilterChanged = function () {
this.isGridFiltered = this.filterManager.isAnyFilterPresent();
};
RowDragFeature.prototype.onRowGroupChanged = function () {
var rowGroups = this.columnController.getRowGroupColumns();
this.isRowGroupActive = !Object(_utils_generic__WEBPACK_IMPORTED_MODULE_5__["missingOrEmpty"])(rowGroups);
};
RowDragFeature.prototype.getContainer = function () {
return this.eContainer;
};
RowDragFeature.prototype.isInterestedIn = function (type) {
return type === _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_0__["DragSourceType"].RowDrag;
};
RowDragFeature.prototype.getIconName = function () {
var managedDrag = this.gridOptionsWrapper.isRowDragManaged();
if (managedDrag && this.shouldPreventRowMove()) {
return _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_0__["DragAndDropService"].ICON_NOT_ALLOWED;
}
return _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_0__["DragAndDropService"].ICON_MOVE;
};
RowDragFeature.prototype.shouldPreventRowMove = function () {
return this.isGridSorted || this.isGridFiltered || this.isRowGroupActive;
};
RowDragFeature.prototype.getRowNodes = function (draggingEvent) {
if (!this.isFromThisGrid(draggingEvent)) {
return draggingEvent.dragItem.rowNodes;
}
var enableMultiRowDragging = this.gridOptionsWrapper.isEnableMultiRowDragging();
var selectedNodes = this.selectionController.getSelectedNodes();
var currentNode = draggingEvent.dragItem.rowNode;
if (enableMultiRowDragging && selectedNodes.indexOf(currentNode) !== -1) {
this.isMultiRowDrag = true;
return __spreadArrays(selectedNodes);
}
this.isMultiRowDrag = false;
return [currentNode];
};
RowDragFeature.prototype.onDragEnter = function (draggingEvent) {
// when entering, we fire the enter event, then in onEnterOrDragging,
// we also fire the move event. so we get both events when entering.
this.dispatchGridEvent(_eventKeys__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_ROW_DRAG_ENTER, draggingEvent);
this.getRowNodes(draggingEvent).forEach(function (rowNode) {
rowNode.setDragging(true);
});
this.onEnterOrDragging(draggingEvent);
};
RowDragFeature.prototype.onDragging = function (draggingEvent) {
this.onEnterOrDragging(draggingEvent);
};
RowDragFeature.prototype.isFromThisGrid = function (draggingEvent) {
var dragSourceDomDataKey = draggingEvent.dragSource.dragSourceDomDataKey;
return dragSourceDomDataKey === this.gridOptionsWrapper.getDomDataKey();
};
RowDragFeature.prototype.isDropZoneWithinThisGrid = function (draggingEvent) {
var gridGui = this.gridPanel.getGui();
var dropZoneTarget = draggingEvent.dropZoneTarget;
return !gridGui.contains(dropZoneTarget);
};
RowDragFeature.prototype.onEnterOrDragging = function (draggingEvent) {
// this event is fired for enter and move
this.dispatchGridEvent(_eventKeys__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_ROW_DRAG_MOVE, draggingEvent);
this.lastDraggingEvent = draggingEvent;
var pixel = this.mouseEventService.getNormalisedPosition(draggingEvent).y;
var managedDrag = this.gridOptionsWrapper.isRowDragManaged();
if (managedDrag) {
this.doManagedDrag(draggingEvent, pixel);
}
this.checkCenterForScrolling(pixel);
};
RowDragFeature.prototype.doManagedDrag = function (draggingEvent, pixel) {
var _this = this;
var rowNodes;
var isFromThisGrid = this.isFromThisGrid(draggingEvent);
if (isFromThisGrid) {
rowNodes = [draggingEvent.dragItem.rowNode];
if (this.isMultiRowDrag) {
rowNodes = __spreadArrays(this.selectionController.getSelectedNodes()).sort(function (a, b) { return _this.getRowIndexNumber(a) - _this.getRowIndexNumber(b); });
}
draggingEvent.dragItem.rowNodes = rowNodes;
}
else {
rowNodes = draggingEvent.dragItem.rowNodes;
}
var managedDrag = this.gridOptionsWrapper.isRowDragManaged();
if (managedDrag && this.shouldPreventRowMove()) {
return;
}
if (this.gridOptionsWrapper.isSuppressMoveWhenRowDragging() || !isFromThisGrid) {
if (!this.isDropZoneWithinThisGrid(draggingEvent)) {
this.clientSideRowModel.highlightRowAtPixel(rowNodes[0], pixel);
}
}
else {
this.moveRows(rowNodes, pixel);
}
};
RowDragFeature.prototype.getRowIndexNumber = function (rowNode) {
return parseInt(Object(_utils_array__WEBPACK_IMPORTED_MODULE_3__["last"])(rowNode.getRowIndexString().split('-')), 10);
};
RowDragFeature.prototype.moveRowAndClearHighlight = function (draggingEvent) {
var _this = this;
var lastHighlightedRowNode = this.clientSideRowModel.getLastHighlightedRowNode();
var isBelow = lastHighlightedRowNode && lastHighlightedRowNode.highlighted === 'below';
var pixel = this.mouseEventService.getNormalisedPosition(draggingEvent).y;
var rowNodes = draggingEvent.dragItem.rowNodes;
var increment = isBelow ? 1 : 0;
if (this.isFromThisGrid(draggingEvent)) {
rowNodes.forEach(function (rowNode) {
if (rowNode.rowTop < pixel) {
increment -= 1;
}
});
this.moveRows(rowNodes, pixel, increment);
}
else {
var getRowNodeId_1 = this.gridOptionsWrapper.getRowNodeIdFunc();
var addIndex = this.clientSideRowModel.getRowIndexAtPixel(pixel) + 1;
if (this.clientSideRowModel.getHighlightPosition(pixel) === 'above') {
addIndex--;
}
this.clientSideRowModel.updateRowData({
add: rowNodes
.map(function (node) { return node.data; })
.filter(function (data) { return !_this.clientSideRowModel.getRowNode(getRowNodeId_1 ? getRowNodeId_1(data) : data.id); }),
addIndex: addIndex
});
}
this.clearRowHighlight();
};
RowDragFeature.prototype.clearRowHighlight = function () {
this.clientSideRowModel.highlightRowAtPixel(null);
};
RowDragFeature.prototype.moveRows = function (rowNodes, pixel, increment) {
if (increment === void 0) { increment = 0; }
var rowWasMoved = this.clientSideRowModel.ensureRowsAtPixel(rowNodes, pixel, increment);
if (rowWasMoved) {
this.focusController.clearFocusedCell();
if (this.rangeController) {
this.rangeController.removeAllCellRanges();
}
}
};
RowDragFeature.prototype.checkCenterForScrolling = function (pixel) {
// scroll if the mouse is within 50px of the grid edge
var pixelRange = this.gridPanel.getVScrollPosition();
// console.log(`pixelRange = (${pixelRange.top}, ${pixelRange.bottom})`);
this.needToMoveUp = pixel < (pixelRange.top + 50);
this.needToMoveDown = pixel > (pixelRange.bottom - 50);
// console.log(`needToMoveUp = ${this.needToMoveUp} = pixel < (pixelRange.top + 50) = ${pixel} < (${pixelRange.top} + 50)`);
// console.log(`needToMoveDown = ${this.needToMoveDown} = pixel < (pixelRange.top + 50) = ${pixel} < (${pixelRange.top} + 50)`);
if (this.needToMoveUp || this.needToMoveDown) {
this.ensureIntervalStarted();
}
else {
this.ensureIntervalCleared();
}
};
RowDragFeature.prototype.ensureIntervalStarted = function () {
if (this.movingIntervalId) {
return;
}
this.intervalCount = 0;
this.movingIntervalId = window.setInterval(this.moveInterval.bind(this), 100);
};
RowDragFeature.prototype.ensureIntervalCleared = function () {
if (!this.moveInterval) {
return;
}
window.clearInterval(this.movingIntervalId);
this.movingIntervalId = null;
};
RowDragFeature.prototype.moveInterval = function () {
// the amounts we move get bigger at each interval, so the speed accelerates, starting a bit slow
// and getting faster. this is to give smoother user experience. we max at 100px to limit the speed.
var pixelsToMove;
this.intervalCount++;
pixelsToMove = 10 + (this.intervalCount * 5);
if (pixelsToMove > 100) {
pixelsToMove = 100;
}
var pixelsMoved;
if (this.needToMoveDown) {
pixelsMoved = this.gridPanel.scrollVertically(pixelsToMove);
}
else if (this.needToMoveUp) {
pixelsMoved = this.gridPanel.scrollVertically(-pixelsToMove);
}
if (pixelsMoved !== 0) {
this.onDragging(this.lastDraggingEvent);
}
};
RowDragFeature.prototype.addRowDropZone = function (params) {
var _this = this;
if (!params.getContainer()) {
Object(_utils_function__WEBPACK_IMPORTED_MODULE_6__["doOnce"])(function () { return console.warn('ag-Grid: addRowDropZone - A container target needs to be provided'); }, 'add-drop-zone-empty-target');
return;
}
if (this.dragAndDropService.findExternalZone(params)) {
console.warn('ag-Grid: addRowDropZone - target already exists in the list of DropZones. Use `removeRowDropZone` before adding it again.');
return;
}
var processedParams = {
getContainer: params.getContainer
};
if (params.fromGrid) {
params.fromGrid = undefined;
processedParams = params;
}
else {
if (params.onDragEnter) {
processedParams.onDragEnter = function (e) {
params.onDragEnter(_this.draggingToRowDragEvent(_eventKeys__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_ROW_DRAG_ENTER, e));
};
}
if (params.onDragLeave) {
processedParams.onDragLeave = function (e) {
params.onDragLeave(_this.draggingToRowDragEvent(_eventKeys__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_ROW_DRAG_LEAVE, e));
};
}
if (params.onDragging) {
processedParams.onDragging = function (e) {
params.onDragging(_this.draggingToRowDragEvent(_eventKeys__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_ROW_DRAG_MOVE, e));
};
}
if (params.onDragStop) {
processedParams.onDragStop = function (e) {
params.onDragStop(_this.draggingToRowDragEvent(_eventKeys__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_ROW_DRAG_END, e));
};
}
}
this.dragAndDropService.addDropTarget(__assign({ isInterestedIn: function (type) { return type === _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_0__["DragSourceType"].RowDrag; }, getIconName: function () { return _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_0__["DragAndDropService"].ICON_MOVE; }, external: true }, processedParams));
};
RowDragFeature.prototype.getRowDropZone = function (events) {
var _this = this;
var getContainer = this.getContainer.bind(this);
var onDragEnter = this.onDragEnter.bind(this);
var onDragLeave = this.onDragLeave.bind(this);
var onDragging = this.onDragging.bind(this);
var onDragStop = this.onDragStop.bind(this);
if (!events) {
return { getContainer: getContainer, onDragEnter: onDragEnter, onDragLeave: onDragLeave, onDragging: onDragging, onDragStop: onDragStop, fromGrid: true };
}
return {
getContainer: getContainer,
onDragEnter: events.onDragEnter
? (function (e) {
onDragEnter(e);
events.onDragEnter(_this.draggingToRowDragEvent(_eventKeys__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_ROW_DRAG_ENTER, e));
})
: onDragEnter,
onDragLeave: events.onDragLeave
? (function (e) {
onDragLeave(e);
events.onDragLeave(_this.draggingToRowDragEvent(_eventKeys__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_ROW_DRAG_LEAVE, e));
})
: onDragLeave,
onDragging: events.onDragging
? (function (e) {
onDragging(e);
events.onDragging(_this.draggingToRowDragEvent(_eventKeys__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_ROW_DRAG_MOVE, e));
})
: onDragging,
onDragStop: events.onDragStop
? (function (e) {
onDragStop(e);
events.onDragStop(_this.draggingToRowDragEvent(_eventKeys__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_ROW_DRAG_END, e));
})
: onDragStop,
fromGrid: true
};
};
RowDragFeature.prototype.draggingToRowDragEvent = function (type, draggingEvent) {
var yNormalised = this.mouseEventService.getNormalisedPosition(draggingEvent).y;
var mouseIsPastLastRow = yNormalised > this.rowModel.getCurrentPageHeight();
var overIndex = -1;
var overNode = null;
if (!mouseIsPastLastRow) {
overIndex = this.rowModel.getRowIndexAtPixel(yNormalised);
overNode = this.rowModel.getRow(overIndex);
}
var vDirectionString;
switch (draggingEvent.vDirection) {
case _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_0__["VerticalDirection"].Down:
vDirectionString = 'down';
break;
case _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_0__["VerticalDirection"].Up:
vDirectionString = 'up';
break;
default:
vDirectionString = null;
break;
}
var event = {
type: type,
api: this.gridOptionsWrapper.getApi(),
columnApi: this.gridOptionsWrapper.getColumnApi(),
event: draggingEvent.event,
node: draggingEvent.dragItem.rowNode,
nodes: draggingEvent.dragItem.rowNodes,
overIndex: overIndex,
overNode: overNode,
y: yNormalised,
vDirection: vDirectionString
};
return event;
};
RowDragFeature.prototype.dispatchGridEvent = function (type, draggingEvent) {
var event = this.draggingToRowDragEvent(type, draggingEvent);
this.eventService.dispatchEvent(event);
};
RowDragFeature.prototype.onDragLeave = function (draggingEvent) {
this.dispatchGridEvent(_eventKeys__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_ROW_DRAG_LEAVE, draggingEvent);
this.stopDragging(draggingEvent);
if (this.gridOptionsWrapper.isRowDragManaged()) {
this.clearRowHighlight();
}
if (this.isFromThisGrid(draggingEvent)) {
this.isMultiRowDrag = false;
}
};
RowDragFeature.prototype.onDragStop = function (draggingEvent) {
this.dispatchGridEvent(_eventKeys__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_ROW_DRAG_END, draggingEvent);
this.stopDragging(draggingEvent);
if (this.gridOptionsWrapper.isRowDragManaged() &&
(this.gridOptionsWrapper.isSuppressMoveWhenRowDragging() || !this.isFromThisGrid(draggingEvent)) &&
!this.isDropZoneWithinThisGrid(draggingEvent)) {
this.moveRowAndClearHighlight(draggingEvent);
}
};
RowDragFeature.prototype.stopDragging = function (draggingEvent) {
this.ensureIntervalCleared();
this.getRowNodes(draggingEvent).forEach(function (rowNode) {
rowNode.setDragging(false);
});
};
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('dragAndDropService')
], RowDragFeature.prototype, "dragAndDropService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('rowModel')
], RowDragFeature.prototype, "rowModel", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('columnController')
], RowDragFeature.prototype, "columnController", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('focusController')
], RowDragFeature.prototype, "focusController", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('sortController')
], RowDragFeature.prototype, "sortController", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('filterManager')
], RowDragFeature.prototype, "filterManager", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('selectionController')
], RowDragFeature.prototype, "selectionController", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Optional"])('rangeController')
], RowDragFeature.prototype, "rangeController", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('mouseEventService')
], RowDragFeature.prototype, "mouseEventService", void 0);
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_1__["PostConstruct"]
], RowDragFeature.prototype, "postConstruct", null);
return RowDragFeature;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_4__["BeanStub"]));
/***/ }),
/* 136 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GridApi", function() { return GridApi; });
/* harmony import */ var _gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(95);
/* harmony import */ var _constants_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16);
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12);
/* harmony import */ var _modules_moduleNames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(17);
/* harmony import */ var _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(18);
/* harmony import */ var _utils_object__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(13);
/* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7);
/* harmony import */ var _utils_string__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(26);
/* harmony import */ var _utils_function__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(15);
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(37);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (undefined && undefined.__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 GridApi = /** @class */ (function () {
function GridApi() {
this.detailGridInfoMap = {};
this.destroyCalled = false;
}
GridApi.prototype.registerGridComp = function (gridPanel) {
this.gridPanel = gridPanel;
};
GridApi.prototype.registerGridCore = function (gridCore) {
this.gridCore = gridCore;
};
GridApi.prototype.registerHeaderRootComp = function (headerRootComp) {
this.headerRootComp = headerRootComp;
};
GridApi.prototype.init = function () {
switch (this.rowModel.getType()) {
case _constants_constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].ROW_MODEL_TYPE_CLIENT_SIDE:
this.clientSideRowModel = this.rowModel;
break;
case _constants_constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].ROW_MODEL_TYPE_INFINITE:
this.infiniteRowModel = this.rowModel;
break;
case _constants_constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].ROW_MODEL_TYPE_SERVER_SIDE:
this.serverSideRowModel = 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;
Object(_utils_object__WEBPACK_IMPORTED_MODULE_5__["iterateObject"])(this.detailGridInfoMap, function (id, gridInfo) {
// check for undefined, as old references will still be lying around
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_6__["exists"])(gridInfo)) {
callback(gridInfo, index);
index++;
}
});
};
GridApi.prototype.getDataAsCsv = function (params) {
if (_modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_4__["ModuleRegistry"].assertRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_3__["ModuleNames"].CsvExportModule, 'api.getDataAsCsv')) {
return this.csvCreator.getDataAsCsv(params);
}
};
GridApi.prototype.exportDataAsCsv = function (params) {
if (_modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_4__["ModuleRegistry"].assertRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_3__["ModuleNames"].CsvExportModule, 'api.exportDataAsCSv')) {
this.csvCreator.exportDataAsCsv(params);
}
};
GridApi.prototype.getDataAsExcel = function (params) {
if (_modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_4__["ModuleRegistry"].assertRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_3__["ModuleNames"].ExcelExportModule, 'api.getDataAsExcel')) {
return this.excelCreator.getDataAsExcelXml(params);
}
};
GridApi.prototype.exportDataAsExcel = function (params) {
if (_modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_4__["ModuleRegistry"].assertRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_3__["ModuleNames"].ExcelExportModule, 'api.exportDataAsExcel')) {
this.excelCreator.exportDataAsExcel(params);
}
};
/** @deprecated */
GridApi.prototype.setEnterpriseDatasource = function (datasource) {
console.warn("ag-grid: since version 18.x, api.setEnterpriseDatasource() should be replaced with api.setServerSideDatasource()");
this.setServerSideDatasource(datasource);
};
GridApi.prototype.setGridAriaProperty = function (property, value) {
if (!property) {
return;
}
var eGrid = this.gridPanel.getGui();
var ariaProperty = "aria-" + property;
if (value === null) {
eGrid.removeAttribute(ariaProperty);
}
else {
eGrid.setAttribute(ariaProperty, value);
}
};
GridApi.prototype.setServerSideDatasource = function (datasource) {
if (this.serverSideRowModel) {
// should really have an IEnterpriseRowModel interface, so we are not casting to any
this.serverSideRowModel.setDatasource(datasource);
}
else {
console.warn("ag-Grid: you can only use an enterprise datasource when gridOptions.rowModelType is '" + _constants_constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].ROW_MODEL_TYPE_SERVER_SIDE + "'");
}
};
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_constants__WEBPACK_IMPORTED_MODULE_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_constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].ROW_MODEL_TYPE_VIEWPORT + "'");
}
};
GridApi.prototype.setRowData = function (rowData) {
if (this.gridOptionsWrapper.isRowModelDefault()) {
if (this.gridOptionsWrapper.isImmutableData()) {
var transactionAndMap = this.immutableService.createTransactionForRowData(rowData);
if (!transactionAndMap) {
return;
}
var transaction = transactionAndMap[0], orderIdMap = transactionAndMap[1];
var nodeTransaction = this.clientSideRowModel.updateRowData(transaction, orderIdMap);
// need to force updating of full width rows - note this wouldn't be necessary the full width cell comp listened
// to the data change event on the row node and refreshed itself.
this.rowRenderer.refreshFullWidthRows(nodeTransaction.update);
}
else {
this.selectionController.reset();
this.clientSideRowModel.setRowData(rowData);
}
}
else {
console.warn('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.setAutoGroupColumnDef = function (colDef, source) {
if (source === void 0) { source = "api"; }
this.gridOptionsWrapper.setProperty('autoGroupColumnDef', colDef, true);
};
GridApi.prototype.expireValueCache = function () {
this.valueCache.expire();
};
GridApi.prototype.getVerticalPixelRange = function () {
return this.gridPanel.getVScrollPosition();
};
GridApi.prototype.getHorizontalPixelRange = function () {
return this.gridPanel.getHScrollPosition();
};
GridApi.prototype.setAlwaysShowVerticalScroll = function (show) {
this.gridOptionsWrapper.setProperty('alwaysShowVerticalScroll', show);
};
GridApi.prototype.refreshToolPanel = function () {
this.gridCore.refreshSideBar();
};
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.flashCells = function (params) {
if (params === void 0) { params = {}; }
this.rowRenderer.flashCells(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();
window.setTimeout(function () {
var endReflow = (new Date()).getTime();
var durationProcessing = endProcessing - start;
var durationReflow = endReflow - endProcessing;
// tslint:disable-next-line
console.log('duration: processing = ' + durationProcessing + 'ms, reflow = ' + durationReflow + 'ms');
iterationCount++;
totalProcessing += durationProcessing;
totalReflow += durationReflow;
if (iterationCount < count) {
// wait for 1s between tests
window.setTimeout(doOneIteration, 1000);
}
else {
finish();
}
}, 0);
}
function finish() {
// tslint:disable-next-line
console.log('tests complete. iteration count = ' + iterationCount);
// tslint:disable-next-line
console.log('average processing = ' + (totalProcessing / iterationCount) + 'ms');
// tslint:disable-next-line
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.warn('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.headerRootComp.refreshHeader();
this.gridPanel.setHeaderAndFloatingHeights();
};
GridApi.prototype.isAnyFilterPresent = function () {
return this.filterManager.isAnyFilterPresent();
};
/** @deprecated */
GridApi.prototype.isAdvancedFilterPresent = function () {
console.warn('ag-Grid: isAdvancedFilterPresent() is deprecated, please use isColumnFilterPresent()');
return this.isColumnFilterPresent();
};
GridApi.prototype.isColumnFilterPresent = function () {
return this.filterManager.isAdvancedFilterPresent();
};
GridApi.prototype.isQuickFilterPresent = function () {
return this.filterManager.isQuickFilterPresent();
};
GridApi.prototype.getModel = function () {
return this.rowModel;
};
GridApi.prototype.setRowNodeExpanded = function (rowNode, expanded) {
if (rowNode) {
rowNode.setExpanded(expanded);
}
};
GridApi.prototype.onGroupExpandedOrCollapsed = function (deprecated_refreshFromIndex) {
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_6__["missing"])(this.clientSideRowModel)) {
console.warn('ag-Grid: cannot call onGroupExpandedOrCollapsed unless using normal row model');
}
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_6__["exists"])(deprecated_refreshFromIndex)) {
console.warn('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 only 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.clientSideRowModel.refreshModel({ step: _constants_constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].STEP_MAP });
};
GridApi.prototype.refreshInMemoryRowModel = function (step) {
console.warn("ag-grid: since version 18.x, api.refreshInMemoryRowModel() should be replaced with api.refreshClientSideRowModel()");
this.refreshClientSideRowModel(step);
};
GridApi.prototype.refreshClientSideRowModel = function (step) {
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_6__["missing"])(this.clientSideRowModel)) {
console.warn('cannot call refreshClientSideRowModel unless using normal row model');
}
var paramsStep = _constants_constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].STEP_EVERYTHING;
var stepsMapped = {
group: _constants_constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].STEP_EVERYTHING,
filter: _constants_constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].STEP_FILTER,
map: _constants_constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].STEP_MAP,
aggregate: _constants_constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].STEP_AGGREGATE,
sort: _constants_constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].STEP_SORT,
pivot: _constants_constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].STEP_PIVOT
};
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_6__["exists"])(step)) {
paramsStep = stepsMapped[step];
}
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_6__["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.clientSideRowModel.refreshModel(modelParams);
};
GridApi.prototype.isAnimationFrameQueueEmpty = function () {
return this.animationFrameService.isQueueEmpty();
};
GridApi.prototype.getRowNode = function (id) {
return this.rowModel.getRowNode(id);
};
GridApi.prototype.getSizesForCurrentTheme = function () {
return {
rowHeight: this.gridOptionsWrapper.getRowHeightAsNumber(),
headerHeight: this.gridOptionsWrapper.getHeaderHeight()
};
};
GridApi.prototype.expandAll = function () {
if (this.clientSideRowModel) {
this.clientSideRowModel.expandOrCollapseAll(true);
}
else if (this.serverSideRowModel) {
this.serverSideRowModel.expandAll(true);
}
else {
console.warn('ag-Grid: expandAll only works with Client Side Row Model and Server Side Row Model');
}
};
GridApi.prototype.collapseAll = function () {
if (this.clientSideRowModel) {
this.clientSideRowModel.expandOrCollapseAll(false);
}
else if (this.serverSideRowModel) {
this.serverSideRowModel.expandAll(false);
}
else {
console.warn('ag-Grid: collapseAll only works with Client Side Row Model and Server Side Row Model');
}
};
GridApi.prototype.getToolPanelInstance = function (id) {
return this.gridCore.getToolPanelInstance(id);
};
GridApi.prototype.addVirtualRowListener = function (eventName, rowIndex, callback) {
if (typeof eventName !== 'string') {
console.warn('ag-Grid: addVirtualRowListener is deprecated, please use addRenderedRowListener.');
}
this.addRenderedRowListener(eventName, rowIndex, callback);
};
GridApi.prototype.addRenderedRowListener = function (eventName, rowIndex, callback) {
if (eventName === 'virtualRowSelected') {
console.warn("ag-Grid: event virtualRowSelected is deprecated, to register for individual row\n 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.warn('ag-Grid: do not use api for selection, call node.setSelected(value) instead');
if (suppressEvents) {
console.warn('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.warn('ag-Grid: do not use api for selection, call node.setSelected(value) instead');
if (suppressEvents) {
console.warn('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.warn('ag-Grid: API for selection is deprecated, call node.setSelected(value) instead');
if (suppressEvents) {
console.warn('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.warn('ag-Grid: API for selection is deprecated, call node.setSelected(value) instead');
if (suppressEvents) {
console.warn('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 (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_6__["missing"])(this.clientSideRowModel)) {
console.warn('cannot call recomputeAggregates unless using normal row model');
}
console.warn("recomputeAggregates is deprecated, please call api.refreshClientSideRowModel('aggregate') instead");
this.clientSideRowModel.refreshModel({ step: _constants_constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].STEP_AGGREGATE });
};
GridApi.prototype.sizeColumnsToFit = function () {
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.warn('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 (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_6__["missing"])(this.clientSideRowModel)) {
console.warn('cannot call forEachNode unless using normal row model');
}
this.clientSideRowModel.forEachLeafNode(callback);
};
GridApi.prototype.forEachNode = function (callback) {
this.rowModel.forEachNode(callback);
};
GridApi.prototype.forEachNodeAfterFilter = function (callback) {
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_6__["missing"])(this.clientSideRowModel)) {
console.warn('cannot call forEachNodeAfterFilter unless using normal row model');
}
this.clientSideRowModel.forEachNodeAfterFilter(callback);
};
GridApi.prototype.forEachNodeAfterFilterAndSort = function (callback) {
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_6__["missing"])(this.clientSideRowModel)) {
console.warn('cannot call forEachNodeAfterFilterAndSort unless using normal row model');
}
this.clientSideRowModel.forEachNodeAfterFilterAndSort(callback);
};
GridApi.prototype.getFilterApiForColDef = function (colDef) {
console.warn('ag-grid API method getFilterApiForColDef deprecated, use getFilterInstance instead');
return this.getFilterInstance(colDef);
};
GridApi.prototype.getFilterInstance = function (key, callback) {
var column = this.columnController.getPrimaryColumn(key);
if (column) {
var filterPromise = this.filterManager.getFilterComponent(column, 'NO_UI');
var currentValue = filterPromise.resolveNow(null, function (filterComp) { return filterComp; });
if (callback) {
if (currentValue) {
setTimeout(callback, 0, currentValue);
}
else {
filterPromise.then(callback);
}
}
return currentValue;
}
};
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.getStatusPanel = function (key) {
if (this.statusBarService) {
return this.statusBarService.getStatusPanel(key);
}
};
GridApi.prototype.getColumnDef = function (key) {
var column = this.columnController.getPrimaryColumn(key);
if (column) {
return column.getColDef();
}
return null;
};
GridApi.prototype.getColumnDefs = function () { return this.columnController.getColumnDefs(); };
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"; }
console.warn('ag-Grid: as of version 24.0.0, setSortModel() is deprecated, sort information is now part of Column State. Please use columnApi.applyColumnState() instead.');
var columnState = [];
if (sortModel) {
sortModel.forEach(function (item, index) {
columnState.push({
colId: item.colId,
sort: item.sort,
sortIndex: index
});
});
}
this.columnController.applyColumnState({ state: columnState, defaultState: { sort: null } });
};
GridApi.prototype.getSortModel = function () {
console.warn('ag-Grid: as of version 24.0.0, getSortModel() is deprecated, sort information is now part of Column State. Please use columnApi.getColumnState() instead.');
var columnState = this.columnController.getColumnState();
var filteredStates = columnState.filter(function (item) { return item.sort != null; });
var indexes = {};
filteredStates.forEach(function (state) { return indexes[state.colId] = state.sortIndex; });
var res = filteredStates.map(function (s) {
return { colId: s.colId, sort: s.sort };
});
res.sort(function (a, b) { return indexes[a.colId] - indexes[b.colId]; });
return res;
};
GridApi.prototype.setFilterModel = function (model) {
this.filterManager.setFilterModel(model);
};
GridApi.prototype.getFilterModel = function () {
return this.filterManager.getFilterModel();
};
GridApi.prototype.getFocusedCell = function () {
return this.focusController.getFocusedCell();
};
GridApi.prototype.clearFocusedCell = function () {
return this.focusController.clearFocusedCell();
};
GridApi.prototype.setFocusedCell = function (rowIndex, colKey, floating) {
this.focusController.setFocusedCell(rowIndex, colKey, floating, true);
};
GridApi.prototype.setSuppressRowDrag = function (value) {
this.gridOptionsWrapper.setProperty(_gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__["GridOptionsWrapper"].PROP_SUPPRESS_ROW_DRAG, value);
};
GridApi.prototype.setSuppressMoveWhenRowDragging = function (value) {
this.gridOptionsWrapper.setProperty(_gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__["GridOptionsWrapper"].PROP_SUPPRESS_MOVE_WHEN_ROW_DRAG, value);
};
GridApi.prototype.setSuppressRowClickSelection = function (value) {
this.gridOptionsWrapper.setProperty(_gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__["GridOptionsWrapper"].PROP_SUPPRESS_ROW_CLICK_SELECTION, value);
};
GridApi.prototype.addRowDropZone = function (params) {
this.gridPanel.getRowDragFeature().addRowDropZone(params);
};
GridApi.prototype.removeRowDropZone = function (params) {
var activeDropTarget = this.dragAndDropService.findExternalZone(params);
if (activeDropTarget) {
this.dragAndDropService.removeDropTarget(activeDropTarget);
}
};
GridApi.prototype.getRowDropZoneParams = function (events) {
return this.gridPanel.getRowDragFeature().getRowDropZone(events);
};
GridApi.prototype.setHeaderHeight = function (headerHeight) {
this.gridOptionsWrapper.setProperty(_gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__["GridOptionsWrapper"].PROP_HEADER_HEIGHT, headerHeight);
this.doLayout();
};
GridApi.prototype.setDomLayout = function (domLayout) {
this.gridOptionsWrapper.setProperty(_gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__["GridOptionsWrapper"].PROP_DOM_LAYOUT, domLayout);
};
GridApi.prototype.setEnableCellTextSelection = function (selectable) {
this.gridPanel.setCellTextSelection(selectable);
};
GridApi.prototype.setFillHandleDirection = function (direction) {
this.gridOptionsWrapper.setProperty(_gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__["GridOptionsWrapper"].PROP_FILL_HANDLE_DIRECTION, direction);
};
GridApi.prototype.setGroupHeaderHeight = function (headerHeight) {
this.gridOptionsWrapper.setProperty(_gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__["GridOptionsWrapper"].PROP_GROUP_HEADER_HEIGHT, headerHeight);
this.doLayout();
};
GridApi.prototype.setFloatingFiltersHeight = function (headerHeight) {
this.gridOptionsWrapper.setProperty(_gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__["GridOptionsWrapper"].PROP_FLOATING_FILTERS_HEIGHT, headerHeight);
this.doLayout();
};
GridApi.prototype.setPivotGroupHeaderHeight = function (headerHeight) {
this.gridOptionsWrapper.setProperty(_gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__["GridOptionsWrapper"].PROP_PIVOT_GROUP_HEADER_HEIGHT, headerHeight);
this.doLayout();
};
GridApi.prototype.setPivotHeaderHeight = function (headerHeight) {
this.gridOptionsWrapper.setProperty(_gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__["GridOptionsWrapper"].PROP_PIVOT_HEADER_HEIGHT, headerHeight);
this.doLayout();
};
GridApi.prototype.isSideBarVisible = function () {
return this.gridCore.isSideBarVisible();
};
GridApi.prototype.setSideBarVisible = function (show) {
this.gridCore.setSideBarVisible(show);
};
GridApi.prototype.setSideBarPosition = function (position) {
this.gridCore.setSideBarPosition(position);
};
GridApi.prototype.openToolPanel = function (key) {
this.gridCore.openToolPanel(key);
};
GridApi.prototype.closeToolPanel = function () {
this.gridCore.closeToolPanel();
};
GridApi.prototype.getOpenedToolPanel = function () {
return this.gridCore.getOpenedToolPanel();
};
GridApi.prototype.getSideBar = function () {
return this.gridCore.getSideBar();
};
GridApi.prototype.setSideBar = function (def) {
return this.gridCore.setSideBar(def);
};
GridApi.prototype.setSuppressClipboardPaste = function (value) {
this.gridOptionsWrapper.setProperty(_gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__["GridOptionsWrapper"].PROP_SUPPRESS_CLIPBOARD_PASTE, value);
};
GridApi.prototype.isToolPanelShowing = function () {
return this.gridCore.isToolPanelShowing();
};
GridApi.prototype.doLayout = function () {
this.gridPanel.checkViewportAndScrolls();
};
GridApi.prototype.resetRowHeights = function () {
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_6__["exists"])(this.clientSideRowModel)) {
this.clientSideRowModel.resetRowHeights();
}
};
GridApi.prototype.setGroupRemoveSingleChildren = function (value) {
this.gridOptionsWrapper.setProperty(_gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__["GridOptionsWrapper"].PROP_GROUP_REMOVE_SINGLE_CHILDREN, value);
};
GridApi.prototype.setGroupRemoveLowestSingleChildren = function (value) {
this.gridOptionsWrapper.setProperty(_gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__["GridOptionsWrapper"].PROP_GROUP_REMOVE_LOWEST_SINGLE_CHILDREN, value);
};
GridApi.prototype.onRowHeightChanged = function () {
if (this.clientSideRowModel) {
this.clientSideRowModel.onRowHeightChanged();
}
else if (this.serverSideRowModel) {
this.serverSideRowModel.onRowHeightChanged();
}
};
GridApi.prototype.getValue = function (colKey, rowNode) {
var column = this.columnController.getPrimaryColumn(colKey);
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_6__["missing"])(column)) {
column = this.columnController.getGridColumn(colKey);
}
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_6__["missing"])(column)) {
return null;
}
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 is needed as GridAPI is a bean, and GridAPI.destroy() is called as part
// of context.destroy(). so we need to stop the infinite loop.
if (this.destroyCalled) {
return;
}
this.destroyCalled = true;
// destroy the UI first (as they use the services)
this.context.destroyBean(this.gridCore);
// destroy the services
this.context.destroy();
};
GridApi.prototype.cleanDownReferencesToAvoidMemoryLeakInCaseApplicationIsKeepingReferenceToDestroyedGrid = function () {
// some users were raising support issues with regards memory leaks. the problem was the customers applications
// were keeping references to the API. trying to educate them all would be difficult, easier to just remove
// all references in teh API so at least the core grid can be garbage collected.
//
// wait about 100ms before clearing down the references, in case user has some cleanup to do,
// and needs to deference the API first
setTimeout(_utils__WEBPACK_IMPORTED_MODULE_9__["_"].removeAllReferences.bind(window, this, 'Grid API'), 100);
};
GridApi.prototype.warnIfDestroyed = function (methodName) {
if (this.destroyCalled) {
console.warn("ag-Grid: Grid API method " + methodName + " was called on a grid that was destroyed.");
}
return this.destroyCalled;
};
GridApi.prototype.resetQuickFilter = function () {
if (this.warnIfDestroyed('resetQuickFilter')) {
return;
}
this.rowModel.forEachNode(function (node) { return node.quickFilterAggregateText = null; });
};
GridApi.prototype.getRangeSelections = function () {
console.warn("ag-Grid: in v20.1.x, api.getRangeSelections() is gone, please use getCellRanges() instead.\n We had to change how cell selections works a small bit to allow charting to integrate. The return type of\n getCellRanges() is a bit different, please check the ag-Grid documentation.");
return null;
};
GridApi.prototype.getCellRanges = function () {
if (this.rangeController) {
return this.rangeController.getCellRanges();
}
console.warn('ag-Grid: cell range selection is only available in ag-Grid Enterprise');
return null;
};
GridApi.prototype.camelCaseToHumanReadable = function (camelCase) {
return Object(_utils_string__WEBPACK_IMPORTED_MODULE_7__["camelCaseToHumanText"])(camelCase);
};
GridApi.prototype.addRangeSelection = function (deprecatedNoLongerUsed) {
console.warn('ag-Grid: As of version 21.x, range selection changed slightly to allow charting integration. Please call api.addCellRange() instead of api.addRangeSelection()');
};
GridApi.prototype.addCellRange = function (params) {
if (!this.rangeController) {
console.warn('ag-Grid: cell range selection is only available in ag-Grid Enterprise');
}
this.rangeController.addCellRange(params);
};
GridApi.prototype.clearRangeSelection = function () {
if (!this.rangeController) {
console.warn('ag-Grid: cell range selection is only available in ag-Grid Enterprise');
}
this.rangeController.removeAllCellRanges();
};
GridApi.prototype.undoCellEditing = function () {
this.undoRedoService.undo();
};
GridApi.prototype.redoCellEditing = function () {
this.undoRedoService.redo();
};
GridApi.prototype.getCurrentUndoSize = function () {
return this.undoRedoService.getCurrentUndoStackSize();
};
GridApi.prototype.getCurrentRedoSize = function () {
return this.undoRedoService.getCurrentRedoStackSize();
};
GridApi.prototype.getChartModels = function () {
if (_modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_4__["ModuleRegistry"].assertRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_3__["ModuleNames"].RangeSelectionModule, 'api.getChartModels') &&
_modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_4__["ModuleRegistry"].assertRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_3__["ModuleNames"].GridChartsModule, 'api.getChartModels')) {
return this.chartService.getChartModels();
}
};
GridApi.prototype.createRangeChart = function (params) {
if (_modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_4__["ModuleRegistry"].assertRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_3__["ModuleNames"].RangeSelectionModule, 'api.createRangeChart') &&
_modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_4__["ModuleRegistry"].assertRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_3__["ModuleNames"].GridChartsModule, 'api.createRangeChart')) {
return this.chartService.createRangeChart(params);
}
};
GridApi.prototype.createCrossFilterChart = function (params) {
if (_modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_4__["ModuleRegistry"].assertRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_3__["ModuleNames"].RangeSelectionModule, 'api.createCrossFilterChart') &&
_modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_4__["ModuleRegistry"].assertRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_3__["ModuleNames"].GridChartsModule, 'api.createCrossFilterChart')) {
return this.chartService.createCrossFilterChart(params);
}
};
GridApi.prototype.restoreChart = function (chartModel, chartContainer) {
if (_modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_4__["ModuleRegistry"].assertRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_3__["ModuleNames"].RangeSelectionModule, 'api.restoreChart') &&
_modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_4__["ModuleRegistry"].assertRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_3__["ModuleNames"].GridChartsModule, 'api.restoreChart')) {
return this.chartService.restoreChart(chartModel, chartContainer);
}
};
GridApi.prototype.createPivotChart = function (params) {
if (_modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_4__["ModuleRegistry"].assertRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_3__["ModuleNames"].RangeSelectionModule, 'api.createPivotChart') &&
_modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_4__["ModuleRegistry"].assertRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_3__["ModuleNames"].GridChartsModule, 'api.createPivotChart')) {
return this.chartService.createPivotChart(params);
}
};
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) {
// use grid column so works with pivot mode
var column = this.columnController.getGridColumn(colKey);
this.menuFactory.showMenuAfterButtonClick(column, buttonElement);
};
GridApi.prototype.showColumnMenuAfterMouseClick = function (colKey, mouseEvent) {
// use grid column so works with pivot mode
var column = this.columnController.getGridColumn(colKey);
if (!column) {
column = this.columnController.getPrimaryColumn(colKey);
}
if (!column) {
console.error("ag-Grid: column '" + colKey + "' not found");
return;
}
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__WEBPACK_IMPORTED_MODULE_0__["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.getCellRendererInstances = function (params) {
if (params === void 0) { params = {}; }
return this.rowRenderer.getCellRendererInstances(params);
};
GridApi.prototype.getCellEditorInstances = function (params) {
if (params === void 0) { params = {}; }
return this.rowRenderer.getCellEditorInstances(params);
};
GridApi.prototype.getEditingCells = function () {
return this.rowRenderer.getEditingCells();
};
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 cellPosition = {
rowIndex: params.rowIndex,
rowPinned: params.rowPinned,
column: column
};
var notPinned = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_6__["missing"])(params.rowPinned);
if (notPinned) {
this.gridPanel.ensureIndexVisible(params.rowIndex);
}
this.rowRenderer.startEditingCell(cellPosition, 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.applyServerSideTransaction = function (rowDataTransaction, route) {
if (route === void 0) { route = []; }
if (this.serverSideRowModel) {
this.serverSideRowModel.applyTransaction(rowDataTransaction, route);
}
};
GridApi.prototype.applyTransaction = function (rowDataTransaction) {
var res = null;
if (this.clientSideRowModel) {
res = this.clientSideRowModel.updateRowData(rowDataTransaction);
}
return this.serverSideTransactionManager.applyTransactionAsync(transaction, callback);
};
GridApi.prototype.retryServerSideLoads = function () {
if (!this.serverSideRowModel) {
console.warn('ag-Grid: API retryServerSideLoads() can only be used when using Server-Side Row Model.');
return;
}
this.serverSideRowModel.retryLoads();
};
GridApi.prototype.flushServerSideAsyncTransactions = function () {
if (!this.serverSideTransactionManager) {
console.warn('ag-Grid: Cannot flush Server Side Transaction if not using the Server Side Row Model.');
return;
}
else {
console.error('ag-Grid: updateRowData() only works with ClientSideRowModel.');
return;
}
// refresh all the full width rows
this.rowRenderer.refreshFullWidthRows(res.update);
// do change detection for all present cells
if (!this.gridOptionsWrapper.isSuppressChangeDetection()) {
this.rowRenderer.refreshCells();
}
return res;
};
/** @deprecated */
GridApi.prototype.updateRowData = function (rowDataTransaction) {
var message = 'ag-Grid: as of v23.1, grid API updateRowData(transaction) is now called applyTransaction(transaction). updateRowData is deprecated and will be removed in a future major release.';
Object(_utils_function__WEBPACK_IMPORTED_MODULE_8__["doOnce"])(function () { return console.warn(message); }, 'updateRowData deprecated');
return this.applyTransaction(rowDataTransaction);
};
GridApi.prototype.applyTransactionAsync = function (rowDataTransaction, callback) {
if (!this.clientSideRowModel) {
console.error('ag-Grid: api.applyTransactionAsync() only works with ClientSideRowModel.');
return;
}
this.clientSideRowModel.batchUpdateRowData(rowDataTransaction, callback);
};
GridApi.prototype.flushAsyncTransactions = function () {
if (!this.clientSideRowModel) {
console.error('ag-Grid: api.applyTransactionAsync() only works with ClientSideRowModel.');
return;
}
this.clientSideRowModel.flushAsyncTransactions();
};
/** @deprecated */
GridApi.prototype.batchUpdateRowData = function (rowDataTransaction, callback) {
var message = 'ag-Grid: as of v23.1, grid API batchUpdateRowData(transaction, callback) is now called applyTransactionAsync(transaction, callback). batchUpdateRowData is deprecated and will be removed in a future major release.';
Object(_utils_function__WEBPACK_IMPORTED_MODULE_8__["doOnce"])(function () { return console.warn(message); }, 'batchUpdateRowData deprecated');
this.applyTransactionAsync(rowDataTransaction, callback);
};
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.infiniteRowModel) {
this.infiniteRowModel.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.infiniteRowModel) {
this.infiniteRowModel.purgeCache();
}
else {
console.warn("ag-Grid: api.purgeInfiniteCache is only available when rowModelType='infinite'.");
}
};
/** @deprecated */
GridApi.prototype.purgeEnterpriseCache = function (route) {
console.warn("ag-grid: since version 18.x, api.purgeEnterpriseCache() should be replaced with api.purgeServerSideCache()");
this.purgeServerSideCache(route);
};
/** @deprecated */
GridApi.prototype.purgeServerSideCache = function (route) {
if (route === void 0) { route = []; }
if (this.serverSideRowModel) {
console.warn("ag-Grid: since v25.0, api.purgeServerSideCache is deprecated. Please use api.refreshServerSideStore({purge: true}) instead.");
this.refreshServerSideStore({
route: route,
purge: true
});
}
else {
console.warn("ag-Grid: api.purgeServerSideCache is only available when rowModelType='serverSide'.");
}
};
GridApi.prototype.refreshServerSideStore = function (params) {
if (this.serverSideRowModel) {
this.serverSideRowModel.refreshStore(params);
}
else {
console.warn("ag-Grid: api.refreshServerSideStore is only available when rowModelType='serverSide'.");
}
};
GridApi.prototype.getServerSideStoreState = function () {
if (this.serverSideRowModel) {
return this.serverSideRowModel.getStoreState();
}
else {
console.warn("ag-Grid: api.getServerSideStoreState is only available when rowModelType='serverSide'.");
return [];
}
};
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.infiniteRowModel) {
return this.infiniteRowModel.getVirtualRowCount();
}
else {
console.warn("ag-Grid: api.getVirtualRowCount is only available when rowModelType='virtual'.");
}
};
GridApi.prototype.isMaxRowFound = function () {
if (this.infiniteRowModel) {
return this.infiniteRowModel.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.infiniteRowModel) {
this.infiniteRowModel.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.infiniteRowModel) {
return this.infiniteRowModel.getBlockState();
}
else if (this.serverSideRowModel) {
return this.serverSideRowModel.getBlockState();
}
else {
console.warn("ag-Grid: api.getCacheBlockState() is only available when rowModelType='infinite' or rowModelType='serverSide'.");
}
};
GridApi.prototype.checkGridSize = function () {
this.gridPanel.setHeaderAndFloatingHeights();
};
GridApi.prototype.getFirstRenderedRow = function () {
console.warn('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.warn('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.getMasterRowCount();
};
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([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Optional"])('immutableService')
], GridApi.prototype, "immutableService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Optional"])('csvCreator')
], GridApi.prototype, "csvCreator", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Optional"])('excelCreator')
], GridApi.prototype, "excelCreator", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('rowRenderer')
], GridApi.prototype, "rowRenderer", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('filterManager')
], GridApi.prototype, "filterManager", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('columnController')
], GridApi.prototype, "columnController", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('selectionController')
], GridApi.prototype, "selectionController", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('gridOptionsWrapper')
], GridApi.prototype, "gridOptionsWrapper", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('valueService')
], GridApi.prototype, "valueService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('alignedGridsService')
], GridApi.prototype, "alignedGridsService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('eventService')
], GridApi.prototype, "eventService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('pinnedRowModel')
], GridApi.prototype, "pinnedRowModel", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('context')
], GridApi.prototype, "context", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('rowModel')
], GridApi.prototype, "rowModel", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('sortController')
], GridApi.prototype, "sortController", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('paginationProxy')
], GridApi.prototype, "paginationProxy", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('focusController')
], GridApi.prototype, "focusController", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('dragAndDropService')
], GridApi.prototype, "dragAndDropService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Optional"])('rangeController')
], GridApi.prototype, "rangeController", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Optional"])('clipboardService')
], GridApi.prototype, "clipboardService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Optional"])('aggFuncService')
], GridApi.prototype, "aggFuncService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('menuFactory')
], GridApi.prototype, "menuFactory", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Optional"])('contextMenuFactory')
], GridApi.prototype, "contextMenuFactory", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('valueCache')
], GridApi.prototype, "valueCache", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('animationFrameService')
], GridApi.prototype, "animationFrameService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Optional"])('statusBarService')
], GridApi.prototype, "statusBarService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Optional"])('chartService')
], GridApi.prototype, "chartService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Optional"])('undoRedoService')
], GridApi.prototype, "undoRedoService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Optional"])('rowNodeBlockLoader')
], GridApi.prototype, "rowNodeBlockLoader", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Optional"])('ssrmTransactionManager')
], GridApi.prototype, "serverSideTransactionManager", void 0);
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_2__["PostConstruct"]
], GridApi.prototype, "init", null);
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_2__["PreDestroy"]
], GridApi.prototype, "cleanDownReferencesToAvoidMemoryLeakInCaseApplicationIsKeepingReferenceToDestroyedGrid", null);
GridApi = __decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Bean"])('gridApi')
], GridApi);
return GridApi;
}());
/***/ }),
/* 137 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExpressionService", function() { return ExpressionService; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 __param = (undefined && undefined.__param) || function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
var ExpressionService = /** @class */ (function (_super) {
__extends(ExpressionService, _super);
function ExpressionService() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.expressionToFunctionCache = {};
return _this;
}
ExpressionService.prototype.setBeans = function (loggerFactory) {
this.logger = loggerFactory.create('ExpressionService');
};
ExpressionService.prototype.evaluate = function (expressionOrFunc, params) {
if (typeof expressionOrFunc === 'function') {
// valueGetter is a function, so just call it
var func = expressionOrFunc;
return func(params);
}
else if (typeof expressionOrFunc === 'string') {
// valueGetter is an expression, so execute the expression
var expression = expressionOrFunc;
return this.evaluateExpression(expression, params);
}
else {
console.error('ag-Grid: value should be either a string or a function', expressionOrFunc);
}
};
ExpressionService.prototype.evaluateExpression = function (expression, params) {
try {
var javaScriptFunction = this.createExpressionFunction(expression);
// the params don't have all these values, rather we add every possible
// value a params can have, which makes whatever is in the params available.
var result = javaScriptFunction(params.value, params.context, params.oldValue, params.newValue, params.value, params.node, params.data, params.colDef, params.rowIndex, params.api, params.columnApi, params.getValue, params.column, params.columnGroup);
return result;
}
catch (e) {
// the expression failed, which can happen, as it's the client that
// provides the expression. so print a nice message
// tslint:disable-next-line
console.log('Processing of the expression failed');
// tslint:disable-next-line
console.log('Expression = ' + expression);
// tslint:disable-next-line
console.log('Params =', params);
// tslint:disable-next-line
console.log('Exception = ' + e);
return null;
}
};
ExpressionService.prototype.createExpressionFunction = function (expression) {
// check cache first
if (this.expressionToFunctionCache[expression]) {
return this.expressionToFunctionCache[expression];
}
// if not found in cache, return the function
var functionBody = this.createFunctionBody(expression);
var theFunction = new Function('x, ctx, oldValue, newValue, value, node, data, colDef, rowIndex, api, columnApi, getValue, column, columnGroup', functionBody);
// store in cache
this.expressionToFunctionCache[expression] = theFunction;
return theFunction;
};
ExpressionService.prototype.createFunctionBody = function (expression) {
// if the expression has the 'return' word in it, then use as is,
// if not, then wrap it with return and ';' to make a function
if (expression.indexOf('return') >= 0) {
return expression;
}
else {
return 'return ' + expression + ';';
}
};
__decorate([
__param(0, Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Qualifier"])('loggerFactory'))
], ExpressionService.prototype, "setBeans", null);
ExpressionService = __decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('expressionService')
], ExpressionService);
return ExpressionService;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
/***/ }),
/* 138 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TemplateService", function() { return TemplateService; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 TemplateService = /** @class */ (function (_super) {
__extends(TemplateService, _super);
function TemplateService() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.templateCache = {};
_this.waitingCallbacks = {};
return _this;
}
// returns the template if it is loaded, or null if it is not loaded
// but will call the callback when it is loaded
TemplateService.prototype.getTemplate = function (url, callback) {
var templateFromCache = this.templateCache[url];
if (templateFromCache) {
return templateFromCache;
}
var callbackList = this.waitingCallbacks[url];
var that = this;
if (!callbackList) {
// first time this was called, so need a new list for callbacks
callbackList = [];
this.waitingCallbacks[url] = callbackList;
// and also need to do the http request
var client = new XMLHttpRequest();
client.onload = function () {
that.handleHttpResult(this, url);
};
client.open("GET", url);
client.send();
}
// add this callback
if (callback) {
callbackList.push(callback);
}
// caller needs to wait for template to load, so return null
return null;
};
TemplateService.prototype.handleHttpResult = function (httpResult, url) {
if (httpResult.status !== 200 || httpResult.response === null) {
console.warn("Unable to get template error " + httpResult.status + " - " + url);
return;
}
// response success, so process it
// in IE9 the response is in - responseText
this.templateCache[url] = httpResult.response || httpResult.responseText;
// inform all listeners that this is now in the cache
var callbacks = this.waitingCallbacks[url];
for (var i = 0; i < callbacks.length; i++) {
var callback = callbacks[i];
// we could pass the callback the response, however we know the client of this code
// is the cell renderer, and it passes the 'cellRefresh' method in as the callback
// which doesn't take any parameters.
callback();
}
if (this.$scope) {
var that_1 = this;
window.setTimeout(function () {
that_1.$scope.$apply();
}, 0);
}
};
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('$scope')
], TemplateService.prototype, "$scope", void 0);
TemplateService = __decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('templateService')
], TemplateService);
return TemplateService;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
/***/ }),
/* 139 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PopupService", function() { return PopupService; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23);
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(20);
/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(42);
/* harmony import */ var _utils_array__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(14);
/* harmony import */ var _utils_event__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(21);
/* harmony import */ var _constants_keyCode__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(58);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 PopupService = /** @class */ (function (_super) {
__extends(PopupService, _super);
function PopupService() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.popupList = [];
return _this;
}
PopupService.prototype.registerGridCore = function (gridCore) {
var _this = this;
this.gridCore = gridCore;
this.addManagedListener(this.gridCore, _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_KEYBOARD_FOCUS, function () {
Object(_utils_array__WEBPACK_IMPORTED_MODULE_4__["forEach"])(_this.popupList, function (popup) { return Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["addCssClass"])(popup.element, 'ag-keyboard-focus'); });
});
this.addManagedListener(this.gridCore, _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_MOUSE_FOCUS, function () {
Object(_utils_array__WEBPACK_IMPORTED_MODULE_4__["forEach"])(_this.popupList, function (popup) { return Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["removeCssClass"])(popup.element, 'ag-keyboard-focus'); });
});
};
PopupService.prototype.getPopupParent = function () {
var ePopupParent = this.gridOptionsWrapper.getPopupParent();
if (ePopupParent) {
return ePopupParent;
}
return this.gridCore.getRootGui();
};
PopupService.prototype.positionPopupForMenu = function (params) {
var sourceRect = params.eventSource.getBoundingClientRect();
var parentRect = this.getParentRect();
var y = this.keepYWithinBounds(params, sourceRect.top - parentRect.top);
var minWidth = (params.ePopup.clientWidth > 0) ? params.ePopup.clientWidth : 200;
params.ePopup.style.minWidth = minWidth + "px";
var widthOfParent = parentRect.right - parentRect.left;
var maxX = widthOfParent - minWidth;
// the x position of the popup depends on RTL or LTR. for normal cases, LTR, we put the child popup
// to the right, unless it doesn't fit and we then put it to the left. for RTL it's the other way around,
// we try place it first to the left, and then if not to the right.
var x;
if (this.gridOptionsWrapper.isEnableRtl()) {
// for RTL, try left first
x = xLeftPosition();
if (x < 0) {
x = xRightPosition();
}
if (x > maxX) {
x = 0;
}
}
else {
// for LTR, try right first
x = xRightPosition();
if (x > maxX) {
x = xLeftPosition();
}
if (x < 0) {
x = 0;
}
}
params.ePopup.style.left = x + "px";
params.ePopup.style.top = y + "px";
function xRightPosition() {
return sourceRect.right - parentRect.left - 2;
}
function xLeftPosition() {
return sourceRect.left - parentRect.left - minWidth;
}
};
PopupService.prototype.positionPopupUnderMouseEvent = function (params) {
var _a = this.calculatePointerAlign(params.mouseEvent), x = _a.x, y = _a.y;
var ePopup = params.ePopup, nudgeX = params.nudgeX, nudgeY = params.nudgeY;
this.positionPopup({
ePopup: ePopup,
x: x,
y: y,
nudgeX: nudgeX,
nudgeY: nudgeY,
keepWithinBounds: true
});
this.callPostProcessPopup(params.type, params.ePopup, null, params.mouseEvent, params.column, params.rowNode);
};
PopupService.prototype.calculatePointerAlign = function (e) {
var parentRect = this.getParentRect();
return {
x: e.clientX - parentRect.left,
y: e.clientY - parentRect.top
};
};
PopupService.prototype.positionPopupUnderComponent = function (params) {
var sourceRect = params.eventSource.getBoundingClientRect();
var alignSide = params.alignSide || 'left';
var parentRect = this.getParentRect();
var x = sourceRect.left - parentRect.left;
if (alignSide === 'right') {
x -= (params.ePopup.offsetWidth - sourceRect.width);
}
this.positionPopup({
ePopup: params.ePopup,
minWidth: params.minWidth,
minHeight: params.minHeight,
nudgeX: params.nudgeX,
nudgeY: params.nudgeY,
x: x,
y: sourceRect.top - parentRect.top + sourceRect.height,
keepWithinBounds: params.keepWithinBounds
});
this.callPostProcessPopup(params.type, params.ePopup, params.eventSource, null, params.column, params.rowNode);
};
PopupService.prototype.positionPopupOverComponent = function (params) {
var sourceRect = params.eventSource.getBoundingClientRect();
var parentRect = this.getParentRect();
this.positionPopup({
ePopup: params.ePopup,
minWidth: params.minWidth,
nudgeX: params.nudgeX,
nudgeY: params.nudgeY,
x: sourceRect.left - parentRect.left,
y: sourceRect.top - parentRect.top,
keepWithinBounds: params.keepWithinBounds
});
this.callPostProcessPopup(params.type, params.ePopup, params.eventSource, null, params.column, params.rowNode);
};
PopupService.prototype.callPostProcessPopup = function (type, ePopup, eventSource, mouseEvent, column, rowNode) {
var callback = this.gridOptionsWrapper.getPostProcessPopupFunc();
if (callback) {
var params = {
column: column,
rowNode: rowNode,
ePopup: ePopup,
type: type,
eventSource: eventSource,
mouseEvent: mouseEvent
};
callback(params);
}
};
PopupService.prototype.positionPopup = function (params) {
var x = params.x;
var y = params.y;
if (params.nudgeX) {
x += params.nudgeX;
}
if (params.nudgeY) {
y += params.nudgeY;
}
// if popup is overflowing to the bottom, move it up
if (params.keepWithinBounds) {
x = this.keepXWithinBounds(params, x);
y = this.keepYWithinBounds(params, y);
}
params.ePopup.style.left = x + "px";
params.ePopup.style.top = y + "px";
};
PopupService.prototype.getActivePopups = function () {
return this.popupList.map(function (popup) { return popup.element; });
};
PopupService.prototype.getParentRect = function () {
// subtract the popup parent borders, because popupParent.getBoundingClientRect
// returns the rect outside the borders, but the 0,0 coordinate for absolute
// positioning is inside the border, leading the popup to be off by the width
// of the border
var popupParent = this.getPopupParent();
var eDocument = this.gridOptionsWrapper.getDocument();
if (popupParent === eDocument.body) {
popupParent = eDocument.documentElement;
}
var style = getComputedStyle(popupParent);
var bounds = popupParent.getBoundingClientRect();
return {
top: bounds.top + parseFloat(style.borderTopWidth) || 0,
left: bounds.left + parseFloat(style.borderLeftWidth) || 0,
right: bounds.right + parseFloat(style.borderRightWidth) || 0,
bottom: bounds.bottom + parseFloat(style.borderBottomWidth) || 0,
};
};
PopupService.prototype.keepYWithinBounds = function (params, y) {
var eDocument = this.gridOptionsWrapper.getDocument();
var docElement = eDocument.documentElement;
var popupParent = this.getPopupParent();
var parentRect = popupParent.getBoundingClientRect();
var documentRect = eDocument.documentElement.getBoundingClientRect();
var isBody = popupParent === eDocument.body;
var minHeight = Math.min(200, parentRect.height);
var diff = 0;
if (params.minHeight && params.minHeight < minHeight) {
minHeight = params.minHeight;
}
else if (params.ePopup.offsetHeight > 0) {
minHeight = params.ePopup.clientHeight;
diff = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["getAbsoluteHeight"])(params.ePopup) - minHeight;
}
var heightOfParent = isBody ? (Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["getAbsoluteHeight"])(docElement) + docElement.scrollTop) : parentRect.height;
if (isBody) {
heightOfParent -= Math.abs(documentRect.top - parentRect.top);
}
var maxY = heightOfParent - minHeight - diff;
return Math.min(Math.max(y, 0), Math.abs(maxY));
};
PopupService.prototype.keepXWithinBounds = function (params, x) {
var eDocument = this.gridOptionsWrapper.getDocument();
var docElement = eDocument.documentElement;
var popupParent = this.getPopupParent();
var parentRect = popupParent.getBoundingClientRect();
var documentRect = eDocument.documentElement.getBoundingClientRect();
var isBody = popupParent === eDocument.body;
var ePopup = params.ePopup;
var minWidth = Math.min(200, parentRect.width);
var diff = 0;
if (params.minWidth && params.minWidth < minWidth) {
minWidth = params.minWidth;
}
else if (ePopup.offsetWidth > 0) {
minWidth = ePopup.offsetWidth;
ePopup.style.minWidth = minWidth + "px";
diff = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["getAbsoluteWidth"])(ePopup) - minWidth;
}
var widthOfParent = isBody ? (Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["getAbsoluteWidth"])(docElement) + docElement.scrollLeft) : parentRect.width;
if (isBody) {
widthOfParent -= Math.abs(documentRect.left - parentRect.left);
}
var maxX = widthOfParent - minWidth - diff;
return Math.min(Math.max(x, 0), Math.abs(maxX));
};
PopupService.prototype.keepPopupPositionedRelativeTo = function (params) {
var eParent = this.getPopupParent();
var parentRect = eParent.getBoundingClientRect();
var sourceRect = params.element.getBoundingClientRect();
var initialDiffTop = parentRect.top - sourceRect.top;
var initialDiffLeft = parentRect.left - sourceRect.left;
var lastDiffTop = initialDiffTop;
var lastDiffLeft = initialDiffLeft;
var topPx = params.ePopup.style.top;
var top = parseInt(topPx.substring(0, topPx.length - 1), 10);
var leftPx = params.ePopup.style.left;
var left = parseInt(leftPx.substring(0, leftPx.length - 1), 10);
var intervalId = window.setInterval(function () {
var pRect = eParent.getBoundingClientRect();
var sRect = params.element.getBoundingClientRect();
var elementNotInDom = sRect.top == 0 && sRect.left == 0 && sRect.height == 0 && sRect.width == 0;
if (elementNotInDom) {
params.hidePopup();
return;
}
var currentDiffTop = pRect.top - sRect.top;
if (currentDiffTop != lastDiffTop) {
var newTop = top + initialDiffTop - currentDiffTop;
params.ePopup.style.top = newTop + "px";
}
lastDiffTop = currentDiffTop;
var currentDiffLeft = pRect.left - sRect.left;
if (currentDiffLeft != lastDiffLeft) {
var newLeft = left + initialDiffLeft - currentDiffLeft;
params.ePopup.style.left = newLeft + "px";
}
lastDiffLeft = currentDiffLeft;
}, 200);
var res = function () {
if (intervalId != null) {
window.clearInterval(intervalId);
}
intervalId = undefined;
};
return res;
};
PopupService.prototype.addPopup = function (params) {
var _this = this;
var modal = params.modal, eChild = params.eChild, closeOnEsc = params.closeOnEsc, closedCallback = params.closedCallback, click = params.click, alwaysOnTop = params.alwaysOnTop, afterGuiAttached = params.afterGuiAttached, positionCallback = params.positionCallback, anchorToElement = params.anchorToElement;
var eDocument = this.gridOptionsWrapper.getDocument();
if (!eDocument) {
console.warn('ag-grid: could not find the document, document is empty');
return;
}
var pos = Object(_utils_array__WEBPACK_IMPORTED_MODULE_4__["findIndex"])(this.popupList, function (popup) { return popup.element === eChild; });
if (pos !== -1) {
var popup = this.popupList[pos];
return { hideFunc: popup.hideFunc, stopAnchoringFunc: popup.stopAnchoringFunc };
}
var ePopupParent = this.getPopupParent();
// for angular specifically, but shouldn't cause an issue with js or other fw's
// https://github.com/angular/angular/issues/8563
ePopupParent.appendChild(eChild);
if (eChild.style.top == null) {
eChild.style.top = '0px';
}
if (eChild.style.left == null) {
eChild.style.left = '0px';
}
// add env CSS class to child, in case user provided a popup parent, which means
// theme class may be missing
var eWrapper = document.createElement('div');
var theme = this.environment.getTheme().theme;
if (theme) {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["addCssClass"])(eWrapper, theme);
}
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["addCssClass"])(eWrapper, 'ag-popup');
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["addCssClass"])(eChild, this.gridOptionsWrapper.isEnableRtl() ? 'ag-rtl' : 'ag-ltr');
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["addCssClass"])(eChild, 'ag-popup-child');
eWrapper.appendChild(eChild);
ePopupParent.appendChild(eWrapper);
if (alwaysOnTop) {
this.setAlwaysOnTop(eWrapper, true);
}
else {
this.bringPopupToFront(eWrapper);
}
var popupHidden = false;
var hidePopupOnKeyboardEvent = function (event) {
if (!eWrapper.contains(document.activeElement)) {
return;
}
var key = event.which || event.keyCode;
if (key === _constants_keyCode__WEBPACK_IMPORTED_MODULE_6__["KeyCode"].ESCAPE) {
hidePopup({ keyboardEvent: event });
}
};
var hidePopupOnMouseEvent = function (event) { return hidePopup({ mouseEvent: event }); };
var hidePopupOnTouchEvent = function (event) { return hidePopup({ touchEvent: event }); };
var destroyPositionTracker;
var hidePopup = function (params) {
if (params === void 0) { params = {}; }
var mouseEvent = params.mouseEvent, touchEvent = params.touchEvent, keyboardEvent = params.keyboardEvent;
if (
// we don't hide popup if the event was on the child, or any
// children of this child
_this.isEventFromCurrentPopup({ mouseEvent: mouseEvent, touchEvent: touchEvent }, eChild) ||
// if the event to close is actually the open event, then ignore it
_this.isEventSameChainAsOriginalEvent({ originalMouseEvent: click, mouseEvent: mouseEvent, touchEvent: touchEvent }) ||
// this method should only be called once. the client can have different
// paths, each one wanting to close, so this method may be called multiple times.
popupHidden) {
return;
}
popupHidden = true;
ePopupParent.removeChild(eWrapper);
eDocument.removeEventListener('keydown', hidePopupOnKeyboardEvent);
eDocument.removeEventListener('mousedown', hidePopupOnMouseEvent);
eDocument.removeEventListener('touchstart', hidePopupOnTouchEvent);
eDocument.removeEventListener('contextmenu', hidePopupOnMouseEvent);
_this.eventService.removeEventListener(_events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_DRAG_STARTED, hidePopupOnMouseEvent);
if (closedCallback) {
closedCallback(mouseEvent || touchEvent || keyboardEvent);
}
_this.popupList = _this.popupList.filter(function (popup) { return popup.element !== eChild; });
if (destroyPositionTracker) {
destroyPositionTracker();
}
};
if (afterGuiAttached) {
afterGuiAttached({ hidePopup: hidePopup });
}
// if we add these listeners now, then the current mouse
// click will be included, which we don't want
window.setTimeout(function () {
if (closeOnEsc) {
eDocument.addEventListener('keydown', hidePopupOnKeyboardEvent);
}
if (modal) {
eDocument.addEventListener('mousedown', hidePopupOnMouseEvent);
_this.eventService.addEventListener(_events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_DRAG_STARTED, hidePopupOnMouseEvent);
eDocument.addEventListener('touchstart', hidePopupOnTouchEvent);
eDocument.addEventListener('contextmenu', hidePopupOnMouseEvent);
}
}, 0);
if (positionCallback) {
positionCallback();
}
if (anchorToElement) {
// keeps popup positioned under created, eg if context menu, if user scrolls
// using touchpad and the cell moves, it moves the popup to keep it with the cell.
destroyPositionTracker = this.keepPopupPositionedRelativeTo({
element: anchorToElement,
ePopup: eChild,
hidePopup: hidePopup
});
}
this.popupList.push({
element: eChild,
hideFunc: hidePopup,
stopAnchoringFunc: destroyPositionTracker
});
return {
hideFunc: hidePopup,
stopAnchoringFunc: destroyPositionTracker
};
};
PopupService.prototype.isEventFromCurrentPopup = function (params, target) {
var mouseEvent = params.mouseEvent, touchEvent = params.touchEvent;
var event = mouseEvent ? mouseEvent : touchEvent;
if (!event) {
return false;
}
var indexOfThisChild = Object(_utils_array__WEBPACK_IMPORTED_MODULE_4__["findIndex"])(this.popupList, function (popup) { return popup.element === target; });
if (indexOfThisChild === -1) {
return false;
}
for (var i = indexOfThisChild; i < this.popupList.length; i++) {
var popup = this.popupList[i];
if (Object(_utils_event__WEBPACK_IMPORTED_MODULE_5__["isElementInEventPath"])(popup.element, event)) {
return true;
}
}
// if the user did not write their own Custom Element to be rendered as popup
// and this component has an additional popup element, they should have the
// `ag-custom-component-popup` class to be detected as part of the Custom Component
return this.isElementWithinCustomPopup(event.target);
};
PopupService.prototype.isElementWithinCustomPopup = function (el) {
if (!this.popupList.length) {
return false;
}
while (el && el !== document.body) {
if (el.classList.contains('ag-custom-component-popup') || el.parentElement === null) {
return true;
}
el = el.parentElement;
}
return false;
};
// in some browsers, the context menu event can be fired before the click event, which means
// the context menu event could open the popup, but then the click event closes it straight away.
PopupService.prototype.isEventSameChainAsOriginalEvent = function (params) {
var originalMouseEvent = params.originalMouseEvent, mouseEvent = params.mouseEvent, touchEvent = params.touchEvent;
// we check the coordinates of the event, to see if it's the same event. there is a 1 / 1000 chance that
// the event is a different event, however that is an edge case that is not very relevant (the user clicking
// twice on the same location isn't a normal path).
// event could be mouse event or touch event.
var mouseEventOrTouch = null;
if (mouseEvent) {
// mouse event can be used direction, it has coordinates
mouseEventOrTouch = mouseEvent;
}
else if (touchEvent) {
// touch event doesn't have coordinates, need it's touch object
mouseEventOrTouch = touchEvent.touches[0];
}
if (mouseEventOrTouch && originalMouseEvent) {
// for x, allow 4px margin, to cover iPads, where touch (which opens menu) is followed
// by browser click (when you finger up, touch is interrupted as click in browser)
var screenX_1 = mouseEvent ? mouseEvent.screenX : 0;
var screenY_1 = mouseEvent ? mouseEvent.screenY : 0;
var xMatch = Math.abs(originalMouseEvent.screenX - screenX_1) < 5;
var yMatch = Math.abs(originalMouseEvent.screenY - screenY_1) < 5;
if (xMatch && yMatch) {
return true;
}
}
return false;
};
PopupService.prototype.getWrapper = function (ePopup) {
while (!Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["containsClass"])(ePopup, 'ag-popup') && ePopup.parentElement) {
ePopup = ePopup.parentElement;
}
return Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["containsClass"])(ePopup, 'ag-popup') ? ePopup : null;
};
PopupService.prototype.setAlwaysOnTop = function (ePopup, alwaysOnTop) {
var eWrapper = this.getWrapper(ePopup);
if (!eWrapper) {
return;
}
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["addOrRemoveCssClass"])(eWrapper, 'ag-always-on-top', !!alwaysOnTop);
if (alwaysOnTop) {
this.bringPopupToFront(eWrapper);
}
};
PopupService.prototype.bringPopupToFront = function (ePopup) {
var parent = this.getPopupParent();
var popupList = Array.prototype.slice.call(parent.querySelectorAll('.ag-popup'));
var popupLen = popupList.length;
var alwaysOnTopList = Array.prototype.slice.call(parent.querySelectorAll('.ag-popup.ag-always-on-top'));
var onTopLength = alwaysOnTopList.length;
var eWrapper = this.getWrapper(ePopup);
if (!eWrapper || popupLen <= 1 || !parent.contains(ePopup)) {
return;
}
var pos = popupList.indexOf(eWrapper);
if (onTopLength) {
var isPopupAlwaysOnTop = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["containsClass"])(eWrapper, 'ag-always-on-top');
if (isPopupAlwaysOnTop) {
if (pos !== popupLen - 1) {
Object(_utils_array__WEBPACK_IMPORTED_MODULE_4__["last"])(alwaysOnTopList).insertAdjacentElement('afterend', eWrapper);
}
}
else if (pos !== popupLen - onTopLength - 1) {
alwaysOnTopList[0].insertAdjacentElement('beforebegin', eWrapper);
}
}
else if (pos !== popupLen - 1) {
Object(_utils_array__WEBPACK_IMPORTED_MODULE_4__["last"])(popupList).insertAdjacentElement('afterend', eWrapper);
}
var params = {
type: 'popupToFront',
api: this.gridOptionsWrapper.getApi(),
columnApi: this.gridOptionsWrapper.getColumnApi(),
eWrapper: eWrapper
};
this.eventService.dispatchEvent(params);
};
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('environment')
], PopupService.prototype, "environment", void 0);
PopupService = __decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('popupService')
], PopupService);
return PopupService;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_2__["BeanStub"]));
/***/ }),
/* 140 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LoggerFactory", function() { return LoggerFactory; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Logger", function() { return Logger; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 __param = (undefined && undefined.__param) || function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
var LoggerFactory = /** @class */ (function (_super) {
__extends(LoggerFactory, _super);
function LoggerFactory() {
return _super !== null && _super.apply(this, arguments) || this;
}
LoggerFactory.prototype.setBeans = function (gridOptionsWrapper) {
this.logging = gridOptionsWrapper.isDebug();
};
LoggerFactory.prototype.create = function (name) {
return new Logger(name, this.isLogging.bind(this));
};
LoggerFactory.prototype.isLogging = function () {
return this.logging;
};
__decorate([
__param(0, Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Qualifier"])('gridOptionsWrapper'))
], LoggerFactory.prototype, "setBeans", null);
LoggerFactory = __decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('loggerFactory')
], LoggerFactory);
return LoggerFactory;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
var Logger = /** @class */ (function () {
function Logger(name, isLoggingFunc) {
this.name = name;
this.isLoggingFunc = isLoggingFunc;
}
Logger.prototype.isLogging = function () {
return this.isLoggingFunc();
};
Logger.prototype.log = function (message) {
if (this.isLoggingFunc()) {
// tslint:disable-next-line
console.log('ag-Grid.' + this.name + ': ' + message);
}
};
return Logger;
}());
/***/ }),
/* 141 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AutoWidthCalculator", function() { return AutoWidthCalculator; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _headerRendering_header_headerWrapperComp__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(112);
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(20);
/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(42);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 AutoWidthCalculator = /** @class */ (function (_super) {
__extends(AutoWidthCalculator, _super);
function AutoWidthCalculator() {
return _super !== null && _super.apply(this, arguments) || this;
}
AutoWidthCalculator.prototype.registerGridComp = function (gridPanel) {
this.gridPanel = gridPanel;
};
AutoWidthCalculator.prototype.registerHeaderRootComp = function (headerRootComp) {
this.headerRootComp = headerRootComp;
};
// this is the trick: we create a dummy container and clone all the cells
// into the dummy, then check the dummy's width. then destroy the dummy
// as we don't need it any more.
// drawback: only the cells visible on the screen are considered
AutoWidthCalculator.prototype.getPreferredWidthForColumn = function (column, skipHeader) {
var eHeaderCell = this.getHeaderCellForColumn(column);
// cell isn't visible
if (!eHeaderCell) {
return -1;
}
var eDummyContainer = document.createElement('span');
// position fixed, so it isn't restricted to the boundaries of the parent
eDummyContainer.style.position = 'fixed';
// we put the dummy into the body container, so it will inherit all the
// css styles that the real cells are inheriting
var eBodyContainer = this.gridPanel.getCenterContainer();
eBodyContainer.appendChild(eDummyContainer);
// get all the cells that are currently displayed (this only brings back
// rendered cells, rows not rendered due to row visualisation will not be here)
this.putRowCellsIntoDummyContainer(column, eDummyContainer);
if (!skipHeader) {
// we only consider the lowest level cell, not the group cell. in 99% of the time, this
// will be enough. if we consider groups, then it gets too complicated for what it's worth,
// as the groups can span columns and this class only considers one column at a time.
this.cloneItemIntoDummy(eHeaderCell, eDummyContainer);
}
// at this point, all the clones are lined up vertically with natural widths. the dummy
// container will have a width wide enough just to fit the largest.
var dummyContainerWidth = eDummyContainer.offsetWidth;
// we are finished with the dummy container, so get rid of it
eBodyContainer.removeChild(eDummyContainer);
// we add padding as I found sometimes the gui still put '...' after some of the texts. so the
// user can configure the grid to add a few more pixels after the calculated width
var autoSizePadding = this.gridOptionsWrapper.getAutoSizePadding();
return dummyContainerWidth + autoSizePadding;
};
AutoWidthCalculator.prototype.getHeaderCellForColumn = function (column) {
var comp = null;
// find the rendered header cell
this.headerRootComp.forEachHeaderElement(function (headerElement) {
if (headerElement instanceof _headerRendering_header_headerWrapperComp__WEBPACK_IMPORTED_MODULE_1__["HeaderWrapperComp"]) {
var headerWrapperComp = headerElement;
if (headerWrapperComp.getColumn() === column) {
comp = headerWrapperComp;
}
}
});
return comp ? comp.getGui() : null;
};
AutoWidthCalculator.prototype.putRowCellsIntoDummyContainer = function (column, eDummyContainer) {
var _this = this;
var eCells = this.rowRenderer.getAllCellsForColumn(column);
eCells.forEach(function (eCell) { return _this.cloneItemIntoDummy(eCell, eDummyContainer); });
};
AutoWidthCalculator.prototype.cloneItemIntoDummy = function (eCell, eDummyContainer) {
// make a deep clone of the cell
var eCellClone = eCell.cloneNode(true);
// the original has a fixed width, we remove this to allow the natural width based on content
eCellClone.style.width = '';
// the original has position = absolute, we need to remove this so it's positioned normally
eCellClone.style.position = 'static';
eCellClone.style.left = '';
// we put the cell into a containing div, as otherwise the cells would just line up
// on the same line, standard flow layout, by putting them into divs, they are laid
// out one per line
var eCloneParent = document.createElement('div');
if (Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["containsClass"])(eCellClone, 'ag-header-cell')) {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["addCssClass"])(eCloneParent, 'ag-header');
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["addCssClass"])(eCloneParent, 'ag-header-row');
eCloneParent.style.position = 'static';
}
else {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["addCssClass"])(eCloneParent, 'ag-row');
}
// table-row, so that each cell is on a row. i also tried display='block', but this
// didn't work in IE
eCloneParent.style.display = 'table-row';
// the twig on the branch, the branch on the tree, the tree in the hole,
// the hole in the bog, the bog in the clone, the clone in the parent,
// the parent in the dummy, and the dummy down in the vall-e-ooo, OOOOOOOOO! Oh row the rattling bog....
eCloneParent.appendChild(eCellClone);
eDummyContainer.appendChild(eCloneParent);
};
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('rowRenderer')
], AutoWidthCalculator.prototype, "rowRenderer", void 0);
AutoWidthCalculator = __decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('autoWidthCalculator')
], AutoWidthCalculator);
return AutoWidthCalculator;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_2__["BeanStub"]));
/***/ }),
/* 142 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HorizontalResizeService", function() { return HorizontalResizeService; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 HorizontalResizeService = /** @class */ (function (_super) {
__extends(HorizontalResizeService, _super);
function HorizontalResizeService() {
return _super !== null && _super.apply(this, arguments) || this;
}
HorizontalResizeService.prototype.addResizeBar = function (params) {
var _this = this;
var dragSource = {
dragStartPixels: params.dragStartPixels || 0,
eElement: params.eResizeBar,
onDragStart: this.onDragStart.bind(this, params),
onDragStop: this.onDragStop.bind(this, params),
onDragging: this.onDragging.bind(this, params)
};
this.dragService.addDragSource(dragSource, true);
// we pass remove func back to the caller, so call can tell us when they
// are finished, and then we remove the listener from the drag source
var finishedWithResizeFunc = function () { return _this.dragService.removeDragSource(dragSource); };
return finishedWithResizeFunc;
};
HorizontalResizeService.prototype.onDragStart = function (params, mouseEvent) {
this.dragStartX = mouseEvent.clientX;
this.setResizeIcons();
var shiftKey = mouseEvent instanceof MouseEvent ? mouseEvent.shiftKey === true : false;
params.onResizeStart(shiftKey);
};
HorizontalResizeService.prototype.setResizeIcons = function () {
this.oldBodyCursor = this.eGridDiv.style.cursor;
this.oldUserSelect = this.eGridDiv.style.userSelect;
this.oldWebkitUserSelect = this.eGridDiv.style.webkitUserSelect;
// change the body cursor, so when drag moves out of the drag bar, the cursor is still 'resize' (or 'move'
this.eGridDiv.style.cursor = 'ew-resize';
// we don't want text selection outside the grid (otherwise it looks weird as text highlights when we move)
this.eGridDiv.style.userSelect = 'none';
this.eGridDiv.style.webkitUserSelect = 'none';
};
HorizontalResizeService.prototype.onDragStop = function (params, mouseEvent) {
params.onResizeEnd(this.resizeAmount);
this.resetIcons();
};
HorizontalResizeService.prototype.resetIcons = function () {
// we don't want text selection outside the grid (otherwise it looks weird as text highlights when we move)
this.eGridDiv.style.cursor = this.oldBodyCursor;
this.eGridDiv.style.userSelect = this.oldUserSelect;
this.eGridDiv.style.webkitUserSelect = this.oldWebkitUserSelect;
};
HorizontalResizeService.prototype.onDragging = function (params, mouseEvent) {
this.resizeAmount = mouseEvent.clientX - this.dragStartX;
params.onResizing(this.resizeAmount);
};
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('dragService')
], HorizontalResizeService.prototype, "dragService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('eGridDiv')
], HorizontalResizeService.prototype, "eGridDiv", void 0);
HorizontalResizeService = __decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('horizontalResizeService')
], HorizontalResizeService);
return HorizontalResizeService;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
/***/ }),
/* 143 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GridCore", function() { return GridCore; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(57);
/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(23);
/* harmony import */ var _entities_sideBar__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(96);
/* harmony import */ var _modules_moduleNames__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(17);
/* harmony import */ var _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(18);
/* harmony import */ var _widgets_managedFocusComponent__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(65);
/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(42);
/* harmony import */ var _utils_array__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(14);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 GridCore = /** @class */ (function (_super) {
__extends(GridCore, _super);
function GridCore() {
return _super.call(this, undefined, true) || this;
}
GridCore.prototype.postConstruct = function () {
var _this = this;
this.logger = this.loggerFactory.create('GridCore');
var template = this.createTemplate();
this.setTemplate(template);
// register with services that need grid core
[
this.gridApi,
this.rowRenderer,
this.popupService,
this.focusController
].forEach(function (service) { return service.registerGridCore(_this); });
if (_modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_5__["ModuleRegistry"].isRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_4__["ModuleNames"].ClipboardModule)) {
this.clipboardService.registerGridCore(this);
}
this.gridOptionsWrapper.addLayoutElement(this.getGui());
this.eGridDiv.appendChild(this.getGui());
this.addDestroyFunc(function () {
_this.eGridDiv.removeChild(_this.getGui());
});
// if using angular, watch for quickFilter changes
if (this.$scope) {
var quickFilterUnregisterFn = this.$scope.$watch(this.quickFilterOnScope, function (newFilter) { return _this.filterManager.setQuickFilter(newFilter); });
this.addDestroyFunc(quickFilterUnregisterFn);
}
// important to set rtl before doLayout, as setting the RTL class impacts the scroll position,
// which doLayout indirectly depends on
this.addRtlSupport();
this.logger.log('ready');
this.gridOptionsWrapper.addLayoutElement(this.eRootWrapperBody);
var unsubscribeFromResize = this.resizeObserverService.observeResize(this.eGridDiv, this.onGridSizeChanged.bind(this));
this.addDestroyFunc(function () { return unsubscribeFromResize(); });
var eGui = this.getGui();
this.addManagedListener(this, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_KEYBOARD_FOCUS, function () {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_7__["addCssClass"])(eGui, 'ag-keyboard-focus');
});
this.addManagedListener(this, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_MOUSE_FOCUS, function () {
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_7__["removeCssClass"])(eGui, 'ag-keyboard-focus');
});
_super.prototype.postConstruct.call(this);
};
GridCore.prototype.getFocusableElement = function () {
return this.eRootWrapperBody;
};
GridCore.prototype.createTemplate = function () {
var sideBarModuleLoaded = _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_5__["ModuleRegistry"].isRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_4__["ModuleNames"].SideBarModule);
var statusBarModuleLoaded = _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_5__["ModuleRegistry"].isRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_4__["ModuleNames"].StatusBarModule);
var rowGroupingLoaded = _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_5__["ModuleRegistry"].isRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_4__["ModuleNames"].RowGroupingModule);
var enterpriseCoreLoaded = _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_5__["ModuleRegistry"].isRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_4__["ModuleNames"].EnterpriseCoreModule);
var dropZones = rowGroupingLoaded ? '' : '';
var sideBar = sideBarModuleLoaded ? '' : '';
var statusBar = statusBarModuleLoaded ? '' : '';
var watermark = enterpriseCoreLoaded ? '' : '';
var template = "
\n " + dropZones + "\n
\n \n " + sideBar + "\n
\n " + statusBar + "\n \n " + watermark + "\n
";
return template;
};
GridCore.prototype.getFocusableContainers = function () {
var focusableContainers = [
this.gridPanel.getGui()
];
if (this.sideBarComp) {
focusableContainers.push(this.sideBarComp.getGui());
}
return focusableContainers.filter(function (el) { return Object(_utils_dom__WEBPACK_IMPORTED_MODULE_7__["isVisible"])(el); });
};
GridCore.prototype.focusNextInnerContainer = function (backwards) {
var focusableContainers = this.getFocusableContainers();
var idxWithFocus = Object(_utils_array__WEBPACK_IMPORTED_MODULE_8__["findIndex"])(focusableContainers, function (container) { return container.contains(document.activeElement); });
var nextIdx = idxWithFocus + (backwards ? -1 : 1);
if (nextIdx < 0 || nextIdx >= focusableContainers.length) {
return false;
}
if (nextIdx === 0) {
return this.focusGridHeader();
}
return this.focusController.focusInto(focusableContainers[nextIdx]);
};
GridCore.prototype.focusInnerElement = function (fromBottom) {
var focusableContainers = this.getFocusableContainers();
if (fromBottom) {
if (focusableContainers.length > 1) {
return this.focusController.focusInto(Object(_utils_array__WEBPACK_IMPORTED_MODULE_8__["last"])(focusableContainers));
}
var lastColumn = Object(_utils_array__WEBPACK_IMPORTED_MODULE_8__["last"])(this.columnController.getAllDisplayedColumns());
if (this.focusController.focusGridView(lastColumn, true)) {
return true;
}
}
return this.focusGridHeader();
};
GridCore.prototype.focusGridHeader = function () {
var firstColumn = this.columnController.getAllDisplayedColumns()[0];
if (!firstColumn) {
return false;
}
if (firstColumn.getParent()) {
firstColumn = this.columnController.getColumnGroupAtLevel(firstColumn, 0);
}
this.focusController.focusHeaderPosition({ headerRowIndex: 0, column: firstColumn });
return true;
};
GridCore.prototype.onGridSizeChanged = function () {
var event = {
type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_GRID_SIZE_CHANGED,
api: this.gridApi,
columnApi: this.columnApi,
clientWidth: this.eGridDiv.clientWidth,
clientHeight: this.eGridDiv.clientHeight
};
this.eventService.dispatchEvent(event);
};
GridCore.prototype.addRtlSupport = function () {
var cssClass = this.gridOptionsWrapper.isEnableRtl() ? 'ag-rtl' : 'ag-ltr';
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_7__["addCssClass"])(this.getGui(), cssClass);
};
GridCore.prototype.getRootGui = function () {
return this.getGui();
};
GridCore.prototype.isSideBarVisible = function () {
if (!this.sideBarComp) {
return false;
}
return this.sideBarComp.isDisplayed();
};
GridCore.prototype.setSideBarVisible = function (show) {
if (!this.sideBarComp) {
if (show) {
console.warn('ag-Grid: sideBar is not loaded');
}
return;
}
this.sideBarComp.setDisplayed(show);
};
GridCore.prototype.setSideBarPosition = function (position) {
if (!this.sideBarComp) {
console.warn('ag-Grid: sideBar is not loaded');
return;
}
this.sideBarComp.setSideBarPosition(position);
};
GridCore.prototype.closeToolPanel = function () {
if (!this.sideBarComp) {
console.warn('ag-Grid: toolPanel is only available in ag-Grid Enterprise');
return;
}
this.sideBarComp.close();
};
GridCore.prototype.getSideBar = function () {
return this.gridOptions.sideBar;
};
GridCore.prototype.getToolPanelInstance = function (key) {
if (!this.sideBarComp) {
console.warn('ag-Grid: toolPanel is only available in ag-Grid Enterprise');
return;
}
return this.sideBarComp.getToolPanelInstance(key);
};
GridCore.prototype.refreshSideBar = function () {
if (this.sideBarComp) {
this.sideBarComp.refresh();
}
};
GridCore.prototype.setSideBar = function (def) {
if (!this.sideBarComp) {
return;
}
this.eRootWrapperBody.removeChild(this.sideBarComp.getGui());
this.gridOptions.sideBar = _entities_sideBar__WEBPACK_IMPORTED_MODULE_3__["SideBarDefParser"].parse(def);
this.sideBarComp.reset();
this.eRootWrapperBody.appendChild(this.sideBarComp.getGui());
};
GridCore.prototype.getOpenedToolPanel = function () {
if (!this.sideBarComp) {
return null;
}
return this.sideBarComp.openedItem();
};
GridCore.prototype.openToolPanel = function (key) {
if (!this.sideBarComp) {
console.warn('ag-Grid: toolPanel is only available in ag-Grid Enterprise');
return;
}
this.sideBarComp.openToolPanel(key);
};
GridCore.prototype.isToolPanelShowing = function () {
return this.sideBarComp.isToolPanelShowing();
};
GridCore.prototype.destroy = function () {
this.logger.log('Grid DOM removed');
_super.prototype.destroy.call(this);
};
// Valid values for position are bottom, middle and top
GridCore.prototype.ensureNodeVisible = function (comparator, position) {
if (position === void 0) { position = null; }
if (this.doingVirtualPaging) {
throw new Error('Cannot use ensureNodeVisible when doing virtual paging, as we cannot check rows that are not in memory');
}
// look for the node index we want to display
var rowCount = this.rowModel.getRowCount();
var comparatorIsAFunction = typeof comparator === 'function';
var indexToSelect = -1;
// go through all the nodes, find the one we want to show
for (var i = 0; i < rowCount; i++) {
var node = this.rowModel.getRow(i);
if (comparatorIsAFunction) {
if (comparator(node)) {
indexToSelect = i;
break;
}
}
else {
// check object equality against node and data
if (comparator === node || comparator === node.data) {
indexToSelect = i;
break;
}
}
}
if (indexToSelect >= 0) {
this.gridPanel.ensureIndexVisible(indexToSelect, position);
}
};
GridCore.prototype.onTabKeyDown = function () { };
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptions')
], GridCore.prototype, "gridOptions", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('rowModel')
], GridCore.prototype, "rowModel", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('resizeObserverService')
], GridCore.prototype, "resizeObserverService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('rowRenderer')
], GridCore.prototype, "rowRenderer", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('filterManager')
], GridCore.prototype, "filterManager", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('eGridDiv')
], GridCore.prototype, "eGridDiv", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('$scope')
], GridCore.prototype, "$scope", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('quickFilterOnScope')
], GridCore.prototype, "quickFilterOnScope", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('popupService')
], GridCore.prototype, "popupService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnController')
], GridCore.prototype, "columnController", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('loggerFactory')
], GridCore.prototype, "loggerFactory", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnApi')
], GridCore.prototype, "columnApi", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridApi')
], GridCore.prototype, "gridApi", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Optional"])('clipboardService')
], GridCore.prototype, "clipboardService", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_1__["RefSelector"])('gridPanel')
], GridCore.prototype, "gridPanel", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_1__["RefSelector"])('sideBar')
], GridCore.prototype, "sideBarComp", void 0);
__decorate([
Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_1__["RefSelector"])('rootWrapperBody')
], GridCore.prototype, "eRootWrapperBody", void 0);
return GridCore;
}(_widgets_managedFocusComponent__WEBPACK_IMPORTED_MODULE_6__["ManagedFocusComponent"]));
/***/ }),
/* 144 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StandardMenuFactory", function() { return StandardMenuFactory; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20);
/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(42);
/* harmony import */ var _constants_keyCode__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(58);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 StandardMenuFactory = /** @class */ (function (_super) {
__extends(StandardMenuFactory, _super);
function StandardMenuFactory() {
return _super !== null && _super.apply(this, arguments) || this;
}
StandardMenuFactory.prototype.registerGridComp = function (gridPanel) {
this.gridPanel = gridPanel;
};
StandardMenuFactory.prototype.hideActiveMenu = function () {
if (this.hidePopup) {
this.hidePopup();
}
};
StandardMenuFactory.prototype.showMenuAfterMouseEvent = function (column, mouseEvent) {
var _this = this;
this.showPopup(column, function (eMenu) {
_this.popupService.positionPopupUnderMouseEvent({
column: column,
type: 'columnMenu',
mouseEvent: mouseEvent,
ePopup: eMenu
});
}, mouseEvent.target);
};
StandardMenuFactory.prototype.showMenuAfterButtonClick = function (column, eventSource) {
var _this = this;
this.showPopup(column, function (eMenu) {
_this.popupService.positionPopupUnderComponent({
type: 'columnMenu',
eventSource: eventSource,
ePopup: eMenu,
keepWithinBounds: true,
column: column
});
}, eventSource);
};
StandardMenuFactory.prototype.showPopup = function (column, positionCallback, eventSource) {
var _this = this;
var filterWrapper = this.filterManager.getOrCreateFilterWrapper(column, 'COLUMN_MENU');
var eMenu = document.createElement('div');
eMenu.setAttribute('role', 'presentation');
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_2__["addCssClass"])(eMenu, 'ag-menu');
this.tabListener = this.addManagedListener(eMenu, 'keydown', function (e) { return _this.trapFocusWithin(e, eMenu); });
filterWrapper.guiPromise.then(function (gui) { return eMenu.appendChild(gui); });
var hidePopup;
var bodyScrollListener = function (event) {
// if h scroll, popup is no longer over the column
if (event.direction === 'horizontal' && hidePopup) {
hidePopup();
}
};
this.eventService.addEventListener('bodyScroll', bodyScrollListener);
var closedCallback = function (e) {
_this.eventService.removeEventListener('bodyScroll', bodyScrollListener);
column.setMenuVisible(false, 'contextMenu');
var isKeyboardEvent = e instanceof KeyboardEvent;
if (_this.tabListener) {
_this.tabListener = _this.tabListener();
}
if (isKeyboardEvent && eventSource && Object(_utils_dom__WEBPACK_IMPORTED_MODULE_2__["isVisible"])(eventSource)) {
var focusableEl = _this.focusController.findTabbableParent(eventSource);
if (focusableEl) {
focusableEl.focus();
}
}
};
var addPopupRes = this.popupService.addPopup({
modal: true,
eChild: eMenu,
closeOnEsc: true,
closedCallback: closedCallback
});
if (addPopupRes) {
this.hidePopup = hidePopup = addPopupRes.hideFunc;
}
filterWrapper.filterPromise.then(function (filter) {
// need to make sure the filter is present before positioning, as only
// after filter it is visible can we find out what the width of it is
positionCallback(eMenu);
if (filter.afterGuiAttached) {
filter.afterGuiAttached({ container: 'columnMenu', hidePopup: hidePopup });
}
});
column.setMenuVisible(true, 'contextMenu');
};
StandardMenuFactory.prototype.trapFocusWithin = function (e, menu) {
if (e.keyCode !== _constants_keyCode__WEBPACK_IMPORTED_MODULE_3__["KeyCode"].TAB ||
e.defaultPrevented ||
this.focusController.findNextFocusableElement(menu, false, e.shiftKey)) {
return;
}
e.preventDefault();
this.focusController.focusInto(menu, e.shiftKey);
};
StandardMenuFactory.prototype.isMenuEnabled = function (column) {
// for standard, we show menu if filter is enabled, and the menu is not suppressed
return column.isFilterAllowed();
};
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('filterManager')
], StandardMenuFactory.prototype, "filterManager", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('popupService')
], StandardMenuFactory.prototype, "popupService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('focusController')
], StandardMenuFactory.prototype, "focusController", void 0);
StandardMenuFactory = __decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('menuFactory')
], StandardMenuFactory);
return StandardMenuFactory;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
/***/ }),
/* 145 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DragService", function() { return DragService; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23);
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(20);
/* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7);
/* harmony import */ var _utils_array__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(14);
/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(42);
/* harmony import */ var _utils_mouse__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(50);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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;
};
/** Adds drag listening onto an element. In ag-Grid this is used twice, first is resizing columns,
* second is moving the columns and column groups around (ie the 'drag' part of Drag and Drop. */
var DragService = /** @class */ (function (_super) {
__extends(DragService, _super);
function DragService() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.dragEndFunctions = [];
_this.dragSources = [];
return _this;
}
DragService.prototype.init = function () {
this.logger = this.loggerFactory.create('DragService');
};
DragService.prototype.removeAllListeners = function () {
this.dragSources.forEach(this.removeListener.bind(this));
this.dragSources.length = 0;
};
DragService.prototype.removeListener = function (dragSourceAndListener) {
var element = dragSourceAndListener.dragSource.eElement;
var mouseDownListener = dragSourceAndListener.mouseDownListener;
element.removeEventListener('mousedown', mouseDownListener);
// remove touch listener only if it exists
if (dragSourceAndListener.touchEnabled) {
var touchStartListener = dragSourceAndListener.touchStartListener;
element.removeEventListener('touchstart', touchStartListener, { passive: true });
}
};
DragService.prototype.removeDragSource = function (params) {
var dragSourceAndListener = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_3__["find"])(this.dragSources, function (item) { return item.dragSource === params; });
if (!dragSourceAndListener) {
return;
}
this.removeListener(dragSourceAndListener);
Object(_utils_array__WEBPACK_IMPORTED_MODULE_4__["removeFromArray"])(this.dragSources, dragSourceAndListener);
};
DragService.prototype.setNoSelectToBody = function (noSelect) {
var eDocument = this.gridOptionsWrapper.getDocument();
var eBody = eDocument.querySelector('body');
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_3__["exists"])(eBody)) {
// when we drag the mouse in ag-Grid, this class gets added / removed from the body, so that
// the mouse isn't selecting text when dragging.
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_5__["addOrRemoveCssClass"])(eBody, 'ag-unselectable', noSelect);
}
};
DragService.prototype.isDragging = function () {
return this.dragging;
};
DragService.prototype.addDragSource = function (params, includeTouch) {
if (includeTouch === void 0) { includeTouch = false; }
var mouseListener = this.onMouseDown.bind(this, params);
params.eElement.addEventListener('mousedown', mouseListener);
var touchListener = null;
var suppressTouch = this.gridOptionsWrapper.isSuppressTouch();
if (includeTouch && !suppressTouch) {
touchListener = this.onTouchStart.bind(this, params);
params.eElement.addEventListener('touchstart', touchListener, { passive: true });
}
this.dragSources.push({
dragSource: params,
mouseDownListener: mouseListener,
touchStartListener: touchListener,
touchEnabled: includeTouch
});
};
// gets called whenever mouse down on any drag source
DragService.prototype.onTouchStart = function (params, touchEvent) {
var _this = this;
this.currentDragParams = params;
this.dragging = false;
var touch = touchEvent.touches[0];
this.touchLastTime = touch;
this.touchStart = touch;
var touchMoveEvent = function (e) { return _this.onTouchMove(e, params.eElement); };
var touchEndEvent = function (e) { return _this.onTouchUp(e, params.eElement); };
var documentTouchMove = function (e) { if (e.cancelable) {
e.preventDefault();
} };
var target = params.eElement;
var events = [
// Prevents the page document from moving while we are dragging items around.
// preventDefault needs to be called in the touchmove listener and never inside the
// touchstart, because using touchstart causes the click event to be cancelled on touch devices.
{ target: document, type: 'touchmove', listener: documentTouchMove, options: { passive: false } },
{ target: target, type: 'touchmove', listener: touchMoveEvent, options: { passive: true } },
{ target: target, type: 'touchend', listener: touchEndEvent, options: { passive: true } },
{ target: target, type: 'touchcancel', listener: touchEndEvent, options: { passive: true } }
];
// temporally add these listeners, for the duration of the drag
this.addTemporaryEvents(events);
// see if we want to start dragging straight away
if (params.dragStartPixels === 0) {
this.onCommonMove(touch, this.touchStart, params.eElement);
}
};
// gets called whenever mouse down on any drag source
DragService.prototype.onMouseDown = function (params, mouseEvent) {
var _this = this;
var e = mouseEvent;
if (params.skipMouseEvent && params.skipMouseEvent(mouseEvent)) {
return;
}
// if there are two elements with parent / child relationship, and both are draggable,
// when we drag the child, we should NOT drag the parent. an example of this is row moving
// and range selection - row moving should get preference when use drags the rowDrag component.
if (e._alreadyProcessedByDragService) {
return;
}
e._alreadyProcessedByDragService = true;
// only interested in left button clicks
if (mouseEvent.button !== 0) {
return;
}
this.currentDragParams = params;
this.dragging = false;
this.mouseStartEvent = mouseEvent;
var eDocument = this.gridOptionsWrapper.getDocument();
this.setNoSelectToBody(true);
var mouseMoveEvent = function (e, el) { return _this.onMouseMove(e, params.eElement); };
var mouseUpEvent = function (e, el) { return _this.onMouseUp(e, params.eElement); };
var contextEvent = function (e) { return e.preventDefault(); };
var target = eDocument;
var events = [
{ target: target, type: 'mousemove', listener: mouseMoveEvent },
{ target: target, type: 'mouseup', listener: mouseUpEvent },
{ target: target, type: 'contextmenu', listener: contextEvent }
];
// temporally add these listeners, for the duration of the drag
this.addTemporaryEvents(events);
//see if we want to start dragging straight away
if (params.dragStartPixels === 0) {
this.onMouseMove(mouseEvent, params.eElement);
}
};
DragService.prototype.addTemporaryEvents = function (events) {
events.forEach(function (currentEvent) {
var target = currentEvent.target, type = currentEvent.type, listener = currentEvent.listener, options = currentEvent.options;
target.addEventListener(type, listener, options);
});
this.dragEndFunctions.push(function () {
events.forEach(function (currentEvent) {
var target = currentEvent.target, type = currentEvent.type, listener = currentEvent.listener, options = currentEvent.options;
target.removeEventListener(type, listener, options);
});
});
};
// 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.
DragService.prototype.isEventNearStartEvent = function (currentEvent, startEvent) {
// by default, we wait 4 pixels before starting the drag
var dragStartPixels = this.currentDragParams.dragStartPixels;
var requiredPixelDiff = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_3__["exists"])(dragStartPixels) ? dragStartPixels : 4;
return Object(_utils_mouse__WEBPACK_IMPORTED_MODULE_6__["areEventsNear"])(currentEvent, startEvent, requiredPixelDiff);
};
DragService.prototype.getFirstActiveTouch = function (touchList) {
for (var i = 0; i < touchList.length; i++) {
if (touchList[i].identifier === this.touchStart.identifier) {
return touchList[i];
}
}
return null;
};
DragService.prototype.onCommonMove = function (currentEvent, startEvent, el) {
if (!this.dragging) {
// if mouse hasn't travelled from the start position enough, do nothing
if (!this.dragging && this.isEventNearStartEvent(currentEvent, startEvent)) {
return;
}
this.dragging = true;
var event_1 = {
type: _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_DRAG_STARTED,
api: this.gridApi,
columnApi: this.columnApi,
target: el
};
this.eventService.dispatchEvent(event_1);
this.currentDragParams.onDragStart(startEvent);
// we need ONE drag action at the startEvent, so that we are guaranteed the drop target
// at the start gets notified. this is because the drag can start outside of the element
// that started it, as the mouse is allowed drag away from the mouse down before it's
// considered a drag (the isEventNearStartEvent() above). if we didn't do this, then
// it would be possible to click a column by the edge, then drag outside of the drop zone
// in less than 4 pixels and the drag officially starts outside of the header but the header
// wouldn't be notified of the dragging.
this.currentDragParams.onDragging(startEvent);
}
this.currentDragParams.onDragging(currentEvent);
};
DragService.prototype.onTouchMove = function (touchEvent, el) {
var touch = this.getFirstActiveTouch(touchEvent.touches);
if (!touch) {
return;
}
// this.___statusPanel.setInfoText(Math.random() + ' onTouchMove preventDefault stopPropagation');
this.onCommonMove(touch, this.touchStart, el);
};
// only gets called after a mouse down - as this is only added after mouseDown
// and is removed when mouseUp happens
DragService.prototype.onMouseMove = function (mouseEvent, el) {
this.onCommonMove(mouseEvent, this.mouseStartEvent, el);
};
DragService.prototype.onTouchUp = function (touchEvent, el) {
var touch = this.getFirstActiveTouch(touchEvent.changedTouches);
// i haven't worked this out yet, but there is no matching touch
// when we get the touch up event. to get around this, we swap in
// the last touch. this is a hack to 'get it working' while we
// figure out what's going on, why we are not getting a touch in
// current event.
if (!touch) {
touch = this.touchLastTime;
}
// if mouse was left up before we started to move, then this is a tap.
// we check this before onUpCommon as onUpCommon resets the dragging
// let tap = !this.dragging;
// let tapTarget = this.currentDragParams.eElement;
this.onUpCommon(touch, el);
// if tap, tell user
// console.log(`${Math.random()} tap = ${tap}`);
// if (tap) {
// tapTarget.click();
// }
};
DragService.prototype.onMouseUp = function (mouseEvent, el) {
this.onUpCommon(mouseEvent, el);
};
DragService.prototype.onUpCommon = function (eventOrTouch, el) {
if (this.dragging) {
this.dragging = false;
this.currentDragParams.onDragStop(eventOrTouch);
var event_2 = {
type: _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_DRAG_STOPPED,
api: this.gridApi,
columnApi: this.columnApi,
target: el
};
this.eventService.dispatchEvent(event_2);
}
this.setNoSelectToBody(false);
this.mouseStartEvent = null;
this.touchStart = null;
this.touchLastTime = null;
this.currentDragParams = null;
this.dragEndFunctions.forEach(function (func) { return func(); });
this.dragEndFunctions.length = 0;
};
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('loggerFactory')
], DragService.prototype, "loggerFactory", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnApi')
], DragService.prototype, "columnApi", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridApi')
], DragService.prototype, "gridApi", void 0);
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_0__["PostConstruct"]
], DragService.prototype, "init", null);
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_0__["PreDestroy"]
], DragService.prototype, "removeAllListeners", null);
DragService = __decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('dragService')
], DragService);
return DragService;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_2__["BeanStub"]));
/***/ }),
/* 146 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SortController", function() { return SortController; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20);
/* harmony import */ var _constants_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(16);
/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(23);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 SortController = /** @class */ (function (_super) {
__extends(SortController, _super);
function SortController() {
var _this = _super !== null && _super.apply(this, arguments) || this;
// used by server side row models, to send sorting to server
_this.getSortModel = function () {
return _this.getColumnsWithSortingOrdered().map(function (column) { return ({
colId: column.getColId(),
sort: column.getSort()
}); });
};
return _this;
}
SortController_1 = SortController;
SortController.prototype.progressSort = function (column, multiSort, source) {
if (source === void 0) { source = "api"; }
var nextDirection = this.getNextSortDirection(column);
this.setSortForColumn(column, nextDirection, multiSort, source);
};
SortController.prototype.setSortForColumn = function (column, sort, multiSort, source) {
if (source === void 0) { source = "api"; }
// auto correct - if sort not legal value, then set it to 'no sort' (which is null)
if (sort !== _constants_constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].SORT_ASC && sort !== _constants_constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].SORT_DESC) {
sort = null;
}
// update sort on current col
column.setSort(sort, source);
var doingMultiSort = multiSort && !this.gridOptionsWrapper.isSuppressMultiSort();
// clear sort on all columns except this one, and update the icons
if (!doingMultiSort) {
this.clearSortBarThisColumn(column, source);
}
// sortIndex used for knowing order of cols when multi-col sort
this.updateSortIndex(column);
this.dispatchSortChangedEvents();
};
SortController.prototype.updateSortIndex = function (lastColToChange) {
// update sortIndex on all sorting cols
var allSortedCols = this.getColumnsWithSortingOrdered();
var sortIndex = 0;
allSortedCols.forEach(function (col) {
if (col !== lastColToChange) {
col.setSortIndex(sortIndex);
sortIndex++;
}
});
// last col to change always gets the last sort index, it's added to the end
if (lastColToChange.getSort()) {
lastColToChange.setSortIndex(sortIndex);
}
// clear sort index on all cols not sorting
var allCols = this.columnController.getPrimaryAndSecondaryAndAutoColumns();
allCols.filter(function (col) { return col.getSort() == null; }).forEach(function (col) { return col.setSortIndex(undefined); });
};
// gets called by API, so if data changes, use can call this, which will end up
// working out the sort order again of the rows.
SortController.prototype.onSortChanged = function () {
this.dispatchSortChangedEvents();
};
SortController.prototype.isSortActive = function () {
// pull out all the columns that have sorting set
var allCols = this.columnController.getPrimaryAndSecondaryAndAutoColumns();
var sortedCols = allCols.filter(function (column) { return !!column.getSort(); });
return sortedCols && sortedCols.length > 0;
};
SortController.prototype.dispatchSortChangedEvents = function () {
var event = {
type: _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_SORT_CHANGED,
api: this.gridApi,
columnApi: this.columnApi
};
this.eventService.dispatchEvent(event);
};
SortController.prototype.clearSortBarThisColumn = function (columnToSkip, source) {
this.columnController.getPrimaryAndSecondaryAndAutoColumns().forEach(function (columnToClear) {
// Do not clear if either holding shift, or if column in question was clicked
if (!(columnToClear === columnToSkip)) {
// setting to 'undefined' as null means 'none' rather than cleared, otherwise issue will arise
// if sort order is: ['desc', null , 'asc'], as it will start at null rather than 'desc'.
columnToClear.setSort(undefined, source);
}
});
};
SortController.prototype.getNextSortDirection = function (column) {
var sortingOrder;
if (column.getColDef().sortingOrder) {
sortingOrder = column.getColDef().sortingOrder;
}
else if (this.gridOptionsWrapper.getSortingOrder()) {
sortingOrder = this.gridOptionsWrapper.getSortingOrder();
}
else {
sortingOrder = SortController_1.DEFAULT_SORTING_ORDER;
}
if (!Array.isArray(sortingOrder) || sortingOrder.length <= 0) {
console.warn("ag-grid: sortingOrder must be an array with at least one element, currently it's " + sortingOrder);
return null;
}
var currentIndex = sortingOrder.indexOf(column.getSort());
var notInArray = currentIndex < 0;
var lastItemInArray = currentIndex == sortingOrder.length - 1;
var result;
if (notInArray || lastItemInArray) {
result = sortingOrder[0];
}
else {
result = sortingOrder[currentIndex + 1];
}
// verify the sort type exists, as the user could provide the sortingOrder, need to make sure it's valid
if (SortController_1.DEFAULT_SORTING_ORDER.indexOf(result) < 0) {
console.warn('ag-grid: invalid sort type ' + result);
return null;
}
return result;
};
SortController.prototype.getColumnsWithSortingOrdered = function () {
// pull out all the columns that have sorting set
var allColumnsIncludingAuto = this.columnController.getPrimaryAndSecondaryAndAutoColumns();
var columnsWithSorting = allColumnsIncludingAuto.filter(function (column) { return !!column.getSort(); });
// when both cols are missing sortIndex, we use the position of the col in all cols list.
// this means if colDefs only have sort, but no sortIndex, we deterministically pick which
// cols is sorted by first.
var allColsIndexes = {};
allColumnsIncludingAuto.forEach(function (col, index) { return allColsIndexes[col.getId()] = index; });
// put the columns in order of which one got sorted first
columnsWithSorting.sort(function (a, b) {
var iA = a.getSortIndex();
var iB = b.getSortIndex();
if (iA != null && iB != null) {
return iA - iB; // both present, normal comparison
}
else if (iA == null && iB == null) {
// both missing, compare using column positions
var posA = allColsIndexes[a.getId()];
var posB = allColsIndexes[b.getId()];
return posA > posB ? 1 : -1;
}
else if (iB == null) {
return -1; // iB missing
}
else {
return 1; // iA missing
}
});
return columnsWithSorting;
};
// used by row controller, when doing the sorting
SortController.prototype.getSortForRowController = function () {
return this.getColumnsWithSortingOrdered().map(function (column) {
var isAscending = column.getSort() === _constants_constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].SORT_ASC;
return {
inverter: isAscending ? 1 : -1,
column: column
};
});
};
var SortController_1;
SortController.DEFAULT_SORTING_ORDER = [_constants_constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].SORT_ASC, _constants_constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].SORT_DESC, null];
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnController')
], SortController.prototype, "columnController", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnApi')
], SortController.prototype, "columnApi", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridApi')
], SortController.prototype, "gridApi", void 0);
SortController = SortController_1 = __decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('sortController')
], SortController);
return SortController;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
/***/ }),
/* 147 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FocusController", function() { return FocusController; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20);
/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(23);
/* harmony import */ var _rendering_cellComp__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(102);
/* harmony import */ var _widgets_managedFocusComponent__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(65);
/* harmony import */ var _utils_browser__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(43);
/* harmony import */ var _utils_array__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(14);
/* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(7);
/* harmony import */ var _constants_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(16);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 __spreadArrays = (undefined && undefined.__spreadArrays) || function () {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
};
var FocusController = /** @class */ (function (_super) {
__extends(FocusController, _super);
function FocusController() {
return _super !== null && _super.apply(this, arguments) || this;
}
FocusController_1 = FocusController;
/**
* Adds a gridCore to the list of the gridCores monitoring Keyboard Mode
* in a specific HTMLDocument.
*
* @param doc {Document} - The Document containing the gridCore.
* @param gridCore {GridCore} - The GridCore to be monitored.
*/
FocusController.addKeyboardModeEvents = function (doc, gridCore) {
var gridCoresForDocument = FocusController_1.instancesMonitored.get(doc);
if (gridCoresForDocument && gridCoresForDocument.length > 0) {
if (gridCoresForDocument.indexOf(gridCore) === -1) {
gridCoresForDocument.push(gridCore);
}
}
else {
FocusController_1.instancesMonitored.set(doc, [gridCore]);
doc.addEventListener('keydown', FocusController_1.toggleKeyboardMode);
doc.addEventListener('mousedown', FocusController_1.toggleKeyboardMode);
}
};
/**
* Removes a gridCore from the list of the gridCores monitoring Keyboard Mode
* in a specific HTMLDocument.
*
* @param doc {Document} - The Document containing the gridCore.
* @param gridCore {GridCore} - The GridCore to be removed.
*/
FocusController.removeKeyboardModeEvents = function (doc, gridCore) {
var gridCoresForDocument = FocusController_1.instancesMonitored.get(doc);
var newGridCoresForDocument = [];
if (gridCoresForDocument && gridCoresForDocument.length) {
newGridCoresForDocument = __spreadArrays(gridCoresForDocument).filter(function (currentGridCore) { return currentGridCore !== gridCore; });
FocusController_1.instancesMonitored.set(doc, newGridCoresForDocument);
}
if (newGridCoresForDocument.length === 0) {
doc.removeEventListener('keydown', FocusController_1.toggleKeyboardMode);
doc.removeEventListener('mousedown', FocusController_1.toggleKeyboardMode);
}
};
/**
* This method will be called by `keydown` and `mousedown` events on all Documents monitoring
* KeyboardMode. It will then fire a KEYBOARD_FOCUS, MOUSE_FOCUS on each gridCore present in
* the Document allowing each gridCore to maintain a state for KeyboardMode.
*
* @param event {KeyboardEvent | MouseEvent | TouchEvent} - The event triggered.
*/
FocusController.toggleKeyboardMode = function (event) {
var isKeyboardActive = FocusController_1.keyboardModeActive;
var isKeyboardEvent = event.type === 'keydown';
if (isKeyboardActive && isKeyboardEvent || !isKeyboardActive && !isKeyboardEvent) {
return;
}
FocusController_1.keyboardModeActive = isKeyboardEvent;
var doc = event.target.ownerDocument;
if (!doc) {
return;
}
var gridCoresForDocument = FocusController_1.instancesMonitored.get(doc);
if (gridCoresForDocument) {
gridCoresForDocument.forEach(function (gridCore) {
gridCore.dispatchEvent({ type: isKeyboardEvent ? _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_KEYBOARD_FOCUS : _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_MOUSE_FOCUS });
});
}
};
FocusController.prototype.init = function () {
var clearFocusedCellListener = this.clearFocusedCell.bind(this);
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_PIVOT_MODE_CHANGED, clearFocusedCellListener);
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_NEW_COLUMNS_LOADED, this.onColumnEverythingChanged.bind(this));
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_GROUP_OPENED, clearFocusedCellListener);
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_ROW_GROUP_CHANGED, clearFocusedCellListener);
};
FocusController.prototype.registerGridCore = function (gridCore) {
var _this = this;
this.gridCore = gridCore;
var doc = this.gridOptionsWrapper.getDocument();
FocusController_1.addKeyboardModeEvents(doc, gridCore);
this.addDestroyFunc(function () { return _this.unregisterGridCore(gridCore); });
};
FocusController.prototype.unregisterGridCore = function (gridCore) {
var doc = this.gridOptionsWrapper.getDocument();
FocusController_1.removeKeyboardModeEvents(doc, gridCore);
};
FocusController.prototype.onColumnEverythingChanged = function () {
// if the columns change, check and see if this column still exists. if it does, then
// we can keep the focused cell. if it doesn't, then we need to drop the focused cell.
if (!this.focusedCellPosition) {
return;
}
var col = this.focusedCellPosition.column;
var colFromColumnController = this.columnController.getGridColumn(col.getId());
if (col !== colFromColumnController) {
this.clearFocusedCell();
}
};
FocusController.prototype.isKeyboardMode = function () {
return FocusController_1.keyboardModeActive;
};
// we check if the browser is focusing something, and if it is, and
// it's the cell we think is focused, then return the cell. so this
// methods returns the cell if a) we think it has focus and b) the
// browser thinks it has focus. this then returns nothing if we
// first focus a cell, then second click outside the grid, as then the
// grid cell will still be focused as far as the grid is concerned,
// however the browser focus will have moved somewhere else.
FocusController.prototype.getFocusCellToUseAfterRefresh = function () {
if (this.gridOptionsWrapper.isSuppressFocusAfterRefresh() || !this.focusedCellPosition) {
return null;
}
// we check that the browser is actually focusing on the grid, if it is not, then
// we have nothing to worry about
if (!this.getGridCellForDomElement(document.activeElement)) {
return null;
}
return this.focusedCellPosition;
};
FocusController.prototype.getGridCellForDomElement = function (eBrowserCell) {
var ePointer = eBrowserCell;
while (ePointer) {
var cellComp = this.gridOptionsWrapper.getDomData(ePointer, _rendering_cellComp__WEBPACK_IMPORTED_MODULE_3__["CellComp"].DOM_DATA_KEY_CELL_COMP);
if (cellComp) {
return cellComp.getCellPosition();
}
ePointer = ePointer.parentNode;
}
return null;
};
FocusController.prototype.clearFocusedCell = function () {
this.focusedCellPosition = null;
this.onCellFocused(false);
};
FocusController.prototype.getFocusedCell = function () {
return this.focusedCellPosition;
};
FocusController.prototype.setFocusedCell = function (rowIndex, colKey, floating, forceBrowserFocus) {
if (forceBrowserFocus === void 0) { forceBrowserFocus = false; }
var gridColumn = this.columnController.getGridColumn(colKey);
// if column doesn't exist, then blank the focused cell and return. this can happen when user sets new columns,
// and the focused cell is in a column that no longer exists. after columns change, the grid refreshes and tries
// to re-focus the focused cell.
if (!gridColumn) {
this.focusedCellPosition = null;
return;
}
this.focusedCellPosition = { rowIndex: rowIndex, rowPinned: Object(_utils_generic__WEBPACK_IMPORTED_MODULE_7__["makeNull"])(floating), column: Object(_utils_generic__WEBPACK_IMPORTED_MODULE_7__["makeNull"])(gridColumn) };
this.onCellFocused(forceBrowserFocus);
};
FocusController.prototype.isCellFocused = function (cellPosition) {
if (this.focusedCellPosition == null) {
return false;
}
return this.focusedCellPosition.column === cellPosition.column &&
this.isRowFocused(cellPosition.rowIndex, cellPosition.rowPinned);
};
FocusController.prototype.isRowNodeFocused = function (rowNode) {
return this.isRowFocused(rowNode.rowIndex, rowNode.rowPinned);
};
FocusController.prototype.isHeaderWrapperFocused = function (headerWrapper) {
if (this.focusedHeaderPosition == null) {
return false;
}
var column = headerWrapper.getColumn();
var headerRowIndex = headerWrapper.getParentComponent().getRowIndex();
var pinned = headerWrapper.getPinned();
var _a = this.focusedHeaderPosition, focusedColumn = _a.column, focusedHeaderRowIndex = _a.headerRowIndex;
return column === focusedColumn &&
headerRowIndex === focusedHeaderRowIndex &&
pinned == focusedColumn.getPinned();
};
FocusController.prototype.clearFocusedHeader = function () {
this.focusedHeaderPosition = null;
};
FocusController.prototype.getFocusedHeader = function () {
return this.focusedHeaderPosition;
};
FocusController.prototype.setFocusedHeader = function (headerRowIndex, column) {
this.focusedHeaderPosition = { headerRowIndex: headerRowIndex, column: column };
};
FocusController.prototype.focusHeaderPosition = function (headerPosition, direction, fromTab, allowUserOverride, event) {
if (direction === void 0) { direction = null; }
if (fromTab === void 0) { fromTab = false; }
if (allowUserOverride === void 0) { allowUserOverride = false; }
if (allowUserOverride) {
var gridOptionsWrapper = this.gridOptionsWrapper;
var currentPosition = this.getFocusedHeader();
var headerRowCount = this.headerNavigationService.getHeaderRowCount();
if (fromTab) {
var userFunc = gridOptionsWrapper.getTabToNextHeaderFunc();
if (userFunc) {
var params = {
backwards: direction === 'Before',
previousHeaderPosition: currentPosition,
nextHeaderPosition: headerPosition,
headerRowCount: headerRowCount
};
headerPosition = userFunc(params);
}
}
else {
var userFunc = gridOptionsWrapper.getNavigateToNextHeaderFunc();
if (userFunc) {
var params = {
key: event.key,
previousHeaderPosition: currentPosition,
nextHeaderPosition: headerPosition,
headerRowCount: headerRowCount,
event: event
};
headerPosition = userFunc(params);
}
}
}
if (!headerPosition) {
return false;
}
if (headerPosition.headerRowIndex === -1) {
return this.focusGridView(headerPosition.column);
}
this.headerNavigationService.scrollToColumn(headerPosition.column, direction);
var childContainer = this.headerNavigationService.getHeaderContainer(headerPosition.column.getPinned());
var rowComps = childContainer.getRowComps();
var nextRowComp = rowComps[headerPosition.headerRowIndex];
var headerComps = nextRowComp.getHeaderComps();
var nextHeader = headerComps[headerPosition.column.getUniqueId()];
if (nextHeader) {
// this will automatically call the setFocusedHeader method above
nextHeader.getFocusableElement().focus();
return true;
}
return false;
};
FocusController.prototype.isAnyCellFocused = function () {
return !!this.focusedCellPosition;
};
FocusController.prototype.isRowFocused = function (rowIndex, floating) {
if (this.focusedCellPosition == null) {
return false;
}
return this.focusedCellPosition.rowIndex === rowIndex && this.focusedCellPosition.rowPinned === Object(_utils_generic__WEBPACK_IMPORTED_MODULE_7__["makeNull"])(floating);
};
FocusController.prototype.findFocusableElements = function (rootNode, exclude, onlyUnmanaged) {
if (onlyUnmanaged === void 0) { onlyUnmanaged = false; }
var focusableString = _constants_constants__WEBPACK_IMPORTED_MODULE_8__["Constants"].FOCUSABLE_SELECTOR;
var excludeString = _constants_constants__WEBPACK_IMPORTED_MODULE_8__["Constants"].FOCUSABLE_EXCLUDE;
if (exclude) {
excludeString += ', ' + exclude;
}
if (onlyUnmanaged) {
excludeString += ', [tabindex="-1"]';
}
var nodes = Array.prototype.slice.apply(rootNode.querySelectorAll(focusableString));
var excludeNodes = Array.prototype.slice.apply(rootNode.querySelectorAll(excludeString));
if (!excludeNodes.length) {
return nodes;
}
var diff = function (a, b) { return a.filter(function (element) { return b.indexOf(element) === -1; }); };
return diff(nodes, excludeNodes);
};
FocusController.prototype.focusInto = function (rootNode, up, onlyUnmanaged) {
if (up === void 0) { up = false; }
if (onlyUnmanaged === void 0) { onlyUnmanaged = false; }
var focusableElements = this.findFocusableElements(rootNode, null, onlyUnmanaged);
var toFocus = up ? Object(_utils_array__WEBPACK_IMPORTED_MODULE_6__["last"])(focusableElements) : focusableElements[0];
if (toFocus) {
toFocus.focus();
return true;
}
return false;
};
FocusController.prototype.findNextFocusableElement = function (rootNode, onlyManaged, backwards) {
var focusable = this.findFocusableElements(rootNode, onlyManaged ? ':not([tabindex="-1"])' : null);
var currentIndex;
if (onlyManaged) {
currentIndex = Object(_utils_array__WEBPACK_IMPORTED_MODULE_6__["findIndex"])(focusable, function (el) { return el.contains(document.activeElement); });
}
else {
currentIndex = focusable.indexOf(document.activeElement);
}
var nextIndex = currentIndex + (backwards ? -1 : 1);
if (nextIndex < 0 || nextIndex >= focusable.length) {
return null;
}
return focusable[nextIndex];
};
FocusController.prototype.isFocusUnderManagedComponent = function (rootNode) {
var managedContainers = rootNode.querySelectorAll("." + _widgets_managedFocusComponent__WEBPACK_IMPORTED_MODULE_4__["ManagedFocusComponent"].FOCUS_MANAGED_CLASS);
if (!managedContainers.length) {
return false;
}
for (var i = 0; i < managedContainers.length; i++) {
if (managedContainers[i].contains(document.activeElement)) {
return true;
}
}
return false;
};
FocusController.prototype.findTabbableParent = function (node, limit) {
if (limit === void 0) { limit = 5; }
var counter = 0;
while (node && Object(_utils_browser__WEBPACK_IMPORTED_MODULE_5__["getTabIndex"])(node) === null && ++counter <= limit) {
node = node.parentElement;
}
if (Object(_utils_browser__WEBPACK_IMPORTED_MODULE_5__["getTabIndex"])(node) === null) {
return null;
}
return node;
};
FocusController.prototype.onCellFocused = function (forceBrowserFocus) {
var event = {
type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_CELL_FOCUSED,
forceBrowserFocus: forceBrowserFocus,
rowIndex: null,
column: null,
floating: null,
api: this.gridApi,
columnApi: this.columnApi,
rowPinned: null
};
if (this.focusedCellPosition) {
event.rowIndex = this.focusedCellPosition.rowIndex;
event.column = this.focusedCellPosition.column;
event.rowPinned = this.focusedCellPosition.rowPinned;
}
this.eventService.dispatchEvent(event);
};
FocusController.prototype.focusGridView = function (column, backwards) {
var nextRow = backwards
? this.rowPositionUtils.getLastRow()
: this.rowPositionUtils.getFirstRow();
if (!nextRow) {
return false;
}
var rowIndex = nextRow.rowIndex, rowPinned = nextRow.rowPinned;
var focusedHeader = this.getFocusedHeader();
if (!column) {
column = focusedHeader.column;
}
if (rowIndex == null) {
return false;
}
this.rowRenderer.ensureCellVisible({ rowIndex: rowIndex, column: column, rowPinned: rowPinned });
this.setFocusedCell(rowIndex, column, Object(_utils_generic__WEBPACK_IMPORTED_MODULE_7__["makeNull"])(rowPinned), true);
if (this.rangeController) {
var cellPosition = { rowIndex: rowIndex, rowPinned: rowPinned, column: column };
this.rangeController.setRangeToCell(cellPosition);
}
return true;
};
FocusController.prototype.focusNextGridCoreContainer = function (backwards) {
if (this.gridCore.focusNextInnerContainer(backwards)) {
return true;
}
if (!backwards) {
this.gridCore.forceFocusOutOfContainer();
}
};
var FocusController_1;
FocusController.keyboardModeActive = false;
FocusController.instancesMonitored = new Map();
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnController')
], FocusController.prototype, "columnController", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('headerNavigationService')
], FocusController.prototype, "headerNavigationService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnApi')
], FocusController.prototype, "columnApi", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridApi')
], FocusController.prototype, "gridApi", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('rowRenderer')
], FocusController.prototype, "rowRenderer", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('rowPositionUtils')
], FocusController.prototype, "rowPositionUtils", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Optional"])('rangeController')
], FocusController.prototype, "rangeController", void 0);
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_0__["PostConstruct"]
], FocusController.prototype, "init", null);
FocusController = FocusController_1 = __decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('focusController')
], FocusController);
return FocusController;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
/***/ }),
/* 148 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MouseEventService", function() { return MouseEventService; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(37);
/* harmony import */ var _constants_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(16);
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(20);
/* harmony import */ var _utils_event__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(21);
/* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 MouseEventService = /** @class */ (function (_super) {
__extends(MouseEventService, _super);
function MouseEventService() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.gridInstanceId = MouseEventService_1.gridInstanceSequence.next();
return _this;
}
MouseEventService_1 = MouseEventService;
MouseEventService.prototype.init = function () {
this.stampDomElementWithGridInstance();
};
MouseEventService.prototype.registerGridComp = function (gridPanel) {
this.gridPanel = gridPanel;
};
// we put the instance id onto the main DOM element. this is used for events, when grids are inside grids,
// so the grid can work out if the even came from this grid or a grid inside this one. see the ctrl+v logic
// for where this is used.
MouseEventService.prototype.stampDomElementWithGridInstance = function () {
this.eGridDiv[MouseEventService_1.GRID_DOM_KEY] = this.gridInstanceId;
};
MouseEventService.prototype.getRenderedCellForEvent = function (event) {
return Object(_utils_event__WEBPACK_IMPORTED_MODULE_4__["getCellCompForEvent"])(this.gridOptionsWrapper, event);
};
// walks the path of the event, and returns true if this grid is the first one that it finds. if doing
// master / detail grids, and a child grid is found, then it returns false. this stops things like copy/paste
// getting executed on many grids at the same time.
MouseEventService.prototype.isEventFromThisGrid = function (event) {
var path = Object(_utils_event__WEBPACK_IMPORTED_MODULE_4__["getEventPath"])(event);
for (var i = 0; i < path.length; i++) {
var element = path[i];
var instanceId = element[MouseEventService_1.GRID_DOM_KEY];
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_5__["exists"])(instanceId)) {
var eventFromThisGrid = instanceId === this.gridInstanceId;
return eventFromThisGrid;
}
}
return false;
};
MouseEventService.prototype.getCellPositionForEvent = function (event) {
var cellComp = this.getRenderedCellForEvent(event);
return cellComp ? cellComp.getCellPosition() : null;
};
MouseEventService.prototype.getNormalisedPosition = function (event) {
var gridPanelHasScrolls = this.gridOptionsWrapper.getDomLayout() === _constants_constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].DOM_LAYOUT_NORMAL;
var e = event;
var x;
var y;
if (e.clientX != null || e.clientY != null) {
x = e.clientX;
y = e.clientY;
}
else {
x = e.x;
y = e.y;
}
if (gridPanelHasScrolls) {
var vRange = this.gridPanel.getVScrollPosition();
var hRange = this.gridPanel.getHScrollPosition();
x += hRange.left;
y += vRange.top;
}
return { x: x, y: y };
};
var MouseEventService_1;
MouseEventService.gridInstanceSequence = new _utils__WEBPACK_IMPORTED_MODULE_1__["NumberSequence"]();
MouseEventService.GRID_DOM_KEY = '__ag_grid_instance';
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('eGridDiv')
], MouseEventService.prototype, "eGridDiv", void 0);
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_0__["PostConstruct"]
], MouseEventService.prototype, "init", null);
MouseEventService = MouseEventService_1 = __decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('mouseEventService')
], MouseEventService);
return MouseEventService;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_3__["BeanStub"]));
/***/ }),
/* 149 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CellNavigationService", function() { return CellNavigationService; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20);
/* harmony import */ var _constants_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(16);
/* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7);
/* harmony import */ var _utils_array__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(14);
/* harmony import */ var _constants_keyCode__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(58);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 CellNavigationService = /** @class */ (function (_super) {
__extends(CellNavigationService, _super);
function CellNavigationService() {
return _super !== null && _super.apply(this, arguments) || this;
}
// returns null if no cell to focus on, ie at the end of the grid
CellNavigationService.prototype.getNextCellToFocus = function (key, lastCellToFocus) {
// starting with the provided cell, we keep moving until we find a cell we can
// focus on.
var pointer = lastCellToFocus;
var finished = false;
// finished will be true when either:
// a) cell found that we can focus on
// b) run out of cells (ie the method returns null)
while (!finished) {
switch (key) {
case _constants_keyCode__WEBPACK_IMPORTED_MODULE_5__["KeyCode"].UP:
pointer = this.getCellAbove(pointer);
break;
case _constants_keyCode__WEBPACK_IMPORTED_MODULE_5__["KeyCode"].DOWN:
pointer = this.getCellBelow(pointer);
break;
case _constants_keyCode__WEBPACK_IMPORTED_MODULE_5__["KeyCode"].RIGHT:
if (this.gridOptionsWrapper.isEnableRtl()) {
pointer = this.getCellToLeft(pointer);
}
else {
pointer = this.getCellToRight(pointer);
}
break;
case _constants_keyCode__WEBPACK_IMPORTED_MODULE_5__["KeyCode"].LEFT:
if (this.gridOptionsWrapper.isEnableRtl()) {
pointer = this.getCellToRight(pointer);
}
else {
pointer = this.getCellToLeft(pointer);
}
break;
default:
pointer = null;
console.warn('ag-Grid: unknown key for navigation ' + key);
break;
}
if (pointer) {
finished = this.isCellGoodToFocusOn(pointer);
}
else {
finished = true;
}
}
return pointer;
};
CellNavigationService.prototype.isCellGoodToFocusOn = function (gridCell) {
var column = gridCell.column;
var rowNode;
switch (gridCell.rowPinned) {
case _constants_constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_TOP:
rowNode = this.pinnedRowModel.getPinnedTopRow(gridCell.rowIndex);
break;
case _constants_constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_BOTTOM:
rowNode = this.pinnedRowModel.getPinnedBottomRow(gridCell.rowIndex);
break;
default:
rowNode = this.rowModel.getRow(gridCell.rowIndex);
break;
}
var suppressNavigable = column.isSuppressNavigable(rowNode);
return !suppressNavigable;
};
CellNavigationService.prototype.getCellToLeft = function (lastCell) {
if (!lastCell) {
return null;
}
var colToLeft = this.columnController.getDisplayedColBefore(lastCell.column);
if (!colToLeft) {
return null;
}
return {
rowIndex: lastCell.rowIndex,
column: colToLeft,
rowPinned: lastCell.rowPinned
};
};
CellNavigationService.prototype.getCellToRight = function (lastCell) {
if (!lastCell) {
return null;
}
var colToRight = this.columnController.getDisplayedColAfter(lastCell.column);
// if already on right, do nothing
if (!colToRight) {
return null;
}
return {
rowIndex: lastCell.rowIndex,
column: colToRight,
rowPinned: lastCell.rowPinned
};
};
CellNavigationService.prototype.getRowBelow = function (rowPosition) {
// if already on top row, do nothing
var index = rowPosition.rowIndex;
var pinned = rowPosition.rowPinned;
if (this.isLastRowInContainer(rowPosition)) {
switch (pinned) {
case _constants_constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_BOTTOM:
// never any rows after pinned bottom
return null;
case _constants_constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_TOP:
// if on last row of pinned top, then next row is main body (if rows exist),
// otherwise it's the pinned bottom
if (this.rowModel.isRowsToRender()) {
return { rowIndex: this.paginationProxy.getPageFirstRow(), rowPinned: null };
}
if (this.pinnedRowModel.isRowsToRender(_constants_constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_BOTTOM)) {
return { rowIndex: 0, rowPinned: _constants_constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_BOTTOM };
}
return null;
default:
// if in the main body, then try pinned bottom, otherwise return nothing
if (this.pinnedRowModel.isRowsToRender(_constants_constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_BOTTOM)) {
return { rowIndex: 0, rowPinned: _constants_constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_BOTTOM };
}
return null;
}
}
return { rowIndex: index + 1, rowPinned: pinned };
};
CellNavigationService.prototype.getCellBelow = function (lastCell) {
if (!lastCell) {
return null;
}
var rowBelow = this.getRowBelow(lastCell);
if (rowBelow) {
return {
rowIndex: rowBelow.rowIndex,
column: lastCell.column,
rowPinned: rowBelow.rowPinned
};
}
return null;
};
CellNavigationService.prototype.isLastRowInContainer = function (rowPosition) {
var pinned = rowPosition.rowPinned;
var index = rowPosition.rowIndex;
if (pinned === _constants_constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_TOP) {
var lastTopIndex = this.pinnedRowModel.getPinnedTopRowData().length - 1;
return lastTopIndex <= index;
}
if (pinned === _constants_constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_BOTTOM) {
var lastBottomIndex = this.pinnedRowModel.getPinnedBottomRowData().length - 1;
return lastBottomIndex <= index;
}
var lastBodyIndex = this.paginationProxy.getPageLastRow();
return lastBodyIndex <= index;
};
CellNavigationService.prototype.getRowAbove = function (rowPosition) {
// if already on top row, do nothing
var index = rowPosition.rowIndex;
var pinned = rowPosition.rowPinned;
var isFirstRow = pinned ? index === 0 : index === this.paginationProxy.getPageFirstRow();
// if already on top row, do nothing
if (isFirstRow) {
if (pinned === _constants_constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_TOP) {
return null;
}
if (!pinned) {
if (this.pinnedRowModel.isRowsToRender(_constants_constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_TOP)) {
return this.getLastFloatingTopRow();
}
return null;
}
// last floating bottom
if (this.rowModel.isRowsToRender()) {
return this.getLastBodyCell();
}
if (this.pinnedRowModel.isRowsToRender(_constants_constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_TOP)) {
return this.getLastFloatingTopRow();
}
return null;
}
return { rowIndex: index - 1, rowPinned: pinned };
};
CellNavigationService.prototype.getCellAbove = function (lastCell) {
if (!lastCell) {
return null;
}
var rowAbove = this.getRowAbove({ rowIndex: lastCell.rowIndex, rowPinned: lastCell.rowPinned });
if (rowAbove) {
return {
rowIndex: rowAbove.rowIndex,
column: lastCell.column,
rowPinned: rowAbove.rowPinned
};
}
return null;
};
CellNavigationService.prototype.getLastBodyCell = function () {
var lastBodyRow = this.paginationProxy.getPageLastRow();
return { rowIndex: lastBodyRow, rowPinned: null };
};
CellNavigationService.prototype.getLastFloatingTopRow = function () {
var lastFloatingRow = this.pinnedRowModel.getPinnedTopRowData().length - 1;
return { rowIndex: lastFloatingRow, rowPinned: _constants_constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_TOP };
};
CellNavigationService.prototype.getNextTabbedCell = function (gridCell, backwards) {
if (backwards) {
return this.getNextTabbedCellBackwards(gridCell);
}
return this.getNextTabbedCellForwards(gridCell);
};
CellNavigationService.prototype.getNextTabbedCellForwards = function (gridCell) {
var displayedColumns = this.columnController.getAllDisplayedColumns();
var newRowIndex = gridCell.rowIndex;
var newFloating = gridCell.rowPinned;
// move along to the next cell
var newColumn = this.columnController.getDisplayedColAfter(gridCell.column);
// check if end of the row, and if so, go forward a row
if (!newColumn) {
newColumn = displayedColumns[0];
var rowBelow = this.getRowBelow(gridCell);
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_3__["missing"])(rowBelow)) {
return null;
}
// If we are tabbing and there is a paging panel present, tabbing should go
// to the paging panel instead of loading the next page.
if (!rowBelow.rowPinned && !this.paginationProxy.isRowInPage(rowBelow)) {
return null;
}
newRowIndex = rowBelow ? rowBelow.rowIndex : null;
newFloating = rowBelow ? rowBelow.rowPinned : null;
}
return { rowIndex: newRowIndex, column: newColumn, rowPinned: newFloating };
};
CellNavigationService.prototype.getNextTabbedCellBackwards = function (gridCell) {
var displayedColumns = this.columnController.getAllDisplayedColumns();
var newRowIndex = gridCell.rowIndex;
var newFloating = gridCell.rowPinned;
// move along to the next cell
var newColumn = this.columnController.getDisplayedColBefore(gridCell.column);
// check if end of the row, and if so, go forward a row
if (!newColumn) {
newColumn = Object(_utils_array__WEBPACK_IMPORTED_MODULE_4__["last"])(displayedColumns);
var rowAbove = this.getRowAbove({ rowIndex: gridCell.rowIndex, rowPinned: gridCell.rowPinned });
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_3__["missing"])(rowAbove)) {
return null;
}
// If we are tabbing and there is a paging panel present, tabbing should go
// to the paging panel instead of loading the next page.
if (!rowAbove.rowPinned && !this.paginationProxy.isRowInPage(rowAbove)) {
return null;
}
newRowIndex = rowAbove ? rowAbove.rowIndex : null;
newFloating = rowAbove ? rowAbove.rowPinned : null;
}
return { rowIndex: newRowIndex, column: newColumn, rowPinned: newFloating };
};
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnController')
], CellNavigationService.prototype, "columnController", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('rowModel')
], CellNavigationService.prototype, "rowModel", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('pinnedRowModel')
], CellNavigationService.prototype, "pinnedRowModel", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('paginationProxy')
], CellNavigationService.prototype, "paginationProxy", void 0);
CellNavigationService = __decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('cellNavigationService')
], CellNavigationService);
return CellNavigationService;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
/***/ }),
/* 150 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ValueFormatterService", function() { return ValueFormatterService; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 ValueFormatterService = /** @class */ (function (_super) {
__extends(ValueFormatterService, _super);
function ValueFormatterService() {
return _super !== null && _super.apply(this, arguments) || this;
}
ValueFormatterService.prototype.formatValue = function (column, node, $scope, value, suppliedFormatter, useFormatterFromColumn) {
if (useFormatterFromColumn === void 0) { useFormatterFromColumn = true; }
var result = null;
var formatter;
var colDef = column.getColDef();
if (suppliedFormatter) {
// use supplied formatter if provided, e.g. set filter items can have their own value formatters
formatter = suppliedFormatter;
}
else if (useFormatterFromColumn) {
// if row is pinned, give preference to the pinned formatter
formatter = node && node.rowPinned && colDef.pinnedRowValueFormatter ?
colDef.pinnedRowValueFormatter : colDef.valueFormatter;
}
if (formatter) {
var params = {
value: value,
node: node,
data: node ? node.data : null,
colDef: colDef,
column: column,
api: this.gridOptionsWrapper.getApi(),
columnApi: this.gridOptionsWrapper.getColumnApi(),
context: this.gridOptionsWrapper.getContext()
};
// originally we put the angular 1 scope here, but we don't want the scope
// in the params interface, as other frameworks will see the interface, and
// angular 1 is not cool any more. so we hack the scope in here (we cannot
// include it above, as it's not in the interface, so would cause a compile error).
// in the future, when we stop supporting angular 1, we can take this out.
params.$scope = $scope;
result = this.expressionService.evaluate(formatter, params);
}
else if (colDef.refData) {
return colDef.refData[value] || '';
}
// if we don't do this, then arrays get displayed as 1,2,3, but we want 1, 2, 3 (i.e. with spaces)
if (result == null && Array.isArray(value)) {
result = value.join(', ');
}
return result;
};
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('expressionService')
], ValueFormatterService.prototype, "expressionService", void 0);
ValueFormatterService = __decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('valueFormatterService')
], ValueFormatterService);
return ValueFormatterService;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
/***/ }),
/* 151 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgRadioButton", function() { return AgRadioButton; });
/* harmony import */ var _agCheckbox__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(117);
/* harmony import */ var _eventKeys__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(24);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var AgRadioButton = /** @class */ (function (_super) {
__extends(AgRadioButton, _super);
function AgRadioButton(config) {
return _super.call(this, config, 'ag-radio-button', 'radio') || this;
}
AgRadioButton.prototype.isSelected = function () {
return this.eInput.checked;
};
AgRadioButton.prototype.toggle = function () {
// do not allow an active radio button to be deselected
if (!this.isSelected()) {
this.setValue(true);
}
};
AgRadioButton.prototype.addInputListeners = function () {
_super.prototype.addInputListeners.call(this);
this.addManagedListener(this.eventService, _eventKeys__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_CHECKBOX_CHANGED, this.onChange.bind(this));
};
/**
* This ensures that if another radio button in the same named group is selected, we deselect this radio button.
* By default the browser does this for you, but we are managing classes ourselves in order to ensure input
* elements are styled correctly in IE11, and the DOM 'changed' event is only fired when a button is selected,
* not deselected, so we need to use our own event.
*/
AgRadioButton.prototype.onChange = function (event) {
if (event.selected &&
event.name &&
this.eInput.name &&
this.eInput.name === event.name &&
event.id &&
this.eInput.id !== event.id) {
this.setValue(false, true);
}
};
return AgRadioButton;
}(_agCheckbox__WEBPACK_IMPORTED_MODULE_0__["AgCheckbox"]));
/***/ }),
/* 152 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VanillaFrameworkOverrides", function() { return VanillaFrameworkOverrides; });
/* harmony import */ var _utils_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var OUTSIDE_ANGULAR_EVENTS = ['mouseover', 'mouseout', 'mouseenter', 'mouseleave'];
/** The base frameworks, eg React & Angular 2, override this bean with implementations specific to their requirement. */
var VanillaFrameworkOverrides = /** @class */ (function () {
function VanillaFrameworkOverrides() {
this.isOutsideAngular = function (eventType) { return Object(_utils_array__WEBPACK_IMPORTED_MODULE_0__["includes"])(OUTSIDE_ANGULAR_EVENTS, eventType); };
}
// for Vanilla JS, we use simple timeout
VanillaFrameworkOverrides.prototype.setTimeout = function (action, timeout) {
window.setTimeout(action, timeout);
};
// for Vanilla JS, we just add the event to the element
VanillaFrameworkOverrides.prototype.addEventListener = function (element, type, listener, useCapture) {
element.addEventListener(type, listener, useCapture);
};
// for Vanilla JS, we just execute the listener
VanillaFrameworkOverrides.prototype.dispatchEvent = function (eventType, listener) {
listener();
};
return VanillaFrameworkOverrides;
}());
/***/ }),
/* 153 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScrollVisibleService", function() { return ScrollVisibleService; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20);
/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(23);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 ScrollVisibleService = /** @class */ (function (_super) {
__extends(ScrollVisibleService, _super);
function ScrollVisibleService() {
return _super !== null && _super.apply(this, arguments) || this;
}
ScrollVisibleService.prototype.setScrollsVisible = function (params) {
var atLeastOneDifferent = this.horizontalScrollShowing !== params.horizontalScrollShowing ||
this.verticalScrollShowing !== params.verticalScrollShowing;
if (atLeastOneDifferent) {
this.horizontalScrollShowing = params.horizontalScrollShowing;
this.verticalScrollShowing = params.verticalScrollShowing;
var event_1 = {
type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_SCROLL_VISIBILITY_CHANGED,
api: this.gridApi,
columnApi: this.columnApi
};
this.eventService.dispatchEvent(event_1);
}
};
// used by pagination service - to know page height
ScrollVisibleService.prototype.isHorizontalScrollShowing = function () {
return this.horizontalScrollShowing;
};
// used by header container
ScrollVisibleService.prototype.isVerticalScrollShowing = function () {
return this.verticalScrollShowing;
};
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnController')
], ScrollVisibleService.prototype, "columnController", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnApi')
], ScrollVisibleService.prototype, "columnApi", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridApi')
], ScrollVisibleService.prototype, "gridApi", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
], ScrollVisibleService.prototype, "gridOptionsWrapper", void 0);
ScrollVisibleService = __decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('scrollVisibleService')
], ScrollVisibleService);
return ScrollVisibleService;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
/***/ }),
/* 154 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StylingService", function() { return StylingService; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20);
/* harmony import */ var _utils_object__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(13);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 StylingService = /** @class */ (function (_super) {
__extends(StylingService, _super);
function StylingService() {
return _super !== null && _super.apply(this, arguments) || this;
}
StylingService.prototype.processAllCellClasses = function (colDef, params, onApplicableClass, onNotApplicableClass) {
this.processClassRules(colDef.cellClassRules, params, onApplicableClass, onNotApplicableClass);
this.processStaticCellClasses(colDef, params, onApplicableClass);
};
StylingService.prototype.processClassRules = function (classRules, params, onApplicableClass, onNotApplicableClass) {
if (Object(_utils_object__WEBPACK_IMPORTED_MODULE_2__["isNonNullObject"])(classRules)) {
var classNames = Object.keys(classRules);
for (var i = 0; i < classNames.length; i++) {
var className = classNames[i];
var rule = classRules[className];
var resultOfRule = void 0;
if (typeof rule === 'string') {
resultOfRule = this.expressionService.evaluate(rule, params);
}
else if (typeof rule === 'function') {
resultOfRule = rule(params);
}
if (resultOfRule) {
onApplicableClass(className);
}
else if (onNotApplicableClass) {
onNotApplicableClass(className);
}
}
}
};
StylingService.prototype.processStaticCellClasses = function (colDef, params, onApplicableClass) {
var cellClass = colDef.cellClass;
if (cellClass) {
var classOrClasses = void 0;
if (typeof colDef.cellClass === 'function') {
var cellClassFunc = colDef.cellClass;
classOrClasses = cellClassFunc(params);
}
else {
classOrClasses = colDef.cellClass;
}
if (typeof classOrClasses === 'string') {
onApplicableClass(classOrClasses);
}
else if (Array.isArray(classOrClasses)) {
classOrClasses.forEach(function (cssClassItem) {
onApplicableClass(cssClassItem);
});
}
}
};
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('expressionService')
], StylingService.prototype, "expressionService", void 0);
StylingService = __decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('stylingService')
], StylingService);
return StylingService;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
/***/ }),
/* 155 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColumnHoverService", function() { return ColumnHoverService; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23);
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(20);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 ColumnHoverService = /** @class */ (function (_super) {
__extends(ColumnHoverService, _super);
function ColumnHoverService() {
return _super !== null && _super.apply(this, arguments) || this;
}
ColumnHoverService.prototype.setMouseOver = function (columns) {
this.selectedColumns = columns;
var event = {
type: _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_COLUMN_HOVER_CHANGED,
api: this.gridApi,
columnApi: this.columnApi
};
this.eventService.dispatchEvent(event);
};
ColumnHoverService.prototype.clearMouseOver = function () {
this.selectedColumns = null;
var event = {
type: _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_COLUMN_HOVER_CHANGED,
api: this.gridApi,
columnApi: this.columnApi
};
this.eventService.dispatchEvent(event);
};
ColumnHoverService.prototype.isHovered = function (column) {
return this.selectedColumns && this.selectedColumns.indexOf(column) >= 0;
};
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnApi')
], ColumnHoverService.prototype, "columnApi", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridApi')
], ColumnHoverService.prototype, "gridApi", void 0);
ColumnHoverService = __decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('columnHoverService')
], ColumnHoverService);
return ColumnHoverService;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_2__["BeanStub"]));
/***/ }),
/* 156 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColumnAnimationService", function() { return ColumnAnimationService; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 ColumnAnimationService = /** @class */ (function (_super) {
__extends(ColumnAnimationService, _super);
function ColumnAnimationService() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.executeNextFuncs = [];
_this.executeLaterFuncs = [];
_this.active = false;
_this.animationThreadCount = 0;
return _this;
}
ColumnAnimationService.prototype.registerGridComp = function (gridPanel) {
this.gridPanel = gridPanel;
};
ColumnAnimationService.prototype.isActive = function () {
return this.active;
};
ColumnAnimationService.prototype.start = function () {
if (this.active) {
return;
}
if (this.gridOptionsWrapper.isSuppressColumnMoveAnimation()) {
return;
}
// if doing RTL, we don't animate open / close as due to how the pixels are inverted,
// the animation moves all the row the the right rather than to the left (ie it's the static
// columns that actually get their coordinates updated)
if (this.gridOptionsWrapper.isEnableRtl()) {
return;
}
this.ensureAnimationCssClassPresent();
this.active = true;
};
ColumnAnimationService.prototype.finish = function () {
if (!this.active) {
return;
}
this.flush();
this.active = false;
};
ColumnAnimationService.prototype.executeNextVMTurn = function (func) {
if (this.active) {
this.executeNextFuncs.push(func);
}
else {
func();
}
};
ColumnAnimationService.prototype.executeLaterVMTurn = function (func) {
if (this.active) {
this.executeLaterFuncs.push(func);
}
else {
func();
}
};
ColumnAnimationService.prototype.ensureAnimationCssClassPresent = function () {
var _this = this;
// up the count, so we can tell if someone else has updated the count
// by the time the 'wait' func executes
this.animationThreadCount++;
var animationThreadCountCopy = this.animationThreadCount;
this.gridPanel.setColumnMovingCss(true);
this.executeLaterFuncs.push(function () {
// only remove the class if this thread was the last one to update it
if (_this.animationThreadCount === animationThreadCountCopy) {
_this.gridPanel.setColumnMovingCss(false);
}
});
};
ColumnAnimationService.prototype.flush = function () {
var nowFuncs = this.executeNextFuncs;
this.executeNextFuncs = [];
var waitFuncs = this.executeLaterFuncs;
this.executeLaterFuncs = [];
if (nowFuncs.length === 0 && waitFuncs.length === 0) {
return;
}
window.setTimeout(function () { return nowFuncs.forEach(function (func) { return func(); }); }, 0);
window.setTimeout(function () { return waitFuncs.forEach(function (func) { return func(); }); }, 300);
};
ColumnAnimationService = __decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('columnAnimationService')
], ColumnAnimationService);
return ColumnAnimationService;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
/***/ }),
/* 157 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AutoGroupColService", function() { return AutoGroupColService; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _entities_column__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(10);
/* harmony import */ var _constants_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(16);
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(20);
/* harmony import */ var _utils_object__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(13);
/* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 AutoGroupColService = /** @class */ (function (_super) {
__extends(AutoGroupColService, _super);
function AutoGroupColService() {
return _super !== null && _super.apply(this, arguments) || this;
}
AutoGroupColService_1 = AutoGroupColService;
AutoGroupColService.prototype.createAutoGroupColumns = function (rowGroupColumns) {
var _this = this;
var groupAutoColumns = [];
var doingTreeData = this.gridOptionsWrapper.isTreeData();
var doingMultiAutoColumn = this.gridOptionsWrapper.isGroupMultiAutoColumn();
if (doingTreeData && doingMultiAutoColumn) {
console.warn('ag-Grid: you cannot mix groupMultiAutoColumn with treeData, only one column can be used to display groups when doing tree data');
doingMultiAutoColumn = false;
}
// if doing groupMultiAutoColumn, then we call the method multiple times, once
// for each column we are grouping by
if (doingMultiAutoColumn) {
rowGroupColumns.forEach(function (rowGroupCol, index) {
groupAutoColumns.push(_this.createOneAutoGroupColumn(rowGroupCol, index));
});
}
else {
groupAutoColumns.push(this.createOneAutoGroupColumn());
}
return groupAutoColumns;
};
// rowGroupCol and index are missing if groupMultiAutoColumn=false
AutoGroupColService.prototype.createOneAutoGroupColumn = function (rowGroupCol, index) {
// if one provided by user, use it, otherwise create one
var defaultAutoColDef = this.generateDefaultColDef(rowGroupCol);
// if doing multi, set the field
var colId;
if (rowGroupCol) {
colId = _constants_constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].GROUP_AUTO_COLUMN_ID + "-" + rowGroupCol.getId();
}
else {
colId = AutoGroupColService_1.GROUP_AUTO_COLUMN_BUNDLE_ID;
}
var userAutoColDef = this.gridOptionsWrapper.getAutoGroupColumnDef();
Object(_utils_object__WEBPACK_IMPORTED_MODULE_4__["mergeDeep"])(defaultAutoColDef, userAutoColDef);
defaultAutoColDef = this.columnFactory.mergeColDefs(defaultAutoColDef);
defaultAutoColDef.colId = colId;
// For tree data the filter is always allowed
if (!this.gridOptionsWrapper.isTreeData()) {
// we would only allow filter if the user has provided field or value getter. otherwise the filter
// would not be able to work.
var noFieldOrValueGetter = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_5__["missing"])(defaultAutoColDef.field) && Object(_utils_generic__WEBPACK_IMPORTED_MODULE_5__["missing"])(defaultAutoColDef.valueGetter) && Object(_utils_generic__WEBPACK_IMPORTED_MODULE_5__["missing"])(defaultAutoColDef.filterValueGetter);
if (noFieldOrValueGetter) {
defaultAutoColDef.filter = false;
}
}
// if showing many cols, we don't want to show more than one with a checkbox for selection
if (index && index > 0) {
defaultAutoColDef.headerCheckboxSelection = false;
}
var newCol = new _entities_column__WEBPACK_IMPORTED_MODULE_1__["Column"](defaultAutoColDef, null, colId, true);
this.context.createBean(newCol);
return newCol;
};
AutoGroupColService.prototype.generateDefaultColDef = function (rowGroupCol) {
var userAutoColDef = this.gridOptionsWrapper.getAutoGroupColumnDef();
var localeTextFunc = this.gridOptionsWrapper.getLocaleTextFunc();
var defaultAutoColDef = {
headerName: localeTextFunc('group', 'Group')
};
var userHasProvidedGroupCellRenderer = userAutoColDef && (userAutoColDef.cellRenderer || userAutoColDef.cellRendererFramework);
// only add the default group cell renderer if user hasn't provided one
if (!userHasProvidedGroupCellRenderer) {
defaultAutoColDef.cellRenderer = 'agGroupCellRenderer';
}
// we never allow moving the group column
// defaultAutoColDef.suppressMovable = true;
if (rowGroupCol) {
var rowGroupColDef = rowGroupCol.getColDef();
Object(_utils_object__WEBPACK_IMPORTED_MODULE_4__["assign"])(defaultAutoColDef, {
// cellRendererParams.groupKey: colDefToCopy.field;
headerName: this.columnController.getDisplayNameForColumn(rowGroupCol, 'header'),
headerValueGetter: rowGroupColDef.headerValueGetter
});
if (rowGroupColDef.cellRenderer) {
Object(_utils_object__WEBPACK_IMPORTED_MODULE_4__["assign"])(defaultAutoColDef, {
cellRendererParams: {
innerRenderer: rowGroupColDef.cellRenderer,
innerRendererParams: rowGroupColDef.cellRendererParams
}
});
}
defaultAutoColDef.showRowGroup = rowGroupCol.getColId();
}
else {
defaultAutoColDef.showRowGroup = true;
}
return defaultAutoColDef;
};
var AutoGroupColService_1;
AutoGroupColService.GROUP_AUTO_COLUMN_BUNDLE_ID = _constants_constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].GROUP_AUTO_COLUMN_ID;
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnController')
], AutoGroupColService.prototype, "columnController", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnFactory')
], AutoGroupColService.prototype, "columnFactory", void 0);
AutoGroupColService = AutoGroupColService_1 = __decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('autoGroupColService')
], AutoGroupColService);
return AutoGroupColService;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_3__["BeanStub"]));
/***/ }),
/* 158 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PaginationProxy", function() { return PaginationProxy; });
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20);
/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23);
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12);
/* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7);
/* harmony import */ var _utils_number__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(28);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 PaginationProxy = /** @class */ (function (_super) {
__extends(PaginationProxy, _super);
function PaginationProxy() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.currentPage = 0;
_this.topDisplayedRowIndex = 0;
_this.bottomDisplayedRowIndex = 0;
_this.pixelOffset = 0;
_this.masterRowCount = 0;
return _this;
}
PaginationProxy.prototype.postConstruct = function () {
this.active = this.gridOptionsWrapper.isPagination();
this.paginateChildRows = this.gridOptionsWrapper.isPaginateChildRows();
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_MODEL_UPDATED, this.onModelUpdated.bind(this));
this.addManagedListener(this.gridOptionsWrapper, 'paginationPageSize', this.onPaginationPageSizeChanged.bind(this));
this.onModelUpdated();
};
PaginationProxy.prototype.ensureRowHeightsValid = function (startPixel, endPixel, startLimitIndex, endLimitIndex) {
var res = this.rowModel.ensureRowHeightsValid(startPixel, endPixel, this.getPageFirstRow(), this.getPageLastRow());
if (res) {
this.calculatePages();
}
return res;
};
PaginationProxy.prototype.onModelUpdated = function (modelUpdatedEvent) {
this.calculatePages();
var paginationChangedEvent = {
type: _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_PAGINATION_CHANGED,
animate: modelUpdatedEvent ? modelUpdatedEvent.animate : false,
newData: modelUpdatedEvent ? modelUpdatedEvent.newData : false,
newPage: modelUpdatedEvent ? modelUpdatedEvent.newPage : false,
keepRenderedRows: modelUpdatedEvent ? modelUpdatedEvent.keepRenderedRows : false,
api: this.gridApi,
columnApi: this.columnApi
};
this.eventService.dispatchEvent(paginationChangedEvent);
};
PaginationProxy.prototype.onPaginationPageSizeChanged = function () {
this.calculatePages();
var paginationChangedEvent = {
type: _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_PAGINATION_CHANGED,
animate: false,
newData: false,
newPage: false,
// important to keep rendered rows, otherwise every time grid is resized,
// we would destroy all the rows.
keepRenderedRows: true,
api: this.gridApi,
columnApi: this.columnApi
};
this.eventService.dispatchEvent(paginationChangedEvent);
};
PaginationProxy.prototype.goToPage = function (page) {
if (!this.active || this.currentPage === page) {
return;
}
this.currentPage = page;
var event = {
type: _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_MODEL_UPDATED,
animate: false,
keepRenderedRows: false,
newData: false,
newPage: true,
api: this.gridApi,
columnApi: this.columnApi
};
this.onModelUpdated(event);
};
PaginationProxy.prototype.getPixelOffset = function () {
return this.pixelOffset;
};
PaginationProxy.prototype.getRow = function (index) {
return this.rowModel.getRow(index);
};
PaginationProxy.prototype.getRowNode = function (id) {
return this.rowModel.getRowNode(id);
};
PaginationProxy.prototype.getRowIndexAtPixel = function (pixel) {
return this.rowModel.getRowIndexAtPixel(pixel);
};
PaginationProxy.prototype.getCurrentPageHeight = function () {
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_3__["missing"])(this.topRowBounds) || Object(_utils_generic__WEBPACK_IMPORTED_MODULE_3__["missing"])(this.bottomRowBounds)) {
return 0;
}
return Math.max(this.bottomRowBounds.rowTop + this.bottomRowBounds.rowHeight - this.topRowBounds.rowTop, 0);
};
PaginationProxy.prototype.isRowPresent = function (rowNode) {
if (!this.rowModel.isRowPresent(rowNode)) {
return false;
}
var nodeIsInPage = rowNode.rowIndex >= this.topDisplayedRowIndex && rowNode.rowIndex <= this.bottomDisplayedRowIndex;
return nodeIsInPage;
};
PaginationProxy.prototype.isEmpty = function () {
return this.rowModel.isEmpty();
};
PaginationProxy.prototype.isRowsToRender = function () {
return this.rowModel.isRowsToRender();
};
PaginationProxy.prototype.getNodesInRangeForSelection = function (firstInRange, lastInRange) {
return this.rowModel.getNodesInRangeForSelection(firstInRange, lastInRange);
};
PaginationProxy.prototype.forEachNode = function (callback) {
return this.rowModel.forEachNode(callback);
};
PaginationProxy.prototype.getType = function () {
return this.rowModel.getType();
};
PaginationProxy.prototype.getRowBounds = function (index) {
var res = this.rowModel.getRowBounds(index);
res.rowIndex = index;
return res;
};
PaginationProxy.prototype.getPageFirstRow = function () {
return this.topRowBounds ? this.topRowBounds.rowIndex : -1;
};
PaginationProxy.prototype.getPageLastRow = function () {
return this.bottomRowBounds ? this.bottomRowBounds.rowIndex : -1;
};
PaginationProxy.prototype.getRowCount = function () {
return this.rowModel.getRowCount();
};
PaginationProxy.prototype.getPageForIndex = function (index) {
return Math.floor(index / this.pageSize);
};
PaginationProxy.prototype.goToPageWithIndex = function (index) {
if (!this.active) {
return;
}
var pageNumber = this.getPageForIndex(index);
this.goToPage(pageNumber);
};
PaginationProxy.prototype.isRowInPage = function (row) {
if (!this.active) {
return true;
}
var rowPage = this.getPageForIndex(row.rowIndex);
return rowPage === this.currentPage;
};
PaginationProxy.prototype.isLastPageFound = function () {
return this.rowModel.isLastRowFound();
};
PaginationProxy.prototype.getCurrentPage = function () {
return this.currentPage;
};
PaginationProxy.prototype.goToNextPage = function () {
this.goToPage(this.currentPage + 1);
};
PaginationProxy.prototype.goToPreviousPage = function () {
this.goToPage(this.currentPage - 1);
};
PaginationProxy.prototype.goToFirstPage = function () {
this.goToPage(0);
};
PaginationProxy.prototype.goToLastPage = function () {
var rowCount = this.rowModel.getRowCount();
var lastPage = Math.floor(rowCount / this.pageSize);
this.goToPage(lastPage);
};
PaginationProxy.prototype.getPageSize = function () {
return this.pageSize;
};
PaginationProxy.prototype.getTotalPages = function () {
return this.totalPages;
};
PaginationProxy.prototype.setPageSize = function () {
// show put this into super class
this.pageSize = this.gridOptionsWrapper.getPaginationPageSize();
if (this.pageSize == null || this.pageSize < 1) {
this.pageSize = 100;
}
};
PaginationProxy.prototype.calculatePages = function () {
if (this.active) {
this.setPageSize();
if (this.paginateChildRows) {
this.calculatePagesAllRows();
}
else {
this.calculatePagesMasterRowsOnly();
}
}
else {
this.calculatedPagesNotActive();
}
this.topRowBounds = this.rowModel.getRowBounds(this.topDisplayedRowIndex);
if (this.topRowBounds) {
this.topRowBounds.rowIndex = this.topDisplayedRowIndex;
}
this.bottomRowBounds = this.rowModel.getRowBounds(this.bottomDisplayedRowIndex);
if (this.bottomRowBounds) {
this.bottomRowBounds.rowIndex = this.bottomDisplayedRowIndex;
}
this.setPixelOffset(Object(_utils_generic__WEBPACK_IMPORTED_MODULE_3__["exists"])(this.topRowBounds) ? this.topRowBounds.rowTop : 0);
};
PaginationProxy.prototype.setPixelOffset = function (value) {
if (this.pixelOffset === value) {
return;
}
this.pixelOffset = value;
this.eventService.dispatchEvent({ type: _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_PAGINATION_PIXEL_OFFSET_CHANGED });
};
PaginationProxy.prototype.setZeroRows = function () {
this.masterRowCount = 0;
this.topDisplayedRowIndex = 0;
this.bottomDisplayedRowIndex = -1;
this.currentPage = 0;
this.totalPages = 0;
};
PaginationProxy.prototype.calculatePagesMasterRowsOnly = function () {
// const csrm = this.rowModel;
// const rootNode = csrm.getRootNode();
// const masterRows = rootNode.childrenAfterSort;
this.masterRowCount = this.rowModel.getTopLevelRowCount();
// we say <=0 (rather than =0) as viewport returns -1 when no rows
if (this.masterRowCount <= 0) {
this.setZeroRows();
return;
}
var masterLastRowIndex = this.masterRowCount - 1;
this.totalPages = Math.floor((masterLastRowIndex) / this.pageSize) + 1;
if (this.currentPage >= this.totalPages) {
this.currentPage = this.totalPages - 1;
}
if (!Object(_utils_number__WEBPACK_IMPORTED_MODULE_4__["isNumeric"])(this.currentPage) || this.currentPage < 0) {
this.currentPage = 0;
}
var masterPageStartIndex = this.pageSize * this.currentPage;
var masterPageEndIndex = (this.pageSize * (this.currentPage + 1)) - 1;
if (masterPageEndIndex > masterLastRowIndex) {
masterPageEndIndex = masterLastRowIndex;
}
this.topDisplayedRowIndex = this.rowModel.getTopLevelRowDisplayedIndex(masterPageStartIndex);
// masterRows[masterPageStartIndex].rowIndex;
if (masterPageEndIndex === masterLastRowIndex) {
// if showing the last master row, then we want to show the very last row of the model
this.bottomDisplayedRowIndex = this.rowModel.getRowCount() - 1;
}
else {
var firstIndexNotToShow = this.rowModel.getTopLevelRowDisplayedIndex(masterPageEndIndex + 1);
//masterRows[masterPageEndIndex + 1].rowIndex;
// this gets the index of the last child - eg current row is open, we want to display all children,
// the index of the last child is one less than the index of the next parent row.
this.bottomDisplayedRowIndex = firstIndexNotToShow - 1;
}
};
PaginationProxy.prototype.getMasterRowCount = function () {
return this.masterRowCount;
};
PaginationProxy.prototype.calculatePagesAllRows = function () {
this.masterRowCount = this.rowModel.getRowCount();
if (this.masterRowCount === 0) {
this.setZeroRows();
return;
}
var maxRowIndex = this.masterRowCount - 1;
this.totalPages = Math.floor((maxRowIndex) / this.pageSize) + 1;
if (this.currentPage >= this.totalPages) {
this.currentPage = this.totalPages - 1;
}
if (!Object(_utils_number__WEBPACK_IMPORTED_MODULE_4__["isNumeric"])(this.currentPage) || this.currentPage < 0) {
this.currentPage = 0;
}
this.topDisplayedRowIndex = this.pageSize * this.currentPage;
this.bottomDisplayedRowIndex = (this.pageSize * (this.currentPage + 1)) - 1;
if (this.bottomDisplayedRowIndex > maxRowIndex) {
this.bottomDisplayedRowIndex = maxRowIndex;
}
};
PaginationProxy.prototype.calculatedPagesNotActive = function () {
this.pageSize = this.rowModel.getRowCount();
this.totalPages = 1;
this.currentPage = 0;
this.topDisplayedRowIndex = 0;
this.bottomDisplayedRowIndex = this.rowModel.getRowCount() - 1;
};
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('rowModel')
], PaginationProxy.prototype, "rowModel", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('columnApi')
], PaginationProxy.prototype, "columnApi", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('gridApi')
], PaginationProxy.prototype, "gridApi", void 0);
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_2__["PostConstruct"]
], PaginationProxy.prototype, "postConstruct", null);
PaginationProxy = __decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Bean"])('paginationProxy')
], PaginationProxy);
return PaginationProxy;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_0__["BeanStub"]));
/***/ }),
/* 159 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PaginationAutoPageSizeService", function() { return PaginationAutoPageSizeService; });
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20);
/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23);
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 PaginationAutoPageSizeService = /** @class */ (function (_super) {
__extends(PaginationAutoPageSizeService, _super);
function PaginationAutoPageSizeService() {
return _super !== null && _super.apply(this, arguments) || this;
}
PaginationAutoPageSizeService.prototype.registerGridComp = function (gridPanel) {
this.gridPanel = gridPanel;
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_BODY_HEIGHT_CHANGED, this.onBodyHeightChanged.bind(this));
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_SCROLL_VISIBILITY_CHANGED, this.onScrollVisibilityChanged.bind(this));
this.checkPageSize();
};
PaginationAutoPageSizeService.prototype.notActive = function () {
return !this.gridOptionsWrapper.isPaginationAutoPageSize();
};
PaginationAutoPageSizeService.prototype.onScrollVisibilityChanged = function () {
this.checkPageSize();
};
PaginationAutoPageSizeService.prototype.onBodyHeightChanged = function () {
this.checkPageSize();
};
PaginationAutoPageSizeService.prototype.checkPageSize = function () {
if (this.notActive()) {
return;
}
var rowHeight = this.gridOptionsWrapper.getRowHeightAsNumber();
var bodyHeight = this.gridPanel.getBodyHeight();
if (bodyHeight > 0) {
var newPageSize = Math.floor(bodyHeight / rowHeight);
this.gridOptionsWrapper.setProperty('paginationPageSize', newPageSize);
}
};
PaginationAutoPageSizeService = __decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Bean"])('paginationAutoPageSizeService')
], PaginationAutoPageSizeService);
return PaginationAutoPageSizeService;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_0__["BeanStub"]));
/***/ }),
/* 160 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ValueCache", function() { return ValueCache; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 ValueCache = /** @class */ (function (_super) {
__extends(ValueCache, _super);
function ValueCache() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.cacheVersion = 0;
return _this;
}
ValueCache.prototype.init = function () {
this.active = this.gridOptionsWrapper.isValueCache();
this.neverExpires = this.gridOptionsWrapper.isValueCacheNeverExpires();
};
ValueCache.prototype.onDataChanged = function () {
if (this.neverExpires) {
return;
}
this.expire();
};
ValueCache.prototype.expire = function () {
this.cacheVersion++;
};
ValueCache.prototype.setValue = function (rowNode, colId, value) {
if (this.active) {
if (rowNode.__cacheVersion !== this.cacheVersion) {
rowNode.__cacheVersion = this.cacheVersion;
rowNode.__cacheData = {};
}
rowNode.__cacheData[colId] = value;
}
};
ValueCache.prototype.getValue = function (rowNode, colId) {
if (!this.active || rowNode.__cacheVersion !== this.cacheVersion) {
return undefined;
}
return rowNode.__cacheData[colId];
};
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_0__["PostConstruct"]
], ValueCache.prototype, "init", null);
ValueCache = __decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('valueCache')
], ValueCache);
return ValueCache;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
/***/ }),
/* 161 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ChangeDetectionService", function() { return ChangeDetectionService; });
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20);
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12);
/* harmony import */ var _utils_changedPath__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(98);
/* harmony import */ var _constants_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(16);
/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(23);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 ChangeDetectionService = /** @class */ (function (_super) {
__extends(ChangeDetectionService, _super);
function ChangeDetectionService() {
return _super !== null && _super.apply(this, arguments) || this;
}
ChangeDetectionService.prototype.init = function () {
if (this.rowModel.getType() === _constants_constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].ROW_MODEL_TYPE_CLIENT_SIDE) {
this.clientSideRowModel = this.rowModel;
}
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_4__["Events"].EVENT_CELL_VALUE_CHANGED, this.onCellValueChanged.bind(this));
};
ChangeDetectionService.prototype.onCellValueChanged = function (event) {
// Clipboard service manages its own change detection, so no need to do it here.
// The clipboard manages its own as otherwise this would happen once for every cell
// that got updated as part of a paste operation, so e.g. if 100 cells in a paste operation,
// this doChangeDetection would get called 100 times (once for each cell), instead clipboard
// service executes the logic we have here once (in essence batching up all cell changes
// into one change detection).
if (event.source === _constants_constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].SOURCE_PASTE) {
return;
}
this.doChangeDetection(event.node, event.column);
};
ChangeDetectionService.prototype.doChangeDetection = function (rowNode, column) {
if (this.gridOptionsWrapper.isSuppressChangeDetection()) {
return;
}
// step 1 of change detection is to update the aggregated values
if (this.clientSideRowModel && !rowNode.isRowPinned()) {
var onlyChangedColumns = this.gridOptionsWrapper.isAggregateOnlyChangedColumns();
var changedPath = new _utils_changedPath__WEBPACK_IMPORTED_MODULE_2__["ChangedPath"](onlyChangedColumns, this.clientSideRowModel.getRootNode());
changedPath.addParentNode(rowNode.parent, [column]);
this.clientSideRowModel.doAggregate(changedPath);
}
// step 2 of change detection is to refresh the cells
this.rowRenderer.refreshCells();
};
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('rowModel')
], ChangeDetectionService.prototype, "rowModel", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('rowRenderer')
], ChangeDetectionService.prototype, "rowRenderer", void 0);
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_1__["PostConstruct"]
], ChangeDetectionService.prototype, "init", null);
ChangeDetectionService = __decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Bean"])('changeDetectionService')
], ChangeDetectionService);
return ChangeDetectionService;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_0__["BeanStub"]));
/***/ }),
/* 162 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AlignedGridsService", function() { return AlignedGridsService; });
/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23);
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12);
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(20);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 __param = (undefined && undefined.__param) || function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
var AlignedGridsService = /** @class */ (function (_super) {
__extends(AlignedGridsService, _super);
function AlignedGridsService() {
var _this = _super !== null && _super.apply(this, arguments) || this;
// flag to mark if we are consuming. to avoid cyclic events (ie other grid firing back to master
// while processing a master event) we mark this if consuming an event, and if we are, then
// we don't fire back any events.
_this.consuming = false;
return _this;
}
AlignedGridsService.prototype.setBeans = function (loggerFactory) {
this.logger = loggerFactory.create('AlignedGridsService');
};
AlignedGridsService.prototype.registerGridComp = function (gridPanel) {
this.gridPanel = gridPanel;
};
AlignedGridsService.prototype.init = function () {
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_COLUMN_MOVED, this.fireColumnEvent.bind(this));
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_COLUMN_VISIBLE, this.fireColumnEvent.bind(this));
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_COLUMN_PINNED, this.fireColumnEvent.bind(this));
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_COLUMN_GROUP_OPENED, this.fireColumnEvent.bind(this));
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_COLUMN_RESIZED, this.fireColumnEvent.bind(this));
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_BODY_SCROLL, this.fireScrollEvent.bind(this));
};
// common logic across all the fire methods
AlignedGridsService.prototype.fireEvent = function (callback) {
// if we are already consuming, then we are acting on an event from a master,
// so we don't cause a cyclic firing of events
if (this.consuming) {
return;
}
// iterate through the aligned grids, and pass each aligned grid service to the callback
var otherGrids = this.gridOptionsWrapper.getAlignedGrids();
if (otherGrids) {
otherGrids.forEach(function (otherGridOptions) {
if (otherGridOptions.api) {
var alignedGridService = otherGridOptions.api.__getAlignedGridService();
callback(alignedGridService);
}
});
}
};
// common logic across all consume methods. very little common logic, however extracting
// guarantees consistency across the methods.
AlignedGridsService.prototype.onEvent = function (callback) {
this.consuming = true;
callback();
this.consuming = false;
};
AlignedGridsService.prototype.fireColumnEvent = function (event) {
this.fireEvent(function (alignedGridsService) {
alignedGridsService.onColumnEvent(event);
});
};
AlignedGridsService.prototype.fireScrollEvent = function (event) {
if (event.direction !== 'horizontal') {
return;
}
this.fireEvent(function (alignedGridsService) {
alignedGridsService.onScrollEvent(event);
});
};
AlignedGridsService.prototype.onScrollEvent = function (event) {
var _this = this;
this.onEvent(function () {
_this.gridPanel.setHorizontalScrollPosition(event.left);
});
};
AlignedGridsService.prototype.getMasterColumns = function (event) {
var result = [];
if (event.columns) {
event.columns.forEach(function (column) {
result.push(column);
});
}
else if (event.column) {
result.push(event.column);
}
return result;
};
AlignedGridsService.prototype.getColumnIds = function (event) {
var result = [];
if (event.columns) {
event.columns.forEach(function (column) {
result.push(column.getColId());
});
}
else if (event.column) {
result.push(event.column.getColId());
}
return result;
};
AlignedGridsService.prototype.onColumnEvent = function (event) {
var _this = this;
this.onEvent(function () {
switch (event.type) {
case _events__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_COLUMN_MOVED:
case _events__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_COLUMN_VISIBLE:
case _events__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_COLUMN_PINNED:
case _events__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_COLUMN_RESIZED:
var colEvent = event;
_this.processColumnEvent(colEvent);
break;
case _events__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_COLUMN_GROUP_OPENED:
var groupOpenedEvent = event;
_this.processGroupOpenedEvent(groupOpenedEvent);
break;
case _events__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_COLUMN_PIVOT_CHANGED:
// we cannot support pivoting with aligned grids as the columns will be out of sync as the
// grids will have columns created based on the row data of the grid.
console.warn('ag-Grid: pivoting is not supported with aligned grids. ' +
'You can only use one of these features at a time in a grid.');
break;
}
});
};
AlignedGridsService.prototype.processGroupOpenedEvent = function (groupOpenedEvent) {
// likewise for column group
var masterColumnGroup = groupOpenedEvent.columnGroup;
var otherColumnGroup;
if (masterColumnGroup) {
var groupId = masterColumnGroup.getGroupId();
otherColumnGroup = this.columnController.getOriginalColumnGroup(groupId);
}
if (masterColumnGroup && !otherColumnGroup) {
return;
}
this.logger.log('onColumnEvent-> processing ' + groupOpenedEvent + ' expanded = ' + masterColumnGroup.isExpanded());
this.columnController.setColumnGroupOpened(otherColumnGroup, masterColumnGroup.isExpanded(), "alignedGridChanged");
};
AlignedGridsService.prototype.processColumnEvent = function (colEvent) {
var _this = this;
// the column in the event is from the master grid. need to
// look up the equivalent from this (other) grid
var masterColumn = colEvent.column;
var otherColumn;
if (masterColumn) {
otherColumn = this.columnController.getPrimaryColumn(masterColumn.getColId());
}
// if event was with respect to a master column, that is not present in this
// grid, then we ignore the event
if (masterColumn && !otherColumn) {
return;
}
// in time, all the methods below should use the column ids, it's a more generic way
// of handling columns, and also allows for single or multi column events
var columnIds = this.getColumnIds(colEvent);
var masterColumns = this.getMasterColumns(colEvent);
switch (colEvent.type) {
case _events__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_COLUMN_MOVED:
var movedEvent = colEvent;
this.logger.log("onColumnEvent-> processing " + colEvent.type + " toIndex = " + movedEvent.toIndex);
this.columnController.moveColumns(columnIds, movedEvent.toIndex, "alignedGridChanged");
break;
case _events__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_COLUMN_VISIBLE:
var visibleEvent = colEvent;
this.logger.log("onColumnEvent-> processing " + colEvent.type + " visible = " + visibleEvent.visible);
this.columnController.setColumnsVisible(columnIds, visibleEvent.visible, "alignedGridChanged");
break;
case _events__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_COLUMN_PINNED:
var pinnedEvent = colEvent;
this.logger.log("onColumnEvent-> processing " + colEvent.type + " pinned = " + pinnedEvent.pinned);
this.columnController.setColumnsPinned(columnIds, pinnedEvent.pinned, "alignedGridChanged");
break;
case _events__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_COLUMN_RESIZED:
var resizedEvent_1 = colEvent;
masterColumns.forEach(function (column) {
_this.logger.log("onColumnEvent-> processing " + colEvent.type + " actualWidth = " + column.getActualWidth());
var columnWidths = [{ key: column.getColId(), newWidth: column.getActualWidth() }];
_this.columnController.setColumnWidths(columnWidths, false, resizedEvent_1.finished, "alignedGridChanged");
});
break;
}
var isVerticalScrollShowing = this.gridPanel.isVerticalScrollShowing();
var alignedGrids = this.gridOptionsWrapper.getAlignedGrids();
alignedGrids.forEach(function (grid) {
grid.api.setAlwaysShowVerticalScroll(isVerticalScrollShowing);
});
};
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('columnController')
], AlignedGridsService.prototype, "columnController", void 0);
__decorate([
__param(0, Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Qualifier"])('loggerFactory'))
], AlignedGridsService.prototype, "setBeans", null);
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_1__["PostConstruct"]
], AlignedGridsService.prototype, "init", null);
AlignedGridsService = __decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Bean"])('alignedGridsService')
], AlignedGridsService);
return AlignedGridsService;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_2__["BeanStub"]));
/***/ }),
/* 163 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgComponentUtils", function() { return AgComponentUtils; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20);
/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(42);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 AgComponentUtils = /** @class */ (function (_super) {
__extends(AgComponentUtils, _super);
function AgComponentUtils() {
return _super !== null && _super.apply(this, arguments) || this;
}
AgComponentUtils.prototype.adaptFunction = function (propertyName, hardcodedJsFunction, componentFromFramework, source) {
if (hardcodedJsFunction == null) {
return {
component: null,
componentFromFramework: componentFromFramework,
source: source,
paramsFromSelector: null
};
}
var metadata = this.componentMetadataProvider.retrieve(propertyName);
if (metadata && metadata.functionAdapter) {
return {
componentFromFramework: componentFromFramework,
component: metadata.functionAdapter(hardcodedJsFunction),
source: source,
paramsFromSelector: null
};
}
return null;
};
AgComponentUtils.prototype.adaptCellRendererFunction = function (callback) {
var Adapter = /** @class */ (function () {
function Adapter() {
}
Adapter.prototype.refresh = function (params) {
return false;
};
Adapter.prototype.getGui = function () {
var callbackResult = callback(this.params);
var type = typeof callbackResult;
if (type === 'string' || type === 'number' || type === 'boolean') {
return Object(_utils_dom__WEBPACK_IMPORTED_MODULE_2__["loadTemplate"])('' + callbackResult + '');
}
return callbackResult;
};
Adapter.prototype.init = function (params) {
this.params = params;
};
return Adapter;
}());
return Adapter;
};
AgComponentUtils.prototype.doesImplementIComponent = function (candidate) {
if (!candidate) {
return false;
}
return candidate.prototype && 'getGui' in candidate.prototype;
};
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])("componentMetadataProvider")
], AgComponentUtils.prototype, "componentMetadataProvider", void 0);
AgComponentUtils = __decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])("agComponentUtils")
], AgComponentUtils);
return AgComponentUtils;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
/***/ }),
/* 164 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ComponentMetadataProvider", function() { return ComponentMetadataProvider; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 ComponentMetadataProvider = /** @class */ (function (_super) {
__extends(ComponentMetadataProvider, _super);
function ComponentMetadataProvider() {
return _super !== null && _super.apply(this, arguments) || this;
}
ComponentMetadataProvider.prototype.postConstruct = function () {
this.componentMetaData = {
dateComponent: {
mandatoryMethodList: ['getDate', 'setDate'],
optionalMethodList: ['afterGuiAttached', 'setInputPlaceholder', 'setInputAriaLabel']
},
detailCellRenderer: {
mandatoryMethodList: [],
optionalMethodList: ['refresh']
},
headerComponent: {
mandatoryMethodList: [],
optionalMethodList: ['refresh']
},
headerGroupComponent: {
mandatoryMethodList: [],
optionalMethodList: []
},
loadingCellRenderer: {
mandatoryMethodList: [],
optionalMethodList: []
},
loadingOverlayComponent: {
mandatoryMethodList: [],
optionalMethodList: []
},
noRowsOverlayComponent: {
mandatoryMethodList: [],
optionalMethodList: []
},
floatingFilterComponent: {
mandatoryMethodList: ['onParentModelChanged'],
optionalMethodList: ['afterGuiAttached']
},
floatingFilterWrapperComponent: {
mandatoryMethodList: [],
optionalMethodList: []
},
cellRenderer: {
mandatoryMethodList: [],
optionalMethodList: ['refresh', 'afterGuiAttached'],
functionAdapter: this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)
},
cellEditor: {
mandatoryMethodList: ['getValue'],
optionalMethodList: ['isPopup', 'isCancelBeforeStart', 'isCancelAfterEnd', 'getPopupPosition', 'focusIn', 'focusOut', 'afterGuiAttached']
},
innerRenderer: {
mandatoryMethodList: [],
optionalMethodList: ['afterGuiAttached'],
functionAdapter: this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)
},
fullWidthCellRenderer: {
mandatoryMethodList: [],
optionalMethodList: ['refresh', 'afterGuiAttached'],
functionAdapter: this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)
},
pinnedRowCellRenderer: {
mandatoryMethodList: [],
optionalMethodList: ['refresh', 'afterGuiAttached'],
functionAdapter: this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)
},
groupRowRenderer: {
mandatoryMethodList: [],
optionalMethodList: ['afterGuiAttached'],
functionAdapter: this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)
},
filter: {
mandatoryMethodList: ['isFilterActive', 'doesFilterPass', 'getModel', 'setModel'],
optionalMethodList: ['afterGuiAttached', 'onNewRowsLoaded', 'getModelAsString', 'onFloatingFilterChanged']
},
filterComponent: {
mandatoryMethodList: ['isFilterActive', 'doesFilterPass', 'getModel', 'setModel'],
optionalMethodList: ['afterGuiAttached', 'onNewRowsLoaded', 'getModelAsString', 'onFloatingFilterChanged']
},
statusPanel: {
mandatoryMethodList: [],
optionalMethodList: ['afterGuiAttached'],
},
toolPanel: {
mandatoryMethodList: [],
optionalMethodList: ['refresh', 'afterGuiAttached']
},
tooltipComponent: {
mandatoryMethodList: [],
optionalMethodList: []
}
};
};
ComponentMetadataProvider.prototype.retrieve = function (name) {
return this.componentMetaData[name];
};
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])("agComponentUtils")
], ComponentMetadataProvider.prototype, "agComponentUtils", void 0);
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_0__["PostConstruct"]
], ComponentMetadataProvider.prototype, "postConstruct", null);
ComponentMetadataProvider = __decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])("componentMetadataProvider")
], ComponentMetadataProvider);
return ComponentMetadataProvider;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
/***/ }),
/* 165 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Beans", function() { return Beans; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (undefined && undefined.__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;
};
/** Using the IoC has a slight performance consideration, which is no problem most of the
* time, unless we are trashing objects - which is the case when scrolling and rowComp
* and cellComp. So for performance reasons, RowComp and CellComp do not get autowired
* with the IoC. Instead they get passed this object which is all the beans the RowComp
* and CellComp need. Not autowiring all the cells gives performance improvement. */
var Beans = /** @class */ (function () {
function Beans() {
}
Beans.prototype.registerGridComp = function (gridPanel) {
this.gridPanel = gridPanel;
};
Beans.prototype.postConstruct = function () {
this.doingMasterDetail = this.gridOptionsWrapper.isMasterDetail();
if (this.gridOptionsWrapper.isRowModelDefault()) {
this.clientSideRowModel = this.rowModel;
}
if (this.gridOptionsWrapper.isRowModelServerSide()) {
this.serverSideRowModel = this.rowModel;
}
};
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('resizeObserverService')
], Beans.prototype, "resizeObserverService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('paginationProxy')
], Beans.prototype, "paginationProxy", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('context')
], Beans.prototype, "context", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnApi')
], Beans.prototype, "columnApi", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridApi')
], Beans.prototype, "gridApi", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
], Beans.prototype, "gridOptionsWrapper", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('expressionService')
], Beans.prototype, "expressionService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('rowRenderer')
], Beans.prototype, "rowRenderer", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('$compile')
], Beans.prototype, "$compile", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('templateService')
], Beans.prototype, "templateService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('valueService')
], Beans.prototype, "valueService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('eventService')
], Beans.prototype, "eventService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnController')
], Beans.prototype, "columnController", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('headerNavigationService')
], Beans.prototype, "headerNavigationService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnAnimationService')
], Beans.prototype, "columnAnimationService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Optional"])('rangeController')
], Beans.prototype, "rangeController", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('focusController')
], Beans.prototype, "focusController", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Optional"])('contextMenuFactory')
], Beans.prototype, "contextMenuFactory", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('popupService')
], Beans.prototype, "popupService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('valueFormatterService')
], Beans.prototype, "valueFormatterService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('stylingService')
], Beans.prototype, "stylingService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnHoverService')
], Beans.prototype, "columnHoverService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('userComponentFactory')
], Beans.prototype, "userComponentFactory", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('animationFrameService')
], Beans.prototype, "taskQueue", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('dragAndDropService')
], Beans.prototype, "dragAndDropService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('sortController')
], Beans.prototype, "sortController", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('filterManager')
], Beans.prototype, "filterManager", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('maxDivHeightScaler')
], Beans.prototype, "maxDivHeightScaler", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('frameworkOverrides')
], Beans.prototype, "frameworkOverrides", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('detailRowCompCache')
], Beans.prototype, "detailRowCompCache", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('cellPositionUtils')
], Beans.prototype, "cellPositionUtils", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('rowPositionUtils')
], Beans.prototype, "rowPositionUtils", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('selectionController')
], Beans.prototype, "selectionController", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Optional"])('selectionHandleFactory')
], Beans.prototype, "selectionHandleFactory", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('rowCssClassCalculator')
], Beans.prototype, "rowCssClassCalculator", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('rowModel')
], Beans.prototype, "rowModel", void 0);
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_0__["PostConstruct"]
], Beans.prototype, "postConstruct", null);
Beans = __decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('beans')
], Beans);
return Beans;
}());
/***/ }),
/* 166 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Environment", function() { return Environment; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20);
/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(42);
/* harmony import */ var _utils_function__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(15);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 MAT_GRID_SIZE = 8;
var BASE_GRID_SIZE = 4;
var BALHAM_GRID_SIZE = 4;
var ALPINE_GRID_SIZE = 6;
var HARD_CODED_SIZES = {
// this item is required for custom themes
'ag-theme-custom': {
headerHeight: 25,
headerCellMinWidth: 24,
listItemHeight: BASE_GRID_SIZE * 5,
rowHeight: 25,
chartMenuPanelWidth: 220
},
'ag-theme-material': {
headerHeight: MAT_GRID_SIZE * 7,
headerCellMinWidth: 48,
listItemHeight: MAT_GRID_SIZE * 4,
rowHeight: MAT_GRID_SIZE * 6,
chartMenuPanelWidth: 240
},
'ag-theme-balham': {
headerHeight: BALHAM_GRID_SIZE * 8,
headerCellMinWidth: 24,
listItemHeight: BALHAM_GRID_SIZE * 6,
rowHeight: BALHAM_GRID_SIZE * 7,
chartMenuPanelWidth: 220
},
'ag-theme-alpine': {
headerHeight: ALPINE_GRID_SIZE * 8,
headerCellMinWidth: 36,
listItemHeight: ALPINE_GRID_SIZE * 4,
rowHeight: ALPINE_GRID_SIZE * 7,
chartMenuPanelWidth: 240
}
};
/**
* this object contains a list of Sass variables and an array
* of CSS styles required to get the correct value.
* eg. $virtual-item-height requires a structure, so we can get its height.
*
*
*
*
*
*/
var SASS_PROPERTY_BUILDER = {
headerHeight: ['ag-header-row'],
headerCellMinWidth: ['ag-header-cell'],
listItemHeight: ['ag-virtual-list-item'],
rowHeight: ['ag-row'],
chartMenuPanelWidth: ['ag-chart-docked-container']
};
var CALCULATED_SIZES = {};
var Environment = /** @class */ (function (_super) {
__extends(Environment, _super);
function Environment() {
return _super !== null && _super.apply(this, arguments) || this;
}
Environment.prototype.getSassVariable = function (theme, key) {
var useTheme = 'ag-theme-' + (theme.match('material') ? 'material' : theme.match('balham') ? 'balham' : theme.match('alpine') ? 'alpine' : 'custom');
var defaultValue = HARD_CODED_SIZES[useTheme][key];
var calculatedValue = 0;
if (!CALCULATED_SIZES[theme]) {
CALCULATED_SIZES[theme] = {};
}
if (CALCULATED_SIZES[theme][key]) {
return CALCULATED_SIZES[theme][key];
}
if (SASS_PROPERTY_BUILDER[key]) {
var classList = SASS_PROPERTY_BUILDER[key];
var div = document.createElement('div');
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_2__["addCssClass"])(div, theme);
div.style.position = 'absolute';
var el = classList.reduce(function (el, currentClass) {
var div = document.createElement('div');
div.style.position = 'static';
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_2__["addCssClass"])(div, currentClass);
el.appendChild(div);
return div;
}, div);
if (document.body) {
document.body.appendChild(div);
var sizeName = key.toLowerCase().indexOf('height') !== -1 ? 'height' : 'width';
calculatedValue = parseInt(window.getComputedStyle(el)[sizeName], 10);
document.body.removeChild(div);
}
}
CALCULATED_SIZES[theme][key] = calculatedValue || defaultValue;
return CALCULATED_SIZES[theme][key];
};
Environment.prototype.isThemeDark = function () {
var theme = this.getTheme().theme;
return !!theme && theme.indexOf('dark') >= 0;
};
Environment.prototype.chartMenuPanelWidth = function () {
var theme = this.getTheme().themeFamily;
return this.getSassVariable(theme, 'chartMenuPanelWidth');
};
Environment.prototype.getTheme = function () {
var reg = /\bag-(material|(?:theme-([\w\-]*)))\b/;
var el = this.eGridDiv;
var themeMatch;
while (el) {
themeMatch = reg.exec(el.className);
if (!themeMatch) {
el = el.parentElement;
}
else {
break;
}
}
if (!themeMatch) {
return {};
}
var theme = themeMatch[0];
var usingOldTheme = themeMatch[2] === undefined;
if (usingOldTheme) {
var newTheme_1 = theme.replace('ag-', 'ag-theme-');
Object(_utils_function__WEBPACK_IMPORTED_MODULE_3__["doOnce"])(function () { return console.warn("ag-Grid: As of v19 old theme are no longer provided. Please replace " + theme + " with " + newTheme_1 + "."); }, 'using-old-theme');
}
return { theme: theme, el: el, themeFamily: theme.replace(/-dark$/, '') };
};
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('eGridDiv')
], Environment.prototype, "eGridDiv", void 0);
Environment = __decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('environment')
], Environment);
return Environment;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
/***/ }),
/* 167 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimationFrameService", function() { return AnimationFrameService; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _eventKeys__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(24);
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(20);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 AnimationFrameService = /** @class */ (function (_super) {
__extends(AnimationFrameService, _super);
function AnimationFrameService() {
var _this = _super !== null && _super.apply(this, arguments) || this;
// p1 and p2 are create tasks are to do with row and cell creation.
// for them we want to execute according to row order, so we use
// TaskItem so we know what index the item is for.
_this.createTasksP1 = { list: [], sorted: false }; // eg drawing back-ground of rows
_this.createTasksP2 = { list: [], sorted: false }; // eg cell renderers, adding hover functionality
// destroy tasks are to do with row removal. they are done after row creation as the user will need to see new
// rows first (as blank is scrolled into view), when we remove the old rows (no longer in view) is not as
// important.
_this.destroyTasks = [];
_this.ticking = false;
// we need to know direction of scroll, to build up rows in the direction of
// the scroll. eg if user scrolls down, we extend the rows by building down.
_this.scrollGoingDown = true;
_this.lastScrollTop = 0;
_this.taskCount = 0;
_this.cancelledTasks = new Set();
return _this;
}
AnimationFrameService.prototype.setScrollTop = function (scrollTop) {
this.scrollGoingDown = scrollTop > this.lastScrollTop;
this.lastScrollTop = scrollTop;
};
AnimationFrameService.prototype.init = function () {
this.useAnimationFrame = !this.gridOptionsWrapper.isSuppressAnimationFrame();
};
// this method is for our ag-Grid sanity only - if animation frames are turned off,
// then no place in the code should be looking to add any work to be done in animation
// frames. this stops bugs - where some code is asking for a frame to be executed
// when it should not.
AnimationFrameService.prototype.verifyAnimationFrameOn = function (methodName) {
if (this.useAnimationFrame === false) {
console.warn("ag-Grid: AnimationFrameService." + methodName + " called but animation frames are off");
}
};
AnimationFrameService.prototype.createTask = function (task, index, list) {
this.verifyAnimationFrameOn(list);
var taskItem = { task: task, index: index, createOrder: ++this.taskCount };
this.addTaskToList(this[list], taskItem);
this.schedule();
};
AnimationFrameService.prototype.cancelTask = function (task) {
this.cancelledTasks.add(task);
};
AnimationFrameService.prototype.addTaskToList = function (taskList, task) {
taskList.list.push(task);
taskList.sorted = false;
};
AnimationFrameService.prototype.sortTaskList = function (taskList) {
if (taskList.sorted) {
return;
}
var sortDirection = this.scrollGoingDown ? 1 : -1;
// sort first by row index (taking into account scroll direction), then by
// order of task creation (always ascending, so cells will render left-to-right)
taskList.list.sort(function (a, b) { return a.index !== b.index ? sortDirection * (b.index - a.index) : b.createOrder - a.createOrder; });
taskList.sorted = true;
};
AnimationFrameService.prototype.addDestroyTask = function (task) {
this.verifyAnimationFrameOn('createTasksP3');
this.destroyTasks.push(task);
this.schedule();
};
AnimationFrameService.prototype.executeFrame = function (millis) {
this.verifyAnimationFrameOn('executeFrame');
var p1TaskList = this.createTasksP1;
var p1Tasks = p1TaskList.list;
var p2TaskList = this.createTasksP2;
var p2Tasks = p2TaskList.list;
var destroyTasks = this.destroyTasks;
var frameStart = new Date().getTime();
var duration = (new Date().getTime()) - frameStart;
// 16ms is 60 fps
var noMaxMillis = millis <= 0;
while (noMaxMillis || duration < millis) {
var task = void 0;
if (p1Tasks.length) {
this.sortTaskList(p1TaskList);
task = p1Tasks.pop().task;
}
else if (p2Tasks.length) {
this.sortTaskList(p2TaskList);
task = p2Tasks.pop().task;
}
else if (destroyTasks.length) {
task = destroyTasks.pop();
}
else {
this.cancelledTasks.clear();
break;
}
if (!this.cancelledTasks.has(task)) {
task();
}
duration = (new Date().getTime()) - frameStart;
}
if (p1Tasks.length || p2Tasks.length || destroyTasks.length) {
this.requestFrame();
}
else {
this.stopTicking();
}
};
AnimationFrameService.prototype.stopTicking = function () {
this.ticking = false;
var event = {
type: _eventKeys__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_ANIMATION_QUEUE_EMPTY,
columnApi: this.gridOptionsWrapper.getColumnApi(),
api: this.gridOptionsWrapper.getApi()
};
this.eventService.dispatchEvent(event);
};
AnimationFrameService.prototype.flushAllFrames = function () {
if (!this.useAnimationFrame) {
return;
}
this.executeFrame(-1);
};
AnimationFrameService.prototype.schedule = function () {
if (!this.useAnimationFrame) {
return;
}
if (!this.ticking) {
this.ticking = true;
this.requestFrame();
}
};
AnimationFrameService.prototype.requestFrame = function () {
// check for the existence of requestAnimationFrame, and if
// it's missing, then we polyfill it with setTimeout()
var callback = this.executeFrame.bind(this, 60);
if (window.requestAnimationFrame) {
window.requestAnimationFrame(callback);
}
else if (window.webkitRequestAnimationFrame) {
window.webkitRequestAnimationFrame(callback);
}
else {
window.setTimeout(callback, 0);
}
};
AnimationFrameService.prototype.isQueueEmpty = function () {
return !this.ticking;
};
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_0__["PostConstruct"]
], AnimationFrameService.prototype, "init", null);
AnimationFrameService = __decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('animationFrameService')
], AnimationFrameService);
return AnimationFrameService;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_2__["BeanStub"]));
/***/ }),
/* 168 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NavigationService", function() { return NavigationService; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20);
/* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7);
/* harmony import */ var _utils_array__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(14);
/* harmony import */ var _constants_keyCode__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(58);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 NavigationService = /** @class */ (function (_super) {
__extends(NavigationService, _super);
function NavigationService() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.timeLastPageEventProcessed = 0;
return _this;
}
NavigationService.prototype.registerGridComp = function (gridPanel) {
this.gridPanel = gridPanel;
};
NavigationService.prototype.handlePageScrollingKey = function (event) {
var key = event.which || event.keyCode;
var alt = event.altKey;
var ctrl = event.ctrlKey;
var currentCell = this.mouseEventService.getCellPositionForEvent(event);
if (!currentCell) {
return false;
}
var processed = false;
switch (key) {
case _constants_keyCode__WEBPACK_IMPORTED_MODULE_4__["KeyCode"].PAGE_HOME:
case _constants_keyCode__WEBPACK_IMPORTED_MODULE_4__["KeyCode"].PAGE_END:
// handle home and end when ctrl & alt are NOT pressed
if (!ctrl && !alt) {
this.onHomeOrEndKey(key);
processed = true;
}
break;
case _constants_keyCode__WEBPACK_IMPORTED_MODULE_4__["KeyCode"].LEFT:
case _constants_keyCode__WEBPACK_IMPORTED_MODULE_4__["KeyCode"].RIGHT:
// handle left and right when ctrl is pressed only
if (ctrl && !alt) {
this.onCtrlLeftOrRight(key, currentCell);
processed = true;
}
break;
case _constants_keyCode__WEBPACK_IMPORTED_MODULE_4__["KeyCode"].UP:
case _constants_keyCode__WEBPACK_IMPORTED_MODULE_4__["KeyCode"].DOWN:
// handle up and down when ctrl is pressed only
if (ctrl && !alt) {
this.onCtrlUpOrDown(key, currentCell);
processed = true;
}
break;
case _constants_keyCode__WEBPACK_IMPORTED_MODULE_4__["KeyCode"].PAGE_DOWN:
// handle page up and page down when ctrl & alt are NOT pressed
if (!ctrl && !alt) {
this.onPageDown(currentCell);
processed = true;
}
break;
case _constants_keyCode__WEBPACK_IMPORTED_MODULE_4__["KeyCode"].PAGE_UP:
// handle page up and page down when ctrl & alt are NOT pressed
if (!ctrl && !alt) {
this.onPageUp(currentCell);
processed = true;
}
break;
}
if (processed) {
event.preventDefault();
}
return processed;
};
// the page up/down keys caused a problem, in that if the user
// held the page up/down key down, lots of events got generated,
// which clogged up the event queue (as they take time to process)
// which in turn froze the grid. Logic below makes sure we wait 100ms
// between processing the page up/down events, so when user has finger
// held down on key, we ignore page up/down events until 100ms has passed,
// which effectively empties the queue of page up/down events.
NavigationService.prototype.isTimeSinceLastPageEventToRecent = function () {
var now = new Date().getTime();
var diff = now - this.timeLastPageEventProcessed;
return (diff < 100);
};
NavigationService.prototype.setTimeLastPageEventProcessed = function () {
this.timeLastPageEventProcessed = new Date().getTime();
};
NavigationService.prototype.onPageDown = function (gridCell) {
if (this.isTimeSinceLastPageEventToRecent()) {
return;
}
var scrollPosition = this.gridPanel.getVScrollPosition();
var scrollbarWidth = this.gridOptionsWrapper.getScrollbarWidth();
var pixelsInOnePage = scrollPosition.bottom - scrollPosition.top;
if (this.gridPanel.isHorizontalScrollShowing()) {
pixelsInOnePage -= scrollbarWidth;
}
var pagingPixelOffset = this.paginationProxy.getPixelOffset();
var currentPageBottomPixel = scrollPosition.top + pixelsInOnePage;
var currentPageBottomRow = this.paginationProxy.getRowIndexAtPixel(currentPageBottomPixel + pagingPixelOffset);
var scrollIndex = currentPageBottomRow;
var currentCellPixel = this.paginationProxy.getRow(gridCell.rowIndex).rowTop;
var nextCellPixel = currentCellPixel + pixelsInOnePage - pagingPixelOffset;
var focusIndex = this.paginationProxy.getRowIndexAtPixel(nextCellPixel + pagingPixelOffset);
var pageLastRow = this.paginationProxy.getPageLastRow();
if (focusIndex > pageLastRow) {
focusIndex = pageLastRow;
}
if (scrollIndex > pageLastRow) {
scrollIndex = pageLastRow;
}
this.navigateTo(scrollIndex, 'top', null, focusIndex, gridCell.column);
this.setTimeLastPageEventProcessed();
};
NavigationService.prototype.onPageUp = function (gridCell) {
if (this.isTimeSinceLastPageEventToRecent()) {
return;
}
var scrollPosition = this.gridPanel.getVScrollPosition();
var scrollbarWidth = this.gridOptionsWrapper.getScrollbarWidth();
var pixelsInOnePage = scrollPosition.bottom - scrollPosition.top;
if (this.gridPanel.isHorizontalScrollShowing()) {
pixelsInOnePage -= scrollbarWidth;
}
var pagingPixelOffset = this.paginationProxy.getPixelOffset();
var currentPageTopPixel = scrollPosition.top;
var currentPageTopRow = this.paginationProxy.getRowIndexAtPixel(currentPageTopPixel + pagingPixelOffset);
var scrollIndex = currentPageTopRow;
var currentRowNode = this.paginationProxy.getRow(gridCell.rowIndex);
var nextCellPixel = currentRowNode.rowTop + currentRowNode.rowHeight - pixelsInOnePage - pagingPixelOffset;
var focusIndex = this.paginationProxy.getRowIndexAtPixel(nextCellPixel + pagingPixelOffset);
var firstRow = this.paginationProxy.getPageFirstRow();
if (focusIndex < firstRow) {
focusIndex = firstRow;
}
if (scrollIndex < firstRow) {
scrollIndex = firstRow;
}
this.navigateTo(scrollIndex, 'bottom', null, focusIndex, gridCell.column);
this.setTimeLastPageEventProcessed();
};
// common logic to navigate. takes parameters:
// scrollIndex - what row to vertically scroll to
// scrollType - what position to put scroll index ie top/bottom
// scrollColumn - what column to horizontally scroll to
// focusIndex / focusColumn - for page up / down, we want to scroll to one row/column, but focus another
NavigationService.prototype.navigateTo = function (scrollIndex, scrollType, scrollColumn, focusIndex, focusColumn) {
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_2__["exists"])(scrollColumn)) {
this.gridPanel.ensureColumnVisible(scrollColumn);
}
if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_2__["exists"])(scrollIndex)) {
this.gridPanel.ensureIndexVisible(scrollIndex, scrollType);
}
// make sure the cell is rendered, needed if we are to focus
this.animationFrameService.flushAllFrames();
// if we don't do this, the range will be left on the last cell, which will leave the last focused cell
// highlighted.
this.focusController.setFocusedCell(focusIndex, focusColumn, null, true);
if (this.rangeController) {
var cellPosition = { rowIndex: focusIndex, rowPinned: null, column: focusColumn };
this.rangeController.setRangeToCell(cellPosition);
}
};
// ctrl + up/down will bring focus to same column, first/last row. no horizontal scrolling.
NavigationService.prototype.onCtrlUpOrDown = function (key, gridCell) {
var upKey = key === _constants_keyCode__WEBPACK_IMPORTED_MODULE_4__["KeyCode"].UP;
var rowIndexToScrollTo = upKey ? 0 : this.paginationProxy.getPageLastRow();
this.navigateTo(rowIndexToScrollTo, null, gridCell.column, rowIndexToScrollTo, gridCell.column);
};
// ctrl + left/right will bring focus to same row, first/last cell. no vertical scrolling.
NavigationService.prototype.onCtrlLeftOrRight = function (key, gridCell) {
var leftKey = key === _constants_keyCode__WEBPACK_IMPORTED_MODULE_4__["KeyCode"].LEFT;
var allColumns = this.columnController.getAllDisplayedColumns();
var columnToSelect = leftKey ? allColumns[0] : Object(_utils_array__WEBPACK_IMPORTED_MODULE_3__["last"])(allColumns);
this.navigateTo(gridCell.rowIndex, null, columnToSelect, gridCell.rowIndex, columnToSelect);
};
// home brings focus to top left cell, end brings focus to bottom right, grid scrolled to bring
// same cell into view (which means either scroll all the way up, or all the way down).
NavigationService.prototype.onHomeOrEndKey = function (key) {
var homeKey = key === _constants_keyCode__WEBPACK_IMPORTED_MODULE_4__["KeyCode"].PAGE_HOME;
var allColumns = this.columnController.getAllDisplayedColumns();
var columnToSelect = homeKey ? allColumns[0] : Object(_utils_array__WEBPACK_IMPORTED_MODULE_3__["last"])(allColumns);
var rowIndexToScrollTo = homeKey ? this.paginationProxy.getPageFirstRow() : this.paginationProxy.getPageLastRow();
this.navigateTo(rowIndexToScrollTo, null, columnToSelect, rowIndexToScrollTo, columnToSelect);
};
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('mouseEventService')
], NavigationService.prototype, "mouseEventService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('paginationProxy')
], NavigationService.prototype, "paginationProxy", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('focusController')
], NavigationService.prototype, "focusController", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('animationFrameService')
], NavigationService.prototype, "animationFrameService", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Optional"])('rangeController')
], NavigationService.prototype, "rangeController", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnController')
], NavigationService.prototype, "columnController", void 0);
NavigationService = __decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('navigationService')
], NavigationService);
return NavigationService;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
/***/ }),
/* 169 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MaxDivHeightScaler", function() { return MaxDivHeightScaler; });
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20);
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12);
/* harmony import */ var _eventKeys__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(24);
/* harmony import */ var _utils_browser__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(43);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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;
};
/**
* This class solves the 'max height' problem, where the user might want to show more data than
* the max div height actually allows.
*/
var MaxDivHeightScaler = /** @class */ (function (_super) {
__extends(MaxDivHeightScaler, _super);
function MaxDivHeightScaler() {
var _this = _super !== null && _super.apply(this, arguments) || this;
// the scrollY position
_this.scrollY = 0;
// how tall the body is
_this.uiBodyHeight = 0;
return _this;
}
MaxDivHeightScaler.prototype.postConstruct = function () {
this.addManagedListener(this.eventService, _eventKeys__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_BODY_HEIGHT_CHANGED, this.updateOffset.bind(this));
this.maxDivHeight = Object(_utils_browser__WEBPACK_IMPORTED_MODULE_3__["getMaxDivHeight"])();
};
MaxDivHeightScaler.prototype.registerGridComp = function (gridPanel) {
this.gridPanel = gridPanel;
};
MaxDivHeightScaler.prototype.isScaling = function () {
return this.scaling;
};
MaxDivHeightScaler.prototype.getOffset = function () {
return this.offset;
};
MaxDivHeightScaler.prototype.updateOffset = function () {
if (!this.scaling) {
return;
}
var newScrollY = this.gridPanel.getVScrollPosition().top;
var newBodyHeight = this.getUiBodyHeight();
var atLeastOneChanged = newScrollY !== this.scrollY || newBodyHeight !== this.uiBodyHeight;
if (atLeastOneChanged) {
this.scrollY = newScrollY;
this.uiBodyHeight = newBodyHeight;
this.calculateOffset();
}
};
MaxDivHeightScaler.prototype.calculateOffset = function () {
this.uiContainerHeight = this.maxDivHeight;
this.pixelsToShave = this.modelHeight - this.uiContainerHeight;
this.maxScrollY = this.uiContainerHeight - this.uiBodyHeight;
var scrollPercent = this.scrollY / this.maxScrollY;
this.setOffset(scrollPercent * this.pixelsToShave);
};
MaxDivHeightScaler.prototype.clearOffset = function () {
this.uiContainerHeight = this.modelHeight;
this.pixelsToShave = 0;
this.setOffset(0);
};
MaxDivHeightScaler.prototype.setOffset = function (newOffset) {
// because we are talking pixels, no point in confusing things with half numbers
var newOffsetFloor = typeof newOffset === 'number' ? Math.floor(newOffset) : null;
if (this.offset === newOffsetFloor) {
return;
}
this.offset = newOffsetFloor;
this.eventService.dispatchEvent({ type: _eventKeys__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_HEIGHT_SCALE_CHANGED });
};
MaxDivHeightScaler.prototype.setModelHeight = function (modelHeight) {
this.modelHeight = modelHeight;
this.scaling = this.maxDivHeight > 0 && modelHeight > this.maxDivHeight;
if (this.scaling) {
this.calculateOffset();
}
else {
this.clearOffset();
}
};
MaxDivHeightScaler.prototype.getUiContainerHeight = function () {
return this.uiContainerHeight;
};
MaxDivHeightScaler.prototype.getRealPixelPosition = function (modelPixel) {
return modelPixel - this.offset;
};
MaxDivHeightScaler.prototype.getUiBodyHeight = function () {
var pos = this.gridPanel.getVScrollPosition();
return pos.bottom - pos.top;
};
MaxDivHeightScaler.prototype.getScrollPositionForPixel = function (rowTop) {
if (this.pixelsToShave <= 0) {
return rowTop;
}
var modelMaxScroll = this.modelHeight - this.getUiBodyHeight();
var scrollPercent = rowTop / modelMaxScroll;
var scrollPixel = this.maxScrollY * scrollPercent;
return scrollPixel;
};
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_1__["PostConstruct"]
], MaxDivHeightScaler.prototype, "postConstruct", null);
MaxDivHeightScaler = __decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Bean"])('maxDivHeightScaler')
], MaxDivHeightScaler);
return MaxDivHeightScaler;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_0__["BeanStub"]));
/***/ }),
/* 170 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SelectableService", function() { return SelectableService; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20);
/* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 SelectableService = /** @class */ (function (_super) {
__extends(SelectableService, _super);
function SelectableService() {
return _super !== null && _super.apply(this, arguments) || this;
}
SelectableService.prototype.init = function () {
this.groupSelectsChildren = this.gridOptionsWrapper.isGroupSelectsChildren();
this.isRowSelectableFunc = this.gridOptionsWrapper.getIsRowSelectableFunc();
};
SelectableService.prototype.updateSelectableAfterGrouping = function (rowNode) {
if (this.isRowSelectableFunc) {
var nextChildrenFunc = function (rowNode) { return rowNode.childrenAfterGroup; };
this.recurseDown(rowNode.childrenAfterGroup, nextChildrenFunc);
}
};
SelectableService.prototype.updateSelectableAfterFiltering = function (rowNode) {
if (this.isRowSelectableFunc) {
var nextChildrenFunc = function (rowNode) { return rowNode.childrenAfterFilter; };
this.recurseDown(rowNode.childrenAfterGroup, nextChildrenFunc);
}
};
SelectableService.prototype.recurseDown = function (children, nextChildrenFunc) {
var _this = this;
children.forEach(function (child) {
if (!child.group) {
return;
} // only interested in groups
if (child.hasChildren()) {
_this.recurseDown(nextChildrenFunc(child), nextChildrenFunc);
}
var rowSelectable;
if (_this.groupSelectsChildren) {
// have this group selectable if at least one direct child is selectable
var firstSelectable = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_2__["find"])(nextChildrenFunc(child), 'selectable', true);
rowSelectable = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_2__["exists"])(firstSelectable);
}
else {
// directly retrieve selectable value from user callback
rowSelectable = _this.isRowSelectableFunc ? _this.isRowSelectableFunc(child) : false;
}
child.setRowSelectable(rowSelectable);
});
};
__decorate([
_context_context__WEBPACK_IMPORTED_MODULE_0__["PostConstruct"]
], SelectableService.prototype, "init", null);
SelectableService = __decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('selectableService')
], SelectableService);
return SelectableService;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
/***/ }),
/* 171 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AutoHeightCalculator", function() { return AutoHeightCalculator; });
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _cellComp__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(102);
/* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(20);
/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(42);
/* harmony import */ var _angularRowUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(108);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 AutoHeightCalculator = /** @class */ (function (_super) {
__extends(AutoHeightCalculator, _super);
function AutoHeightCalculator() {
return _super !== null && _super.apply(this, arguments) || this;
}
AutoHeightCalculator.prototype.registerGridComp = function (gridPanel) {
this.gridPanel = gridPanel;
};
AutoHeightCalculator.prototype.getPreferredHeightForRow = function (rowNode) {
var _this = this;
var eDummyContainer = document.createElement('div');
this.addInRowCssClasses(rowNode, eDummyContainer);
// we put the dummy into the body container, so it will inherit all the
// css styles that the real cells are inheriting
var eBodyContainer = this.gridPanel.getCenterContainer();
eBodyContainer.appendChild(eDummyContainer);
var scopeResult = _angularRowUtils__WEBPACK_IMPORTED_MODULE_4__["AngularRowUtils"].createChildScopeOrNull(rowNode, this.$scope, this.beans.gridOptionsWrapper);
var scope = scopeResult ? scopeResult.scope : undefined;
var scopeDestroyFunc = scopeResult ? scopeResult.scopeDestroyFunc : undefined;
var cellComps = [];
var autoRowHeightCols = this.columnController.getAllAutoRowHeightCols();
var displayedCols = this.columnController.getAllDisplayedColumns();
var visibleAutoRowHeightCols = autoRowHeightCols.filter(function (col) { return displayedCols.indexOf(col) >= 0; });
visibleAutoRowHeightCols.forEach(function (col) {
var cellComp = new _cellComp__WEBPACK_IMPORTED_MODULE_1__["CellComp"](scope, _this.beans, col, rowNode, null, true, false);
cellComp.setParentRow(eDummyContainer);
cellComps.push(cellComp);
});
var template = cellComps.map(function (cellComp) { return cellComp.getCreateTemplate(); }).join(' ');
eDummyContainer.innerHTML = template;
// this gets any cellComps that are using components to put the components in
cellComps.forEach(function (cellComp) { return cellComp.afterAttached(); });
if (scope) {
this.$compile(eDummyContainer)(scope);
}
// we should be able to just take the height of the row at this point, however
// the row isn't expanding to cover the cell heights, i don't know why, i couldn't
// figure it out so instead looking at the individual cells instead
var maxCellHeight = 0;
for (var i = 0; i < eDummyContainer.children.length; i++) {
var child = eDummyContainer.children[i];
if (child.offsetHeight > maxCellHeight) {
maxCellHeight = child.offsetHeight;
}
}
// we are finished with the dummy container, so get rid of it
eBodyContainer.removeChild(eDummyContainer);
cellComps.forEach(function (cellComp) {
// dunno why we need to detach first, doing it here to be consistent with code in RowComp
cellComp.detach();
cellComp.destroy();
});
if (scopeDestroyFunc) {
scopeDestroyFunc();
}
return maxCellHeight;
};
AutoHeightCalculator.prototype.addInRowCssClasses = function (rowNode, eDummyContainer) {
// so any styles on row also get applied in dummy, otherwise
// the content in dummy may differ to the real
var rowIndex = rowNode.rowIndex;
var params = {
rowNode: rowNode,
rowIsEven: rowIndex % 2 === 0,
rowLevel: this.rowCssClassCalculator.calculateRowLevel(rowNode),
firstRowOnPage: rowIndex === this.beans.paginationProxy.getPageFirstRow(),
lastRowOnPage: rowIndex === this.beans.paginationProxy.getPageLastRow(),
printLayout: false,
expandable: rowNode.isExpandable()
};
var classes = this.rowCssClassCalculator.getInitialRowClasses(params);
Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["addCssClass"])(eDummyContainer, classes.join(' '));
};
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('beans')
], AutoHeightCalculator.prototype, "beans", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])("$scope")
], AutoHeightCalculator.prototype, "$scope", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])("columnController")
], AutoHeightCalculator.prototype, "columnController", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])("rowCssClassCalculator")
], AutoHeightCalculator.prototype, "rowCssClassCalculator", void 0);
__decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('$compile')
], AutoHeightCalculator.prototype, "$compile", void 0);
AutoHeightCalculator = __decorate([
Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('autoHeightCalculator')
], AutoHeightCalculator);
return AutoHeightCalculator;
}(_context_beanStub__WEBPACK_IMPORTED_MODULE_2__["BeanStub"]));
/***/ }),
/* 172 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PaginationComp", function() { return PaginationComp; });
/* harmony import */ var _widgets_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(36);
/* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12);
/* harmony import */ var _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(57);
/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(23);
/* harmony import */ var _utils_icon__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(47);
/* harmony import */ var _utils_number__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(28);
/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(42);
/* harmony import */ var _utils_aria__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(44);
/* harmony import */ var _constants_keyCode__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(58);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__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 PaginationComp = /** @class */ (function (_super) {
__extends(PaginationComp, _super);
function PaginationComp() {
var _this = _super.call(this) || this;
_this.previousAndFirstButtonsDisabled = false;
_this.nextButtonDisabled = false;
_this.lastButtonDisabled = false;
return _this;
}
PaginationComp.prototype.postConstruct = function () {
var _this = this;
var isRtl = this.gridOptionsWrapper.isEnableRtl();
this.setTemplate(this.getTemplate());
this.btFirst.insertAdjacentElement('afterbegin', Object(_utils_icon__WEBPACK_IMPORTED_MODULE_5__["createIconNoSpan"])(isRtl ? 'last' : 'first', this.gridOptionsWrapper));
this.btPrevious.insertAdjacentElement('afterbegin', Object(_utils_icon__WEBPACK_IMPORTED_MODULE_5__["createIconNoSpan"])(isRtl ? 'next' : 'previous', this.gridOptionsWrapper));
this.btNext.insertAdjacentElement('afterbegin', Object(_utils_icon__WEBPACK_IMPORTED_MODULE_5__["createIconNoSpan"])(isRtl ? 'previous' : 'next', this.gridOptionsWrapper));
this.btLast.insertAdjacentElement('afterbegin', Object(_utils_icon__WEBPACK_IMPORTED_MODULE_5__["createIconNoSpan"])(isRtl ? 'first' : 'last', this.gridOptionsWrapper));
if (this.rowModel.getType() === _constants_constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].ROW_MODEL_TYPE_SERVER_SIDE) {
this.serverSideRowModel = this.rowModel;
}
var isPaging = this.gridOptionsWrapper.isPagination();
var paginationPanelEnabled = isPaging && !this.gridOptionsWrapper.isSuppressPaginationPanel();
if (!paginationPanelEnabled) {
this.setDisplayed(false);
return;
}
this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_PAGINATION_CHANGED, this.onPaginationChanged.bind(this));
[
{ el: this.btFirst, fn: this.onBtFirst.bind(this) },
{ el: this.btPrevious, fn: this.onBtPrevious.bind(this) },
{ el: this.btNext, fn: this.onBtNext.bind(this) },
{ el: this.btLast, fn: this.onBtLast.bind(this) }
].forEach(function (item) {
var el = item.el, fn = item.fn;
_this.addManagedListener(el, 'click', fn);
_this.addManagedListener(el, 'keydown', function (e) {
if (e.keyCode === _constants_keyCode__WEBPACK_IMPORTED_MODULE_9__["KeyCode"].ENTER || e.keyCode === _constants_keyCode__WEBPACK_IMPORTED_MODULE_9__["KeyCode"].SPACE) {
e.preventDefault();
fn();
}
});
});
this.onPaginationChanged();
};
PaginationComp.prototype.onPaginationChanged = function () {
this.enableOrDisableButtons();
this.updateRowLabels();
this.setCurrentPageLabel();
this.setTotalLabels();
};
PaginationComp.prototype.onBtFirst = function () {
if (!this.previousAndFirstButtonsDisabled) {
this.paginationProxy.goToFirstPage();
}
};
PaginationComp.prototype.setCurrentPageLabel = function () {
var pagesExist = this.paginationProxy.getTotalPages() > 0;
var currentPage = this.paginationProxy.getCurrentPage();
var toDisplay = pagesExist ? currentPage + 1 : 0;
this.lbCurrent.innerHTML = this.formatNumber(toDisplay);
};
PaginationComp.prototype.formatNumber = function (value) {
var userFunc = this.gridOptionsWrapper.getPaginationNumberFormatterFunc();
if (userFunc) {
return userFunc({ value: value });
}
return Object(_utils_number__WEBPACK_IMPORTED_MODULE_6__["formatNumberCommas"])(value);
};
PaginationComp.prototype.getTemplate = function () {
var localeTextFunc = this.gridOptionsWrapper.getLocaleTextFunc();
var strPage = localeTextFunc('page', 'Page');
var strTo = localeTextFunc('to', 'to');
var strOf = localeTextFunc('of', 'of');
var strFirst = localeTextFunc('firstPage', 'First Page');
var strPrevious = localeTextFunc('previousPage', 'Previous Page');
var strNext = localeTextFunc('nextPage', 'Next Page');
var strLast = localeTextFunc('lastPage', 'Last Page');
var compId = this.getCompId();
var summaryDescribedBy = "ag-" + compId + "-first-row ag-" + compId + "-to ag-" + compId + "-last-row ag-" + compId + "-of ag-" + compId + "-row-count";
var descriptionDescribedBy = "ag-" + compId + "-start-page ag-" + compId + "-start-page-number ag-" + compId + "-of-page ag-" + compId + "-of-page-number";
return /* html */ "