UNPKG

ag-grid-enterprise

Version:

Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue

1,416 lines (1,396 loc) 1.65 MB
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")); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // 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 }); module.exports = __toCommonJS(main_exports); var import_client_side_row_model = require("ag-grid-community"); var import_core308 = require("ag-grid-community"); var import_csv_export6 = require("ag-grid-community"); var import_infinite_row_model = require("ag-grid-community"); // enterprise-modules/advanced-filter/dist/package/main.esm.mjs var import_core25 = require("ag-grid-community"); // enterprise-modules/core/src/agGridEnterpriseModule.ts var import_core5 = require("ag-grid-community"); // enterprise-modules/core/src/license/gridLicenseManager.ts var import_core3 = require("ag-grid-community"); // enterprise-modules/core/src/license/shared/licenseManager.ts var import_core = require("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 ((0, import_core._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 ((0, import_core._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() && !(0, import_core._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 var import_core2 = require("ag-grid-community"); var AgWatermark = class extends import_core2.Component { constructor() { super( /* html*/ `<div class="ag-watermark"> <div data-ref="eLicenseTextRef" class="ag-watermark-text"></div> </div>` ); this.eLicenseTextRef = import_core2.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 import_core3.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 var import_core4 = require("ag-grid-community"); var AgMenuItemRenderer = class extends import_core4.Component { 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 = (0, import_core4._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((0, import_core4._createIconNoSpan)("check", this.gos)); } else if (icon) { if ((0, import_core4._isNodeOrElement)(icon)) { iconWrapper.appendChild(icon); } else if (typeof icon === "string") { iconWrapper.innerHTML = icon; } else { (0, import_core4._warnOnce)("menu item icon must be DOM node or string"); } } this.getGui().appendChild(iconWrapper); } addName() { const name = (0, import_core4._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 = (0, import_core4._loadTemplate)( /* html */ `<span data-ref="eShortcut" class="${this.getClassName("part")} ${this.getClassName("shortcut")}">${this.params.shortcut || ""}</span>` ); this.getGui().appendChild(shortcut); } addSubMenu() { const pointer = (0, import_core4._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"; (0, import_core4._setAriaExpanded)(eGui, false); pointer.appendChild((0, import_core4._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: import_core5.ModuleNames.EnterpriseCoreModule, beans: [GridLicenseManager], userComponents: [ { name: "agMenuItem", classImp: AgMenuItemRenderer } ] }; // enterprise-modules/core/src/widgets/agGroupComponent.ts var import_core6 = require("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 import_core6.Component { constructor(params = {}) { super(getAgGroupComponentTemplate(params), [import_core6.AgCheckboxSelector]); this.params = params; this.suppressEnabledCheckbox = true; this.suppressToggleExpandOnEnableChange = false; this.eToolbar = import_core6.RefPlaceholder; this.cbGroupEnabled = import_core6.RefPlaceholder; this.eContainer = import_core6.RefPlaceholder; 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(); (0, import_core6._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() { (0, import_core6._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(); (0, import_core6._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 import_core6.Component ? 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]; (0, import_core6._setDisplayed)(itemToHide, !hide); } getItemIndex(item) { const el = item instanceof import_core6.Component ? 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 import_core6.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 import_core6.Component { constructor(params = {}) { super(getDefaultTitleBarTemplate(params)); this.suppressOpenCloseIcons = false; this.suppressKeyboardNavigation = false; this.eGroupOpenedIcon = import_core6.RefPlaceholder; this.eGroupClosedIcon = import_core6.RefPlaceholder; this.eTitle = import_core6.RefPlaceholder; 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((0, import_core6._createIcon)("columnSelectClosed", this.gos, null)); this.eGroupOpenedIcon.appendChild((0, import_core6._createIcon)("columnSelectOpen", this.gos, null)); this.addManagedElementListeners(this.getGui(), { click: () => this.dispatchExpandChanged(), keydown: (e) => { switch (e.key) { case import_core6.KeyCode.ENTER: case import_core6.KeyCode.SPACE: e.preventDefault(); this.dispatchExpandChanged(); break; case import_core6.KeyCode.RIGHT: case import_core6.KeyCode.LEFT: e.preventDefault(); this.dispatchExpandChanged(e.key === import_core6.KeyCode.RIGHT); break; } } }); } refreshOnExpand(expanded) { this.refreshAriaStatus(expanded); this.refreshOpenCloseIcons(expanded); } refreshAriaStatus(expanded) { if (!this.suppressOpenCloseIcons) { (0, import_core6._setAriaExpanded)(this.getGui(), expanded); } } refreshOpenCloseIcons(expanded) { const showIcon = !this.suppressOpenCloseIcons; (0, import_core6._setDisplayed)(this.eGroupOpenedIcon, showIcon && expanded); (0, import_core6._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 ?? ""; (0, import_core6._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 var import_core13 = require("ag-grid-community"); // enterprise-modules/core/src/widgets/AgPillContainer.ts var import_core9 = require("ag-grid-community"); // enterprise-modules/core/src/widgets/agPill.ts var import_core7 = require("ag-grid-community"); var import_core8 = require("ag-grid-community"); var AgPill = class extends import_core8.Component { 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 = import_core7.RefPlaceholder; this.eButton = import_core7.RefPlaceholder; } 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 import_core9.Component { 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(); (0, import_core9._setAriaPosInSet)(pillGui, i + 1); (0, import_core9._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 !== import_core9.KeyCode.LEFT && key !== import_core9.KeyCode.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 === import_core9.KeyCode.LEFT); if (nextFocusableEl) { nextFocusableEl.focus(); } else if (params.eWrapper) { params.eWrapper.focus(); } } else { const focusableElements = focusService.findFocusableElements(eGui); if (focusableElements.length > 0) { focusableElements[key === import_core9.KeyCode.RIGHT ? 0 : focusableElements.length - 1].focus(); } } } clearPills() { const eGui = this.getGui(); if (eGui.contains(this.gos.getActiveDomElement()) && this.params.eWrapper) { this.params.eWrapper.focus(); } (0, import_core9._clearElement)(eGui); this.destroyBeans(this.pills); this.pills = []; } onPillButtonClick(pill) { this.deletePill(pill); } onPillKeyDown(e) { const key = e.key; if (key !== import_core9.KeyCode.DELETE && key !== import_core9.KeyCode.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 var import_core12 = require("ag-grid-community"); // enterprise-modules/core/src/widgets/agRichSelectRow.ts var import_core10 = require("ag-grid-community"); var RichSelectRow = class extends import_core10.Component { 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 || !(0, import_core10._exists)(parsedValue)) { return; } let hasMatch = (0, import_core10._exists)(matchString); if (hasMatch) { const index = parsedValue?.toLocaleLowerCase().indexOf(matchString.toLocaleLowerCase()); if (index >= 0) { const highlightEndIndex = index + matchString.length; const startPart = (0, import_core10._escapeString)(parsedValue.slice(0, index), true); const highlightedPart = (0, import_core10._escapeString)(parsedValue.slice(index, highlightEndIndex), true); const endPart = (0, import_core10._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(); (0, import_core10._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 = (0, import_core10._escapeString)((0, import_core10._exists)(valueFormatted) ? valueFormatted : value, true); this.parsedValue = (0, import_core10._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 = (0, import_core10._exists)(value) ? value : "&nbsp;"; } 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) { (0, import_core10._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 var import_core11 = require("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 import_core11.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 = import_core11.RefPlaceholder; const { cssIdentifier = "default", ariaRole = "listbox", listName } = params || {}; this.cssIdentifier = cssIdentifier; this.ariaRole = ariaRole; this.listName = listName; } wireBeans(beans) { this.resizeOb