This repository has been archived by the owner on Sep 26, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
486a1dd
commit 1cf6d30
Showing
109 changed files
with
106,747 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,6 @@ node_modules/ | |
|
||
ag-grid-enterprise.iml | ||
|
||
dist/ | ||
package-lock.json | ||
|
||
module.tgz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// ag-grid-enterprise v18.0.0 | ||
import { IAggFuncService, IAggFunc, GridOptionsWrapper, Column } from "ag-grid/main"; | ||
export declare class AggFuncService implements IAggFuncService { | ||
private static AGG_SUM; | ||
private static AGG_FIRST; | ||
private static AGG_LAST; | ||
private static AGG_MIN; | ||
private static AGG_MAX; | ||
private static AGG_COUNT; | ||
private static AGG_AVG; | ||
gridOptionsWrapper: GridOptionsWrapper; | ||
private aggFuncsMap; | ||
private initialised; | ||
private init(); | ||
private initialiseWithDefaultAggregations(); | ||
getDefaultAggFunc(column: Column): string; | ||
addAggFuncs(aggFuncs: { | ||
[key: string]: IAggFunc; | ||
}): void; | ||
addAggFunc(key: string, aggFunc: IAggFunc): void; | ||
getAggFunc(name: string): IAggFunc; | ||
getFuncNames(column: Column): string[]; | ||
clear(): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,237 @@ | ||
// ag-grid-enterprise v18.0.0 | ||
"use strict"; | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); | ||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; | ||
return c > 3 && r && Object.defineProperty(target, key, r), r; | ||
}; | ||
var __metadata = (this && this.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var main_1 = require("ag-grid/main"); | ||
var AggFuncService = (function () { | ||
function AggFuncService() { | ||
this.aggFuncsMap = {}; | ||
this.initialised = false; | ||
} | ||
AggFuncService_1 = AggFuncService; | ||
AggFuncService.prototype.init = function () { | ||
if (this.initialised) { | ||
return; | ||
} | ||
this.initialised = true; | ||
this.initialiseWithDefaultAggregations(); | ||
this.addAggFuncs(this.gridOptionsWrapper.getAggFuncs()); | ||
}; | ||
AggFuncService.prototype.initialiseWithDefaultAggregations = function () { | ||
this.aggFuncsMap[AggFuncService_1.AGG_SUM] = aggSum; | ||
this.aggFuncsMap[AggFuncService_1.AGG_FIRST] = aggFirst; | ||
this.aggFuncsMap[AggFuncService_1.AGG_LAST] = aggLast; | ||
this.aggFuncsMap[AggFuncService_1.AGG_MIN] = aggMin; | ||
this.aggFuncsMap[AggFuncService_1.AGG_MAX] = aggMax; | ||
this.aggFuncsMap[AggFuncService_1.AGG_COUNT] = aggCount; | ||
this.aggFuncsMap[AggFuncService_1.AGG_AVG] = aggAvg; | ||
}; | ||
AggFuncService.prototype.getDefaultAggFunc = function (column) { | ||
var allKeys = this.getFuncNames(column); | ||
// use 'sum' if it's a) allowed for the column and b) still registered | ||
// (ie not removed by user) | ||
var sumInKeysList = allKeys.indexOf(AggFuncService_1.AGG_SUM) >= 0; | ||
var sumInFuncs = main_1._.exists(this.aggFuncsMap[AggFuncService_1.AGG_SUM]); | ||
var useSum = sumInKeysList && sumInFuncs; | ||
if (useSum) { | ||
return AggFuncService_1.AGG_SUM; | ||
} | ||
else { | ||
if (main_1.Utils.existsAndNotEmpty(allKeys)) { | ||
return allKeys[0]; | ||
} | ||
else { | ||
return null; | ||
} | ||
} | ||
}; | ||
AggFuncService.prototype.addAggFuncs = function (aggFuncs) { | ||
main_1.Utils.iterateObject(aggFuncs, this.addAggFunc.bind(this)); | ||
}; | ||
AggFuncService.prototype.addAggFunc = function (key, aggFunc) { | ||
this.init(); | ||
this.aggFuncsMap[key] = aggFunc; | ||
}; | ||
AggFuncService.prototype.getAggFunc = function (name) { | ||
this.init(); | ||
return this.aggFuncsMap[name]; | ||
}; | ||
AggFuncService.prototype.getFuncNames = function (column) { | ||
var userAllowedFuncs = column.getColDef().allowedAggFuncs; | ||
if (main_1._.exists(userAllowedFuncs)) { | ||
return userAllowedFuncs; | ||
} | ||
else { | ||
return Object.keys(this.aggFuncsMap).sort(); | ||
} | ||
}; | ||
AggFuncService.prototype.clear = function () { | ||
this.aggFuncsMap = {}; | ||
}; | ||
AggFuncService.AGG_SUM = 'sum'; | ||
AggFuncService.AGG_FIRST = 'first'; | ||
AggFuncService.AGG_LAST = 'last'; | ||
AggFuncService.AGG_MIN = 'min'; | ||
AggFuncService.AGG_MAX = 'max'; | ||
AggFuncService.AGG_COUNT = 'count'; | ||
AggFuncService.AGG_AVG = 'avg'; | ||
__decorate([ | ||
main_1.Autowired('gridOptionsWrapper'), | ||
__metadata("design:type", main_1.GridOptionsWrapper) | ||
], AggFuncService.prototype, "gridOptionsWrapper", void 0); | ||
__decorate([ | ||
main_1.PostConstruct, | ||
__metadata("design:type", Function), | ||
__metadata("design:paramtypes", []), | ||
__metadata("design:returntype", void 0) | ||
], AggFuncService.prototype, "init", null); | ||
AggFuncService = AggFuncService_1 = __decorate([ | ||
main_1.Bean('aggFuncService') | ||
], AggFuncService); | ||
return AggFuncService; | ||
var AggFuncService_1; | ||
}()); | ||
exports.AggFuncService = AggFuncService; | ||
function aggSum(input) { | ||
var result = null; | ||
var length = input.length; | ||
for (var i = 0; i < length; i++) { | ||
if (typeof input[i] === 'number') { | ||
if (result === null) { | ||
result = input[i]; | ||
} | ||
else { | ||
result += input[i]; | ||
} | ||
} | ||
} | ||
return result; | ||
} | ||
function aggFirst(input) { | ||
if (input.length >= 0) { | ||
return input[0]; | ||
} | ||
else { | ||
return null; | ||
} | ||
} | ||
function aggLast(input) { | ||
if (input.length >= 0) { | ||
return input[input.length - 1]; | ||
} | ||
else { | ||
return null; | ||
} | ||
} | ||
function aggMin(input) { | ||
var result = null; | ||
var length = input.length; | ||
for (var i = 0; i < length; i++) { | ||
if (typeof input[i] === 'number') { | ||
if (result === null) { | ||
result = input[i]; | ||
} | ||
else if (result > input[i]) { | ||
result = input[i]; | ||
} | ||
} | ||
} | ||
return result; | ||
} | ||
function aggMax(input) { | ||
var result = null; | ||
var length = input.length; | ||
for (var i = 0; i < length; i++) { | ||
if (typeof input[i] === 'number') { | ||
if (result === null) { | ||
result = input[i]; | ||
} | ||
else if (result < input[i]) { | ||
result = input[i]; | ||
} | ||
} | ||
} | ||
return result; | ||
} | ||
function aggCount(input) { | ||
var result = { | ||
value: 0, | ||
toString: function () { | ||
return this.value.toString(); | ||
}, | ||
// used for sorting | ||
toNumber: function () { | ||
return this.value; | ||
} | ||
}; | ||
var length = input.length; | ||
for (var i = 0; i < length; i++) { | ||
var isGroupAgg = main_1.Utils.exists(input[i]) && typeof input[i].value === 'number'; | ||
if (isGroupAgg) { | ||
result.value += input[i].value; | ||
} | ||
else { | ||
result.value++; | ||
} | ||
} | ||
return result; | ||
} | ||
// the average function is tricky as the multiple levels require weighted averages | ||
// for the non-leaf node aggregations. | ||
function aggAvg(input) { | ||
// the average will be the sum / count | ||
var sum = 0; | ||
var count = 0; | ||
var length = input.length; | ||
for (var i = 0; i < length; i++) { | ||
var currentItem = input[i]; | ||
var itemIsGroupResult = main_1.Utils.exists(currentItem) && typeof currentItem.value === 'number' && typeof currentItem.count === 'number'; | ||
// skip values that are not numbers (ie skip empty values) | ||
if (typeof currentItem === 'number') { | ||
sum += currentItem; | ||
count++; | ||
// check if it's a group (ie value is a wrapper object) | ||
} | ||
else if (itemIsGroupResult) { | ||
// we are aggregating groups, so we take the | ||
// aggregated values to calculated a weighted average | ||
sum += currentItem.value * currentItem.count; | ||
count += currentItem.count; | ||
} | ||
} | ||
// avoid divide by zero error | ||
var value = null; | ||
if (count !== 0) { | ||
value = sum / count; | ||
} | ||
// the result will be an object. when this cell is rendered, only the avg is shown. | ||
// however when this cell is part of another aggregation, the count is also needed | ||
// to create a weighted average for the next level. | ||
var result = { | ||
count: count, | ||
value: value, | ||
// the grid by default uses toString to render values for an object, so this | ||
// is a trick to get the default cellRenderer to display the avg value | ||
toString: function () { | ||
if (typeof this.value === 'number') { | ||
return this.value.toString(); | ||
} | ||
else { | ||
return ''; | ||
} | ||
}, | ||
// used for sorting | ||
toNumber: function () { | ||
return this.value; | ||
} | ||
}; | ||
return result; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// ag-grid-enterprise v18.0.0 | ||
export declare function populateClientExports(exports: any): void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
// ag-grid-enterprise v18.0.0 | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var columnSelectComp_1 = require("./toolPanel/columnsSelect/columnSelectComp"); | ||
var toolPanelGroupComp_1 = require("./toolPanel/columnsSelect/toolPanelGroupComp"); | ||
var aggregationStage_1 = require("./rowStages/aggregationStage"); | ||
var groupStage_1 = require("./rowStages/groupStage"); | ||
var setFilter_1 = require("./setFilter/setFilter"); | ||
var setFilterModel_1 = require("./setFilter/setFilterModel"); | ||
var statusBar_1 = require("./statusBar/statusBar"); | ||
var statusItem_1 = require("./statusBar/statusItem"); | ||
var clipboardService_1 = require("./clipboardService"); | ||
var enterpriseBoot_1 = require("./enterpriseBoot"); | ||
var enterpriseMenu_1 = require("./menu/enterpriseMenu"); | ||
var menuItemComponent_1 = require("./menu/menuItemComponent"); | ||
var menuList_1 = require("./menu/menuList"); | ||
var rangeController_1 = require("./rangeController"); | ||
var rowGroupColumnsPanel_1 = require("./toolPanel/columnDrop/rowGroupColumnsPanel"); | ||
var contextMenu_1 = require("./menu/contextMenu"); | ||
var viewportRowModel_1 = require("./rowModels/viewport/viewportRowModel"); | ||
var richSelectCellEditor_1 = require("./rendering/richSelect/richSelectCellEditor"); | ||
var richSelectRow_1 = require("./rendering/richSelect/richSelectRow"); | ||
var virtualList_1 = require("./rendering/virtualList"); | ||
var abstractColumnDropPanel_1 = require("./toolPanel/columnDrop/abstractColumnDropPanel"); | ||
var pivotColumnsPanel_1 = require("./toolPanel/columnDrop/pivotColumnsPanel"); | ||
var toolPanelColumnComp_1 = require("./toolPanel/toolPanelColumnComp"); | ||
var licenseManager_1 = require("./licenseManager"); | ||
var pivotStage_1 = require("./rowStages/pivotStage"); | ||
var pivotColDefService_1 = require("./rowStages/pivotColDefService"); | ||
var pivotModePanel_1 = require("./toolPanel/columnDrop/pivotModePanel"); | ||
var aggFuncService_1 = require("./aggregation/aggFuncService"); | ||
var md5_1 = require("./license/md5"); | ||
var setFilterListItem_1 = require("./setFilter/setFilterListItem"); | ||
var columnComponent_1 = require("./toolPanel/columnDrop/columnComponent"); | ||
var valueColumnsPanel_1 = require("./toolPanel/columnDrop/valueColumnsPanel"); | ||
var pivotCompFactory_1 = require("./pivotCompFactory"); | ||
var rowGroupCompFactory_1 = require("./rowGroupCompFactory"); | ||
var excelCreator_1 = require("./excelCreator"); | ||
var excelXmlFactory_1 = require("./excelXmlFactory"); | ||
function populateClientExports(exports) { | ||
exports.AggFuncService = aggFuncService_1.AggFuncService; | ||
exports.MD5 = md5_1.MD5; | ||
exports.EnterpriseMenu = enterpriseMenu_1.EnterpriseMenu; | ||
exports.MenuList = menuList_1.MenuList; | ||
exports.MenuItemComponent = menuItemComponent_1.MenuItemComponent; | ||
exports.RichSelectCellEditor = richSelectCellEditor_1.RichSelectCellEditor; | ||
exports.RichSelectRow = richSelectRow_1.RichSelectRow; | ||
exports.VirtualList = virtualList_1.VirtualList; | ||
exports.AggregationStage = aggregationStage_1.AggregationStage; | ||
exports.GroupStage = groupStage_1.GroupStage; | ||
exports.PivotColDefService = pivotColDefService_1.PivotColDefService; | ||
exports.PivotStage = pivotStage_1.PivotStage; | ||
exports.SetFilter = setFilter_1.SetFilter; | ||
exports.SetFilterListItem = setFilterListItem_1.SetFilterListItem; | ||
exports.SetFilterModel = setFilterModel_1.SetFilterModel; | ||
exports.StatusBar = statusBar_1.StatusBar; | ||
exports.StatusItem = statusItem_1.StatusItem; | ||
exports.AbstractColumnDropPanel = abstractColumnDropPanel_1.AbstractColumnDropPanel; | ||
exports.ColumnComponent = columnComponent_1.ColumnComponent; | ||
exports.PivotColumnsPanel = pivotColumnsPanel_1.PivotColumnsPanel; | ||
exports.PivotModePanel = pivotModePanel_1.PivotModePanel; | ||
exports.RowGroupColumnsPanel = rowGroupColumnsPanel_1.RowGroupColumnsPanel; | ||
exports.ValuesColumnPanel = valueColumnsPanel_1.ValuesColumnPanel; | ||
exports.ToolPanelColumnComp = toolPanelColumnComp_1.ToolPanelColumnComp; | ||
exports.ColumnSelectComp = columnSelectComp_1.ColumnSelectComp; | ||
exports.RenderedColumn = toolPanelColumnComp_1.ToolPanelColumnComp; | ||
exports.RenderedGroup = toolPanelGroupComp_1.ToolPanelGroupComp; | ||
exports.ViewportRowModel = viewportRowModel_1.ViewportRowModel; | ||
exports.ClipboardService = clipboardService_1.ClipboardService; | ||
exports.ContextMenuFactory = contextMenu_1.ContextMenuFactory; | ||
exports.EnterpriseBoot = enterpriseBoot_1.EnterpriseBoot; | ||
exports.LicenseManager = licenseManager_1.LicenseManager; | ||
exports.PivotCompFactory = pivotCompFactory_1.PivotCompFactory; | ||
exports.ExcelCreator = excelCreator_1.ExcelCreator; | ||
exports.ExcelXmlFactory = excelXmlFactory_1.ExcelXmlFactory; | ||
exports.RangeController = rangeController_1.RangeController; | ||
exports.RowGroupCompFactory = rowGroupCompFactory_1.RowGroupCompFactory; | ||
} | ||
exports.populateClientExports = populateClientExports; |
Oops, something went wrong.