ag-grid-community
Version:
Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue
1,421 lines (1,338 loc) • 2.64 MB
JavaScript
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define([], factory);
else if(typeof exports === 'object')
exports["agGrid"] = factory();
else
root["agGrid"] = factory();
})(self, function() {
return /******/ (function() { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ({
/***/ 2074:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.AlignedGridsModule = void 0;
const version_1 = __webpack_require__(7205);
const alignedGridsService_1 = __webpack_require__(8963);
/**
* @feature Other -> Aligned Grids
* @gridOption alignedGrids
*/
exports.AlignedGridsModule = {
moduleName: 'AlignedGrids',
version: version_1.VERSION,
beans: [alignedGridsService_1.AlignedGridsService],
};
/***/ }),
/***/ 8963:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.AlignedGridsService = void 0;
const columnStateUtils_1 = __webpack_require__(2885);
const beanStub_1 = __webpack_require__(8731);
const logging_1 = __webpack_require__(7764);
class AlignedGridsService extends beanStub_1.BeanStub {
constructor() {
super(...arguments);
this.beanName = 'alignedGridsSvc';
// 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;
}
getAlignedGridApis() {
let alignedGrids = this.gos.get('alignedGrids') ?? [];
const isCallbackConfig = typeof alignedGrids === 'function';
if (typeof alignedGrids === 'function') {
alignedGrids = alignedGrids();
}
const apis = alignedGrids
.map((alignedGrid) => {
if (!alignedGrid) {
(0, logging_1._error)(18);
if (!isCallbackConfig) {
(0, logging_1._error)(20);
}
return;
}
if (this.isGridApi(alignedGrid)) {
return alignedGrid;
}
// Extract the GridApi from a ref or component
const refOrComp = alignedGrid;
if ('current' in refOrComp) {
return refOrComp.current?.api;
}
if (!refOrComp.api) {
(0, logging_1._error)(19);
}
return refOrComp.api;
})
.filter((api) => !!api && !api.isDestroyed());
return apis;
}
isGridApi(ref) {
return !!ref && !!ref.dispatchEvent;
}
postConstruct() {
const fireColumnEvent = this.fireColumnEvent.bind(this);
this.addManagedEventListeners({
columnMoved: fireColumnEvent,
columnVisible: fireColumnEvent,
columnPinned: fireColumnEvent,
columnGroupOpened: fireColumnEvent,
columnResized: fireColumnEvent,
bodyScroll: this.fireScrollEvent.bind(this),
alignedGridColumn: ({ event }) => this.onColumnEvent(event),
alignedGridScroll: ({ event }) => this.onScrollEvent(event),
});
}
// common logic across all the fire methods
fireEvent(event) {
// 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;
}
this.getAlignedGridApis().forEach((api) => {
if (api.isDestroyed()) {
return;
}
api.dispatchEvent(event);
});
}
// common logic across all consume methods. very little common logic, however extracting
// guarantees consistency across the methods.
onEvent(callback) {
this.consuming = true;
callback();
this.consuming = false;
}
fireColumnEvent(columnEvent) {
this.fireEvent({
type: 'alignedGridColumn',
event: columnEvent,
});
}
fireScrollEvent(scrollEvent) {
if (scrollEvent.direction !== 'horizontal') {
return;
}
this.fireEvent({
type: 'alignedGridScroll',
event: scrollEvent,
});
}
onScrollEvent(event) {
this.onEvent(() => {
this.beans.ctrlsSvc.getScrollFeature().setHorizontalScrollPosition(event.left, true);
});
}
extractDataFromEvent(event, func) {
const result = [];
if (event.columns) {
event.columns.forEach((column) => {
result.push(func(column));
});
}
else if (event.column) {
result.push(func(event.column));
}
return result;
}
getMasterColumns(event) {
return this.extractDataFromEvent(event, (col) => col);
}
getColumnIds(event) {
return this.extractDataFromEvent(event, (col) => col.getColId());
}
onColumnEvent(event) {
this.onEvent(() => {
switch (event.type) {
case 'columnMoved':
case 'columnVisible':
case 'columnPinned':
case 'columnResized': {
this.processColumnEvent(event);
break;
}
case 'columnGroupOpened': {
this.processGroupOpenedEvent(event);
break;
}
case 'columnPivotChanged':
// 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.
(0, logging_1._warn)(21);
break;
}
});
}
processGroupOpenedEvent(groupOpenedEvent) {
const { colGroupSvc } = this.beans;
if (!colGroupSvc) {
return;
}
groupOpenedEvent.columnGroups.forEach((masterGroup) => {
// likewise for column group
let otherColumnGroup = null;
if (masterGroup) {
otherColumnGroup = colGroupSvc.getProvidedColGroup(masterGroup.getGroupId());
}
if (masterGroup && !otherColumnGroup) {
return;
}
colGroupSvc.setColumnGroupOpened(otherColumnGroup, masterGroup.isExpanded(), 'alignedGridChanged');
});
}
processColumnEvent(colEvent) {
// the column in the event is from the master grid. need to
// look up the equivalent from this (other) grid
const masterColumn = colEvent.column;
let otherColumn = null;
const beans = this.beans;
const { colResize, ctrlsSvc, colModel } = beans;
if (masterColumn) {
otherColumn = colModel.getColDefCol(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
const masterColumns = this.getMasterColumns(colEvent);
switch (colEvent.type) {
case 'columnMoved':
// when the user moves columns via applyColumnState, we can't depend on moving specific columns
// to an index, as there maybe be many indexes columns moved to (as wasn't result of a mouse drag).
// so only way to be sure is match the order of all columns using Column State.
{
const srcColState = colEvent.api.getColumnState();
const destColState = srcColState.map((s) => ({ colId: s.colId }));
(0, columnStateUtils_1._applyColumnState)(beans, { state: destColState, applyOrder: true }, 'alignedGridChanged');
}
break;
case 'columnVisible':
// when the user changes visibility via applyColumnState, we can't depend on visibility flag in event
// as there maybe be mix of true/false (as wasn't result of a mouse click to set visiblity).
// so only way to be sure is match the visibility of all columns using Column State.
{
const srcColState = colEvent.api.getColumnState();
const destColState = srcColState.map((s) => ({ colId: s.colId, hide: s.hide }));
(0, columnStateUtils_1._applyColumnState)(beans, { state: destColState }, 'alignedGridChanged');
}
break;
case 'columnPinned':
{
const srcColState = colEvent.api.getColumnState();
const destColState = srcColState.map((s) => ({ colId: s.colId, pinned: s.pinned }));
(0, columnStateUtils_1._applyColumnState)(beans, { state: destColState }, 'alignedGridChanged');
}
break;
case 'columnResized': {
const resizedEvent = colEvent;
const columnWidths = {};
masterColumns.forEach((column) => {
columnWidths[column.getId()] = { key: column.getColId(), newWidth: column.getActualWidth() };
});
// don't set flex columns width
resizedEvent.flexColumns?.forEach((col) => {
if (columnWidths[col.getId()]) {
delete columnWidths[col.getId()];
}
});
colResize?.setColumnWidths(Object.values(columnWidths), false, resizedEvent.finished, 'alignedGridChanged');
break;
}
}
const gridBodyCon = ctrlsSvc.getGridBodyCtrl();
const isVerticalScrollShowing = gridBodyCon.isVerticalScrollShowing();
this.getAlignedGridApis().forEach((api) => {
api.setGridOption('alwaysShowVerticalScroll', isVerticalScrollShowing);
});
}
}
exports.AlignedGridsService = AlignedGridsService;
/***/ }),
/***/ 1621:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.AllCommunityModule = void 0;
const alignedGridsModule_1 = __webpack_require__(2074);
const apiModule_1 = __webpack_require__(9642);
const clientSideRowModelModule_1 = __webpack_require__(9722);
const clientSideRowModelModule_2 = __webpack_require__(9722);
const columnAutosizeModule_1 = __webpack_require__(3856);
const columnHoverModule_1 = __webpack_require__(1690);
const columnModule_1 = __webpack_require__(2027);
const csvExportModule_1 = __webpack_require__(9734);
const dragModule_1 = __webpack_require__(4388);
const editModule_1 = __webpack_require__(4652);
const filterModule_1 = __webpack_require__(5432);
const infiniteRowModelModule_1 = __webpack_require__(4002);
const apiEventModule_1 = __webpack_require__(9410);
const localeModule_1 = __webpack_require__(9519);
const stateModule_1 = __webpack_require__(6989);
const paginationModule_1 = __webpack_require__(1824);
const pinnedRowModule_1 = __webpack_require__(5423);
const highlightChangesModule_1 = __webpack_require__(3498);
const renderModule_1 = __webpack_require__(6964);
const rowAutoHeightModule_1 = __webpack_require__(4577);
const cellSpanModule_1 = __webpack_require__(4265);
const rowSelectionModule_1 = __webpack_require__(3352);
const stylingModule_1 = __webpack_require__(8594);
const tooltipModule_1 = __webpack_require__(2277);
const validationModule_1 = __webpack_require__(5010);
const valueModule_1 = __webpack_require__(6431);
const version_1 = __webpack_require__(7205);
/**
* @feature All Community Features
*/
exports.AllCommunityModule = {
moduleName: 'AllCommunity',
version: version_1.VERSION,
dependsOn: [
clientSideRowModelModule_1.ClientSideRowModelModule,
csvExportModule_1.CsvExportModule,
infiniteRowModelModule_1.InfiniteRowModelModule,
validationModule_1.ValidationModule,
editModule_1.TextEditorModule,
editModule_1.NumberEditorModule,
editModule_1.DateEditorModule,
editModule_1.CheckboxEditorModule,
editModule_1.SelectEditorModule,
editModule_1.LargeTextEditorModule,
editModule_1.CustomEditorModule,
editModule_1.UndoRedoEditModule,
filterModule_1.TextFilterModule,
filterModule_1.NumberFilterModule,
filterModule_1.DateFilterModule,
filterModule_1.CustomFilterModule,
filterModule_1.QuickFilterModule,
filterModule_1.ExternalFilterModule,
stateModule_1.GridStateModule,
alignedGridsModule_1.AlignedGridsModule,
paginationModule_1.PaginationModule,
columnModule_1.ColumnApiModule,
apiModule_1.RowApiModule,
apiModule_1.ScrollApiModule,
renderModule_1.RenderApiModule,
columnAutosizeModule_1.ColumnAutoSizeModule,
dragModule_1.RowDragModule,
pinnedRowModule_1.PinnedRowModule,
rowSelectionModule_1.RowSelectionModule,
valueModule_1.ValueCacheModule,
stylingModule_1.CellStyleModule,
columnHoverModule_1.ColumnHoverModule,
stylingModule_1.RowStyleModule,
apiEventModule_1.EventApiModule,
valueModule_1.CellApiModule,
highlightChangesModule_1.HighlightChangesModule,
tooltipModule_1.TooltipModule,
localeModule_1.LocaleModule,
rowAutoHeightModule_1.RowAutoHeightModule,
dragModule_1.DragAndDropModule,
clientSideRowModelModule_2.ClientSideRowModelApiModule,
cellSpanModule_1.CellSpanModule,
],
};
/***/ }),
/***/ 3907:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.ApiFunctionService = void 0;
const beanStub_1 = __webpack_require__(8731);
const logging_1 = __webpack_require__(7764);
const gridApiFunctions_1 = __webpack_require__(7689);
const defaultFns = {
isDestroyed: () => true,
destroy() { },
preConstruct() { },
postConstruct() { },
preWireBeans() { },
wireBeans() { },
};
const dispatchEvent = (beans, event) => beans.eventSvc.dispatchEvent(event);
// We use a class for AGGridApi so in stack traces calling grid.api.xxx() if an error is thrown it will print "GridApi.xxx"
class GridApiClass {
}
Reflect.defineProperty(GridApiClass, 'name', { value: 'GridApi' });
class ApiFunctionService extends beanStub_1.BeanStub {
constructor() {
super();
this.beanName = 'apiFunctionSvc';
this.api = new GridApiClass();
this.fns = {
...defaultFns,
// dispatchEvent is used by frameworks, also used by aligned grids to identify a grid api instance
dispatchEvent,
};
this.preDestroyLink = '';
const { api } = this;
for (const key of Object.keys(gridApiFunctions_1.gridApiFunctionsMap)) {
api[key] = this.makeApi(key)[key];
}
}
postConstruct() {
this.preDestroyLink = this.beans.frameworkOverrides.getDocLink('grid-lifecycle/#grid-pre-destroyed');
}
addFunction(functionName, func) {
const { fns, beans } = this;
if (fns !== defaultFns) {
fns[functionName] = beans?.validation?.validateApiFunction(functionName, func) ?? func;
}
}
makeApi(apiName) {
// We return an object here to be sure the function name is properly applied,
// in this way error stack trace are correct and gridApi.xxx.name === 'xxx'
// This is generally faster than using Object.defineProperty(gridApi, apiName, { value: apiName, configurable: true });
// Keep this function as light and simple as possible.
return {
[apiName]: (...args) => {
const { beans, fns: { [apiName]: fn }, } = this;
return fn ? fn(beans, ...args) : this.apiNotFound(apiName);
},
};
}
apiNotFound(fnName) {
const { beans, gos, preDestroyLink } = this;
if (!beans) {
(0, logging_1._warn)(26, { fnName, preDestroyLink });
}
else {
const module = gridApiFunctions_1.gridApiFunctionsMap[fnName];
if (gos.assertModuleRegistered(module, `api.${fnName}`)) {
(0, logging_1._warn)(27, { fnName, module });
}
}
}
destroy() {
super.destroy();
this.fns = defaultFns;
this.beans = null;
}
}
exports.ApiFunctionService = ApiFunctionService;
/***/ }),
/***/ 9642:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.ScrollApiModule = exports.RowApiModule = void 0;
const version_1 = __webpack_require__(7205);
const rowApi_1 = __webpack_require__(8192);
const scrollApi_1 = __webpack_require__(1765);
/**
* @feature Rows
*/
exports.RowApiModule = {
moduleName: 'RowApi',
version: version_1.VERSION,
apiFunctions: {
redrawRows: rowApi_1.redrawRows,
setRowNodeExpanded: rowApi_1.setRowNodeExpanded,
getRowNode: rowApi_1.getRowNode,
addRenderedRowListener: rowApi_1.addRenderedRowListener,
getRenderedNodes: rowApi_1.getRenderedNodes,
forEachNode: rowApi_1.forEachNode,
getFirstDisplayedRowIndex: rowApi_1.getFirstDisplayedRowIndex,
getLastDisplayedRowIndex: rowApi_1.getLastDisplayedRowIndex,
getDisplayedRowAtIndex: rowApi_1.getDisplayedRowAtIndex,
getDisplayedRowCount: rowApi_1.getDisplayedRowCount,
},
};
/**
* @feature Scrolling
*/
exports.ScrollApiModule = {
moduleName: 'ScrollApi',
version: version_1.VERSION,
apiFunctions: {
getVerticalPixelRange: scrollApi_1.getVerticalPixelRange,
getHorizontalPixelRange: scrollApi_1.getHorizontalPixelRange,
ensureColumnVisible: scrollApi_1.ensureColumnVisible,
ensureIndexVisible: scrollApi_1.ensureIndexVisible,
ensureNodeVisible: scrollApi_1.ensureNodeVisible,
},
};
/***/ }),
/***/ 6433:
/***/ (function(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.createGridApi = void 0;
function createGridApi(context) {
return {
beanName: 'gridApi',
bean: context.getBean('apiFunctionSvc').api,
};
}
exports.createGridApi = createGridApi;
/***/ }),
/***/ 9875:
/***/ (function(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.isModuleRegistered = exports.updateGridOptions = exports.setGridOption = exports.getGridOption = exports.isDestroyed = exports.destroy = exports.getGridId = void 0;
function getGridId(beans) {
return beans.context.getGridId();
}
exports.getGridId = getGridId;
function destroy(beans) {
beans.gridDestroySvc.destroy();
}
exports.destroy = destroy;
function isDestroyed(beans) {
return beans.gridDestroySvc.destroyCalled;
}
exports.isDestroyed = isDestroyed;
function getGridOption(beans, key) {
return beans.gos.get(key);
}
exports.getGridOption = getGridOption;
function setGridOption(beans, key, value) {
updateGridOptions(beans, { [key]: value });
}
exports.setGridOption = setGridOption;
function updateGridOptions(beans, options) {
// NOTE: The TDataUpdate generic is used to ensure that the update options match the generic passed into the GridApi above as TData.
// This is required because if we just use TData directly then Typescript will get into an infinite loop due to callbacks which recursively include the GridApi.
beans.gos.updateGridOptions({ options });
}
exports.updateGridOptions = updateGridOptions;
function isModuleRegistered(beans, moduleName) {
const withoutSuffix = moduleName.replace(/Module$/, '');
return beans.gos.isModuleRegistered(withoutSuffix);
}
exports.isModuleRegistered = isModuleRegistered;
/***/ }),
/***/ 9513:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.onRowHeightChanged = exports.collapseAll = exports.expandAll = void 0;
const rowModelApiUtils_1 = __webpack_require__(6876);
function expandAll(beans) {
beans.expansionSvc?.expandAll(true);
}
exports.expandAll = expandAll;
function collapseAll(beans) {
beans.expansionSvc?.expandAll(false);
}
exports.collapseAll = collapseAll;
function onRowHeightChanged(beans) {
const clientSideRowModel = (0, rowModelApiUtils_1._getClientSideRowModel)(beans);
const serverSideRowModel = (0, rowModelApiUtils_1._getServerSideRowModel)(beans);
if (clientSideRowModel) {
clientSideRowModel.onRowHeightChanged();
}
else if (serverSideRowModel) {
serverSideRowModel.onRowHeightChanged();
}
}
exports.onRowHeightChanged = onRowHeightChanged;
/***/ }),
/***/ 7689:
/***/ (function(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.gridApiFunctionsMap = void 0;
const mod = (moduleName, input) => {
for (const key of Object.keys(input)) {
input[key] = moduleName;
}
return input;
};
exports.gridApiFunctionsMap = {
dispatchEvent: 'CommunityCore',
...mod('CommunityCore', {
destroy: 0,
getGridId: 0,
getGridOption: 0,
isDestroyed: 0,
setGridOption: 0,
updateGridOptions: 0,
isModuleRegistered: 0,
}),
...mod('GridState', {
getState: 0,
}),
...mod('SharedRowSelection', {
setNodesSelected: 0,
selectAll: 0,
deselectAll: 0,
selectAllFiltered: 0,
deselectAllFiltered: 0,
selectAllOnCurrentPage: 0,
deselectAllOnCurrentPage: 0,
getSelectedNodes: 0,
getSelectedRows: 0,
}),
...mod('RowApi', {
redrawRows: 0,
setRowNodeExpanded: 0,
getRowNode: 0,
addRenderedRowListener: 0,
getRenderedNodes: 0,
forEachNode: 0,
getFirstDisplayedRowIndex: 0,
getLastDisplayedRowIndex: 0,
getDisplayedRowAtIndex: 0,
getDisplayedRowCount: 0,
}),
...mod('ScrollApi', {
getVerticalPixelRange: 0,
getHorizontalPixelRange: 0,
ensureColumnVisible: 0,
ensureIndexVisible: 0,
ensureNodeVisible: 0,
}),
...mod('KeyboardNavigation', {
getFocusedCell: 0,
clearFocusedCell: 0,
setFocusedCell: 0,
tabToNextCell: 0,
tabToPreviousCell: 0,
setFocusedHeader: 0,
}),
...mod('EventApi', {
addEventListener: 0,
addGlobalListener: 0,
removeEventListener: 0,
removeGlobalListener: 0,
}),
...mod('ValueCache', {
expireValueCache: 0,
}),
...mod('CellApi', {
getCellValue: 0,
}),
...mod('SharedMenu', {
showColumnMenu: 0,
hidePopupMenu: 0,
}),
...mod('Sort', {
onSortChanged: 0,
}),
...mod('PinnedRow', {
getPinnedTopRowCount: 0,
getPinnedBottomRowCount: 0,
getPinnedTopRow: 0,
getPinnedBottomRow: 0,
forEachPinnedRow: 0,
}),
...mod('Overlay', {
showLoadingOverlay: 0,
showNoRowsOverlay: 0,
hideOverlay: 0,
}),
...mod('RenderApi', {
setGridAriaProperty: 0,
refreshCells: 0,
refreshHeader: 0,
isAnimationFrameQueueEmpty: 0,
flushAllAnimationFrames: 0,
getSizesForCurrentTheme: 0,
getCellRendererInstances: 0,
}),
...mod('HighlightChanges', {
flashCells: 0,
}),
...mod('RowDrag', {
addRowDropZone: 0,
removeRowDropZone: 0,
getRowDropZoneParams: 0,
}),
...mod('ColumnApi', {
getColumnDefs: 0,
getColumnDef: 0,
getDisplayNameForColumn: 0,
getColumn: 0,
getColumns: 0,
applyColumnState: 0,
getColumnState: 0,
resetColumnState: 0,
isPinning: 0,
isPinningLeft: 0,
isPinningRight: 0,
getDisplayedColAfter: 0,
getDisplayedColBefore: 0,
setColumnsVisible: 0,
setColumnsPinned: 0,
getAllGridColumns: 0,
getDisplayedLeftColumns: 0,
getDisplayedCenterColumns: 0,
getDisplayedRightColumns: 0,
getAllDisplayedColumns: 0,
getAllDisplayedVirtualColumns: 0,
}),
...mod('ColumnAutoSize', {
sizeColumnsToFit: 0,
autoSizeColumns: 0,
autoSizeAllColumns: 0,
}),
...mod('ColumnGroup', {
setColumnGroupOpened: 0,
getColumnGroup: 0,
getProvidedColumnGroup: 0,
getDisplayNameForColumnGroup: 0,
getColumnGroupState: 0,
setColumnGroupState: 0,
resetColumnGroupState: 0,
getLeftDisplayedColumnGroups: 0,
getCenterDisplayedColumnGroups: 0,
getRightDisplayedColumnGroups: 0,
getAllDisplayedColumnGroups: 0,
}),
...mod('ColumnMove', {
moveColumnByIndex: 0,
moveColumns: 0,
}),
...mod('ColumnResize', {
setColumnWidths: 0,
}),
...mod('ColumnHover', {
isColumnHovered: 0,
}),
...mod('EditCore', {
getCellEditorInstances: 0,
getEditingCells: 0,
stopEditing: 0,
startEditingCell: 0,
}),
...mod('UndoRedoEdit', {
undoCellEditing: 0,
redoCellEditing: 0,
getCurrentUndoSize: 0,
getCurrentRedoSize: 0,
}),
...mod('FilterCore', {
isAnyFilterPresent: 0,
onFilterChanged: 0,
}),
...mod('ColumnFilter', {
isColumnFilterPresent: 0,
getColumnFilterInstance: 0,
destroyFilter: 0,
setFilterModel: 0,
getFilterModel: 0,
getColumnFilterModel: 0,
setColumnFilterModel: 0,
showColumnFilter: 0,
}),
...mod('QuickFilter', {
isQuickFilterPresent: 0,
getQuickFilter: 0,
resetQuickFilter: 0,
}),
...mod('Find', {
findGetActiveMatch: 0,
findGetTotalMatches: 0,
findGoTo: 0,
findNext: 0,
findPrevious: 0,
findGetNumMatches: 0,
findGetParts: 0,
findClearActive: 0,
findRefresh: 0,
}),
...mod('Pagination', {
paginationIsLastPageFound: 0,
paginationGetPageSize: 0,
paginationGetCurrentPage: 0,
paginationGetTotalPages: 0,
paginationGetRowCount: 0,
paginationGoToNextPage: 0,
paginationGoToPreviousPage: 0,
paginationGoToFirstPage: 0,
paginationGoToLastPage: 0,
paginationGoToPage: 0,
}),
...mod('CsrmSsrmSharedApi', {
expandAll: 0,
collapseAll: 0,
onRowHeightChanged: 0,
}),
...mod('SsrmInfiniteSharedApi', {
setRowCount: 0,
getCacheBlockState: 0,
isLastRowIndexKnown: 0,
}),
...mod('ClientSideRowModelApi', {
onGroupExpandedOrCollapsed: 0,
refreshClientSideRowModel: 0,
isRowDataEmpty: 0,
forEachLeafNode: 0,
forEachNodeAfterFilter: 0,
forEachNodeAfterFilterAndSort: 0,
resetRowHeights: 0,
applyTransaction: 0,
applyTransactionAsync: 0,
flushAsyncTransactions: 0,
getBestCostNodeSelection: 0,
}),
...mod('CsvExport', {
getDataAsCsv: 0,
exportDataAsCsv: 0,
}),
...mod('InfiniteRowModel', {
refreshInfiniteCache: 0,
purgeInfiniteCache: 0,
getInfiniteRowCount: 0,
}),
...mod('AdvancedFilter', {
getAdvancedFilterModel: 0,
setAdvancedFilterModel: 0,
showAdvancedFilterBuilder: 0,
hideAdvancedFilterBuilder: 0,
}),
...mod('IntegratedCharts', {
getChartModels: 0,
getChartRef: 0,
getChartImageDataURL: 0,
downloadChart: 0,
openChartToolPanel: 0,
closeChartToolPanel: 0,
createRangeChart: 0,
createPivotChart: 0,
createCrossFilterChart: 0,
updateChart: 0,
restoreChart: 0,
}),
...mod('Clipboard', {
copyToClipboard: 0,
cutToClipboard: 0,
copySelectedRowsToClipboard: 0,
copySelectedRangeToClipboard: 0,
copySelectedRangeDown: 0,
pasteFromClipboard: 0,
}),
...mod('ExcelExport', {
getDataAsExcel: 0,
exportDataAsExcel: 0,
getSheetDataForExcel: 0,
getMultipleSheetsAsExcel: 0,
exportMultipleSheetsAsExcel: 0,
}),
...mod('SharedMasterDetail', {
addDetailGridInfo: 0,
removeDetailGridInfo: 0,
getDetailGridInfo: 0,
forEachDetailGridInfo: 0,
}),
...mod('ContextMenu', {
showContextMenu: 0,
}),
...mod('ColumnMenu', {
showColumnChooser: 0,
hideColumnChooser: 0,
}),
...mod('CellSelection', {
getCellRanges: 0,
addCellRange: 0,
clearRangeSelection: 0,
clearCellSelection: 0,
}),
...mod('SharedRowGrouping', {
setRowGroupColumns: 0,
removeRowGroupColumns: 0,
addRowGroupColumns: 0,
getRowGroupColumns: 0,
moveRowGroupColumn: 0,
}),
...mod('SharedAggregation', {
addAggFuncs: 0,
clearAggFuncs: 0,
setColumnAggFunc: 0,
}),
...mod('SharedPivot', {
isPivotMode: 0,
getPivotResultColumn: 0,
setValueColumns: 0,
getValueColumns: 0,
removeValueColumns: 0,
addValueColumns: 0,
setPivotColumns: 0,
removePivotColumns: 0,
addPivotColumns: 0,
getPivotColumns: 0,
setPivotResultColumns: 0,
getPivotResultColumns: 0,
}),
...mod('ServerSideRowModelApi', {
getServerSideSelectionState: 0,
setServerSideSelectionState: 0,
applyServerSideTransaction: 0,
applyServerSideTransactionAsync: 0,
applyServerSideRowData: 0,
retryServerSideLoads: 0,
flushServerSideAsyncTransactions: 0,
refreshServerSide: 0,
getServerSideGroupLevelState: 0,
}),
...mod('SideBar', {
isSideBarVisible: 0,
setSideBarVisible: 0,
setSideBarPosition: 0,
openToolPanel: 0,
closeToolPanel: 0,
getOpenedToolPanel: 0,
refreshToolPanel: 0,
isToolPanelShowing: 0,
getToolPanelInstance: 0,
getSideBar: 0,
}),
...mod('StatusBar', {
getStatusPanel: 0,
}),
};
/***/ }),
/***/ 8192:
/***/ (function(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.getDisplayedRowCount = exports.getDisplayedRowAtIndex = exports.getLastDisplayedRowIndex = exports.getFirstDisplayedRowIndex = exports.forEachNode = exports.getRenderedNodes = exports.addRenderedRowListener = exports.getRowNode = exports.setRowNodeExpanded = exports.redrawRows = void 0;
function redrawRows(beans, params = {}) {
const rowNodes = params ? params.rowNodes : undefined;
beans.frameworkOverrides.wrapIncoming(() => beans.rowRenderer.redrawRows(rowNodes));
}
exports.redrawRows = redrawRows;
function setRowNodeExpanded(beans, rowNode, expanded, expandParents, forceSync) {
if (rowNode) {
// expand all parents recursively, except root node.
if (expandParents && rowNode.parent && rowNode.parent.level !== -1) {
setRowNodeExpanded(beans, rowNode.parent, expanded, expandParents, forceSync);
}
rowNode.setExpanded(expanded, undefined, forceSync);
}
}
exports.setRowNodeExpanded = setRowNodeExpanded;
function getRowNode(beans, id) {
return beans.rowModel.getRowNode(id);
}
exports.getRowNode = getRowNode;
function addRenderedRowListener(beans, eventName, rowIndex, callback) {
beans.rowRenderer.addRenderedRowListener(eventName, rowIndex, callback);
}
exports.addRenderedRowListener = addRenderedRowListener;
function getRenderedNodes(beans) {
return beans.rowRenderer.getRenderedNodes();
}
exports.getRenderedNodes = getRenderedNodes;
function forEachNode(beans, callback, includeFooterNodes) {
beans.rowModel.forEachNode(callback, includeFooterNodes);
}
exports.forEachNode = forEachNode;
function getFirstDisplayedRowIndex(beans) {
return beans.rowRenderer.firstRenderedRow;
}
exports.getFirstDisplayedRowIndex = getFirstDisplayedRowIndex;
function getLastDisplayedRowIndex(beans) {
return beans.rowRenderer.lastRenderedRow;
}
exports.getLastDisplayedRowIndex = getLastDisplayedRowIndex;
function getDisplayedRowAtIndex(beans, index) {
return beans.rowModel.getRow(index);
}
exports.getDisplayedRowAtIndex = getDisplayedRowAtIndex;
function getDisplayedRowCount(beans) {
return beans.rowModel.getRowCount();
}
exports.getDisplayedRowCount = getDisplayedRowCount;
/***/ }),
/***/ 6876:
/***/ (function(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports._getServerSideRowModel = exports._getInfiniteRowModel = exports._getClientSideRowModel = void 0;
function _getClientSideRowModel(beans) {
const rowModel = beans.rowModel;
return rowModel.getType() === 'clientSide' ? rowModel : undefined;
}
exports._getClientSideRowModel = _getClientSideRowModel;
function _getInfiniteRowModel(beans) {
const rowModel = beans.rowModel;
return rowModel.getType() === 'infinite' ? rowModel : undefined;
}
exports._getInfiniteRowModel = _getInfiniteRowModel;
function _getServerSideRowModel(beans) {
const rowModel = beans.rowModel;
return rowModel.getType() === 'serverSide' ? rowModel : undefined;
}
exports._getServerSideRowModel = _getServerSideRowModel;
/***/ }),
/***/ 1765:
/***/ (function(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.ensureNodeVisible = exports.ensureIndexVisible = exports.ensureColumnVisible = exports.getHorizontalPixelRange = exports.getVerticalPixelRange = void 0;
function getVerticalPixelRange(beans) {
return beans.ctrlsSvc.getScrollFeature().getVScrollPosition();
}
exports.getVerticalPixelRange = getVerticalPixelRange;
function getHorizontalPixelRange(beans) {
return beans.ctrlsSvc.getScrollFeature().getHScrollPosition();
}
exports.getHorizontalPixelRange = getHorizontalPixelRange;
function ensureColumnVisible(beans, key, position = 'auto') {
beans.frameworkOverrides.wrapIncoming(() => beans.ctrlsSvc.getScrollFeature().ensureColumnVisible(key, position), 'ensureVisible');
}
exports.ensureColumnVisible = ensureColumnVisible;
function ensureIndexVisible(beans, index, position) {
beans.frameworkOverrides.wrapIncoming(() => beans.ctrlsSvc.getScrollFeature().ensureIndexVisible(index, position), 'ensureVisible');
}
exports.ensureIndexVisible = ensureIndexVisible;
function ensureNodeVisible(beans, nodeSelector, position = null) {
beans.frameworkOverrides.wrapIncoming(() => beans.ctrlsSvc.getScrollFeature().ensureNodeVisible(nodeSelector, position), 'ensureVisible');
}
exports.ensureNodeVisible = ensureNodeVisible;
/***/ }),
/***/ 6437:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.SsrmInfiniteSharedApiModule = exports.CsrmSsrmSharedApiModule = void 0;
const version_1 = __webpack_require__(7205);
const csrmSsrmSharedApi_1 = __webpack_require__(9513);
const ssrmInfiniteSharedApi_1 = __webpack_require__(8496);
// these modules are not used in core, but are shared between multiple other modules
/**
* @internal
*/
exports.CsrmSsrmSharedApiModule = {
moduleName: 'CsrmSsrmSharedApi',
version: version_1.VERSION,
apiFunctions: {
expandAll: csrmSsrmSharedApi_1.expandAll,
collapseAll: csrmSsrmSharedApi_1.collapseAll,
onRowHeightChanged: csrmSsrmSharedApi_1.onRowHeightChanged,
},
};
/**
* @internal
*/
exports.SsrmInfiniteSharedApiModule = {
moduleName: 'SsrmInfiniteSharedApi',
version: version_1.VERSION,
apiFunctions: {
setRowCount: ssrmInfiniteSharedApi_1.setRowCount,
getCacheBlockState: ssrmInfiniteSharedApi_1.getCacheBlockState,
isLastRowIndexKnown: ssrmInfiniteSharedApi_1.isLastRowIndexKnown,
},
};
/***/ }),
/***/ 8496:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.isLastRowIndexKnown = exports.getCacheBlockState = exports.setRowCount = void 0;
const gridOptionsUtils_1 = __webpack_require__(7274);
const logging_1 = __webpack_require__(7764);
const rowModelApiUtils_1 = __webpack_require__(6876);
function setRowCount(beans, rowCount, maxRowFound) {
const serverSideRowModel = (0, rowModelApiUtils_1._getServerSideRowModel)(beans);
if (serverSideRowModel) {
if (beans.rowGroupColsSvc?.columns.length === 0) {
if (rowCount < 0) {
(0, logging_1._error)(238);
return;
}
serverSideRowModel.setRowCount(rowCount, maxRowFound);
return;
}
(0, logging_1._error)(28);
return;
}
const infiniteRowModel = (0, rowModelApiUtils_1._getInfiniteRowModel)(beans);
if (infiniteRowModel) {
infiniteRowModel.setRowCount(rowCount, maxRowFound);
return;
}
}
exports.setRowCount = setRowCount;
function getCacheBlockState(beans) {
if ((0, gridOptionsUtils_1._isServerSideRowModel)(beans.gos)) {
const ssrm = beans.rowModel;
return ssrm.getBlockStates();
}
return beans.rowNodeBlockLoader?.getBlockState() ?? {};
}
exports.getCacheBlockState = getCacheBlockState;
function isLastRowIndexKnown(beans) {
return beans.rowModel.isLastRowIndexKnown();
}
exports.isLastRowIndexKnown = isLastRowIndexKnown;
/***/ }),
/***/ 5628:
/***/ (function(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.AutoScrollService = void 0;
class AutoScrollService {
constructor(params) {
this.tickingInterval = null;
this.onScrollCallback = null;
this.scrollContainer = params.scrollContainer;
this.scrollHorizontally = params.scrollAxis.indexOf('x') !== -1;
this.scrollVertically = params.scrollAxis.indexOf('y') !== -1;
this.scrollByTick = params.scrollByTick != null ? params.scrollByTick : 20;
if (params.onScrollCallback) {
this.onScrollCallback = params.onScrollCallback;
}
if (this.scrollVertically) {
this.getVerticalPosition = params.getVerticalPosition;
this.setVerticalPosition = params.setVerticalPosition;
}
if (this.scrollHorizontally) {
this.getHorizontalPosition = params.getHorizontalPosition;
this.setHorizontalPosition = params.setHorizontalPosition;
}
this.shouldSkipVerticalScroll = params.shouldSkipVerticalScroll || (() => false);
this.shouldSkipHorizontalScroll = params.shouldSkipHorizontalScroll || (() => false);
}
check(mouseEvent, forceSkipVerticalScroll = false) {
const skipVerticalScroll = forceSkipVerticalScroll || this.shouldSkipVerticalScroll();
if (skipVerticalScroll && this.shouldSkipHorizontalScroll()) {
return;
}
const rect = this.scrollContainer.getBoundingClientRect();
const scrollTick = this.scrollByTick;
this.tickLeft = mouseEvent.clientX < rect.left + scrollTick;
this.tickRight = mouseEvent.clientX > rect.right - scrollTick;
this.tickUp = mouseEvent.clientY < rect.top + scrollTick && !skipVerticalScroll;
this.tickDown = mouseEvent.clientY > rect.bottom - scrollTick && !skipVerticalScroll;
if (this.tickLeft || this.tickRight || this.tickUp || this.tickDown) {
this.ensureTickingStarted();
}
else {
this.ensureCleared();
}
}
ensureTickingStarted() {
if (this.tickingInterval === null) {
this.tickingInterval = window.setInterval(this.doTick.bind(this), 100);
this.tickCount = 0;
}
}
doTick() {
this.tickCount++;
const tickAmount = this.tickCount > 20 ? 200 : this.tickCount > 10 ? 80 : 40;
if (this.scrollVertically) {
const vScrollPosition = this.getVerticalPosition();
if (this.tickUp) {
this.setVerticalPosition(vScrollPosition - tickAmount);
}
if (this.tickDown) {
this.setVerticalPosition(vScrollPosition + tickAmount);
}
}
if (this.scrollHorizontally) {
const hScrollPosition = this.getHorizontalPosition();
if (this.tickLeft) {
this.setHorizontalPosition(hScrollPosition - tickAmount);
}
if (this.tickRight) {
this.setHorizontalPosition(hScrollPosition + tickAmount);
}
}
if (this.onScrollCallback) {
this.onScrollCallback();
}
}
ensureCleared() {
if (this.tickingInterval) {
window.clearInterval(this.tickingInterval);
this.tickingInterval = null;
}
}
}
exports.AutoScrollService = AutoScrollService;
/***/ }),
/***/ 3263:
/***/ (function(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.BASE_URL = void 0;
// DO NOT UPDATE MANUALLY: Generated from script during build time
exports.BASE_URL = 'https://www.ag-grid.com';
/***/ }),
/***/ 1954:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.AbstractClientSideNodeManager = void 0;
const beanStub_1 = __webpack_require__(8731);
const rowNode_1 = __webpack_require__(3373);
const gridOptionsUtils_1 = __webpack_require__(7274);
const logging_1 = __webpack_require__(7764);
const ROOT_NODE_ID = 'ROOT_NODE_ID';
class AbstractClientSideNodeManager extends beanStub_1.BeanStub {
constructor() {
super(...arguments);
this.nextId = 0;
this.allNodesMap = {};
this.rootNode = null;
}
get treeData() {
return false; // not supported by this node manager
}
getRowNode(id) {
return this.allNodesMap[id];
}
extractRowData() {
return this.rootNode?.allLeafChildren?.map((node) => node.data);
}
activate(rootNode) {
this.rootNode = rootNode;
rootNode.group = true;
rootNode.level = -1;
rootNode.id = ROOT_NODE_ID;
rootNode.allLeafChildren = [];
rootNode.childrenAfterGroup = [];
rootNode.childrenAfterSort = [];
rootNode.childrenAfterAggFilter = [];
rootNode.childrenAfterFilter = [];
this.updateRootSiblingArrays(rootNode);
}
deactivate() {
if (this.rootNode) {
this.allNodesMap = {};
this.rootNode = null;
}
}
destroy() {
super.destroy();
// Forcefully deallocate memory
this.allNodesMap = {};
this.rootNode = null;
}
setNewRowData(rowData) {
const rootNode = this.rootNode;
if (!rootNode) {
return;
}
this.dispatchRowDataUpdateStartedEvent(rowData);
rootNode.childrenAfterFilter = null;
rootNode.childrenAfterGroup = null;
rootNode.childrenAfterAggFilter = null;
rootNode.childrenAfterSort = null;
rootNode.childrenMapped = null;
rootNode.updateHasChildren();
// Clear internal maps
this.allNodesMap = {};
this.nextId = 0;
this.loadNewRowData(rowData);
this.updateRootSiblingArrays(rootNode);
}
updateRootSiblingArrays(rootNode) {
const sibling = rootNode.sibling;
if (sibling) {
sibling.childrenAfterFilter = rootNode.childrenAfterFilter;
sibling.childrenAfterGroup = rootNode.childrenAfterGroup;
sibling.childrenAfterAggFilter = rootNode.childrenAfterAggFilter;
sibling.childrenAfterSort = rootNode.childrenAfterSort;
sibling.childrenMapped = rootNode.childrenMapped;
sibling.allLeafChildren = rootNode.allLeafChildren;
}
}
loadNewRowData(rowData) {
this.rootNode.allLeafChildren = rowData?.map((dataItem, index) => this.createRowNode(dataItem, index)) ?? [];
}
setImmutableRowData(params, rowData) {
const getRowIdFunc = (0, gridOptionsUtils_1._getRowIdCallback)(this.gos);
const reorder = !this.gos.get('suppressMaintainUnsortedOrder');
const changedRowNodes = params.changedRowNodes;
const processedNodes = new Set();
const rootNode = this.rootNode;
const oldAllLeafChildren = rootNode.allLeafChildren;
const oldAllLeafChildrenLen = oldAllLeafChildren.length;
let nodesAdded = false;
let nodesRemoved = false;
let nodesUpdated = false;
let orderChanged = false;
for (let i = 0, prevSourceRowIndex = -1, len = rowData.length; i < len; i++) {
const data = rowData[i];
let node = this.getRowNode(getRowIdFunc({ data, level: 0 }));
if (!node) {
nodesAdded = true;
node = this.createRowNode(data, -1);
changedRowNodes.add(node);
}
else {
if (reorder) {
const sourceRowIndex = node.sourceRowIndex;
orderChanged || (orderChanged = sourceRowIndex <= prevSourceRowIndex || // A node was moved up, so order changed
nodesAdded); // A node was inserted not at the end
prevSourceRowIndex = sourceRowIndex;
}
if (node.data !== data) {
nodesUpdated = true;
node.updateData(data);
changedRowNodes.update(node);
}
}
processedNodes.add(node);
}
// Destroy the remaining unprocessed node and collect the removed that were selected.
const nodesToUnselect = [];
for (let i = 0; i < oldAllLeafChildrenLen; i++) {
const node = oldAllLeafChildren[i];
if (!processedNodes.has(node)) {
nodesRemoved = true;
if (node.isSelected()) {
nodesToUnselect.push(node);
}
if (node.pinnedSibling) {
this.beans.pinnedRowModel?.pinRow(node.pinnedSibling, null);
}
this.rowNodeDeleted(node);
changedRowNodes.remove(node);
}
}
if (nodesAdded || nodesRemoved || orderChanged) {
const newAllLeafChildren = new Array(processedNodes.size); // Preallocate
let writeIdx = 0;
if (!reorder) {
// All the old nodes will be in the new array in the order they were in the old array
// At the end of this loop, processedNodes will contain only the new appended nodes
for (let i = 0; i < oldAllLeafChildrenLen; ++i) {
const node = oldAllLeafChildren[i];
if (processedNodes.delete(node)) {
node.sourceRowIndex = writeIdx;
newAllLeafChildren[writeIdx++] = node;
}
}
}
for (const node of processedNodes) {
node.sourceRowIndex = writeIdx;
newAllLeafChildren[writeIdx++] = node;
}
rootNode.allLeafChildren = newAllLeafChildren;
const sibling = rootNode.sibling;
if (sibling) {
sibling.allLeafChildren = newAllLeafChildren;
}
params.rowNodesOrderChanged || (params.rowNodesOrderChanged = orderChanged);
}
if (nodesAdded || nodesRemoved || orderChanged || nodesUpdated) {
this.deselectNodes(nodesToUnselect);
params.rowDataUpdated = true;
}
}
/** Called when a node needs to be deleted */
rowNodeDeleted(node) {
node.clearRowTopAndRowIndex(); // so row renderer knows to fade row out (and not reposition it)
const id = node.id;
const allNodesMap = this.allNodesMap;
if (allNodesMap[id] === node) {
delete allNodesMap[id];
}
}
updateRowData(rowDataTran, changedRowNodes) {
this.dispatchRowDataUpdateStartedEvent(rowDataTran.add);
const updateRowDataResult = {
changedRowNodes,
rowNodeTransaction: { remove: [], update: [], add: [] },
rowsInserted: false,
};
const nodesToUnselect = [];
const getRowIdFunc = (0, gridOptionsUtils_1._getRowIdCallback)(this.gos);
this.executeRemove(getRowIdFunc, rowDataTran, updateRowDataResult, nodesToUnselect);
this.executeUpdate(getRowIdFunc, rowDataTran, updateRowDataResult, nodesToUnselect);
this.executeAdd(rowDataTran, updateRowDataResult);
this.deselectNodes(nodesToUnselect);
return updateRowDataResult;
}
executeAdd(rowDataTran, resu