ag-grid-enterprise
Version:
Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue
1,458 lines (1,438 loc) • 1.65 MB
JavaScript
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
// packages/ag-grid-enterprise/src/main.ts
var main_exports = {};
__export(main_exports, {
AdvancedFilterModule: () => AdvancedFilterModule,
AgDialog: () => AgDialog,
AgGroupComponent: () => AgGroupComponent,
AgGroupComponentSelector: () => AgGroupComponentSelector,
AgMenuItemComponent: () => AgMenuItemComponent,
AgMenuItemRenderer: () => AgMenuItemRenderer,
AgMenuList: () => AgMenuList,
AgMenuPanel: () => AgMenuPanel,
AgPanel: () => AgPanel,
AgPrimaryCols: () => AgPrimaryCols,
AgRichSelect: () => AgRichSelect,
ClipboardModule: () => ClipboardModule,
ColumnsToolPanelModule: () => ColumnsToolPanelModule,
EnterpriseCoreModule: () => EnterpriseCoreModule,
ExcelExportModule: () => ExcelExportModule,
FiltersToolPanelModule: () => FiltersToolPanelModule,
GridChartsModule: () => GridChartsModule,
GroupCellRenderer: () => GroupCellRenderer,
GroupCellRendererCtrl: () => GroupCellRendererCtrl,
LicenseManager: () => GridLicenseManager,
MasterDetailModule: () => MasterDetailModule,
MenuModule: () => MenuModule,
MultiFilter: () => MultiFilter,
MultiFilterModule: () => MultiFilterModule,
PillDragComp: () => PillDragComp,
PillDropZonePanel: () => PillDropZonePanel,
PivotDropZonePanel: () => PivotDropZonePanel,
RangeSelectionModule: () => RangeSelectionModule,
RichSelectModule: () => RichSelectModule,
RowGroupDropZonePanel: () => RowGroupDropZonePanel,
RowGroupingModule: () => RowGroupingModule,
ServerSideRowModelModule: () => ServerSideRowModelModule,
SetFilter: () => SetFilter,
SetFilterModule: () => SetFilterModule,
SideBarModule: () => SideBarModule,
SparklinesModule: () => SparklinesModule,
StatusBarModule: () => StatusBarModule,
TabbedLayout: () => TabbedLayout,
ToolPanelColDefService: () => ToolPanelColDefService,
ValuesDropZonePanel: () => ValuesDropZonePanel,
ViewportRowModelModule: () => ViewportRowModelModule,
VirtualList: () => VirtualList,
VirtualListDragFeature: () => VirtualListDragFeature,
agCharts: () => agCharts,
exportMultipleSheetsAsExcel: () => exportMultipleSheetsAsExcel,
getMultipleSheetsAsExcel: () => getMultipleSheetsAsExcel
});
import { ClientSideRowModelModule } from "ag-grid-community";
import { CommunityFeaturesModule, ModuleRegistry as ModuleRegistry7 } from "ag-grid-community";
import { CsvExportModule as CsvExportModule2 } from "ag-grid-community";
import { InfiniteRowModelModule } from "ag-grid-community";
// enterprise-modules/advanced-filter/dist/package/main.esm.mjs
import { ModuleNames as ModuleNames2, _FilterCoreModule } from "ag-grid-community";
// enterprise-modules/core/src/agGridEnterpriseModule.ts
import { ModuleNames } from "ag-grid-community";
// enterprise-modules/core/src/license/gridLicenseManager.ts
import { BeanStub } from "ag-grid-community";
// enterprise-modules/core/src/license/shared/licenseManager.ts
import { _missingOrEmpty } from "ag-grid-community";
// enterprise-modules/core/src/license/shared/md5.ts
var MD5 = class {
constructor() {
this.ieCompatibility = false;
}
init() {
this.ieCompatibility = this.md5("hello") != "5d41402abc4b2a76b9719d911017c592";
}
md5cycle(x, k) {
let a = x[0], b = x[1], c = x[2], d = x[3];
a = this.ff(a, b, c, d, k[0], 7, -680876936);
d = this.ff(d, a, b, c, k[1], 12, -389564586);
c = this.ff(c, d, a, b, k[2], 17, 606105819);
b = this.ff(b, c, d, a, k[3], 22, -1044525330);
a = this.ff(a, b, c, d, k[4], 7, -176418897);
d = this.ff(d, a, b, c, k[5], 12, 1200080426);
c = this.ff(c, d, a, b, k[6], 17, -1473231341);
b = this.ff(b, c, d, a, k[7], 22, -45705983);
a = this.ff(a, b, c, d, k[8], 7, 1770035416);
d = this.ff(d, a, b, c, k[9], 12, -1958414417);
c = this.ff(c, d, a, b, k[10], 17, -42063);
b = this.ff(b, c, d, a, k[11], 22, -1990404162);
a = this.ff(a, b, c, d, k[12], 7, 1804603682);
d = this.ff(d, a, b, c, k[13], 12, -40341101);
c = this.ff(c, d, a, b, k[14], 17, -1502002290);
b = this.ff(b, c, d, a, k[15], 22, 1236535329);
a = this.gg(a, b, c, d, k[1], 5, -165796510);
d = this.gg(d, a, b, c, k[6], 9, -1069501632);
c = this.gg(c, d, a, b, k[11], 14, 643717713);
b = this.gg(b, c, d, a, k[0], 20, -373897302);
a = this.gg(a, b, c, d, k[5], 5, -701558691);
d = this.gg(d, a, b, c, k[10], 9, 38016083);
c = this.gg(c, d, a, b, k[15], 14, -660478335);
b = this.gg(b, c, d, a, k[4], 20, -405537848);
a = this.gg(a, b, c, d, k[9], 5, 568446438);
d = this.gg(d, a, b, c, k[14], 9, -1019803690);
c = this.gg(c, d, a, b, k[3], 14, -187363961);
b = this.gg(b, c, d, a, k[8], 20, 1163531501);
a = this.gg(a, b, c, d, k[13], 5, -1444681467);
d = this.gg(d, a, b, c, k[2], 9, -51403784);
c = this.gg(c, d, a, b, k[7], 14, 1735328473);
b = this.gg(b, c, d, a, k[12], 20, -1926607734);
a = this.hh(a, b, c, d, k[5], 4, -378558);
d = this.hh(d, a, b, c, k[8], 11, -2022574463);
c = this.hh(c, d, a, b, k[11], 16, 1839030562);
b = this.hh(b, c, d, a, k[14], 23, -35309556);
a = this.hh(a, b, c, d, k[1], 4, -1530992060);
d = this.hh(d, a, b, c, k[4], 11, 1272893353);
c = this.hh(c, d, a, b, k[7], 16, -155497632);
b = this.hh(b, c, d, a, k[10], 23, -1094730640);
a = this.hh(a, b, c, d, k[13], 4, 681279174);
d = this.hh(d, a, b, c, k[0], 11, -358537222);
c = this.hh(c, d, a, b, k[3], 16, -722521979);
b = this.hh(b, c, d, a, k[6], 23, 76029189);
a = this.hh(a, b, c, d, k[9], 4, -640364487);
d = this.hh(d, a, b, c, k[12], 11, -421815835);
c = this.hh(c, d, a, b, k[15], 16, 530742520);
b = this.hh(b, c, d, a, k[2], 23, -995338651);
a = this.ii(a, b, c, d, k[0], 6, -198630844);
d = this.ii(d, a, b, c, k[7], 10, 1126891415);
c = this.ii(c, d, a, b, k[14], 15, -1416354905);
b = this.ii(b, c, d, a, k[5], 21, -57434055);
a = this.ii(a, b, c, d, k[12], 6, 1700485571);
d = this.ii(d, a, b, c, k[3], 10, -1894986606);
c = this.ii(c, d, a, b, k[10], 15, -1051523);
b = this.ii(b, c, d, a, k[1], 21, -2054922799);
a = this.ii(a, b, c, d, k[8], 6, 1873313359);
d = this.ii(d, a, b, c, k[15], 10, -30611744);
c = this.ii(c, d, a, b, k[6], 15, -1560198380);
b = this.ii(b, c, d, a, k[13], 21, 1309151649);
a = this.ii(a, b, c, d, k[4], 6, -145523070);
d = this.ii(d, a, b, c, k[11], 10, -1120210379);
c = this.ii(c, d, a, b, k[2], 15, 718787259);
b = this.ii(b, c, d, a, k[9], 21, -343485551);
x[0] = this.add32(a, x[0]);
x[1] = this.add32(b, x[1]);
x[2] = this.add32(c, x[2]);
x[3] = this.add32(d, x[3]);
}
cmn(q, a, b, x, s, t) {
a = this.add32(this.add32(a, q), this.add32(x, t));
return this.add32(a << s | a >>> 32 - s, b);
}
ff(a, b, c, d, x, s, t) {
return this.cmn(b & c | ~b & d, a, b, x, s, t);
}
gg(a, b, c, d, x, s, t) {
return this.cmn(b & d | c & ~d, a, b, x, s, t);
}
hh(a, b, c, d, x, s, t) {
return this.cmn(b ^ c ^ d, a, b, x, s, t);
}
ii(a, b, c, d, x, s, t) {
return this.cmn(c ^ (b | ~d), a, b, x, s, t);
}
md51(s) {
const n = s.length;
const state = [1732584193, -271733879, -1732584194, 271733878];
let i;
for (i = 64; i <= s.length; i += 64) {
this.md5cycle(state, this.md5blk(s.substring(i - 64, i)));
}
s = s.substring(i - 64);
const tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
for (i = 0; i < s.length; i++) {
tail[i >> 2] |= s.charCodeAt(i) << (i % 4 << 3);
}
tail[i >> 2] |= 128 << (i % 4 << 3);
if (i > 55) {
this.md5cycle(state, tail);
for (i = 0; i < 16; i++) {
tail[i] = 0;
}
}
tail[14] = n * 8;
this.md5cycle(state, tail);
return state;
}
/* there needs to be support for Unicode here, * unless we pretend that we can redefine the MD-5
* algorithm for multi-byte characters (perhaps by adding every four 16-bit characters and
* shortening the sum to 32 bits). Otherwise I suthis.ggest performing MD-5 as if every character
* was two bytes--e.g., 0040 0025 = @%--but then how will an ordinary MD-5 sum be matched?
* There is no way to standardize text to something like UTF-8 before transformation; speed cost is
* utterly prohibitive. The JavaScript standard itself needs to look at this: it should start
* providing access to strings as preformed UTF-8 8-bit unsigned value arrays.
*/
md5blk(s) {
const md5blks = [];
for (let i = 0; i < 64; i += 4) {
md5blks[i >> 2] = s.charCodeAt(i) + (s.charCodeAt(i + 1) << 8) + (s.charCodeAt(i + 2) << 16) + (s.charCodeAt(i + 3) << 24);
}
return md5blks;
}
rhex(n) {
const hex_chr = "0123456789abcdef".split("");
let s = "", j = 0;
for (; j < 4; j++) {
s += hex_chr[n >> j * 8 + 4 & 15] + hex_chr[n >> j * 8 & 15];
}
return s;
}
hex(x) {
for (let i = 0; i < x.length; i++) {
x[i] = this.rhex(x[i]);
}
return x.join("");
}
md5(s) {
return this.hex(this.md51(s));
}
add32(a, b) {
return this.ieCompatibility ? this.add32Compat(a, b) : this.add32Std(a, b);
}
/* this function is much faster, so if possible we use it. Some IEs are the only ones I know of that
need the idiotic second function, generated by an if clause. */
add32Std(a, b) {
return a + b & 4294967295;
}
add32Compat(x, y) {
const lsw = (x & 65535) + (y & 65535), msw = (x >> 16) + (y >> 16) + (lsw >> 16);
return msw << 16 | lsw & 65535;
}
};
// enterprise-modules/core/src/license/shared/licenseManager.ts
var LICENSE_TYPES = {
"01": "GRID",
"02": "CHARTS",
"0102": "BOTH"
};
var _LicenseManager = class _LicenseManager {
constructor(document2) {
this.watermarkMessage = void 0;
this.totalMessageLength = 124;
this.document = document2;
this.md5 = new MD5();
this.md5.init();
}
validateLicense() {
const licenseDetails = this.getLicenseDetails(_LicenseManager.licenseKey);
const currentLicenseName = `AG Grid ${licenseDetails.currentLicenseType === "BOTH" ? "and AG Charts " : ""}Enterprise`;
const suppliedLicenseName = licenseDetails.suppliedLicenseType === void 0 ? "" : `AG ${licenseDetails.suppliedLicenseType === "BOTH" ? "Grid and AG Charts" : licenseDetails.suppliedLicenseType === "GRID" ? "Grid" : "Charts"} Enterprise`;
if (licenseDetails.missing) {
if (!this.isWebsiteUrl() || this.isForceWatermark()) {
this.outputMissingLicenseKey(currentLicenseName);
}
} else if (licenseDetails.expired) {
const gridReleaseDate = _LicenseManager.getGridReleaseDate();
const formattedReleaseDate = _LicenseManager.formatDate(gridReleaseDate);
this.outputExpiredKey(licenseDetails.expiry, formattedReleaseDate, currentLicenseName, suppliedLicenseName);
} else if (!licenseDetails.valid) {
this.outputInvalidLicenseKey(
!!licenseDetails.incorrectLicenseType,
currentLicenseName,
suppliedLicenseName
);
} else if (licenseDetails.isTrial && licenseDetails.trialExpired) {
this.outputExpiredTrialKey(licenseDetails.expiry, currentLicenseName, suppliedLicenseName);
}
}
static extractExpiry(license) {
const restrictionHashed = license.substring(license.lastIndexOf("_") + 1, license.length);
return new Date(parseInt(_LicenseManager.decode(restrictionHashed), 10));
}
static extractLicenseComponents(licenseKey) {
let cleanedLicenseKey = licenseKey.replace(/[\u200B-\u200D\uFEFF]/g, "");
cleanedLicenseKey = cleanedLicenseKey.replace(/\r?\n|\r/g, "");
if (licenseKey.length <= 32) {
return { md5: null, license: licenseKey, version: null, isTrial: null };
}
const hashStart = cleanedLicenseKey.length - 32;
const md5 = cleanedLicenseKey.substring(hashStart);
const license = cleanedLicenseKey.substring(0, hashStart);
const [version, isTrial, type] = _LicenseManager.extractBracketedInformation(cleanedLicenseKey);
return { md5, license, version, isTrial, type };
}
getLicenseDetails(licenseKey) {
const currentLicenseType = _LicenseManager.chartsLicenseManager ? "BOTH" : "GRID";
if (_missingOrEmpty(licenseKey)) {
return {
licenseKey,
valid: false,
missing: true,
currentLicenseType
};
}
const gridReleaseDate = _LicenseManager.getGridReleaseDate();
const { md5, license, version, isTrial, type } = _LicenseManager.extractLicenseComponents(licenseKey);
let valid = md5 === this.md5.md5(license) && licenseKey.indexOf("For_Trialing_ag-Grid_Only") === -1;
let trialExpired = void 0;
let expired = void 0;
let expiry = null;
let incorrectLicenseType = false;
let suppliedLicenseType = void 0;
function handleTrial() {
const now = /* @__PURE__ */ new Date();
trialExpired = expiry < now;
expired = void 0;
}
if (valid) {
expiry = _LicenseManager.extractExpiry(license);
valid = !isNaN(expiry.getTime());
if (valid) {
expired = gridReleaseDate > expiry;
switch (version) {
case "legacy":
case "2": {
if (isTrial) {
handleTrial();
}
break;
}
case "3": {
if (_missingOrEmpty(type)) {
valid = false;
} else {
suppliedLicenseType = type;
if (type !== LICENSE_TYPES["01"] && type !== LICENSE_TYPES["0102"] || currentLicenseType === "BOTH" && suppliedLicenseType !== "BOTH") {
valid = false;
incorrectLicenseType = true;
} else if (isTrial) {
handleTrial();
}
}
}
}
}
}
if (!valid) {
return {
licenseKey,
valid,
incorrectLicenseType,
currentLicenseType,
suppliedLicenseType
};
}
return {
licenseKey,
valid,
expiry: _LicenseManager.formatDate(expiry),
expired,
version,
isTrial,
trialExpired,
incorrectLicenseType,
currentLicenseType,
suppliedLicenseType
};
}
isDisplayWatermark() {
return this.isForceWatermark() || !this.isLocalhost() && !this.isWebsiteUrl() && !_missingOrEmpty(this.watermarkMessage);
}
getWatermarkMessage() {
return this.watermarkMessage || "";
}
getHostname() {
const win = this.document.defaultView || window;
const loc = win.location;
const { hostname = "" } = loc;
return hostname;
}
isForceWatermark() {
const win = this.document.defaultView || window;
const loc = win.location;
const { pathname } = loc;
return pathname ? pathname.indexOf("forceWatermark") !== -1 : false;
}
isWebsiteUrl() {
const hostname = this.getHostname();
return hostname.match(/^((?:[\w-]+\.)?ag-grid\.com)$/) !== null;
}
isLocalhost() {
const hostname = this.getHostname();
return hostname.match(/^(?:127\.0\.0\.1|localhost)$/) !== null;
}
static formatDate(date) {
const monthNames = [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
];
const day = date.getDate();
const monthIndex = date.getMonth();
const year = date.getFullYear();
return day + " " + monthNames[monthIndex] + " " + year;
}
static getGridReleaseDate() {
return new Date(parseInt(_LicenseManager.decode(_LicenseManager.RELEASE_INFORMATION), 10));
}
static decode(input) {
const keystr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
let t = "";
let n, r, i;
let s, o, u, a;
let f = 0;
const e = input.replace(/[^A-Za-z0-9+/=]/g, "");
while (f < e.length) {
s = keystr.indexOf(e.charAt(f++));
o = keystr.indexOf(e.charAt(f++));
u = keystr.indexOf(e.charAt(f++));
a = keystr.indexOf(e.charAt(f++));
n = s << 2 | o >> 4;
r = (o & 15) << 4 | u >> 2;
i = (u & 3) << 6 | a;
t = t + String.fromCharCode(n);
if (u != 64) {
t = t + String.fromCharCode(r);
}
if (a != 64) {
t = t + String.fromCharCode(i);
}
}
t = _LicenseManager.utf8_decode(t);
return t;
}
static utf8_decode(input) {
input = input.replace(/rn/g, "n");
let t = "";
for (let n = 0; n < input.length; n++) {
const r = input.charCodeAt(n);
if (r < 128) {
t += String.fromCharCode(r);
} else if (r > 127 && r < 2048) {
t += String.fromCharCode(r >> 6 | 192);
t += String.fromCharCode(r & 63 | 128);
} else {
t += String.fromCharCode(r >> 12 | 224);
t += String.fromCharCode(r >> 6 & 63 | 128);
t += String.fromCharCode(r & 63 | 128);
}
}
return t;
}
static setChartsLicenseManager(dependantLicenseManager) {
this.chartsLicenseManager = dependantLicenseManager;
}
static setLicenseKey(licenseKey) {
this.licenseKey = licenseKey;
if (this.chartsLicenseManager) {
this.chartsLicenseManager.setLicenseKey(licenseKey, true);
}
}
static extractBracketedInformation(licenseKey) {
if (!licenseKey.includes("[")) {
return ["legacy", false, void 0];
}
const matches = licenseKey.match(/\[(.*?)\]/g).map((match) => match.replace("[", "").replace("]", ""));
if (!matches || matches.length === 0) {
return ["legacy", false, void 0];
}
const isTrial = matches.filter((match) => match === "TRIAL").length === 1;
const rawVersion = matches.filter((match) => match.indexOf("v") === 0)[0];
const version = rawVersion ? rawVersion.replace("v", "") : "legacy";
const type = LICENSE_TYPES[matches.filter((match) => LICENSE_TYPES[match])[0]];
return [version, isTrial, type];
}
centerPadAndOutput(input) {
const paddingRequired = this.totalMessageLength - input.length;
console.error(input.padStart(paddingRequired / 2 + input.length, "*").padEnd(this.totalMessageLength, "*"));
}
padAndOutput(input, padding = "*", terminateWithPadding = "") {
console.error(
input.padEnd(this.totalMessageLength - terminateWithPadding.length, padding) + terminateWithPadding
);
}
outputInvalidLicenseKey(incorrectLicenseType, currentLicenseName, suppliedLicenseName) {
if (incorrectLicenseType) {
this.centerPadAndOutput("");
this.centerPadAndOutput(` ${currentLicenseName} License `);
this.centerPadAndOutput(" Incompatible License Key ");
this.padAndOutput(
`* Your license key is for ${suppliedLicenseName} only and does not cover you for ${currentLicenseName}.`,
" ",
"*"
);
this.padAndOutput("* Please contact info@ag-grid.com to obtain a combined license key.", " ", "*");
this.centerPadAndOutput("");
this.centerPadAndOutput("");
} else {
this.centerPadAndOutput("");
this.centerPadAndOutput(` ${currentLicenseName} License `);
this.centerPadAndOutput(" Invalid License Key ");
this.padAndOutput(
`* Your license key is not valid - please contact info@ag-grid.com to obtain a valid license.`,
" ",
"*"
);
this.centerPadAndOutput("");
this.centerPadAndOutput("");
}
this.watermarkMessage = "Invalid License";
}
outputExpiredTrialKey(formattedExpiryDate, currentLicenseName, suppliedLicenseName) {
this.centerPadAndOutput("");
this.centerPadAndOutput(` ${currentLicenseName} License `);
this.centerPadAndOutput(" Trial Period Expired. ");
this.padAndOutput(
`* Your trial only license for ${suppliedLicenseName} expired on ${formattedExpiryDate}.`,
" ",
"*"
);
this.padAndOutput("* Please email info@ag-grid.com to purchase a license.", " ", "*");
this.centerPadAndOutput("");
this.centerPadAndOutput("");
this.watermarkMessage = "Trial Period Expired";
}
outputMissingLicenseKey(currentLicenseName) {
this.centerPadAndOutput("");
this.centerPadAndOutput(` ${currentLicenseName} License `);
this.centerPadAndOutput(" License Key Not Found ");
this.padAndOutput(`* All ${currentLicenseName} features are unlocked for trial.`, " ", "*");
this.padAndOutput(
"* If you want to hide the watermark please email info@ag-grid.com for a trial license key.",
" ",
"*"
);
this.centerPadAndOutput("");
this.centerPadAndOutput("");
this.watermarkMessage = "For Trial Use Only";
}
outputExpiredKey(formattedExpiryDate, formattedReleaseDate, currentLicenseName, suppliedLicenseName) {
this.centerPadAndOutput("");
this.centerPadAndOutput(` ${currentLicenseName} License `);
this.centerPadAndOutput(" Incompatible Software Version ");
this.padAndOutput(
`* Your license key works with versions of ${suppliedLicenseName} released before ${formattedExpiryDate}.`,
" ",
"*"
);
this.padAndOutput(`* The version you are trying to use was released on ${formattedReleaseDate}.`, " ", "*");
this.padAndOutput("* Please contact info@ag-grid.com to renew your license key.", " ", "*");
this.centerPadAndOutput("");
this.centerPadAndOutput("");
this.watermarkMessage = "License Expired";
}
};
_LicenseManager.RELEASE_INFORMATION = "MTcxOTQzMTYzMDEwNw==";
var LicenseManager = _LicenseManager;
// enterprise-modules/core/src/license/watermark.ts
import { Component, RefPlaceholder } from "ag-grid-community";
var AgWatermark = class extends Component {
constructor() {
super(
/* html*/
`<div class="ag-watermark">
<div data-ref="eLicenseTextRef" class="ag-watermark-text"></div>
</div>`
);
this.eLicenseTextRef = RefPlaceholder;
}
wireBeans(beans) {
this.licenseManager = beans.licenseManager;
}
postConstruct() {
const show = this.shouldDisplayWatermark();
this.setDisplayed(show);
if (show) {
this.eLicenseTextRef.innerText = this.licenseManager.getWatermarkMessage();
window.setTimeout(() => this.addCssClass("ag-opacity-zero"), 0);
window.setTimeout(() => this.setDisplayed(false), 5e3);
}
}
shouldDisplayWatermark() {
return this.licenseManager.isDisplayWatermark();
}
};
var AgWatermarkSelector = {
selector: "AG-WATERMARK",
component: AgWatermark
};
// enterprise-modules/core/src/license/gridLicenseManager.ts
var GridLicenseManager = class extends BeanStub {
constructor() {
super(...arguments);
this.beanName = "licenseManager";
}
postConstruct() {
this.validateLicense();
}
validateLicense() {
this.licenseManager = new LicenseManager(this.gos.getDocument());
this.licenseManager.validateLicense();
}
static getLicenseDetails(licenseKey) {
return new LicenseManager(null).getLicenseDetails(licenseKey);
}
getWatermarkSelector() {
return AgWatermarkSelector;
}
isDisplayWatermark() {
return this.licenseManager.isDisplayWatermark();
}
getWatermarkMessage() {
return this.licenseManager.getWatermarkMessage();
}
static setLicenseKey(licenseKey) {
LicenseManager.setLicenseKey(licenseKey);
}
static setChartsLicenseManager(chartsLicenseManager) {
LicenseManager.setChartsLicenseManager(chartsLicenseManager);
}
};
// enterprise-modules/core/src/version.ts
var VERSION = "32.0.2";
// enterprise-modules/core/src/widgets/agMenuItemRenderer.ts
import {
Component as Component2,
_createIconNoSpan,
_isNodeOrElement,
_loadTemplate,
_setAriaExpanded,
_warnOnce
} from "ag-grid-community";
var AgMenuItemRenderer = class extends Component2 {
constructor() {
super();
this.setTemplate(
/* html */
`<div></div>`
);
}
init(params) {
this.params = params;
this.cssClassPrefix = this.params.cssClassPrefix ?? "ag-menu-option";
this.addIcon();
this.addName();
this.addShortcut();
this.addSubMenu();
}
configureDefaults() {
return true;
}
addIcon() {
if (this.params.isCompact) {
return;
}
const iconWrapper = _loadTemplate(
/* html */
`<span data-ref="eIcon" class="${this.getClassName("part")} ${this.getClassName("icon")}" role="presentation"></span>`
);
const { checked, icon } = this.params;
if (checked) {
iconWrapper.appendChild(_createIconNoSpan("check", this.gos));
} else if (icon) {
if (_isNodeOrElement(icon)) {
iconWrapper.appendChild(icon);
} else if (typeof icon === "string") {
iconWrapper.innerHTML = icon;
} else {
_warnOnce("menu item icon must be DOM node or string");
}
}
this.getGui().appendChild(iconWrapper);
}
addName() {
const name = _loadTemplate(
/* html */
`<span data-ref="eName" class="${this.getClassName("part")} ${this.getClassName("text")}">${this.params.name || ""}</span>`
);
this.getGui().appendChild(name);
}
addShortcut() {
if (this.params.isCompact) {
return;
}
const shortcut = _loadTemplate(
/* html */
`<span data-ref="eShortcut" class="${this.getClassName("part")} ${this.getClassName("shortcut")}">${this.params.shortcut || ""}</span>`
);
this.getGui().appendChild(shortcut);
}
addSubMenu() {
const pointer = _loadTemplate(
/* html */
`<span data-ref="ePopupPointer" class="${this.getClassName("part")} ${this.getClassName("popup-pointer")}"></span>`
);
const eGui = this.getGui();
if (this.params.subMenu) {
const iconName = this.gos.get("enableRtl") ? "smallLeft" : "smallRight";
_setAriaExpanded(eGui, false);
pointer.appendChild(_createIconNoSpan(iconName, this.gos));
}
eGui.appendChild(pointer);
}
getClassName(suffix) {
return `${this.cssClassPrefix}-${suffix}`;
}
destroy() {
super.destroy();
}
};
// enterprise-modules/core/src/agGridEnterpriseModule.ts
var EnterpriseCoreModule = {
version: VERSION,
moduleName: ModuleNames.EnterpriseCoreModule,
beans: [GridLicenseManager],
userComponents: [
{
name: "agMenuItem",
classImp: AgMenuItemRenderer
}
]
};
// enterprise-modules/core/src/widgets/agGroupComponent.ts
import {
AgCheckboxSelector,
AgToggleButton,
Component as Component3,
KeyCode,
RefPlaceholder as RefPlaceholder2,
_createIcon,
_setAriaExpanded as _setAriaExpanded2,
_setDisplayed
} from "ag-grid-community";
function getAgGroupComponentTemplate(params) {
const cssIdentifier = params.cssIdentifier || "default";
const direction = params.direction || "vertical";
return (
/* html */
`
<div class="ag-group ag-${cssIdentifier}-group" role="presentation">
<div data-ref="eToolbar" class="ag-group-toolbar ag-${cssIdentifier}-group-toolbar">
<ag-checkbox data-ref="cbGroupEnabled"></ag-checkbox>
</div>
<div data-ref="eContainer" class="ag-group-container ag-group-container-${direction} ag-${cssIdentifier}-group-container"></div>
</div>
`
);
}
var AgGroupComponent = class extends Component3 {
constructor(params = {}) {
super(getAgGroupComponentTemplate(params), [AgCheckboxSelector]);
this.params = params;
this.suppressEnabledCheckbox = true;
this.suppressToggleExpandOnEnableChange = false;
this.eToolbar = RefPlaceholder2;
this.cbGroupEnabled = RefPlaceholder2;
this.eContainer = RefPlaceholder2;
const {
enabled,
items,
suppressEnabledCheckbox,
expanded,
suppressToggleExpandOnEnableChange,
useToggle: toggleMode
} = params;
this.cssIdentifier = params.cssIdentifier || "default";
this.enabled = enabled != null ? enabled : true;
this.items = items || [];
this.useToggle = toggleMode ?? false;
this.alignItems = params.alignItems || "center";
this.expanded = expanded == null ? true : expanded;
if (suppressEnabledCheckbox != null) {
this.suppressEnabledCheckbox = suppressEnabledCheckbox;
}
if (suppressToggleExpandOnEnableChange != null) {
this.suppressToggleExpandOnEnableChange = suppressToggleExpandOnEnableChange;
}
}
postConstruct() {
this.setupTitleBar();
if (this.items.length) {
const initialItems = this.items;
this.items = [];
this.addItems(initialItems);
}
const localeTextFunc = this.localeService.getLocaleTextFunc();
this.cbGroupEnabled.setLabel(localeTextFunc("enabled", "Enabled"));
if (this.enabled) {
this.setEnabled(this.enabled, void 0, true);
}
this.setAlignItems(this.alignItems);
const { onEnableChange, onExpandedChange, suppressOpenCloseIcons } = this.params;
this.hideEnabledCheckbox(this.suppressEnabledCheckbox);
this.hideOpenCloseIcons(suppressOpenCloseIcons ?? false);
this.refreshChildDisplay();
_setDisplayed(this.eContainer, this.expanded);
this.cbGroupEnabled.onValueChange((newSelection) => {
this.setEnabled(newSelection, true, this.suppressToggleExpandOnEnableChange);
this.dispatchEnableChangeEvent(newSelection);
});
if (onEnableChange != null) {
this.onEnableChange(onEnableChange);
}
if (onExpandedChange != null) {
this.onExpandedChange(onExpandedChange);
}
}
refreshChildDisplay() {
_setDisplayed(this.eToolbar, this.expanded && !this.suppressEnabledCheckbox);
this.eTitleBar?.refreshOnExpand(this.expanded);
}
isExpanded() {
return this.expanded;
}
setAlignItems(alignment) {
if (this.alignItems !== alignment) {
this.removeCssClass(`ag-group-item-alignment-${this.alignItems}`);
}
this.alignItems = alignment;
const newCls = `ag-group-item-alignment-${this.alignItems}`;
this.addCssClass(newCls);
return this;
}
toggleGroupExpand(expanded, silent) {
if (this.eTitleBar?.isSuppressCollapse() && !this.useToggle) {
expanded = true;
silent = true;
} else {
expanded = expanded != null ? expanded : !this.expanded;
if (this.expanded === expanded) {
return this;
}
}
this.expanded = expanded;
this.refreshChildDisplay();
_setDisplayed(this.eContainer, expanded);
if (!silent) {
this.dispatchLocalEvent({
type: expanded ? "expanded" : "collapsed"
});
}
return this;
}
addItems(items) {
items.forEach((item) => this.addItem(item));
}
prependItem(item) {
this.insertItem(item, true);
}
addItem(item) {
this.insertItem(item, false);
}
insertItem(item, prepend) {
const container = this.eContainer;
const el = item instanceof Component3 ? item.getGui() : item;
el.classList.add("ag-group-item", `ag-${this.cssIdentifier}-group-item`);
if (prepend) {
container.insertAdjacentElement("afterbegin", el);
this.items.unshift(el);
} else {
container.appendChild(el);
this.items.push(el);
}
}
hideItem(hide, index) {
const itemToHide = this.items[index];
_setDisplayed(itemToHide, !hide);
}
getItemIndex(item) {
const el = item instanceof Component3 ? item.getGui() : item;
return this.items.indexOf(el);
}
setTitle(title) {
this.eTitleBar?.setTitle(title);
return this;
}
addTitleBarWidget(el) {
this.eTitleBar?.addWidget(el);
return this;
}
addCssClassToTitleBar(cssClass) {
this.eTitleBar?.addCssClass(cssClass);
}
dispatchEnableChangeEvent(enabled) {
const event = {
type: "enableChange",
enabled
};
this.dispatchLocalEvent(event);
}
setEnabled(enabled, skipToggle, skipExpand) {
this.enabled = enabled;
this.refreshDisabledStyles();
if (!skipExpand) {
this.toggleGroupExpand(enabled);
}
if (!skipToggle) {
this.cbGroupEnabled.setValue(enabled);
this.eToggle?.setValue(enabled);
}
return this;
}
isEnabled() {
return this.enabled;
}
onEnableChange(callbackFn) {
this.addManagedListeners(this, { enableChange: (event) => callbackFn(event.enabled) });
return this;
}
onExpandedChange(callbackFn) {
this.addManagedListeners(this, {
expanded: () => callbackFn(true),
collapsed: () => callbackFn(false)
});
return this;
}
hideEnabledCheckbox(hide) {
this.suppressEnabledCheckbox = hide;
this.refreshChildDisplay();
this.refreshDisabledStyles();
return this;
}
hideOpenCloseIcons(hide) {
this.eTitleBar?.hideOpenCloseIcons(hide);
return this;
}
refreshDisabledStyles() {
const disabled = !this.enabled;
this.eContainer.classList.toggle("ag-disabled", disabled);
this.eTitleBar?.refreshDisabledStyles(this.suppressEnabledCheckbox && disabled);
this.eContainer.classList.toggle("ag-disabled-group-container", disabled);
}
setupTitleBar() {
const titleBar = this.useToggle ? this.createToggleTitleBar() : this.createDefaultTitleBar();
this.eToolbar.insertAdjacentElement("beforebegin", titleBar.getGui());
}
createDefaultTitleBar() {
const titleBar = this.createManagedBean(new DefaultTitleBar(this.params));
this.eTitleBar = titleBar;
titleBar.refreshOnExpand(this.expanded);
this.addManagedListeners(titleBar, {
expandedChanged: (event) => this.toggleGroupExpand(event.expanded)
});
return titleBar;
}
createToggleTitleBar() {
const eToggle = this.createManagedBean(
new AgToggleButton({
value: this.enabled,
label: this.params.title,
labelAlignment: "left",
labelWidth: "flex",
onValueChange: (enabled) => {
this.setEnabled(enabled, true);
this.dispatchEnableChangeEvent(enabled);
}
})
);
eToggle.addCssClass("ag-group-title-bar");
eToggle.addCssClass(`ag-${this.params.cssIdentifier ?? "default"}-group-title-bar ag-unselectable`);
this.eToggle = eToggle;
this.toggleGroupExpand(this.enabled);
return eToggle;
}
};
var TITLE_BAR_DISABLED_CLASS = "ag-disabled-group-title-bar";
function getDefaultTitleBarTemplate(params) {
const cssIdentifier = params.cssIdentifier ?? "default";
const role = params.suppressKeyboardNavigation ? "presentation" : "role";
return (
/* html */
`
<div class="ag-group-title-bar ag-${cssIdentifier}-group-title-bar ag-unselectable" role="${role}">
<span class="ag-group-title-bar-icon ag-${cssIdentifier}-group-title-bar-icon" data-ref="eGroupOpenedIcon" role="presentation"></span>
<span class="ag-group-title-bar-icon ag-${cssIdentifier}-group-title-bar-icon" data-ref="eGroupClosedIcon" role="presentation"></span>
<span data-ref="eTitle" class="ag-group-title ag-${cssIdentifier}-group-title"></span>
</div>
`
);
}
var DefaultTitleBar = class extends Component3 {
constructor(params = {}) {
super(getDefaultTitleBarTemplate(params));
this.suppressOpenCloseIcons = false;
this.suppressKeyboardNavigation = false;
this.eGroupOpenedIcon = RefPlaceholder2;
this.eGroupClosedIcon = RefPlaceholder2;
this.eTitle = RefPlaceholder2;
const { title, suppressOpenCloseIcons, suppressKeyboardNavigation } = params;
if (!!title && title.length > 0) {
this.title = title;
}
if (suppressOpenCloseIcons != null) {
this.suppressOpenCloseIcons = suppressOpenCloseIcons;
}
this.suppressKeyboardNavigation = suppressKeyboardNavigation ?? false;
}
postConstruct() {
this.setTitle(this.title);
this.hideOpenCloseIcons(this.suppressOpenCloseIcons);
this.setupExpandContract();
}
setupExpandContract() {
this.eGroupClosedIcon.appendChild(_createIcon("columnSelectClosed", this.gos, null));
this.eGroupOpenedIcon.appendChild(_createIcon("columnSelectOpen", this.gos, null));
this.addManagedElementListeners(this.getGui(), {
click: () => this.dispatchExpandChanged(),
keydown: (e) => {
switch (e.key) {
case KeyCode.ENTER:
case KeyCode.SPACE:
e.preventDefault();
this.dispatchExpandChanged();
break;
case KeyCode.RIGHT:
case KeyCode.LEFT:
e.preventDefault();
this.dispatchExpandChanged(e.key === KeyCode.RIGHT);
break;
}
}
});
}
refreshOnExpand(expanded) {
this.refreshAriaStatus(expanded);
this.refreshOpenCloseIcons(expanded);
}
refreshAriaStatus(expanded) {
if (!this.suppressOpenCloseIcons) {
_setAriaExpanded2(this.getGui(), expanded);
}
}
refreshOpenCloseIcons(expanded) {
const showIcon = !this.suppressOpenCloseIcons;
_setDisplayed(this.eGroupOpenedIcon, showIcon && expanded);
_setDisplayed(this.eGroupClosedIcon, showIcon && !expanded);
}
isSuppressCollapse() {
return this.suppressOpenCloseIcons;
}
dispatchExpandChanged(expanded) {
const event = {
type: "expandedChanged",
expanded
};
this.dispatchLocalEvent(event);
}
setTitle(title) {
const eGui = this.getGui();
const hasTitle = !!title && title.length > 0;
title = hasTitle ? title : void 0;
this.eTitle.textContent = title ?? "";
_setDisplayed(eGui, hasTitle);
if (title !== this.title) {
this.title = title;
}
const disabled = eGui.classList.contains(TITLE_BAR_DISABLED_CLASS);
this.refreshDisabledStyles(disabled);
return this;
}
addWidget(el) {
this.getGui().appendChild(el);
return this;
}
hideOpenCloseIcons(hide) {
this.suppressOpenCloseIcons = hide;
if (hide) {
this.dispatchExpandChanged(true);
}
return this;
}
refreshDisabledStyles(disabled) {
const eGui = this.getGui();
if (disabled) {
eGui.classList.add(TITLE_BAR_DISABLED_CLASS);
eGui.removeAttribute("tabindex");
} else {
eGui.classList.remove(TITLE_BAR_DISABLED_CLASS);
if (typeof this.title === "string" && !this.suppressKeyboardNavigation) {
eGui.setAttribute("tabindex", "0");
} else {
eGui.removeAttribute("tabindex");
}
}
}
};
var AgGroupComponentSelector = {
selector: "AG-GROUP-COMPONENT",
component: AgGroupComponent
};
// enterprise-modules/core/src/widgets/agRichSelect.ts
import {
AgInputTextFieldSelector,
AgPickerField,
KeyCode as KeyCode5,
RefPlaceholder as RefPlaceholder5,
_bindCellRendererToHtmlElement as _bindCellRendererToHtmlElement2,
_clearElement as _clearElement2,
_createIconNoSpan as _createIconNoSpan2,
_debounce,
_escapeString as _escapeString2,
_exists as _exists2,
_fuzzySuggestions,
_isEventFromPrintableCharacter,
_isVisible,
_setAriaActiveDescendant as _setAriaActiveDescendant2,
_stopPropagationForAgGrid as _stopPropagationForAgGrid2
} from "ag-grid-community";
// enterprise-modules/core/src/widgets/AgPillContainer.ts
import { Component as Component5, KeyCode as KeyCode2, _clearElement, _setAriaPosInSet, _setAriaSetSize } from "ag-grid-community";
// enterprise-modules/core/src/widgets/agPill.ts
import { RefPlaceholder as RefPlaceholder3 } from "ag-grid-community";
import { Component as Component4 } from "ag-grid-community";
var AgPill = class extends Component4 {
constructor(config) {
super(
/* html */
`
<div class="ag-pill" role="option">
<span class="ag-pill-text" data-ref="eText"></span>
<span class="ag-button ag-pill-button" data-ref="eButton" role="presentation"></span>
</div>
`
);
this.config = config;
this.eText = RefPlaceholder3;
this.eButton = RefPlaceholder3;
}
postConstruct() {
const { config, eButton } = this;
const { onKeyDown, onButtonClick } = config;
this.getGui().setAttribute("tabindex", String(this.gos.get("tabIndex")));
this.addGuiEventListener("focus", () => {
this.eButton.focus();
});
if (onKeyDown) {
this.addGuiEventListener("keydown", onKeyDown);
}
if (onButtonClick) {
this.addManagedElementListeners(eButton, {
click: onButtonClick
});
}
}
toggleCloseButtonClass(className, force) {
this.eButton.classList.toggle(className, force);
}
setText(text) {
this.eText.textContent = text;
}
getText() {
return this.eText.textContent;
}
};
// enterprise-modules/core/src/widgets/AgPillContainer.ts
var AgPillContainer = class extends Component5 {
constructor() {
super(
/* html */
`
<div class="ag-pill-container" role="listbox"></div>
`
);
this.pills = [];
}
wireBeans(beans) {
this.focusService = beans.focusService;
}
init(params) {
this.params = params;
this.refresh();
}
refresh() {
this.clearPills();
const { params, onPillKeyDown } = this;
const values = params.getValue();
if (!Array.isArray(values)) {
return;
}
const len = values.length;
for (let i = 0; i < len; i++) {
const value = values[i];
const pill = this.createBean(
new AgPill({
onButtonClick: () => this.onPillButtonClick(pill),
onKeyDown: onPillKeyDown.bind(this)
})
);
const pillGui = pill.getGui();
_setAriaPosInSet(pillGui, i + 1);
_setAriaSetSize(pillGui, len);
if (params.onPillMouseDown) {
pill.addGuiEventListener("mousedown", params.onPillMouseDown);
}
if (params.announceItemFocus) {
pill.addGuiEventListener("focus", params.announceItemFocus);
}
pill.setText(value);
pill.toggleCloseButtonClass("ag-icon-cancel", true);
this.appendChild(pillGui);
this.pills.push(pill);
}
}
onNavigationKeyDown(e) {
const { key } = e;
if (!this.pills.length || key !== KeyCode2.LEFT && key !== KeyCode2.RIGHT) {
return;
}
e.preventDefault();
const activeEl = this.gos.getActiveDomElement();
const eGui = this.getGui();
const { params, focusService } = this;
if (eGui.contains(activeEl)) {
const nextFocusableEl = focusService.findNextFocusableElement(eGui, false, key === KeyCode2.LEFT);
if (nextFocusableEl) {
nextFocusableEl.focus();
} else if (params.eWrapper) {
params.eWrapper.focus();
}
} else {
const focusableElements = focusService.findFocusableElements(eGui);
if (focusableElements.length > 0) {
focusableElements[key === KeyCode2.RIGHT ? 0 : focusableElements.length - 1].focus();
}
}
}
clearPills() {
const eGui = this.getGui();
if (eGui.contains(this.gos.getActiveDomElement()) && this.params.eWrapper) {
this.params.eWrapper.focus();
}
_clearElement(eGui);
this.destroyBeans(this.pills);
this.pills = [];
}
onPillButtonClick(pill) {
this.deletePill(pill);
}
onPillKeyDown(e) {
const key = e.key;
if (key !== KeyCode2.DELETE && key !== KeyCode2.BACKSPACE) {
return;
}
e.preventDefault();
const eDoc = this.gos.getDocument();
const pillIndex = this.pills.findIndex((pill2) => pill2.getGui().contains(eDoc.activeElement));
if (pillIndex === -1) {
return;
}
const pill = this.pills[pillIndex];
if (pill) {
this.deletePill(pill, pillIndex);
}
}
deletePill(pill, restoreFocusToIndex) {
const value = pill.getText();
const values = (this.params.getValue() || []).filter((val) => val !== value);
this.params.setValue(values);
if (!values.length && this.params.eWrapper) {
this.params.eWrapper.focus();
} else if (restoreFocusToIndex != null) {
const pill2 = this.pills[Math.min(restoreFocusToIndex, this.pills.length - 1)];
if (pill2) {
pill2.getFocusableElement().focus();
}
}
}
destroy() {
this.clearPills();
super.destroy();
}
};
// enterprise-modules/core/src/widgets/agRichSelectList.ts
import { KeyCode as KeyCode4, _setAriaActiveDescendant, _setAriaControls, _setAriaLabel as _setAriaLabel2 } from "ag-grid-community";
// enterprise-modules/core/src/widgets/agRichSelectRow.ts
import {
Component as Component6,
_bindCellRendererToHtmlElement,
_escapeString,
_exists,
_setAriaSelected
} from "ag-grid-community";
var RichSelectRow = class extends Component6 {
constructor(params) {
super(
/* html */
`<div class="ag-rich-select-row" role="presentation"></div>`
);
this.params = params;
}
wireBeans(beans) {
this.userComponentFactory = beans.userComponentFactory;
}
setState(value) {
let formattedValue = "";
const { params } = this;
if (params.valueFormatter) {
formattedValue = params.valueFormatter(value);
}
const rendererSuccessful = this.populateWithRenderer(value, formattedValue);
if (!rendererSuccessful) {
this.populateWithoutRenderer(value, formattedValue);
}
this.value = value;
}
highlightString(matchString) {
const { parsedValue } = this;
if (this.params.cellRenderer || !_exists(parsedValue)) {
return;
}
let hasMatch = _exists(matchString);
if (hasMatch) {
const index = parsedValue?.toLocaleLowerCase().indexOf(matchString.toLocaleLowerCase());
if (index >= 0) {
const highlightEndIndex = index + matchString.length;
const startPart = _escapeString(parsedValue.slice(0, index), true);
const highlightedPart = _escapeString(parsedValue.slice(index, highlightEndIndex), true);
const endPart = _escapeString(parsedValue.slice(highlightEndIndex));
this.renderValueWithoutRenderer(
/* html */
`${startPart}<span class="ag-rich-select-row-text-highlight">${highlightedPart}</span>${endPart}`
);
} else {
hasMatch = false;
}
}
if (!hasMatch) {
this.renderValueWithoutRenderer(parsedValue);
}
}
updateSelected(selected) {
const eGui = this.getGui();
_setAriaSelected(eGui.parentElement, selected);
this.addOrRemoveCssClass("ag-rich-select-row-selected", selected);
}
getValue() {
return this.value;
}
toggleHighlighted(highlighted) {
this.addOrRemoveCssClass("ag-rich-select-row-highlighted", highlighted);
}
populateWithoutRenderer(value, valueFormatted) {
const eDocument = this.gos.getDocument();
const eGui = this.getGui();
const span = eDocument.createElement("span");
span.style.overflow = "hidden";
span.style.textOverflow = "ellipsis";
const parsedValue = _escapeString(_exists(valueFormatted) ? valueFormatted : value, true);
this.parsedValue = _exists(parsedValue) ? parsedValue : null;
eGui.appendChild(span);
this.renderValueWithoutRenderer(parsedValue);
this.setTooltip({
newTooltipText: this.parsedValue,
shouldDisplayTooltip: () => span.scrollWidth > span.clientWidth
});
}
renderValueWithoutRenderer(value) {
const span = this.getGui().querySelector("span");
if (!span) {
return;
}
span.innerHTML = _exists(value) ? value : " ";
}
populateWithRenderer(value, valueFormatted) {
let cellRendererPromise;
let userCompDetails;
if (this.params.cellRenderer) {
const richSelect = this.getParentComponent()?.getParentComponent();
userCompDetails = this.userComponentFactory.getEditorRendererDetails(this.params, {
value,
valueFormatted,
getValue: () => richSelect?.getValue(),
setValue: (value2) => {
richSelect?.setValue(value2, true);
},
setTooltip: (value2, shouldDisplayTooltip) => {
this.setTooltip({ newTooltipText: value2, shouldDisplayTooltip });
}
});
}
if (userCompDetails) {
cellRendererPromise = userCompDetails.newAgStackInstance();
}
if (cellRendererPromise) {
_bindCellRendererToHtmlElement(cellRendererPromise, this.getGui());
}
if (cellRendererPromise) {
cellRendererPromise.then((childComponent) => {
this.addDestroyFunc(() => {
this.destroyBean(childComponent);
});
});
return true;
}
return false;
}
};
// enterprise-modules/core/src/widgets/virtualList.ts
import {
KeyCode as KeyCode3,
RefPlaceholder as RefPlaceholder4,
TabGuardComp,
_getAriaPosInSet,
_setAriaLabel,
_setAriaPosInSet as _setAriaPosInSet2,
_setAriaRole,
_setAriaSetSize as _setAriaSetSize2,
_stopPropagationForAgGrid,
_waitUntil,
_warnOnce as _warnOnce2
} from "ag-grid-community";
function getVirtualListTemplate(cssIdentifier) {
return (
/* html */
`<div class="ag-virtual-list-viewport ag-${cssIdentifier}-virtual-list-viewport" role="presentation">
<div class="ag-virtual-list-container ag-${cssIdentifier}-virtual-list-container" data-ref="eContainer"></div>
</div>`
);
}
var VirtualList = class extends TabGuardComp {
constructor(params) {
super(getVirtualListTemplate(params?.cssIdentifier || "default"));
this.renderedRows = /* @__PURE__ */ new Map();
this.rowHeight = 20;
this.pageSize = -1;
this.isScrolling = false;
this.isHeightFromTheme = true;
this.eContainer = RefPlaceholder4;
const { cs