Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var initSelect = function (property, input, values, sortedValues) {
var fontValue = _this.params.initialFont[property];
var initialValue = values[0];
if (fontValue) {
var fontValueAsStr = "" + fontValue;
var lowerCaseFontValue = ag_grid_community_1._.exists(fontValueAsStr) ? fontValueAsStr.toLowerCase() : '';
var lowerCaseValues = values.map(function (value) { return value.toLowerCase(); });
// check for known font values using lowercase
var valueIndex = lowerCaseValues.indexOf(lowerCaseFontValue);
var unknownUserProvidedFont = valueIndex < 0;
if (unknownUserProvidedFont) {
var capitalisedFontValue = ag_grid_community_1._.capitalise(fontValueAsStr);
// add user provided font to list
values.push(capitalisedFontValue);
if (sortedValues) {
values.sort();
}
initialValue = capitalisedFontValue;
}
else {
initialValue = values[valueIndex];
}
}
var options = values.map(function (value) {
return { value: value, text: value };
});
input.addOptions(options)
.setValue("" + initialValue)
}
else {
this.tooltipManager.registerTooltip(this);
}
}
if (this.params.shortcut) {
this.eShortcut.innerHTML = this.params.shortcut;
}
if (this.params.subMenu) {
if (this.gridOptionsWrapper.isEnableRtl()) {
// for RTL, we show arrow going left
this.ePopupPointer.appendChild(ag_grid_community_1._.createIconNoSpan('smallLeft', this.gridOptionsWrapper));
}
else {
// for normal, we show arrow going right
this.ePopupPointer.appendChild(ag_grid_community_1._.createIconNoSpan('smallRight', this.gridOptionsWrapper));
}
}
else {
this.ePopupPointer.innerHTML = ' ';
}
this.eName.innerHTML = this.params.name;
if (this.params.disabled) {
ag_grid_community_1._.addCssClass(this.getGui(), 'ag-menu-option-disabled');
}
else {
this.addGuiEventListener('click', this.onOptionSelected.bind(this));
}
if (this.params.cssClasses) {
this.params.cssClasses.forEach(function (it) { return ag_grid_community_1._.addCssClass(_this.getGui(), it); });
}
};
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 = ag_grid_community_1._.exists(this.aggFuncsMap[AggFuncService_1.AGG_SUM]);
var useSum = sumInKeysList && sumInFuncs;
if (useSum) {
return AggFuncService_1.AGG_SUM;
}
else {
if (ag_grid_community_1._.existsAndNotEmpty(allKeys)) {
return allKeys[0];
}
else {
return null;
}
}
};
AggFuncService.prototype.addAggFuncs = function (aggFuncs) {
EnterpriseMenu.prototype.createColumnsPanel = function () {
var eWrapperDiv = document.createElement('div');
ag_grid_community_1._.addCssClass(eWrapperDiv, 'ag-menu-column-select-wrapper');
this.columnSelectPanel = new primaryColsPanel_1.PrimaryColsPanel(false, {
suppressValues: false,
suppressPivots: false,
suppressRowGroups: false,
suppressPivotMode: false,
contractColumnSelection: false,
suppressColumnExpandAll: false,
suppressColumnFilter: false,
suppressColumnSelectAll: false,
suppressSideButtons: false,
api: this.gridApi
});
this.getContext().wireBean(this.columnSelectPanel);
eWrapperDiv.appendChild(this.columnSelectPanel.getGui());
this.tabItemColumns = {
title: ag_grid_community_1._.createIconNoSpan('columns', this.gridOptionsWrapper, this.column),
ExcelXmlFactory.prototype.stylesXmlElement = function (styles) {
var _this = this;
return {
name: 'Styles',
children: styles ? ag_grid_community_1._.map(styles, function (it) {
return _this.styleXmlElement(it);
}) : []
};
};
ExcelXmlFactory.prototype.styleXmlElement = function (styleProperties) {
this.activePanels.forEach(function (panel) {
ag_grid_community_1._.removeFromParent(panel.getGui());
panel.destroy();
});
};
LicenseManager.prototype.isDisplayWatermark = function () {
return !ag_grid_community_1._.missingOrEmpty(this.watermarkMessage);
};
LicenseManager.prototype.getWatermarkMessage = function () {
Chart_Old.prototype.refresh = function () {
var errors = this.datasource.getErrors();
var eGui = this.getGui();
ag_grid_community_1._.clearElement(eGui);
if (errors && errors.length > 0) {
var html_1 = [];
html_1.push("Could not create chart:");
html_1.push("<ul>");
errors.forEach(function (error) { return html_1.push("<li>" + error + "</li>"); });
html_1.push("</ul>");
eGui.innerHTML = html_1.join('');
}
else {
var ctx = this.eCanvas.getContext('2d');
ctx.clearRect(0, 0, this.chartOptions.width, this.chartOptions.height);
this.drawChart();
eGui.appendChild(this.eCanvas);
}
};
Chart_Old.prototype.destroy = function () {
getTemplate: function (xf) {
return {
name: "cellStyleXfs",
properties: {
rawMap: {
count: xf.length
}
},
children: ag_grid_community_1._.map(xf, xf_1.default.getTemplate)
};
}
};
getTemplate: function (fonts) {
return {
name: "fonts",
properties: {
rawMap: {
count: fonts.length
}
},
children: ag_grid_community_1._.map(fonts, font_1.default.getTemplate)
};
}
};